:root {
    --bg-dark: #0f1620;
    --bg-mid: #28435a;
    --surface: rgba(250, 247, 241, 0.9);
    --surface-soft: rgba(236, 243, 249, 0.84);
    --surface-strong: rgba(255, 252, 246, 0.96);
    --ink: #1e2835;
    --muted: #67717b;
    --line: rgba(30, 40, 53, 0.12);
    --accent: #34566f;
    --accent-strong: #213445;
    --accent-soft: #cb8456;
    --shadow: 0 28px 64px rgba(15, 22, 32, 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 12% 16%, rgba(203, 132, 86, 0.2), transparent 22%),
        radial-gradient(circle at 88% 12%, rgba(52, 86, 111, 0.24), transparent 18%),
        linear-gradient(180deg, #0d1520 0%, #182b3d 17%, #efe7db 17.1%, #f8f2e8 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: 46px 46px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.08));
}

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

button,
input {
    font: inherit;
}

canvas {
    display: block;
    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(13, 21, 32, 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.2);
}

.brand {
    color: #f8efe1;
    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(248, 239, 225, 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,
.table-card,
.point-card,
.reason-card,
.chaos-card,
.demo-panel,
.visual-panel,
.math-card,
.method-card,
.map-panel,
.importance-card,
.link-card,
.signal-strip,
.hero-note,
.hero-summary,
.canvas-card,
.equation-card,
.control-card,
.stat-grid article {
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

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

.hero-copy::after {
    content: "";
    position: absolute;
    inset: auto -50px -94px auto;
    width: 290px;
    height: 290px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(203, 132, 86, 0.44), rgba(203, 132, 86, 0));
}

.hero-panel {
    min-width: 0;
    padding: 26px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    background: rgba(244, 248, 252, 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,
.summary-title,
.signal-main,
.equation-block,
.hero-summary strong,
.footer-link {
    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,
.point-card p,
.reason-card p,
.chaos-card p,
.demo-note,
.canvas-caption,
.math-card p,
.method-card p,
.importance-card p,
.link-card p,
.hero-note p,
.hero-summary p,
.site-footer p,
.signal-sub,
.comparison-table th,
.comparison-table td,
.equation-card 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;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 28px rgba(33, 52, 69, 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;
}

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

.pendulum-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.pendulum-stage,
.hero-note,
.hero-summary,
.point-card,
.reason-card,
.chaos-card,
.demo-panel,
.visual-panel,
.math-card,
.method-card,
.importance-card,
.link-card,
.canvas-card,
.equation-card,
.control-card,
.table-card {
    padding: 24px 26px;
    border-radius: 28px;
}

.pendulum-stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
    background: linear-gradient(145deg, rgba(255, 251, 245, 0.96), rgba(236, 243, 249, 0.84));
    border: 1px solid rgba(30, 40, 53, 0.08);
}

.pendulum-stage span {
    font-weight: 700;
    color: var(--accent-strong);
    letter-spacing: 0.08em;
}

.pendulum-stage strong {
    font-family: "Shippori Mincho", serif;
    font-size: 1.32rem;
}

.pendulum-stage p {
    margin: 0;
    color: var(--muted);
}

.pendulum-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 16px 14px;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(33, 52, 69, 0.96), rgba(52, 86, 111, 0.92));
    color: rgba(255, 255, 255, 0.96);
    font-weight: 700;
    text-align: center;
    box-shadow: 0 18px 36px rgba(33, 52, 69, 0.22);
}

.pendulum-figure {
    position: relative;
    width: 124px;
    height: 124px;
    margin: 12px auto 0;
}

.pendulum-figure .pivot,
.pendulum-figure .rod,
.pendulum-figure .bob {
    position: absolute;
    display: block;
}

.pendulum-figure .pivot {
    top: 10px;
    left: 58px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
}

.pendulum-figure .rod {
    width: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    transform-origin: top center;
}

.pendulum-figure .bob {
    border-radius: 50%;
    background: rgba(203, 132, 86, 0.96);
    box-shadow: 0 0 16px rgba(203, 132, 86, 0.28);
}

.single-figure .rod-one {
    top: 18px;
    left: 60px;
    height: 68px;
    transform: rotate(24deg);
}

.single-figure .bob-one {
    top: 76px;
    left: 84px;
    width: 18px;
    height: 18px;
}

.double-figure .rod-one {
    top: 18px;
    left: 60px;
    height: 52px;
    transform: rotate(-24deg);
}

.double-figure .bob-one {
    top: 60px;
    left: 38px;
    width: 16px;
    height: 16px;
}

.double-figure .rod-two {
    top: 70px;
    left: 46px;
    height: 46px;
    transform: rotate(34deg);
}

.double-figure .bob-two {
    top: 108px;
    left: 74px;
    width: 18px;
    height: 18px;
}

.hero-note-grid,
.what-grid,
.reason-grid,
.chaos-grid,
.demo-grid,
.math-grid,
.importance-grid,
.link-board,
.method-grid {
    display: grid;
    gap: 20px;
}

.hero-note-grid,
.what-grid,
.demo-grid,
.math-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

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

.strong-card {
    background: linear-gradient(145deg, rgba(236, 244, 251, 0.98), rgba(223, 234, 245, 0.88));
}

.warm-card {
    background: linear-gradient(145deg, rgba(255, 248, 235, 0.98), rgba(246, 232, 209, 0.88));
}

.hero-summary {
    background: linear-gradient(145deg, rgba(33, 52, 69, 0.98), rgba(52, 86, 111, 0.92));
    color: white;
}

.hero-summary p,
.hero-summary .summary-title {
    color: white;
    margin: 0;
}

.hero-summary p:last-child {
    margin-top: 10px;
}

.signal-strip {
    margin-top: 10px;
    padding: 24px 30px;
    border-radius: 30px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr);
    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.4rem);
    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: 820px;
    line-height: 1.85;
}

.table-card {
    overflow: hidden;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(30, 40, 53, 0.08);
    text-align: left;
}

.comparison-table th {
    color: var(--ink);
    background: rgba(33, 52, 69, 0.08);
}

.visual-panel,
.demo-panel,
.map-panel,
.canvas-card,
.equation-card,
.control-card,
.stat-grid article {
    background: linear-gradient(180deg, rgba(252, 247, 239, 0.96), rgba(236, 243, 249, 0.86));
}

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

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

.control input {
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

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

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

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

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

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

.equation-card {
    margin-top: 18px;
}

.compact-card {
    margin-top: 18px;
}

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

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

#doublePendulumCanvas,
#poincareSimCanvas,
#poincareMapCanvas {
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(9, 12, 22, 0.98), rgba(28, 39, 66, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.map-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.crossing-chip {
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(33, 52, 69, 0.1);
    color: var(--accent-strong);
    font-weight: 700;
}

.map-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.site-footer {
    margin-top: 64px;
    padding: 24px 30px;
    border-radius: 28px;
    background: rgba(13, 21, 32, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 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: 1080px) {
    .hero,
    .signal-strip,
    .what-grid,
    .demo-grid,
    .math-grid,
    .importance-grid,
    .link-board,
    .map-board {
        grid-template-columns: 1fr;
    }

    .reason-grid,
    .chaos-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,
    .table-card,
    .point-card,
    .reason-card,
    .chaos-card,
    .demo-panel,
    .visual-panel,
    .math-card,
    .method-card,
    .map-panel,
    .importance-card,
    .link-card,
    .hero-note,
    .hero-summary,
    .canvas-card,
    .equation-card,
    .control-card,
    .signal-strip,
    .site-footer,
    .pendulum-stage {
        padding: 22px;
        border-radius: 24px;
    }

    .hero-actions,
    .button-row {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .pendulum-board,
    .hero-note-grid,
    .reason-grid,
    .chaos-grid,
    .importance-grid,
    .link-board,
    .stat-grid,
    .map-stats-grid {
        grid-template-columns: 1fr;
    }

    .pendulum-chip {
        width: min(100%, 180px);
        margin: 0 auto;
    }

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

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