:root {
    --bg-1: #f4fbf3;
    --bg-2: #e5f7ee;
    --bg-3: #fff7e8;
    --ink-1: #12231a;
    --ink-2: #466257;
    --ink-3: #6a8579;
    --line: rgba(18, 35, 26, 0.12);
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --hero: #183726;
    --green: #1c8b57;
    --mint: #78d2a0;
    --amber: #e89b2c;
    --red: #cf4d4d;
    --shadow: 0 22px 58px rgba(32, 55, 41, 0.13);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "IBM Plex Sans JP", sans-serif;
    color: var(--ink-1);
    background:
        radial-gradient(circle at 12% 14%, rgba(120, 210, 160, 0.28), transparent 20%),
        radial-gradient(circle at 88% 24%, rgba(232, 155, 44, 0.18), transparent 24%),
        linear-gradient(180deg, #f6fcf5 0%, #eef8f1 44%, #fffaf1 100%);
}

main {
    display: flex;
    flex-direction: column;
}

main > #viewer {
    order: -1;
}

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

button,
input,
select {
    font: inherit;
}

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(24, 55, 38, 0.9);
    color: #f5fff8;
    box-shadow: 0 16px 36px rgba(32, 55, 41, 0.16);
    backdrop-filter: blur(14px);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
}

.site-nav a {
    color: rgba(245, 255, 248, 0.84);
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: #ffffff;
}

.section {
    margin-top: 28px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
    gap: 24px;
    padding: 42px;
    border-radius: 32px;
    background:
        radial-gradient(circle at 84% 16%, rgba(120, 210, 160, 0.15), transparent 18%),
        radial-gradient(circle at 12% 84%, rgba(232, 155, 44, 0.16), transparent 24%),
        linear-gradient(135deg, rgba(24, 55, 38, 0.98), rgba(22, 74, 53, 0.92) 58%, rgba(43, 89, 60, 0.88));
    color: #f4fff8;
    box-shadow: 0 28px 66px rgba(32, 55, 41, 0.2);
}

.hero-copy h1,
.section-heading h2,
.hero-note h2,
.hero-summary .summary-title,
.panel h3,
.bridge-panel h3,
.info-card h3,
.hint-card h3,
.canvas-top h3 {
    font-family: "Shippori Mincho", serif;
}

.eyebrow,
.card-label,
.control-label,
.signal-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow,
.card-label,
.signal-kicker {
    color: rgba(227, 245, 233, 0.74);
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.5rem, 4vw, 4.1rem);
    line-height: 1.1;
}

.hero-lead {
    margin: 22px 0 0;
    color: rgba(244, 255, 248, 0.88);
    font-size: 1.02rem;
    line-height: 1.95;
}

.hero-actions,
.button-row,
.footer-links,
.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

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

.button-primary {
    background: linear-gradient(135deg, var(--mint), #c6f4d5);
    color: #103121;
    box-shadow: 0 14px 30px rgba(120, 210, 160, 0.28);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #f6fff8;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.controls-panel .button-primary,
.controls-panel .button-secondary {
    color: var(--ink-1);
    border: 1px solid rgba(18, 35, 26, 0.12);
    box-shadow: none;
}

.controls-panel .button-primary {
    background: linear-gradient(135deg, rgba(120, 210, 160, 0.24), rgba(232, 155, 44, 0.14));
}

.controls-panel .button-secondary {
    background: #ffffff;
}

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

.hero-points li {
    position: relative;
    padding-left: 22px;
    color: rgba(244, 255, 248, 0.84);
    line-height: 1.7;
}

.hero-points li::before {
    content: "";
    position: absolute;
    top: 0.75em;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mint), var(--amber));
}

.hero-panel {
    display: grid;
    gap: 16px;
}

.hero-note,
.hero-summary,
.panel,
.signal-strip,
.bridge-panel,
.info-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-note,
.hero-summary {
    padding: 24px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px);
}

.hero-note h2,
.hero-summary .summary-title {
    margin: 0;
    font-size: 1.35rem;
}

.hero-note p,
.hero-summary p {
    margin: 12px 0 0;
    line-height: 1.8;
    color: rgba(244, 255, 248, 0.84);
}

.strong-card {
    background: linear-gradient(135deg, rgba(120, 210, 160, 0.18), rgba(255, 255, 255, 0.08));
}

.warm-card {
    background: linear-gradient(135deg, rgba(232, 155, 44, 0.14), rgba(255, 255, 255, 0.08));
}

.signal-strip {
    margin-top: 24px;
    padding: 22px 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(244, 251, 242, 0.78));
}

.signal-kicker {
    color: var(--ink-3);
}

.signal-main {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 700;
    line-height: 1.45;
}

.signal-sub {
    margin: 10px 0 0;
    color: var(--ink-2);
    line-height: 1.85;
}

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

.section-heading .eyebrow,
.control-label {
    color: var(--ink-3);
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    color: var(--ink-1);
}

.section-heading p:last-child {
    margin: 12px 0 0;
    color: var(--ink-2);
    line-height: 1.85;
}

.viewer-grid,
.stats-grid,
.cards-grid {
    display: grid;
    gap: 18px;
}

.viewer-grid {
    grid-template-columns: minmax(310px, 0.78fr) minmax(0, 1.22fr);
}

.panel,
.bridge-panel,
.info-card {
    padding: 24px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
}

.formula-box {
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(120, 210, 160, 0.18), rgba(232, 155, 44, 0.12));
    color: var(--ink-1);
    font-family: "Shippori Mincho", serif;
    font-size: 1.4rem;
    font-weight: 700;
}

.control-stack {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.control-group {
    display: grid;
    gap: 10px;
}

.control-top,
.canvas-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.control-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.control-value {
    font-weight: 700;
    color: var(--ink-1);
}

.control-copy,
.summary-text,
.hint-card p,
.info-card p,
.bridge-panel p {
    color: var(--ink-2);
    line-height: 1.8;
}

.select-input,
.range-input {
    width: 100%;
}

.select-input {
    border: 1px solid rgba(18, 35, 26, 0.14);
    border-radius: 18px;
    padding: 14px 16px;
    background: #ffffff;
    color: var(--ink-1);
}

.range-input {
    appearance: none;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(120, 210, 160, 0.36), rgba(232, 155, 44, 0.22));
}

.range-input::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #143122;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(20, 49, 34, 0.18);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #143122;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(20, 49, 34, 0.18);
}

.summary-box,
.hint-card {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(18, 35, 26, 0.05);
    border: 1px solid rgba(18, 35, 26, 0.08);
}

.summary-box p,
.hint-card p,
.info-card p,
.bridge-panel p {
    margin: 10px 0 0;
}

.hint-card h3,
.canvas-top h3,
.bridge-panel h3,
.info-card h3 {
    margin: 0;
    font-size: 1.22rem;
    color: var(--ink-1);
}

.canvas-top h3 {
    margin-top: 4px;
}

.canvas-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(18, 35, 26, 0.08);
    color: var(--ink-1);
    font-weight: 700;
}

.canvas-chip.is-enzyme {
    background: rgba(28, 139, 87, 0.16);
    color: #145537;
}

.canvas-chip.is-normal {
    background: rgba(232, 155, 44, 0.16);
    color: #7f4a08;
}

.canvas-shell {
    margin-top: 18px;
    padding: 16px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(248, 252, 246, 0.96), rgba(232, 245, 235, 0.96));
    border: 1px solid rgba(18, 35, 26, 0.08);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfefa, #eef7f0);
}

.legend-row {
    margin-top: 14px;
}

.legend-chip,
.inline-code {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(18, 35, 26, 0.06);
    color: var(--ink-2);
    font-size: 0.9rem;
}

.inline-code {
    min-height: auto;
    padding: 2px 10px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.92em;
}

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

.stat-card {
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 252, 248, 0.9));
    border: 1px solid rgba(18, 35, 26, 0.1);
    box-shadow: var(--shadow);
}

.stat-label {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ink-3);
}

.stat-value {
    margin: 10px 0 0;
    font-size: 1.38rem;
    font-weight: 700;
    color: var(--ink-1);
}

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

.site-footer {
    margin-top: 28px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(24, 55, 38, 0.96), rgba(35, 82, 59, 0.92));
    color: rgba(244, 255, 248, 0.88);
}

.footer-links {
    margin-top: 16px;
}

.footer-links a {
    color: #f6fff8;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 680ms ease, transform 680ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.button:focus-visible,
.range-input:focus-visible,
.select-input:focus-visible,
.site-nav a:focus-visible {
    outline: 2px solid rgba(28, 139, 87, 0.8);
    outline-offset: 3px;
}

@media (max-width: 1080px) {
    .hero,
    .viewer-grid,
    .cards-grid {
        grid-template-columns: 1fr;
    }

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

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

    .site-header,
    .hero,
    .signal-strip,
    .panel,
    .bridge-panel,
    .info-card,
    .site-footer {
        padding: 20px;
        border-radius: 24px;
    }

    .site-header,
    .control-top,
    .canvas-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-copy h1 {
        font-size: clamp(2.2rem, 12vw, 3.2rem);
    }

    .stats-grid,
    .cards-grid {
        grid-template-columns: 1fr;
    }
}