/* ===========================================================
   genpatsu.quest — Design Language
   Aesthetic: retro / nostalgic-retro / Showa-era atomic pamphlet
   Palette: warm-earthy with atomic amber
   =========================================================== */

:root {
    --reactor-cream: #F5E6C8;
    --aged-paper: #EDD9B5;
    --cooling-tower-gray: #6B6259;
    --uranium-amber: #C4883A;
    --fallout-olive: #8B7D5E;
    --deep-core-brown: #3A2E22;
    --exposed-film-red: #A0522D;
    --overexposed-white: #FDF8EF;

    --display-font: "Playfair Display", "Times New Roman", Georgia, serif;
    --body-font: "Source Serif 4", Georgia, "Times New Roman", serif;
    --mono-font: "DM Mono", "Courier New", monospace;
    --kanji-font: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

    --reveal-duration: 1200ms;
    --reveal-easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: #F5E6C8;
}

body {
    font-family: var(--body-font);
    font-size: clamp(1rem, 1.05vw + 0.7rem, 1.25rem);
    line-height: 1.75;
    color: var(--cooling-tower-gray);
    background-color: var(--reactor-cream);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(253, 248, 239, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 100%, rgba(196, 136, 58, 0.08) 0%, transparent 50%);
    cursor: default;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===========================================================
   Film grain overlay (fixed, full-viewport)
   =========================================================== */
.film-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: multiply;
    opacity: 0.05;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23  0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 1 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
}

/* ===========================================================
   Kanji watermark (fixed, drifts via JS)
   =========================================================== */
.kanji-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--kanji-font);
    font-weight: 900;
    font-size: 60vw;
    line-height: 1;
    color: var(--deep-core-brown);
    opacity: 0.03;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    will-change: transform;
}

/* ===========================================================
   Site nav (minimal wordmark)
   =========================================================== */
.site-nav {
    position: fixed;
    top: 1.75rem;
    left: 1.75rem;
    z-index: 50;
    pointer-events: none;
}

.wordmark {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    color: var(--deep-core-brown);
    text-transform: lowercase;
}

/* ===========================================================
   Hero region
   =========================================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse at 50% 30%, var(--overexposed-white) 0%, var(--reactor-cream) 35%, var(--aged-paper) 80%, #d8c4a0 100%);
    box-shadow: inset 0 0 180px 60px rgba(58, 46, 34, 0.45);
    overflow: hidden;
    z-index: 1;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(58, 46, 34, 0.35) 100%);
    pointer-events: none;
    z-index: 2;
}

.hero-light-source {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 60vh;
    background: radial-gradient(ellipse at center, rgba(253, 248, 239, 0.55) 0%, rgba(245, 230, 200, 0.2) 40%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 1;
}

.hero-cooling-tower {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(280px, 60vw, 600px);
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.7;
    mix-blend-mode: multiply;
}

.hero-cooling-tower svg {
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 5;
    width: 100%;
    text-align: center;
    margin-top: 8vh;
}

.hero-band {
    width: 100%;
    background-color: rgba(245, 230, 200, 0.85);
    padding-block: clamp(1.5rem, 4vh, 3rem);
    box-shadow:
        0 1px 0 rgba(196, 136, 58, 0.25),
        0 -1px 0 rgba(196, 136, 58, 0.25);
    backdrop-filter: blur(2px);
}

.hero-title {
    font-family: var(--display-font);
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: var(--deep-core-brown);
    line-height: 1;
    text-shadow: 0 0 40px rgba(253, 248, 239, 0.5);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 2000ms var(--reveal-easing) 500ms, transform 2000ms var(--reveal-easing) 500ms;
}

.hero-title.is-visible {
    opacity: 1;
    transform: scale(1);
}

.hero-subtitle {
    font-family: var(--kanji-font);
    font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    color: var(--deep-core-brown);
    margin-top: clamp(1.5rem, 3vh, 2.5rem);
    letter-spacing: 0.3em;
    opacity: 0;
    transition: opacity 1200ms var(--reveal-easing) 2300ms;
}

.hero-subtitle.is-visible {
    opacity: 0.7;
}

.hero-translation {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--fallout-olive);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 1200ms var(--reveal-easing) 2700ms;
}

.hero-translation.is-visible {
    opacity: 0.85;
}

/* ===========================================================
   Crop marks (corner registration marks)
   =========================================================== */
.crop-mark {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 4;
}

.crop-mark::before,
.crop-mark::after {
    content: "";
    position: absolute;
    background-color: var(--fallout-olive);
}

.crop-mark::before {
    width: 1px;
    height: 100%;
}

.crop-mark::after {
    width: 100%;
    height: 1px;
}

.crop-tl { top: 18px; left: 18px; }
.crop-tl::before { left: 0; top: 0; }
.crop-tl::after { left: 0; top: 0; }

.crop-tr { top: 18px; right: 18px; }
.crop-tr::before { right: 0; top: 0; }
.crop-tr::after { right: 0; top: 0; }

.crop-bl { bottom: 18px; left: 18px; }
.crop-bl::before { left: 0; bottom: 0; }
.crop-bl::after { left: 0; bottom: 0; }

.crop-br { bottom: 18px; right: 18px; }
.crop-br::before { right: 0; bottom: 0; }
.crop-br::after { right: 0; bottom: 0; }

/* ===========================================================
   Sections — alternating warm backgrounds
   =========================================================== */
section {
    position: relative;
    width: 100%;
    transition: background-color 800ms ease;
    z-index: 1;
}

.text-section,
.image-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-block: clamp(4rem, 10vh, 8rem);
}

.section-cream {
    background-color: var(--reactor-cream);
}

.section-paper {
    background-color: var(--aged-paper);
    box-shadow: inset 0 0 120px 40px rgba(58, 46, 34, 0.3);
}

/* Atom-pattern background on text-focused sections */
.text-section {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='-100 -100 200 200'><g fill='none' stroke='%238B7D5E' stroke-width='0.7' opacity='0.5'><ellipse cx='0' cy='0' rx='60' ry='20'/><ellipse cx='0' cy='0' rx='60' ry='20' transform='rotate(60)'/><ellipse cx='0' cy='0' rx='60' ry='20' transform='rotate(120)'/></g><circle cx='0' cy='0' r='3' fill='%23A0522D' opacity='0.5'/></svg>");
    background-repeat: repeat;
    background-size: 220px 220px;
    background-position: center;
    background-color: var(--reactor-cream);
}

.text-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--reactor-cream);
    opacity: 0.92;
    pointer-events: none;
    z-index: 0;
}

.section-inner {
    position: relative;
    z-index: 2;
    width: min(100% - 3rem, 65ch);
    max-width: 780px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ===========================================================
   Typography — in-section
   =========================================================== */
.caption {
    font-family: var(--mono-font);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fallout-olive);
    margin-bottom: 1.5rem;
}

.display-heading {
    font-family: var(--display-font);
    font-weight: 900;
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--deep-core-brown);
    line-height: 1.05;
    margin-bottom: 2.25rem;
    text-wrap: balance;
}

.body-text {
    font-family: var(--body-font);
    font-size: clamp(1rem, 0.7vw + 0.85rem, 1.2rem);
    line-height: 1.8;
    color: var(--cooling-tower-gray);
    margin-bottom: 1.4rem;
    max-width: 60ch;
}

.body-text + .body-text {
    text-indent: 1.5em;
}

/* ===========================================================
   Atom rule (decorative section divider)
   =========================================================== */
.atom-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    max-width: 160px;
    margin: 3rem auto 0.5rem;
}

.atom-line {
    flex: 1;
    height: 1px;
    background-color: var(--uranium-amber);
    opacity: 0.4;
}

.atom-tiny {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--uranium-amber);
    opacity: 0.6;
    box-shadow: 0 0 0 1px rgba(196, 136, 58, 0.25);
}

/* ===========================================================
   Image-heavy sections — atom & towers
   =========================================================== */
.image-section {
    flex-direction: column;
    justify-content: flex-end;
    min-height: 95vh;
    overflow: hidden;
}

.atom-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.atom-diagram {
    width: clamp(280px, 55vmin, 620px);
    height: clamp(280px, 55vmin, 620px);
    opacity: 0.65;
    animation: atomDrift 60s linear infinite;
}

@keyframes atomDrift {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tower-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tower-pair {
    width: 100%;
    max-width: 1200px;
    height: 70%;
    opacity: 0.85;
}

.image-overlay {
    position: relative;
    z-index: 3;
    width: 100%;
    margin-top: auto;
    padding-block: clamp(2rem, 6vh, 4rem);
    background: linear-gradient(to bottom, transparent 0%, rgba(237, 217, 181, 0.55) 30%, rgba(237, 217, 181, 0.85) 100%);
}

.image-overlay-bottom {
    background: linear-gradient(to bottom, transparent 0%, rgba(237, 217, 181, 0.7) 40%, rgba(237, 217, 181, 0.95) 100%);
}

/* ===========================================================
   Light leaks (decorative gradient blobs)
   =========================================================== */
.light-leak {
    position: absolute;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    background: radial-gradient(circle, var(--uranium-amber) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.1;
    pointer-events: none;
    z-index: 1;
}

.light-leak-1 {
    top: 10%;
    right: -15%;
}

.light-leak-2 {
    bottom: 10%;
    left: -15%;
    background: radial-gradient(circle, var(--exposed-film-red) 0%, transparent 70%);
    opacity: 0.08;
}

/* ===========================================================
   Pull quote
   =========================================================== */
.pull-quote {
    position: relative;
    font-family: var(--display-font);
    font-weight: 700;
    font-size: clamp(1.5rem, 3.2vw, 2.5rem);
    line-height: 1.35;
    color: var(--deep-core-brown);
    font-style: italic;
    padding: clamp(2rem, 4vw, 3rem);
    border: 1px dotted rgba(196, 136, 58, 0.55);
    background-color: rgba(253, 248, 239, 0.55);
    margin-block: 2rem;
    text-wrap: pretty;
}

.quote-mark {
    font-family: var(--kanji-font);
    color: var(--exposed-film-red);
    font-style: normal;
    opacity: 0.7;
    margin-right: 0.15em;
    font-size: 1.2em;
    vertical-align: -0.05em;
}

.quote-mark.close {
    margin-left: 0.15em;
    margin-right: 0;
}

.quote-attr {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--fallout-olive);
    margin-top: 1rem;
    text-align: right;
}

/* ===========================================================
   Colophon
   =========================================================== */
.colophon {
    font-family: var(--mono-font);
    font-weight: 300;
    font-size: 0.78rem;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--fallout-olive);
    margin-top: 2.5rem;
    padding: 1.5rem;
    border: 1px dotted rgba(139, 125, 94, 0.45);
    background-color: rgba(253, 248, 239, 0.4);
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    background-color: var(--deep-core-brown);
    color: var(--reactor-cream);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: inset 0 80px 80px -40px rgba(58, 46, 34, 0.7);
}

.footer-mark {
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: var(--reactor-cream);
}

.footer-meta {
    font-family: var(--mono-font);
    font-size: 0.72rem;
    font-weight: 300;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fallout-olive);
}

/* ===========================================================
   Reveal animation (IntersectionObserver-driven)
   =========================================================== */
.reveal-item {
    opacity: 0;
    transform: scale(1.02);
    transition:
        opacity var(--reveal-duration) var(--reveal-easing),
        transform var(--reveal-duration) var(--reveal-easing);
}

.reveal-section.is-visible .reveal-item {
    opacity: 1;
    transform: scale(1);
}

/* Stagger inside a section: heading 0ms, body 300ms, decorative 600ms */
.reveal-section.is-visible .caption {
    transition-delay: 0ms;
}

.reveal-section.is-visible .display-heading {
    transition-delay: 0ms;
}

.reveal-section.is-visible .body-text {
    transition-delay: 300ms;
}

.reveal-section.is-visible .body-text + .body-text {
    transition-delay: 450ms;
}

.reveal-section.is-visible .pull-quote {
    transition-delay: 200ms;
}

.reveal-section.is-visible .quote-attr {
    transition-delay: 500ms;
}

.reveal-section.is-visible .atom-rule,
.reveal-section.is-visible .colophon {
    transition-delay: 600ms;
}

/* ===========================================================
   Link styles — hover underline reveal
   =========================================================== */
a {
    color: var(--deep-core-brown);
    text-decoration: none;
    background-image: linear-gradient(var(--uranium-amber), var(--uranium-amber));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    padding-bottom: 0.1em;
    transition: background-size 400ms ease;
    cursor: default;
}

a:hover {
    background-size: 100% 1px;
}

/* ===========================================================
   Responsive adjustments
   =========================================================== */
@media (max-width: 720px) {
    .crop-mark { width: 8px; height: 8px; }
    .crop-tl, .crop-tr { top: 12px; }
    .crop-bl, .crop-br { bottom: 12px; }
    .crop-tl, .crop-bl { left: 12px; }
    .crop-tr, .crop-br { right: 12px; }

    .hero-band { padding-block: 1.25rem; }
    .pull-quote { padding: 1.5rem; }

    .light-leak {
        width: 70vw;
        height: 70vw;
    }
}
