:root {
    --bg-dark: #050a18;
    --bg-mid: #0e1d3a;
    --bg-soft: #f1f4fb;
    --surface: rgba(248, 250, 255, 0.94);
    --surface-soft: rgba(225, 232, 248, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --ink: #14213b;
    --muted: #5a6783;
    --line: rgba(20, 33, 59, 0.12);
    --accent: #4768c3;
    --accent-strong: #1a2c63;
    --accent-soft: #9bb8ee;
    --accent-soft-strong: #2c4a99;
    --warm: #e08a52;
    --shadow: 0 28px 68px rgba(8, 16, 38, 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% 14%, rgba(155, 184, 238, 0.34), transparent 18%),
        radial-gradient(circle at 84% 14%, rgba(224, 138, 82, 0.18), transparent 22%),
        linear-gradient(180deg, #050a18 0%, #0e1d3a 16%, #e7eef9 16.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.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.12));
}

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(5, 10, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.brand {
    color: #f3f6ff;
    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(243, 246, 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.92fr) minmax(0, 1.08fr);
    gap: 24px;
    padding: 34px 0 22px;
}

.hero-copy,
.hero-panel,
.mechanism-card,
.formula-card,
.model-card,
.comparison-card,
.instability-lead,
.step-card,
.growth-card,
.demo-panel,
.canvas-panel,
.environment-card,
.callout-card,
.link-card,
.signal-strip,
.hero-note {
    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 -52px -108px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 184, 238, 0.5), rgba(155, 184, 238, 0));
}

.hero-panel {
    min-width: 0;
    padding: 26px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    background: rgba(231, 238, 249, 0.4);
}

.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,
.formula-block,
.signal-main,
.footer-link,
.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.7rem);
    letter-spacing: -0.04em;
}

.hero-lead,
.section-heading p,
.mechanism-card p,
.formula-card p,
.model-card p,
.comparison-card p,
.instability-lead p,
.step-card p,
.growth-card p,
.demo-note,
.environment-card p,
.callout-card p,
.link-card p,
.site-footer p,
.signal-sub,
.canvas-caption,
.hero-note 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;
    cursor: pointer;
}

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

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 28px rgba(26, 44, 99, 0.28);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.74);
    border-color: var(--line);
}

.hero-points {
    margin: 24px 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.sky-window,
.control,
.stat-grid article,
.preset-chip,
.link-card,
.comparison-card,
.growth-card,
.step-card,
.hero-note {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(225, 232, 248, 0.86));
    border: 1px solid rgba(20, 33, 59, 0.08);
}

.sky-window {
    position: relative;
    min-height: 360px;
    padding: 0;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(180deg, #1a3a8a 0%, #4a78c8 35%, #a0c8ff 70%, #ffe5b8 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.sun {
    position: absolute;
    right: 18%;
    top: 16%;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff8d8 0%, #fff1b3 50%, rgba(255, 240, 180, 0) 75%);
    box-shadow: 0 0 40px rgba(255, 240, 180, 0.7);
}

.scatter-ray {
    position: absolute;
    left: 16%;
    top: 14%;
    width: 36%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 250, 220, 0.95), rgba(255, 250, 220, 0));
    transform-origin: 0 50%;
    transform: rotate(18deg);
    box-shadow: 0 0 8px rgba(255, 250, 220, 0.6);
}

.scatter-ray.ray-b { top: 28%; transform: rotate(8deg); width: 30%; }
.scatter-ray.ray-c { top: 42%; transform: rotate(-2deg); width: 32%; }

.scatter-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(180, 220, 255, 0.95);
    box-shadow: 0 0 14px rgba(180, 220, 255, 0.8);
}

.dot-a { top: 24%; left: 38%; }
.dot-b { top: 36%; left: 52%; width: 6px; height: 6px; }
.dot-c { top: 18%; left: 56%; width: 7px; height: 7px; }
.dot-d { top: 44%; left: 28%; width: 5px; height: 5px; }
.dot-e { top: 52%; left: 60%; width: 6px; height: 6px; }
.dot-f { top: 62%; left: 40%; width: 7px; height: 7px; }

.window-label {
    position: absolute;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(5, 10, 24, 0.42);
    color: rgba(243, 246, 255, 0.92);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.label-blue { left: 20px; bottom: 18px; }
.label-rayleigh { right: 20px; top: 18px; }

.hero-note-grid,
.mechanism-grid,
.model-grid,
.comparison-grid,
.step-grid,
.growth-grid,
.control-grid,
.environment-grid,
.link-grid,
.formula-strip {
    display: grid;
    gap: 18px;
}

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

.hero-note,
.mechanism-card,
.formula-card,
.model-card,
.comparison-card,
.instability-lead,
.step-card,
.growth-card,
.demo-panel,
.canvas-panel,
.environment-card,
.callout-card,
.link-card {
    padding: 24px 26px;
    border-radius: 28px;
}

.card-label,
.signal-kicker {
    display: inline-block;
    font-weight: 700;
    color: var(--accent-strong);
    letter-spacing: 0.08em;
}

.strong-card {
    background: linear-gradient(145deg, rgba(225, 235, 255, 0.98), rgba(196, 215, 248, 0.88));
}

.warm-card {
    background: linear-gradient(145deg, rgba(255, 232, 210, 0.98), rgba(241, 196, 152, 0.9));
}

.night-card {
    background: linear-gradient(145deg, rgba(14, 29, 58, 0.98), rgba(40, 60, 120, 0.92));
    color: white;
}

.night-card p,
.night-card .card-label,
.night-card h2,
.night-card h3,
.night-card li {
    color: white;
}

.signal-strip {
    margin-top: 10px;
    padding: 24px 30px;
    border-radius: 30px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
    align-items: center;
}

.signal-kicker {
    margin: 0;
    font-size: 0.86rem;
    text-transform: uppercase;
}

.signal-main {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    margin: 0;
}

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

.section {
    margin-top: 88px;
}

.section-heading {
    margin-bottom: 26px;
}

.section-heading h2 {
    font-size: clamp(2rem, 3.5vw, 3.1rem);
}

.section-heading p {
    margin: 12px 0 0;
    max-width: 860px;
    line-height: 1.85;
}

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

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

.formula-block {
    font-size: clamp(1.08rem, 2vw, 1.5rem);
    color: var(--ink);
}

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

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

.model-card ul {
    margin: 18px 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 8px;
}

.instability-layout,
.demo-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
    gap: 20px;
}

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

.step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(71, 104, 195, 0.16);
    color: var(--accent-strong);
    font-weight: 700;
}

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

.preset-chip {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(20, 33, 59, 0.08);
    color: var(--accent-strong);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    cursor: pointer;
}

.preset-chip.is-active {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 24px rgba(26, 44, 99, 0.22);
}

.control-grid {
    margin-top: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border-radius: 22px;
}

.control span {
    color: var(--accent-strong);
    font-weight: 600;
}

.control input {
    width: 100%;
    accent-color: var(--accent);
}

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

.stat-grid article {
    padding: 18px 20px;
    border-radius: 22px;
}

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

.stat-grid strong {
    display: block;
    margin-top: 8px;
}

.demo-panel,
.canvas-panel,
.callout-card {
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.97), rgba(225, 232, 248, 0.88));
}

.demo-note,
.canvas-caption {
    margin: 18px 0 0;
    line-height: 1.8;
}

.demo-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.canvas-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.demo-canvas {
    width: 100%;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(5, 10, 24, 0.98), rgba(14, 29, 58, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.color-readout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.color-swatch {
    padding: 14px 18px;
    border-radius: 18px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.color-swatch span {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.86;
}

.color-swatch strong {
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
    font-family: "Shippori Mincho", serif;
}

.link-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.site-footer {
    margin-top: 64px;
    padding: 24px 30px;
    border-radius: 28px;
    background: rgba(5, 10, 24, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(243, 246, 255, 0.82);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-footer p {
    margin: 0;
}

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

.footer-link {
    color: white;
    font-weight: 600;
}

@media (max-width: 1120px) {
    .hero,
    .signal-strip,
    .instability-layout,
    .demo-grid,
    .formula-strip {
        grid-template-columns: 1fr;
    }

    .hero-note-grid,
    .mechanism-grid,
    .model-grid,
    .comparison-grid,
    .growth-grid,
    .environment-grid,
    .link-grid,
    .control-grid,
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .site-header {
        position: static;
        flex-direction: column;
        align-items: flex-start;
        border-radius: 28px;
    }

    .site-nav {
        justify-content: flex-start;
        gap: 12px 14px;
    }

    .hero-copy,
    .hero-panel,
    .hero-note,
    .mechanism-card,
    .formula-card,
    .model-card,
    .comparison-card,
    .instability-lead,
    .step-card,
    .growth-card,
    .demo-panel,
    .canvas-panel,
    .environment-card,
    .callout-card,
    .link-card,
    .signal-strip,
    .site-footer {
        padding: 22px;
        border-radius: 24px;
    }

    .hero-actions {
        flex-direction: column;
    }

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

    .hero-note-grid,
    .mechanism-grid,
    .model-grid,
    .comparison-grid,
    .step-grid,
    .growth-grid,
    .control-grid,
    .stat-grid,
    .environment-grid,
    .link-grid,
    .color-readout {
        grid-template-columns: 1fr;
    }

    .hero,
    .section {
        margin-top: 68px;
    }

    .sky-window {
        min-height: 320px;
    }

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