:root {
    --bg-dark: #081521;
    --bg-mid: #1b3850;
    --bg-soft: #f0f5f7;
    --surface: rgba(248, 252, 255, 0.92);
    --surface-soft: rgba(229, 240, 247, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --ink: #183044;
    --muted: #5d7182;
    --line: rgba(24, 48, 68, 0.12);
    --accent: #2b6f94;
    --accent-strong: #123753;
    --accent-soft: #93d3ef;
    --accent-soft-strong: #1f627e;
    --warm: #d6a56a;
    --shadow: 0 28px 68px rgba(8, 21, 33, 0.16);
}

* {
    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(147, 211, 239, 0.22), transparent 18%),
        radial-gradient(circle at 84% 12%, rgba(214, 165, 106, 0.16), transparent 18%),
        linear-gradient(180deg, #08131f 0%, #163048 16%, #edf3f7 16.1%, #f8fbfd 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(8, 19, 31, 0.76);
    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: #f3fbff;
    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, 251, 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(147, 211, 239, 0.44), rgba(147, 211, 239, 0));
}

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

.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(18, 55, 83, 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;
}

.crystal-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(231, 241, 248, 0.86));
    border: 1px solid rgba(24, 48, 68, 0.08);
}

.crystal-window {
    position: relative;
    min-height: 360px;
    padding: 18px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(150, 220, 248, 0.28), transparent 28%),
        linear-gradient(180deg, rgba(5, 20, 34, 0.98), rgba(18, 46, 69, 0.98));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glow-ring,
.crystal-core,
.arm,
.branch,
.vapor,
.window-label {
    position: absolute;
}

.glow-ring {
    inset: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(169, 229, 255, 0.18);
}

.glow-one {
    width: 176px;
    height: 176px;
}

.glow-two {
    width: 258px;
    height: 258px;
    border-style: dashed;
}

.crystal-core {
    top: 50%;
    left: 50%;
    width: 74px;
    height: 74px;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(236, 252, 255, 0.98), rgba(134, 217, 252, 0.78));
    box-shadow: 0 0 36px rgba(151, 223, 255, 0.42);
}

.arm,
.branch {
    top: 50%;
    left: 50%;
    transform-origin: 0 50%;
    border-radius: 999px;
}

.arm {
    width: 120px;
    height: 4px;
    margin-left: 8px;
    background: linear-gradient(90deg, rgba(236, 252, 255, 0.9), rgba(133, 211, 244, 0.2));
}

.branch {
    width: 74px;
    height: 2px;
    margin-left: 48px;
    background: linear-gradient(90deg, rgba(222, 248, 255, 0.9), rgba(133, 211, 244, 0.12));
}

.arm-a { transform: translateY(-50%) rotate(0deg); }
.arm-b { transform: translateY(-50%) rotate(60deg); }
.arm-c { transform: translateY(-50%) rotate(120deg); }
.arm-d { transform: translateY(-50%) rotate(180deg); }
.arm-e { transform: translateY(-50%) rotate(240deg); }
.arm-f { transform: translateY(-50%) rotate(300deg); }

.branch-a { transform: translateY(-50%) rotate(30deg); }
.branch-b { transform: translateY(-50%) rotate(90deg); }
.branch-c { transform: translateY(-50%) rotate(150deg); }
.branch-d { transform: translateY(-50%) rotate(210deg); }
.branch-e { transform: translateY(-50%) rotate(270deg); }
.branch-f { transform: translateY(-50%) rotate(330deg); }

.vapor {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(242, 251, 255, 0.8);
    box-shadow: 0 0 20px rgba(197, 237, 255, 0.48);
}

.vapor-a { top: 70px; left: 84px; }
.vapor-b { top: 108px; right: 94px; }
.vapor-c { bottom: 82px; left: 112px; }

.window-label {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(244, 251, 255, 0.12);
    color: rgba(243, 251, 255, 0.84);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.label-core {
    left: 20px;
    bottom: 18px;
}

.label-growth {
    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(231, 247, 255, 0.98), rgba(216, 236, 247, 0.88));
}

.warm-card {
    background: linear-gradient(145deg, rgba(255, 248, 235, 0.98), rgba(243, 231, 212, 0.9));
}

.night-card {
    background: linear-gradient(145deg, rgba(18, 55, 83, 0.98), rgba(43, 111, 148, 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));
}

.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(43, 111, 148, 0.12);
    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(24, 48, 68, 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(18, 55, 83, 0.22);
}

.control-grid {
    margin-top: 20px;
    grid-template-columns: repeat(4, 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%;
}

.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(231, 241, 248, 0.88));
}

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

.demo-actions {
    margin-top: 18px;
}

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

#snowflakeCanvas {
    width: 100%;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(7, 18, 30, 0.98), rgba(18, 46, 69, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

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

.site-footer {
    margin-top: 64px;
    padding: 24px 30px;
    border-radius: 28px;
    background: rgba(8, 19, 31, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(243, 251, 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 {
        grid-template-columns: 1fr;
    }

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

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

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