:root {
    --bg-dark: #111417;
    --bg-mid: #243039;
    --bg-soft: #f4efe7;
    --surface: rgba(255, 251, 246, 0.92);
    --surface-soft: rgba(244, 235, 223, 0.86);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --ink: #1b2329;
    --muted: #65717b;
    --line: rgba(27, 35, 41, 0.12);
    --accent: #c76624;
    --accent-strong: #863d12;
    --accent-soft: #f0b56d;
    --cool: #4f8cb6;
    --cool-soft: #d6ebfa;
    --steel: #90a0ae;
    --shadow: 0 28px 70px rgba(11, 16, 20, 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 18% 10%, rgba(240, 181, 109, 0.22), transparent 20%),
        radial-gradient(circle at 82% 14%, rgba(79, 140, 182, 0.18), transparent 22%),
        linear-gradient(180deg, #111417 0%, #243039 17%, #ece6dc 17.1%, #faf7f2 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.78), 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(17, 20, 23, 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: #fff7f0;
    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(255, 247, 240, 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(240, 181, 109, 0.36), rgba(240, 181, 109, 0));
}

.hero-panel {
    min-width: 0;
    padding: 26px;
    border-radius: 36px;
    display: grid;
    gap: 18px;
    background: rgba(247, 240, 230, 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: #fffaf5;
    background: linear-gradient(135deg, var(--accent), #914010);
    box-shadow: 0 14px 28px rgba(145, 64, 16, 0.22);
}

.button-secondary {
    border-color: rgba(134, 61, 18, 0.18);
    background: rgba(255, 253, 250, 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(--accent-soft), var(--accent));
    box-shadow: 0 0 16px rgba(199, 102, 36, 0.35);
}

.engine-window {
    position: relative;
    min-height: 300px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 26%, rgba(240, 181, 109, 0.18), transparent 22%),
        linear-gradient(180deg, #1a2026 0%, #0f1317 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.engine-cylinder {
    position: absolute;
    left: 50%;
    top: 54px;
    width: 154px;
    height: 166px;
    transform: translateX(-50%);
    border: 5px solid rgba(216, 225, 240, 0.9);
    border-radius: 22px 22px 10px 10px;
}

.engine-piston {
    position: absolute;
    left: 50%;
    top: 154px;
    width: 126px;
    height: 34px;
    transform: translateX(-50%);
    border-radius: 10px;
    background: linear-gradient(180deg, #c7d0d7, #89949d);
}

.engine-rod {
    position: absolute;
    left: 50%;
    top: 182px;
    width: 10px;
    height: 74px;
    transform: translateX(-50%) rotate(16deg);
    transform-origin: top center;
    border-radius: 999px;
    background: linear-gradient(180deg, #d7dde2, #91a0ab);
}

.engine-crank {
    position: absolute;
    left: calc(50% + 20px);
    top: 242px;
    width: 82px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f0b56d, #c76624);
    transform: rotate(28deg);
    transform-origin: left center;
}

.engine-flywheel {
    position: absolute;
    left: calc(50% - 4px);
    top: 214px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid rgba(144, 160, 174, 0.72);
}

.engine-valve {
    position: absolute;
    top: 34px;
    width: 34px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(79, 140, 182, 0.9), rgba(79, 140, 182, 0.18));
}

.engine-valve.intake {
    left: calc(50% - 74px);
}

.engine-valve.exhaust {
    left: calc(50% + 42px);
    background: linear-gradient(180deg, rgba(144, 160, 174, 0.92), rgba(144, 160, 174, 0.2));
}

.engine-spark {
    position: absolute;
    left: 50%;
    top: 26px;
    width: 6px;
    height: 48px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #fef8d4, rgba(254, 248, 212, 0.12));
}

.engine-spark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 42px;
    width: 18px;
    height: 34px;
    transform: translateX(-50%);
    clip-path: polygon(50% 0%, 68% 24%, 42% 45%, 62% 68%, 32% 100%, 44% 72%, 24% 54%, 46% 28%);
    background: linear-gradient(180deg, rgba(255, 241, 127, 0.88), rgba(255, 170, 53, 0.22));
}

.engine-label {
    position: absolute;
    color: rgba(255, 247, 240, 0.84);
    font-size: 0.82rem;
}

.label-intake { left: 84px; top: 34px; }
.label-exhaust { right: 74px; top: 34px; }
.label-cycle {
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-note {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 253, 251, 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;
}

.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(255, 248, 238, 0.98), rgba(255, 232, 204, 0.9));
}

.warm-card {
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(217, 235, 247, 0.86));
}

.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(134, 61, 18, 0.16);
    background: rgba(255, 253, 250, 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: #fffaf5;
    background: linear-gradient(135deg, var(--accent), #914010);
    box-shadow: 0 14px 28px rgba(145, 64, 16, 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;
}

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

.stat-grid article {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(134, 61, 18, 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;
}

.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.intake {
    background: #55aaff;
    box-shadow: 0 0 12px rgba(85, 170, 255, 0.35);
}

.legend-swatch.compression {
    background: #f0c552;
    box-shadow: 0 0 12px rgba(240, 197, 82, 0.35);
}

.legend-swatch.power {
    background: #ff6a2d;
    box-shadow: 0 0 12px rgba(255, 106, 45, 0.35);
}

.legend-swatch.exhaust {
    background: #a4adb4;
    box-shadow: 0 0 12px rgba(164, 173, 180, 0.35);
}

.legend-swatch.stirling-hot {
    background: #ff7b45;
    box-shadow: 0 0 12px rgba(255, 123, 69, 0.38);
}

.legend-swatch.stirling-cold {
    background: #68b7ff;
    box-shadow: 0 0 12px rgba(104, 183, 255, 0.38);
}

.legend-swatch.stirling-displacer {
    background: #c8d2d8;
    box-shadow: 0 0 12px rgba(200, 210, 216, 0.28);
}

.legend-swatch.stirling-regen {
    background: #ffcf7b;
    box-shadow: 0 0 12px rgba(255, 207, 123, 0.32);
}

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

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

.demo-canvas {
    width: 100%;
    border-radius: 24px;
    background: linear-gradient(180deg, #161b21 0%, #0f1318 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,
    .stirling-stat-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .label-cycle {
        width: calc(100% - 32px);
        text-align: center;
    }
}