:root {
    --bg: #07090d;
    --bg-elevated: #0d1117;
    --bg-soft: #121821;
    --line: #29303a;
    --line-strong: #3c4653;
    --text: #f2f4f7;
    --text-muted: #97a3b2;
    --text-soft: #cbd3dd;
    --accent: #ff6136;
    --accent-soft: rgba(255, 97, 54, 0.14);
    --shell: 1280px;
    --header-height: 76px;
    --radius: 8px;
    --transition: 220ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Noto Sans SC", "Noto Sans JP", sans-serif;
    line-height: 1.6;
}

img,
canvas,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

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

.shell {
    width: min(calc(100% - 32px), var(--shell));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 30;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    background: var(--bg-elevated);
    color: var(--text);
    transition: top var(--transition);
}

.skip-link:focus {
    top: 16px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(7, 9, 13, 0.78);
    border-bottom: 1px solid rgba(151, 163, 178, 0.12);
}

.site-header__inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand__eyebrow {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.brand__name {
    font-size: 1rem;
    font-weight: 600;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-nav__link,
.icon-button,
.button,
.text-link,
.lane {
    transition:
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.site-nav__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid transparent;
    color: var(--text-soft);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    border-color: rgba(151, 163, 178, 0.26);
    color: var(--text);
}

.page-home [data-nav="chapters"],
.page-chapter [data-nav="chapters"],
.page-section [data-nav="chapters"],
.page-about [data-nav="about"] {
    border-color: rgba(255, 97, 54, 0.34);
    color: var(--text);
}

.icon-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(151, 163, 178, 0.24);
    background: rgba(13, 17, 23, 0.82);
    color: var(--text);
    cursor: pointer;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-button:hover,
.icon-button:focus-visible {
    border-color: rgba(255, 97, 54, 0.7);
    color: var(--accent);
}

.hero {
    position: relative;
    overflow: clip;
    border-bottom: 1px solid rgba(151, 163, 178, 0.16);
}

.hero--home {
    min-height: calc(100svh - var(--header-height) - 56px);
}

.hero__canvas,
.hero__noise {
    position: absolute;
    inset: 0;
}

.hero__canvas {
    background:
        radial-gradient(circle at top right, rgba(255, 97, 54, 0.16), transparent 28%),
        linear-gradient(180deg, #07090d 0%, #090c12 100%);
}

.hero__noise {
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 96px 96px;
    opacity: 0.15;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.hero__content,
.page-hero {
    position: relative;
    z-index: 1;
}

.hero__content {
    padding: 40px 0 48px;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
    gap: 32px;
    align-items: end;
}

.section-kicker {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.hero__intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 24px;
}

.quote-stage {
    display: block;
    width: 100%;
}

.quote-stage__meta,
.quote-stage__source {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.quote-stage__quote {
    margin: 14px 0 18px;
    max-width: 11ch;
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 4.25rem;
    line-height: 1.18;
    font-weight: 600;
    color: var(--text);
}

.quote-stage:hover .quote-stage__quote,
.quote-stage:focus-visible .quote-stage__quote {
    color: #fff3ee;
}

.hero__translation {
    max-width: 56ch;
    color: var(--text-soft);
    font-size: 1rem;
}

.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(151, 163, 178, 0.24);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.button--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #111318;
    font-weight: 600;
}

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

.button--secondary:hover,
.button--ghost:hover,
.button--secondary:focus-visible,
.button--ghost:focus-visible {
    border-color: rgba(255, 97, 54, 0.7);
    color: var(--accent);
}

.hero__rail {
    display: grid;
    gap: 16px;
    align-self: stretch;
}

.hero__rail-block {
    padding: 18px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.76);
}

.hero__rail-copy {
    margin-top: 10px;
    color: var(--text-soft);
}

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

.stat-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(151, 163, 178, 0.14);
}

.stat-list span {
    color: var(--text-muted);
}

.stat-list strong {
    font-size: 1.35rem;
    font-weight: 600;
}

.band {
    padding: 48px 0;
    border-bottom: 1px solid rgba(151, 163, 178, 0.12);
}

.band--dense {
    padding: 36px 0 48px;
}

.band--outlined {
    background: linear-gradient(180deg, rgba(18, 24, 33, 0.75), rgba(7, 9, 13, 0));
}

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

.lane {
    width: 100%;
    padding: 22px 18px 24px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.72);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.lane:hover,
.lane:focus-visible {
    border-color: rgba(255, 97, 54, 0.55);
    transform: translateY(-2px);
}

.lane__label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.lane h2 {
    font-size: 1.45rem;
    line-height: 1.25;
}

.lane p {
    margin-top: 12px;
    color: var(--text-soft);
}

.section-heading,
.manifesto-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 24px;
    align-items: end;
}

.section-heading h2,
.manifesto-grid h2,
.page-hero h1 {
    font-size: 2.4rem;
    line-height: 1.16;
    font-weight: 600;
}

.section-heading__copy,
.manifesto-grid__copy,
.page-hero__copy {
    color: var(--text-soft);
    font-size: 1rem;
}

.chapter-atlas {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.chapter-tile {
    min-height: 196px;
    padding: 18px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.72);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chapter-tile:hover,
.chapter-tile:focus-visible {
    border-color: rgba(255, 97, 54, 0.55);
}

.chapter-tile__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-muted);
}

.chapter-tile__number {
    font-size: 1.3rem;
    color: var(--text);
}

.chapter-tile h3 {
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 1.35rem;
    line-height: 1.2;
}

.chapter-tile p {
    color: var(--text-soft);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--accent);
}

.text-link:hover,
.text-link:focus-visible {
    color: #ff7d5d;
}

.text-link--muted {
    color: var(--text-muted);
}

.page-hero {
    padding: 48px 0 30px;
    border-bottom: 1px solid rgba(151, 163, 178, 0.12);
}

.page-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: end;
}

.page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.chapter-nav-row,
.reading-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.chapter-nav-row__center {
    color: var(--text-muted);
}

.section-list {
    display: grid;
    gap: 10px;
}

.section-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.28fr) minmax(0, 1fr) 52px;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.72);
}

.section-row:hover,
.section-row:focus-visible {
    border-color: rgba(255, 97, 54, 0.55);
}

.section-row__meta {
    display: grid;
    gap: 10px;
}

.section-row__number {
    font-size: 1rem;
    font-weight: 600;
}

.section-row__editions {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.section-row__body h2 {
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 1.35rem;
    line-height: 1.4;
}

.section-row__body p {
    margin-top: 10px;
    color: var(--text-soft);
}

.section-row__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-row__arrow svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
    color: var(--text);
}

.page-hero--reading {
    padding-bottom: 24px;
}

.reading-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.7fr);
    gap: 24px;
    align-items: end;
}

.reading-hero h1 {
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 2.85rem;
    line-height: 1.32;
    margin-top: 10px;
}

.reading-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.reading-nav__link {
    min-width: 160px;
    padding: 14px 16px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.72);
    display: grid;
    gap: 4px;
}

.reading-nav__link strong {
    font-size: 1rem;
}

.reading-nav__label {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.reading-nav__link:hover,
.reading-nav__link:focus-visible {
    border-color: rgba(255, 97, 54, 0.55);
}

.reading-nav__link--muted {
    color: var(--text-muted);
}

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

.edition-panel,
.edition-row {
    padding: 20px;
    border: 1px solid rgba(151, 163, 178, 0.18);
    background: rgba(13, 17, 23, 0.78);
}

.edition-panel__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(151, 163, 178, 0.14);
}

.edition-panel__header h2,
.edition-row h3 {
    font-size: 1.28rem;
    font-weight: 600;
}

.edition-panel__role {
    color: var(--text-muted);
}

.edition-panel__block {
    padding-top: 18px;
}

.edition-panel__block + .edition-panel__block {
    border-top: 1px solid rgba(151, 163, 178, 0.1);
    margin-top: 18px;
}

.edition-panel__block h3 {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.edition-panel__block p,
.edition-row__description {
    color: var(--text-soft);
}

.edition-panel__original {
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    color: var(--text);
}

.edition-panel__original--jp {
    font-family: "Noto Serif JP", "Noto Sans JP", serif;
}

.edition-panel__stack {
    display: grid;
    gap: 10px;
}

.edition-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.edition-row__head,
.edition-row__meta,
.edition-row__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.edition-row__meta,
.edition-row__stats {
    margin-top: 12px;
    color: var(--text-muted);
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
}

.search-overlay.is-open {
    display: block;
}

.search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 4, 6, 0.78);
    backdrop-filter: blur(10px);
}

.search-overlay__panel {
    position: relative;
    width: min(calc(100% - 32px), 980px);
    margin: 8vh auto 0;
    padding: 22px;
    border: 1px solid rgba(151, 163, 178, 0.22);
    background: #0a0f15;
}

.search-overlay__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.search-overlay__header h2 {
    margin-top: 6px;
    font-size: 1.9rem;
    line-height: 1.2;
}

.search-field {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.search-field__label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-field input {
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(151, 163, 178, 0.24);
    background: rgba(18, 24, 33, 0.82);
    color: var(--text);
}

.search-status {
    margin-top: 14px;
    color: var(--text-muted);
}

.search-results {
    max-height: 56vh;
    overflow: auto;
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

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

.search-group__title {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-result {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(151, 163, 178, 0.16);
    background: rgba(13, 17, 23, 0.7);
}

.search-result:hover,
.search-result:focus-visible {
    border-color: rgba(255, 97, 54, 0.55);
}

.search-result__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.search-result__title {
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 1.08rem;
    line-height: 1.45;
}

.search-result__excerpt {
    color: var(--text-soft);
}

.site-footer {
    padding: 22px 0 28px;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(151, 163, 178, 0.12);
}

.site-footer__title {
    font-size: 1rem;
    font-weight: 600;
}

.site-footer__meta {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
}

[data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 420ms ease,
        transform 420ms ease;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1100px) {
    .hero__grid,
    .page-hero__grid,
    .section-heading,
    .manifesto-grid,
    .reading-hero {
        grid-template-columns: 1fr;
    }

    .page-hero__actions,
    .reading-hero__actions {
        justify-content: flex-start;
    }

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

@media (max-width: 780px) {
    :root {
        --header-height: 68px;
    }

    .shell {
        width: min(calc(100% - 24px), var(--shell));
    }

    .site-header__inner {
        gap: 12px;
    }

    .site-nav {
        gap: 6px;
    }

    .site-nav__link {
        padding: 0 10px;
        font-size: 0.92rem;
    }

    .hero__content {
        padding: 28px 0 36px;
    }

    .quote-stage__quote {
        font-size: 2.9rem;
        max-width: 100%;
    }

    .section-heading h2,
    .manifesto-grid h2,
    .page-hero h1,
    .reading-hero h1 {
        font-size: 2rem;
    }

    .explore-lanes,
    .chapter-atlas,
    .editions-grid {
        grid-template-columns: 1fr;
    }

    .section-row {
        grid-template-columns: 1fr;
    }

    .reading-nav,
    .chapter-nav-row,
    .site-footer__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .reading-nav__link {
        min-width: 0;
    }

    .search-overlay__panel {
        width: min(calc(100% - 16px), 980px);
        margin-top: 3vh;
        padding: 18px;
    }

    .search-results {
        max-height: 52vh;
    }
}
