@font-face {
    font-family: Geist;
    src: url("../fonts/geist.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geist Mono";
    src: url("../fonts/geist-mono.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #050505;
    --fg: #f4f4f1;
    --muted: #9b9b96;
    --faint: #6e6e69;
    --line: rgba(244, 244, 241, 0.14);
    --line-strong: rgba(244, 244, 241, 0.28);
    --paper: #f6f6f3;
    --ink: #141414;
    --ink-2: #3d3d3a;
    --ink-3: #6d6d68;
    --rule: #e4e4df;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --nav: 4.25rem;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--fg);
    font-family: Geist, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
    font-weight: 380;
    font-size: 1.0625rem;
    line-height: 1.65;
    letter-spacing: -0.011em;
    line-break: strict;
    word-break: auto-phrase;
    text-wrap: pretty;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(244, 244, 241, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 244, 241, 0.045) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 68%);
    animation: drift 48s linear infinite;
}

body::after {
    content: "";
    position: fixed;
    z-index: 0;
    left: 8vw;
    top: -18vh;
    width: 84vw;
    height: 58vh;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(244, 244, 241, 0.09), transparent 62%);
    animation: breathe 14s ease-in-out infinite;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
    color: inherit;
}

::selection {
    background: var(--fg);
    color: var(--bg);
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 5;
    padding: 0.5rem 0.75rem;
    background: var(--fg);
    color: var(--bg);
}

.skip:focus {
    top: 0.75rem;
}

.nav,
.hero,
.manifesto,
.stage,
.columns,
.closer,
.footer {
    position: relative;
    z-index: 1;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--nav);
    padding: 0 clamp(1.25rem, 4vw, 3.5rem);
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.72) 70%, transparent);
    backdrop-filter: blur(10px);
}

.wordmark {
    font-weight: 520;
    font-size: 0.92rem;
    letter-spacing: 0.18em;
    text-decoration: none;
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.invitation {
    margin: 0;
    color: var(--muted);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.14em;
}

.langs {
    display: flex;
    gap: 0.15rem;
}

.langs button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.35rem 0.4rem;
    color: var(--faint);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.langs button[aria-pressed="true"] {
    color: var(--fg);
}

.langs button:focus-visible {
    outline: 1px solid var(--fg);
    outline-offset: 3px;
}

.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--nav) + 2rem) clamp(1.25rem, 4vw, 3.5rem) 2.25rem;
}

.hero-main {
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 6vh;
}

.kicker {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.16em;
}

html[lang="en"] .kicker {
    text-transform: uppercase;
}

h1,
h2,
.closer h2 {
    margin: 0;
    font-weight: 340;
    letter-spacing: -0.045em;
    line-height: 0.96;
}

h1 {
    font-size: clamp(4.2rem, 11vw, 8.6rem);
}

html[lang="ja"] h1,
html[lang="ja"] .manifesto p,
html[lang="ja"] .closer h2 {
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.deck {
    max-width: 38rem;
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: 1.14rem;
    font-weight: 380;
    line-height: 1.7;
}

.hero-note {
    margin: 2.25rem 0 0;
    color: var(--fg);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
}

.rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
    position: relative;
}

.rail::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 7rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fg), transparent);
    animation: travel 8.5s var(--ease) infinite;
}

.rail li {
    padding: 1rem 0.75rem 0 0;
    color: var(--muted);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.rail li span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--faint);
}

.manifesto,
.stage,
.columns,
.closer {
    padding: clamp(5rem, 12vw, 9rem) clamp(1.25rem, 4vw, 3.5rem);
}

.manifesto {
    border-top: 1px solid var(--line);
}

.manifesto p {
    margin: 0;
    max-width: 12em;
    font-size: clamp(2.4rem, 5.4vw, 4.6rem);
    font-weight: 340;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.stage-head {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 0.7fr);
    gap: 2rem 4rem;
    align-items: end;
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--faint);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
}

html[lang="en"] .eyebrow {
    text-transform: uppercase;
}

.stage-head h2,
.columns h2,
.closer h2 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
}

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

.stage-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 0.72fr) minmax(18rem, 0.9fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.steps li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 0.5rem 1rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--line);
}

.steps .n {
    color: var(--faint);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding-top: 0.35rem;
}

.steps strong {
    display: block;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.steps p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.sheet {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid #deded8;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    padding: 1.35rem 1.35rem 1.15rem;
}

.sheet-top,
.field,
.tags,
.output,
.quote {
    transition: none;
}

.sheet-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ink-3);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
}

.sheet h3 {
    margin: 1.15rem 0 0;
    font-size: 1.85rem;
    font-weight: 520;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.sheet .en-name,
.sheet .role {
    margin: 0.15rem 0 0;
    color: var(--ink-2);
}

.sheet .role {
    color: var(--ink-3);
    font-size: 0.95rem;
}

.quote {
    margin: 1.15rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-2);
    font-size: 0.95rem;
    line-height: 1.65;
}

.fields {
    margin: 1rem 0 0;
    display: grid;
    gap: 0;
}

.field {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--rule);
    font-size: 0.95rem;
}

.field dt {
    color: var(--ink-3);
}

.field dd {
    margin: 0;
    font-weight: 520;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.95rem;
}

.tags span,
.output {
    border: 1px solid #d5d5cf;
    padding: 0.28rem 0.45rem;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.output {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.95rem;
    color: var(--ink-2);
}

.stage.will-play .seq {
    opacity: 0;
    transform: translateY(8px);
}

.stage.is-run .seq {
    animation: rise 0.9s var(--ease) forwards;
}

.stage.is-run .d1 { animation-delay: 0.15s; }
.stage.is-run .d2 { animation-delay: 0.7s; }
.stage.is-run .d3 { animation-delay: 1.35s; }
.stage.is-run .d4 { animation-delay: 2.15s; }
.stage.is-run .d5 { animation-delay: 2.7s; }
.stage.is-run .d6 { animation-delay: 3.2s; }
.stage.is-run .d7 { animation-delay: 3.7s; }
.stage.is-run .d8 { animation-delay: 4.3s; }
.stage.is-run .d9 { animation-delay: 5s; }

.columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    padding-top: 0;
    padding-bottom: 0;
}

.columns article {
    padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 2vw, 2.25rem) clamp(3rem, 6vw, 4.5rem) 0;
    border-bottom: 1px solid var(--line);
}

.columns article + article {
    padding-left: clamp(1.25rem, 2vw, 2.25rem);
    border-left: 1px solid var(--line);
}

.columns h2 {
    margin-top: 1rem;
    font-size: clamp(1.7rem, 2.4vw, 2.15rem);
}

.columns p {
    margin: 1rem 0 0;
    max-width: 28rem;
    color: var(--muted);
}

.agents,
.catalogue,
.stories {
    position: relative;
    z-index: 1;
    padding: clamp(5rem, 12vw, 9rem) clamp(1.25rem, 4vw, 3.5rem);
    border-top: 1px solid var(--line);
}

.agents-row,
.levels,
.catalogue-list,
.story-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agents-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.agents-row li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 6.5rem;
    padding: 1.25rem 1rem 1.25rem 0;
    border-right: 1px solid var(--line);
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    font-weight: 460;
    letter-spacing: -0.03em;
}

.agents-row li:last-child {
    border-right: 0;
    padding-right: 0;
}

.agents-row li:not(:first-child) {
    padding-left: 1.25rem;
}

.mark {
    width: 1.65rem;
    height: 1.65rem;
    flex: none;
}

.agents-also {
    margin: 1.25rem 0 0;
    color: var(--muted);
    max-width: 40rem;
}

.levels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.levels li {
    padding: 1.25rem 1.5rem 0 0;
}

.levels li + li {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
}

.levels span,
.story-list ol li::before {
    color: var(--faint);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.levels strong {
    display: block;
    margin: 0.45rem 0 0.35rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.levels p,
.story-list p {
    margin: 0;
    color: var(--muted);
}

.catalogue-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
}

.catalogue-list > li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 0.75rem;
    padding: 1.35rem 1.75rem 1.35rem 0;
    border-bottom: 1px solid var(--line);
}

.catalogue-list > li:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 1.75rem;
}

.catalogue-list > li:nth-child(even) {
    padding-left: 1.75rem;
}

.catalogue-list .n {
    color: var(--faint);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding-top: 0.35rem;
}

.catalogue-list strong {
    display: block;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.catalogue-list p {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

.story-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
}

.story-list > li {
    padding: 1.75rem 2rem 2rem 0;
    border-bottom: 1px solid var(--line);
}

.story-list > li:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 2rem;
}

.story-list > li:nth-child(even) {
    padding-left: 2rem;
}

.story-list h3 {
    margin: 0.35rem 0 1rem;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 420;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.story-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
}

.story-list ol li {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    gap: 0.65rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
    counter-increment: step;
}

.story-list ol li::before {
    content: counter(step, decimal-leading-zero);
    padding-top: 0.2rem;
}

.will-reveal .reveal-item {
    opacity: 0;
    transform: translateY(10px);
}

.is-in .reveal-item {
    animation: rise 0.9s var(--ease) forwards;
}

.is-in .agents-row .reveal-item:nth-child(2) { animation-delay: 0.08s; }
.is-in .agents-row .reveal-item:nth-child(3) { animation-delay: 0.16s; }
.is-in .agents-row .reveal-item:nth-child(4) { animation-delay: 0.24s; }
.is-in .levels .reveal-item:nth-child(2) { animation-delay: 0.08s; }
.is-in .levels .reveal-item:nth-child(3) { animation-delay: 0.16s; }
.is-in .catalogue-list .reveal-item:nth-child(2),
.is-in .story-list .reveal-item:nth-child(2) { animation-delay: 0.06s; }
.is-in .catalogue-list .reveal-item:nth-child(3),
.is-in .story-list .reveal-item:nth-child(3) { animation-delay: 0.12s; }
.is-in .catalogue-list .reveal-item:nth-child(4),
.is-in .story-list .reveal-item:nth-child(4) { animation-delay: 0.18s; }
.is-in .catalogue-list .reveal-item:nth-child(n + 5) { animation-delay: 0.24s; }

.closer {
    border-top: 1px solid var(--line);
}

.closer h2 {
    max-width: 14em;
}

.closer .hero-note {
    margin-top: 2rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    flex-wrap: wrap;
    padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem) 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.92rem;
}

.footer p {
    margin: 0.35rem 0 0;
}

.footer .wordmark {
    color: var(--fg);
}

html[lang="ja"] [data-lang="en"],
html[lang="en"] [data-lang="ja"] {
    display: none !important;
}

.hero-main .kicker,
.hero-main h1,
.hero-main .deck,
.hero-main .hero-note {
    animation: rise 1.05s var(--ease) both;
}

.hero-main h1 { animation-delay: 0.08s; }
.hero-main .deck { animation-delay: 0.18s; }
.hero-main .hero-note { animation-delay: 0.28s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes drift {
    to {
        background-position: 80px 80px;
    }
}

@keyframes breathe {
    0%,
    100% {
        opacity: 0.65;
    }

    50% {
        opacity: 1;
    }
}

@keyframes travel {
    0% {
        transform: translateX(-20%);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        transform: translateX(calc(100vw - 8rem));
        opacity: 0;
    }
}

.nowrap {
    white-space: nowrap;
}

@media (max-width: 900px) {
    h1 {
        font-size: clamp(2.85rem, 12.2vw, 4.4rem);
    }

    .stage-head,
    .stage-grid,
    .columns,
    .agents-row,
    .levels,
    .catalogue-list,
    .story-list {
        grid-template-columns: 1fr;
    }

    .agents-row li,
    .agents-row li:not(:first-child),
    .levels li,
    .levels li + li,
    .catalogue-list > li,
    .catalogue-list > li:nth-child(odd),
    .catalogue-list > li:nth-child(even),
    .story-list > li,
    .story-list > li:nth-child(odd),
    .story-list > li:nth-child(even) {
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
        border-left: 0;
    }

    .columns article + article {
        padding-left: 0;
        border-left: 0;
    }

    .rail {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .rail li {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--line);
    }

    .rail::after {
        display: none;
    }

    }

@media (max-width: 640px) {
    .invitation {
        letter-spacing: 0.08em;
    }

    .field {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .nav-tools {
        gap: 0.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
    }

    .stage.will-play .seq,
    .will-reveal .reveal-item {
        opacity: 1;
        transform: none;
    }
}
