:root {
    --bg-deep: #0f2318;
    --bg-mid: #234531;
    --bg-light: #eef4e7;
    --surface: rgba(252, 250, 245, 0.9);
    --surface-strong: rgba(246, 255, 246, 0.92);
    --surface-warm: rgba(255, 245, 236, 0.92);
    --surface-dark: rgba(14, 34, 23, 0.92);
    --surface-dark-2: rgba(28, 63, 45, 0.94);
    --ink: #1e2b23;
    --ink-soft: #596a5f;
    --line: rgba(30, 43, 35, 0.1);
    --line-strong: rgba(255, 255, 255, 0.14);
    --accent-leaf: #3fb46f;
    --accent-moss: #81d39e;
    --accent-fox: #e1603a;
    --accent-amber: #d7a94c;
    --shadow: 0 30px 74px rgba(13, 22, 17, 0.14);
    --shadow-strong: 0 26px 66px rgba(6, 15, 10, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "IBM Plex Sans JP", sans-serif;
    background:
        radial-gradient(circle at 12% 12%, rgba(129, 211, 158, 0.2), transparent 22%),
        radial-gradient(circle at 82% 12%, rgba(225, 96, 58, 0.16), transparent 22%),
        linear-gradient(180deg, #0e2116 0%, #1d3b2a 18%, #e8e7db 18.1%, #f5f2ea 100%);
}

main {
    display: flex;
    flex-direction: column;
}

main > #simulation {
    order: -1;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.08) 0 3px, transparent 4px),
        radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.06) 0 2px, transparent 3px),
        radial-gradient(circle at 38% 78%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px);
    background-size: 240px 240px, 190px 190px, 220px 220px;
    opacity: 0.72;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 84px;
}

.site-header {
    position: sticky;
    top: 14px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0 20px;
    padding: 16px 22px;
    border-radius: 999px;
    background: rgba(8, 23, 15, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.brand,
h1,
h2,
h3,
.signal-main,
.hero-note h2,
.bridge-panel h3,
.site-footer p,
.stat-value {
    font-family: "Shippori Mincho", serif;
}

.brand {
    color: #f7f1e7;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
    color: rgba(247, 241, 231, 0.84);
    font-size: 0.95rem;
}

.site-nav a,
.footer-links a,
.button,
.legend-chip,
.status-chip {
    transition:
        transform 180ms ease,
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible,
.button:hover,
.button:focus-visible,
.text-link:hover,
.text-link:focus-visible {
    transform: translateY(-1px);
}

.section,
.signal-strip,
.site-footer {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible,
.site-footer.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section {
    margin-top: 26px;
    padding: 34px;
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
    gap: 24px;
    padding: 34px 0 20px;
    border: none;
    background: transparent;
    box-shadow: none;
}

.hero-copy,
.hero-panel,
.hero-note,
.panel,
.note-card,
.bridge-panel,
.stat-card,
.site-footer {
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-copy {
    position: relative;
    overflow: hidden;
    padding: 40px 34px 42px 38px;
    border-radius: 38px;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -72px -126px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(63, 180, 111, 0.3), rgba(63, 180, 111, 0));
}

.hero-panel,
.signal-strip,
.site-footer,
.stage-panel {
    border: 1px solid var(--line-strong);
    background: linear-gradient(155deg, rgba(10, 27, 18, 0.96), rgba(29, 67, 49, 0.94));
    box-shadow: var(--shadow-strong);
}

.hero-panel {
    padding: 28px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    color: #eef9f3;
}

.hero-note,
.summary-box,
.hint-card,
.note-card {
    padding: 22px;
    border-radius: 24px;
}

.hero-note,
.hero-note h2,
.hero-note p,
.summary-box,
.summary-box p,
.hint-card,
.hint-card h3,
.hint-card p,
.note-card,
.note-card h3,
.note-card p,
.section-heading p,
.hero-lead,
.hero-points li,
.text-link,
.control-copy,
.summary-text,
.site-footer p,
.bridge-panel p,
.signal-sub,
.signal-main {
    color: var(--ink-soft);
    line-height: 1.82;
}

.strong-card {
    background: rgba(246, 255, 246, 0.92);
}

.warm-card {
    background: rgba(255, 245, 236, 0.92);
}

.eyebrow,
.card-label,
.signal-kicker,
.control-label,
.stat-label {
    margin: 0 0 12px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.eyebrow,
.card-label,
.signal-kicker,
.stat-label {
    color: rgba(30, 43, 35, 0.62);
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.5rem, 4.2vw, 4.18rem);
    line-height: 1.08;
}

.hero-lead {
    margin-top: 22px;
    font-size: 1.02rem;
}

.hero-actions,
.button-row,
.legend-row,
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    background: linear-gradient(135deg, var(--accent-leaf), var(--accent-moss));
    color: #143120;
    box-shadow: 0 12px 28px rgba(63, 180, 111, 0.22);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.78);
    color: #234131;
    border: 1px solid rgba(59, 97, 74, 0.16);
}

.hero-points {
    display: grid;
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.hero-points li {
    position: relative;
    padding-left: 22px;
}

.hero-points li::before {
    content: "";
    position: absolute;
    top: 0.78em;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-leaf), var(--accent-fox));
}

.summary-title,
.hero-note h2,
.signal-main,
.section-heading h2,
.note-card h3,
.hint-card h3,
.stage-top h3,
.bridge-panel h3,
.site-footer p {
    margin: 0;
}

.summary-title,
.hero-note h2,
.bridge-panel h3,
.stage-top h3,
.note-card h3,
.hint-card h3 {
    color: var(--ink);
    font-size: 1.34rem;
}

.signal-strip {
    margin-top: 28px;
    padding: 24px 28px;
}

.signal-kicker,
.signal-main,
.signal-sub,
.site-footer,
.site-footer a,
.stage-panel .control-label,
.stage-panel h3,
.stage-panel .legend-chip,
.status-chip {
    color: #edf6f0;
}

.signal-main,
.section-heading h2 {
    font-size: clamp(1.62rem, 3vw, 2.35rem);
}

.signal-sub,
.section-heading p {
    margin: 10px 0 0;
}

.simulation-grid {
    display: grid;
    grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
    gap: 18px;
}

.panel {
    padding: 24px;
    border-radius: 28px;
}

.controls-panel {
    background: rgba(255, 252, 247, 0.94);
}

.control-stack {
    display: grid;
    gap: 18px;
}

.control-group {
    display: grid;
    gap: 10px;
}

.control-top,
.stage-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.control-title {
    font-weight: 700;
}

.control-value {
    color: #1c7d49;
    font-weight: 700;
}

.range-input,
.select-input {
    width: 100%;
}

.range-input {
    accent-color: var(--accent-leaf);
}

.select-input {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(59, 97, 74, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.summary-box,
.hint-card {
    margin-top: 18px;
    border: 1px solid rgba(59, 97, 74, 0.14);
    background: rgba(255, 255, 255, 0.68);
}

.summary-text,
.control-copy,
.hint-card p,
.note-card p,
.bridge-panel p,
.site-footer p {
    margin: 8px 0 0;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(129, 211, 158, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.85rem;
    font-weight: 700;
}

.canvas-shell {
    margin-top: 18px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(231, 247, 235, 0.98), rgba(247, 243, 234, 0.96));
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.legend-row {
    margin-top: 14px;
}

.legend-chip {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.12);
}

.legend-chip.grass {
    background: rgba(63, 180, 111, 0.16);
}

.legend-chip.rabbit {
    background: rgba(255, 255, 255, 0.18);
}

.legend-chip.fox {
    background: rgba(225, 96, 58, 0.18);
}

.legend-chip.neutral {
    background: rgba(160, 176, 167, 0.18);
}

.stats-grid,
.notes-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.notes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notes-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
}

.stat-value {
    margin: 0;
    font-size: clamp(1.08rem, 2vw, 1.45rem);
    line-height: 1.44;
    color: var(--ink);
}

.stat-value.compact {
    font-size: 1rem;
}

.stat-card-wide {
    grid-column: span 2;
}

.note-card,
.bridge-panel {
    padding: 24px;
    border-radius: 28px;
}

.bridge-panel {
    margin-top: 18px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(155deg, rgba(10, 27, 18, 0.96), rgba(29, 67, 49, 0.94));
    box-shadow: var(--shadow-strong);
}

.bridge-panel,
.bridge-panel h3,
.bridge-panel p,
.bridge-panel .card-label,
.site-footer,
.site-footer a {
    color: #edf6f0;
}

.text-link {
    display: inline-block;
    margin-top: 14px;
    color: #276f4c;
    font-weight: 700;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding: 24px;
    border-radius: 30px;
}

@media (max-width: 1040px) {
    .hero,
    .simulation-grid,
    .notes-grid,
    .notes-grid.three-up,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero,
    .simulation-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
    }

    .site-header,
    .site-footer,
    .control-top,
    .stage-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header,
    .hero-copy,
    .hero-panel,
    .panel,
    .note-card,
    .signal-strip,
    .bridge-panel,
    .site-footer {
        padding: 20px;
    }

    .stats-grid,
    .notes-grid,
    .notes-grid.three-up {
        grid-template-columns: 1fr;
    }

    .stat-card-wide {
        grid-column: span 1;
    }
}