:root {
    --bg-dark: #07111d;
    --bg-mid: #14324f;
    --bg-soft: #eef4f9;
    --surface: rgba(247, 251, 255, 0.92);
    --surface-soft: rgba(228, 238, 248, 0.84);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --ink: #172437;
    --muted: #607086;
    --line: rgba(23, 36, 55, 0.12);
    --accent: #4a86bb;
    --accent-strong: #1d4d78;
    --accent-soft: #9cc8e9;
    --warm: #d48239;
    --warm-strong: #a15819;
    --danger: #bf564b;
    --coolant-hot: #ff7f68;
    --coolant-cold: #72b8ff;
    --shadow: 0 28px 70px rgba(7, 17, 29, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "IBM Plex Sans JP", sans-serif;
    background:
        radial-gradient(circle at 16% 12%, rgba(114, 184, 255, 0.2), transparent 22%),
        radial-gradient(circle at 84% 12%, rgba(212, 130, 57, 0.18), transparent 22%),
        linear-gradient(180deg, #07111d 0%, #14324f 17%, #eaf2f8 17.1%, #f8fbff 100%);
    min-height: 100vh;
}

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

main > #demo {
    order: -1;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.08));
}

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

button,
input {
    font: inherit;
}

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

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

.site-header {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 18px 0 20px;
    padding: 16px 22px;
    border-radius: 999px;
    background: rgba(7, 17, 29, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

.brand {
    color: #f5faff;
    font-family: "Shippori Mincho", serif;
    font-size: 1.14rem;
    letter-spacing: 0.1em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    color: rgba(245, 250, 255, 0.84);
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.footer-link:hover,
.footer-link:focus-visible {
    color: white;
}

.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);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 24px;
    padding: 34px 0 22px;
}

.hero-copy,
.hero-panel,
.step-card,
.formula-card,
.demo-panel,
.canvas-panel,
.comparison-card,
.link-card,
.signal-strip,
.hero-note,
.site-footer {
    border: 1px solid rgba(255, 255, 255, 0.64);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-copy {
    min-width: 0;
    padding: 42px 32px 42px 38px;
    border-radius: 38px;
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -56px -112px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(156, 200, 233, 0.36), rgba(156, 200, 233, 0));
}

.hero-panel {
    min-width: 0;
    padding: 26px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    background: rgba(236, 244, 251, 0.42);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1,
h2,
h3,
.brand,
.signal-main,
.formula-block,
.note-title,
.canvas-caption strong {
    font-family: "Shippori Mincho", serif;
}

h1,
h2,
h3,
.brand {
    line-height: 1.15;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    letter-spacing: -0.04em;
}

.hero-lead,
.section-heading p,
.step-card p,
.formula-card p,
.demo-note,
.comparison-card p,
.link-card p,
.canvas-caption,
.hero-note p,
.signal-sub,
.site-footer p {
    color: var(--muted);
}

.hero-lead {
    margin: 20px 0 0;
    font-size: 1.04rem;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible,
.preset-chip:hover,
.preset-chip:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: #f6fbff;
    background: linear-gradient(135deg, var(--accent), #295f96);
    box-shadow: 0 14px 28px rgba(41, 95, 150, 0.22);
}

.button-secondary {
    border-color: rgba(29, 77, 120, 0.18);
    background: rgba(255, 255, 255, 0.8);
    color: var(--accent-strong);
}

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

.hero-points li {
    position: relative;
    padding-left: 20px;
    line-height: 1.7;
}

.hero-points li::before {
    content: "";
    position: absolute;
    top: 0.68em;
    left: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm), var(--accent));
    box-shadow: 0 0 16px rgba(74, 134, 187, 0.35);
}

.reactor-window {
    position: relative;
    min-height: 300px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 28%, rgba(114, 184, 255, 0.18), transparent 24%),
        linear-gradient(180deg, #111a25 0%, #0b1117 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.containment-shell {
    position: absolute;
    left: 36px;
    top: 40px;
    width: 176px;
    height: 204px;
    border-radius: 38px;
    border: 4px solid rgba(216, 225, 240, 0.92);
}

.containment-water {
    position: absolute;
    left: 54px;
    top: 66px;
    width: 140px;
    height: 160px;
    border-radius: 26px;
    background: rgba(114, 184, 255, 0.14);
}

.reactor-core-art {
    position: absolute;
    left: 70px;
    top: 86px;
    width: 108px;
    height: 120px;
    border-radius: 18px;
    background:
        linear-gradient(90deg,
            rgba(212, 130, 57, 0.72) 0 10%,
            transparent 10% 20%,
            rgba(212, 130, 57, 0.72) 20% 30%,
            transparent 30% 40%,
            rgba(212, 130, 57, 0.72) 40% 50%,
            transparent 50% 60%,
            rgba(212, 130, 57, 0.72) 60% 70%,
            transparent 70% 80%,
            rgba(212, 130, 57, 0.72) 80% 90%,
            transparent 90% 100%),
        linear-gradient(180deg, rgba(31, 47, 67, 0.94), rgba(20, 31, 44, 0.94));
}

.control-rod-art {
    position: absolute;
    top: 70px;
    width: 8px;
    height: 78px;
    border-radius: 999px;
    background: linear-gradient(180deg, #0d1116, #303740);
}

.rod-a { left: 92px; }
.rod-b { left: 122px; }
.rod-c { left: 152px; }

.primary-loop {
    position: absolute;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 127, 104, 0.16), rgba(255, 127, 104, 0.94));
    box-shadow: 0 0 18px rgba(255, 127, 104, 0.26);
}

.primary-loop.top {
    left: 210px;
    top: 118px;
    width: 110px;
}

.primary-loop.bottom {
    left: 210px;
    top: 190px;
    width: 110px;
    background: linear-gradient(90deg, rgba(114, 184, 255, 0.94), rgba(114, 184, 255, 0.14));
    box-shadow: 0 0 18px rgba(114, 184, 255, 0.24);
}

.steam-generator-art {
    position: absolute;
    left: 318px;
    top: 86px;
    width: 92px;
    height: 132px;
    border-radius: 24px;
    border: 4px solid rgba(216, 225, 240, 0.92);
    background:
        linear-gradient(180deg, rgba(228, 238, 248, 0.12), rgba(255, 255, 255, 0.02)),
        linear-gradient(180deg, rgba(26, 41, 58, 0.94), rgba(14, 24, 35, 0.96));
}

.turbine-wheel {
    position: absolute;
    left: 442px;
    top: 118px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 4px solid rgba(216, 225, 240, 0.9);
}

.turbine-wheel::before,
.turbine-wheel::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 2px;
    height: 28px;
    transform-origin: top center;
    background: rgba(216, 225, 240, 0.9);
}

.turbine-wheel::before {
    transform: translate(-50%, -50%) rotate(25deg);
}

.turbine-wheel::after {
    transform: translate(-50%, -50%) rotate(115deg);
}

.generator-box {
    position: absolute;
    left: 540px;
    top: 122px;
    width: 96px;
    height: 62px;
    border-radius: 14px;
    border: 3px solid rgba(255, 222, 119, 0.92);
    background: linear-gradient(180deg, rgba(255, 222, 119, 0.1), rgba(255, 222, 119, 0.02));
    box-shadow: 0 0 18px rgba(255, 222, 119, 0.18);
}

.neutron-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7efcff;
    box-shadow: 0 0 12px rgba(126, 252, 255, 0.6);
}

.dot-a { left: 86px; top: 118px; }
.dot-b { left: 146px; top: 158px; }
.dot-c { left: 126px; top: 198px; }

.reactor-label {
    position: absolute;
    color: rgba(245, 250, 255, 0.84);
    font-size: 0.82rem;
}

.label-core { left: 104px; bottom: 30px; }
.label-steam { left: 306px; bottom: 30px; }
.label-turbine { left: 454px; bottom: 30px; }

.hero-note {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
}

.note-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.hero-note p {
    margin: 0;
    line-height: 1.74;
}

.signal-strip {
    margin-top: 12px;
    padding: 26px 30px;
    border-radius: 30px;
}

.signal-kicker,
.card-label {
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.signal-main {
    margin: 12px 0 8px;
    font-size: clamp(1.35rem, 3vw, 2.3rem);
    line-height: 1.3;
}

.signal-sub {
    margin: 0;
    line-height: 1.8;
}

.section {
    margin-top: 84px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 14px 0 0;
    line-height: 1.82;
}

#demo .section-heading {
    padding: 26px 28px;
    border-radius: 30px;
    background: rgba(7, 17, 29, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 44px rgba(2, 8, 16, 0.22);
    backdrop-filter: blur(14px);
}

#demo .section-heading .eyebrow {
    color: rgba(245, 250, 255, 0.72);
}

#demo .section-heading h2 {
    color: #f5faff;
}

#demo .section-heading p {
    color: rgba(232, 240, 248, 0.84);
}

.principle-grid,
.comparison-grid,
.link-grid {
    display: grid;
    gap: 18px;
}

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

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

.step-card,
.comparison-card,
.link-card {
    min-width: 0;
    padding: 24px;
    border-radius: 28px;
}

.step-card h3,
.comparison-card h3,
.link-card h3 {
    margin: 10px 0 12px;
    font-size: 1.36rem;
}

.step-card p,
.comparison-card p,
.link-card p {
    margin: 0;
    line-height: 1.8;
}

.strong-card {
    background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(220, 236, 248, 0.9));
}

.warm-card {
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.98), rgba(255, 235, 210, 0.9));
}

.formula-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.formula-card {
    min-width: 0;
    padding: 24px 26px;
    border-radius: 28px;
}

.formula-block {
    margin: 12px 0 10px;
    font-size: clamp(1.2rem, 2.4vw, 1.74rem);
    line-height: 1.45;
    color: var(--accent-strong);
}

.demo-grid {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 20px;
}

.demo-panel,
.canvas-panel {
    min-width: 0;
    padding: 24px;
    border-radius: 30px;
}

.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-chip {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(29, 77, 120, 0.16);
    background: rgba(255, 255, 255, 0.86);
    color: var(--accent-strong);
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.preset-chip.is-active {
    color: #f6fbff;
    background: linear-gradient(135deg, var(--accent), #295f96);
    box-shadow: 0 14px 28px rgba(41, 95, 150, 0.18);
}

.control-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

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

.control span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.control strong {
    color: var(--accent-strong);
}

.control input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.demo-note {
    margin: 18px 0 0;
    line-height: 1.78;
}

.scenario-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 247, 238, 0.9), rgba(255, 237, 218, 0.76));
    border: 1px solid rgba(161, 88, 25, 0.14);
}

.scenario-title {
    margin: 0 0 12px;
    color: var(--warm-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.event-row {
    margin-top: 0;
}

.event-chip {
    border-color: rgba(161, 88, 25, 0.18);
    color: var(--warm-strong);
}

.event-chip.is-active {
    color: #fff8f1;
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    box-shadow: 0 14px 28px rgba(161, 88, 25, 0.2);
}

.event-note {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.74;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

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

.stat-grid article {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(29, 77, 120, 0.08);
}

.stat-grid span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.stat-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 1.18rem;
    color: var(--ink);
    line-height: 1.45;
}

#statStatus[data-state="stable"] {
    color: #0b8d6d;
}

#statStatus[data-state="low"] {
    color: #4f7aa7;
}

#statStatus[data-state="alert"] {
    color: #b84c43;
}

#statStatus[data-state="recovery"] {
    color: #2f6988;
}

#statStatus[data-state="decay"] {
    color: #a45d1f;
}

#statStatus[data-state="damage"] {
    color: #bf564b;
}

#statStatus[data-state="melt"] {
    color: #821d15;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.93rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-swatch.neutron {
    background: #7efcff;
    box-shadow: 0 0 12px rgba(126, 252, 255, 0.5);
}

.legend-swatch.fission {
    background: #ffe966;
    box-shadow: 0 0 12px rgba(255, 233, 102, 0.4);
}

.legend-swatch.rod {
    background: #1d232b;
}

.legend-swatch.steam {
    background: #eef2f6;
    box-shadow: 0 0 12px rgba(238, 242, 246, 0.34);
}

.legend-swatch.coolant-hot {
    background: var(--coolant-hot);
    box-shadow: 0 0 12px rgba(255, 127, 104, 0.34);
}

.legend-swatch.coolant-cold {
    background: var(--coolant-cold);
    box-shadow: 0 0 12px rgba(114, 184, 255, 0.34);
}

.legend-swatch.hydrogen {
    background: #f3c27d;
    box-shadow: 0 0 12px rgba(243, 194, 125, 0.34);
}

.legend-swatch.corium {
    background: #ff6c4d;
    box-shadow: 0 0 12px rgba(255, 108, 77, 0.4);
}

.canvas-panel {
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.82), rgba(241, 247, 253, 0.92));
}

.demo-canvas {
    width: 100%;
    border-radius: 24px;
    background: linear-gradient(180deg, #111922 0%, #0a1117 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.canvas-caption {
    margin: 16px 0 0;
    line-height: 1.8;
}

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

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

@media (max-width: 1080px) {
    .hero,
    .demo-grid {
        grid-template-columns: 1fr;
    }

    .comparison-grid,
    .link-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .site-header {
        position: static;
        margin-top: 12px;
        padding: 14px 16px;
        border-radius: 28px;
    }

    .site-nav {
        gap: 12px;
        font-size: 0.9rem;
    }

    .hero-copy,
    .hero-panel,
    .demo-panel,
    .canvas-panel,
    .signal-strip,
    .site-footer,
    .step-card,
    .comparison-card,
    .link-card,
    .formula-card {
        padding: 22px;
        border-radius: 26px;
    }

    .principle-grid,
    .formula-strip,
    .comparison-grid,
    .link-grid,
    .stat-grid,
    .nuclear-stat-grid {
        grid-template-columns: 1fr;
    }

    .signal-main {
        font-size: 1.65rem;
    }

    .reactor-window {
        min-height: 260px;
    }

    .containment-shell {
        left: 20px;
        width: 150px;
        height: 180px;
    }

    .containment-water {
        left: 34px;
        width: 122px;
        height: 140px;
    }

    .reactor-core-art {
        left: 46px;
        width: 100px;
        height: 108px;
    }

    .control-rod-art.rod-a { left: 64px; }
    .control-rod-art.rod-b { left: 94px; }
    .control-rod-art.rod-c { left: 124px; }

    .primary-loop.top,
    .primary-loop.bottom {
        left: 176px;
        width: 86px;
    }

    .steam-generator-art {
        left: 258px;
        width: 76px;
        height: 120px;
    }

    .turbine-wheel {
        left: 358px;
    }

    .generator-box {
        left: 444px;
        width: 80px;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 540px) {
    h1 {
        font-size: 2.4rem;
    }

    .hero-actions,
    .preset-row,
    .footer-links {
        width: 100%;
    }

    .button,
    .preset-chip {
        width: 100%;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .reactor-window {
        min-height: 232px;
    }

    .generator-box,
    .turbine-wheel,
    .steam-generator-art {
        transform: scale(0.9);
        transform-origin: top left;
    }

    .reactor-label {
        font-size: 0.74rem;
    }
}