:root {
    --bg-dark: #152535;
    --bg-mid: #314d67;
    --bg-soft: #fff9f0;
    --surface: rgba(255, 252, 246, 0.95);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --ink: #21313d;
    --muted: #63717d;
    --line: rgba(33, 49, 61, 0.12);
    --accent: #78c1b4;
    --accent-strong: #257b78;
    --accent-soft: #d8f1ec;
    --warm: #d6a15c;
    --warm-strong: #9f6322;
    --ember: #d57150;
    --ember-strong: #963f27;
    --shadow: 0 28px 68px rgba(21, 37, 53, 0.18);
}

* {
    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 14% 14%, rgba(120, 193, 180, 0.15), transparent 18%),
        radial-gradient(circle at 84% 16%, rgba(214, 161, 92, 0.18), transparent 18%),
        linear-gradient(180deg, #152535 0%, #314d67 18%, #eef4f7 18.1%, #fffdf8 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1.6px),
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1.8px),
        linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
    background-size: 320px 320px, 280px 280px, 46px 46px, 46px 46px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.16));
}

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

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

.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(21, 37, 53, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

.brand {
    color: #fffaf2;
    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(250, 244, 236, 0.84);
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.footer-links a:hover,
.footer-links a: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.96fr) minmax(0, 1.04fr);
    gap: 24px;
    padding: 34px 0 22px;
}

.hero-copy,
.hero-panel,
.bridge-step,
.formula-pill,
.hero-quote,
.info-card,
.formula-card,
.callout-panel,
.link-card,
.signal-strip {
    border: 1px solid rgba(255, 255, 255, 0.7);
    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 -84px -148px auto;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(216, 241, 236, 0.6), rgba(216, 241, 236, 0));
}

.hero-panel {
    min-width: 0;
    padding: 26px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    background: rgba(237, 242, 246, 0.28);
}

.eyebrow,
.card-label,
.signal-kicker {
    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 {
    font-family: "Shippori Mincho", serif;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2.55rem, 5vw, 4.2rem);
    letter-spacing: -0.04em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.84rem, 3.7vw, 2.92rem);
    letter-spacing: -0.03em;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.hero-lead,
.section-heading p,
.info-card p,
.formula-card p,
.hero-quote p,
.link-card p,
.callout-panel p,
.signal-sub,
.bridge-step p,
.formula-pill p,
.site-footer p {
    color: var(--muted);
}

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

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

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

.button-primary {
    color: #fffdf7;
    background: linear-gradient(135deg, var(--accent-strong), #3569a5);
    box-shadow: 0 16px 34px rgba(37, 123, 120, 0.24);
}

.button-secondary {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(33, 49, 61, 0.12);
}

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

.hero-points li {
    position: relative;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.7;
}

.hero-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm), var(--accent-strong));
    transform: translateY(-50%);
}

.bridge-map {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.bridge-step {
    position: relative;
    padding: 20px 18px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.82);
}

.bridge-step::after {
    content: "→";
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--warm-strong);
    font-size: 1.3rem;
    font-weight: 700;
}

.bridge-step:last-child::after {
    display: none;
}

.bridge-step h2 {
    font-size: 1.36rem;
}

.formula-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.formula-pill {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
}

.hero-quote {
    padding: 20px 22px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(219, 240, 236, 0.9));
}

.signal-strip {
    margin: 14px 0 30px;
    padding: 22px 28px;
    border-radius: 30px;
    text-align: center;
}

.signal-main {
    margin: 0;
    font-size: clamp(1.34rem, 2.6vw, 1.9rem);
}

.signal-sub {
    margin: 10px auto 0;
    max-width: 760px;
    line-height: 1.8;
}

.section {
    padding-top: 10px;
}

.section + .section {
    margin-top: 20px;
}

.section-heading {
    max-width: 800px;
    margin-bottom: 20px;
}

.section-heading p {
    margin-bottom: 0;
    line-height: 1.8;
}

.card-grid,
.formula-strip,
.timeline-grid,
.link-grid {
    display: grid;
    gap: 18px;
}

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

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

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

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

.info-card,
.formula-card,
.callout-panel,
.link-card {
    padding: 24px 22px;
    border-radius: 30px;
}

.link-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-card .button {
    margin-top: auto;
}

.strong-card {
    background: linear-gradient(180deg, rgba(220, 244, 239, 0.92), rgba(255, 255, 255, 0.95));
}

.warm-card {
    background: linear-gradient(180deg, rgba(252, 241, 221, 0.94), rgba(255, 255, 255, 0.96));
}

.night-card {
    background: linear-gradient(180deg, rgba(229, 238, 248, 0.92), rgba(255, 255, 255, 0.95));
}

.callout-panel {
    margin-top: 18px;
    background: linear-gradient(135deg, rgba(21, 37, 53, 0.96), rgba(49, 77, 103, 0.94));
    border-color: rgba(255, 255, 255, 0.16);
}

.callout-panel .card-label {
    color: #9ee2d8;
}

.callout-panel h3,
.callout-panel p {
    color: #edf5fb;
}

.formula-block {
    font-size: 1.06rem;
    line-height: 1.5;
    color: var(--ink);
}

.formula-block .katex-display {
    margin: 0;
}

.formula-card .katex-display,
.formula-pill .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0 0.2rem;
}

.formula-card p:last-child,
.info-card p:last-child,
.link-card p:last-child,
.callout-panel p:last-child,
.bridge-step p:last-child,
.formula-pill p:last-child,
.hero-quote p:last-child {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 42px;
    padding: 28px 30px;
    border-radius: 32px;
    background: rgba(21, 37, 53, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 48px rgba(13, 24, 35, 0.28);
}

.site-footer p {
    color: #eef5fb;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    color: rgba(238, 245, 251, 0.82);
}

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

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

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

    .site-header {
        border-radius: 30px;
        padding: 16px 18px;
        align-items: flex-start;
    }

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

    .bridge-map,
    .card-grid,
    .formula-strip,
    .link-grid {
        grid-template-columns: 1fr;
    }

    .bridge-step::after {
        content: "↓";
        right: auto;
        left: 50%;
        top: auto;
        bottom: -17px;
        transform: translateX(-50%);
    }

    .formula-stack {
        grid-template-columns: 1fr;
    }
}

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

    .hero-copy,
    .hero-panel,
    .info-card,
    .formula-card,
    .callout-panel,
    .link-card,
    .signal-strip,
    .formula-pill,
    .hero-quote {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hero-copy,
    .hero-panel {
        border-radius: 28px;
    }

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

    .button {
        width: 100%;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding: 24px 18px;
    }
}