/* =========================================================
   thesecond.day — Mid-century split-screen day narrative
   Palette: aged paper cream, ink navy, venetian amber...
   ========================================================= */

:root {
    --paper: #F2E8D4;
    --ink: #2A2A3E;
    --stock: #E8DCC4;
    --type-brown: #4A4540;
    --amber: #D4A847;
    --coffee: #8B5E3C;
    --terracotta: #C75D3A;
    --olive: #6B7A5E;

    --split-position: 70;
    --blind-angle: 0;

    --font-display: "Bebas Neue", "Archivo Black", Impact, sans-serif;
    --font-body: "Libre Franklin", "Inter", system-ui, sans-serif;
    --font-mono: "Share Tech Mono", "Courier New", monospace;
    --font-sub: "Archivo", "Inter", system-ui, sans-serif;
}

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

html, body {
    background: var(--paper);
    color: var(--type-brown);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

body {
    /* Subtle paper grain via gradient */
    background-image:
        radial-gradient(circle at 20% 10%, rgba(139,94,60,0.04), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(212,168,71,0.05), transparent 45%);
    background-attachment: fixed;
}

.page {
    position: relative;
    width: 100%;
}

/* ---------- Persistent split-line indicator ---------- */
.split-line {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(var(--split-position) * 1%);
    width: 2px;
    background: var(--coffee);
    z-index: 5;
    transition: left 0.12s linear, opacity 0.4s ease;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(139,94,60,0.15);
}

/* Hide split line in the night section */
.split-line.collapsed {
    opacity: 0;
}

/* ---------- Background scroll-clock ---------- */
.clock-radial {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78vmin;
    height: 78vmin;
    opacity: 0.10;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.clock-radial .hand {
    transform-origin: 100px 100px;
    transition: transform 0.05s linear;
}

/* ---------- Section base ---------- */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    z-index: 2;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.9s cubic-bezier(.22,.61,.36,1), opacity 0.7s ease;
}

.section.before-reveal {
    transform: translateX(100%);
    opacity: 0;
}

.section.revealed {
    transform: translateX(0);
    opacity: 1;
}

/* ---------- Panels ---------- */
.panel {
    position: absolute;
    top: 0;
    bottom: 0;
    overflow: hidden;
    transition: width 0.12s linear, left 0.12s linear, background 0.6s ease;
}

.panel-left {
    left: 0;
    width: calc(var(--split-position) * 1%);
}

.panel-right {
    left: calc(var(--split-position) * 1%);
    width: calc((100 - var(--split-position)) * 1%);
    background: var(--ink);
    color: var(--stock);
}

.panel-full {
    left: 0;
    width: 100%;
    background: var(--ink);
    color: var(--stock);
}

.panel-content {
    position: relative;
    padding: 12vh 7vw 8vh;
    max-width: 720px;
    z-index: 3;
}

.panel-content-wide {
    max-width: 880px;
}

.panel-content-dark {
    color: var(--stock);
}

/* ---------- Dawn ---------- */
.section-dawn .panel-left {
    background: linear-gradient(180deg, rgba(212,168,71,0.18), rgba(212,168,71,0.06));
}

/* Boundary title sits on the dividing line */
.boundary-title {
    position: absolute;
    top: 50%;
    left: calc(var(--split-position) * 1%);
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(28px, 4.4vw, 64px);
    letter-spacing: 0.18em;
    color: var(--ink);
    background: var(--paper);
    padding: 0.25em 0.6em;
    border: 1.5px solid var(--coffee);
    white-space: nowrap;
    z-index: 6;
    transition: left 0.12s linear;
}

/* ---------- Venetian blind overlay ---------- */
.blind-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        calc(var(--blind-angle) * 1deg),
        rgba(212,168,71,0.18) 0px,
        rgba(212,168,71,0.18) 4px,
        transparent 4px,
        transparent 6px
    );
    z-index: 1;
    mix-blend-mode: multiply;
}

.blind-overlay.subtle {
    background: repeating-linear-gradient(
        calc(var(--blind-angle) * 1deg),
        rgba(212,168,71,0.10) 0px,
        rgba(212,168,71,0.10) 4px,
        transparent 4px,
        transparent 6px
    );
}

.blind-overlay.tilt {
    background: repeating-linear-gradient(
        calc((var(--blind-angle) - 5) * 1deg),
        rgba(199,93,58,0.08) 0px,
        rgba(199,93,58,0.08) 4px,
        transparent 4px,
        transparent 6px
    );
}

.blind-overlay.tilt-hard {
    background: repeating-linear-gradient(
        calc((var(--blind-angle) - 10) * 1deg),
        rgba(199,93,58,0.10) 0px,
        rgba(199,93,58,0.10) 4px,
        transparent 4px,
        transparent 6px
    );
}

/* ---------- Typography ---------- */
.title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(64px, 12vw, 168px);
    line-height: 0.92;
    letter-spacing: 0.04em;
    color: var(--ink);
    margin-bottom: 0.4em;
}

.subtitle {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(48px, 7.5vw, 108px);
    line-height: 0.95;
    letter-spacing: 0.06em;
    color: var(--ink);
    margin-bottom: 0.5em;
}

.title-big {
    font-size: clamp(56px, 9vw, 132px);
}

.title-night {
    font-size: clamp(54px, 8.5vw, 124px);
    color: var(--amber);
    letter-spacing: 0.08em;
}

.kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: 0.22em;
    color: var(--coffee);
    margin-bottom: 2.4em;
    text-transform: uppercase;
}

.night-kicker {
    color: var(--amber);
}

.lede {
    font-family: var(--font-sub);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.4;
    color: var(--type-brown);
    max-width: 32ch;
}

.body-copy {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--type-brown);
    margin-bottom: 1.4em;
    max-width: 56ch;
}

.body-copy em {
    font-style: italic;
    color: var(--terracotta);
}

.dark-note {
    font-family: var(--font-sub);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    color: var(--stock);
    max-width: 22ch;
}

.night-body {
    color: var(--stock);
    max-width: 60ch;
}

.time-stamp {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.2em;
    color: var(--amber);
    margin-bottom: 2.4em;
}

.signoff {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.32em;
    color: var(--terracotta);
    margin-top: 3em;
    margin-bottom: 2em;
}

.colophon {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    line-height: 1.7;
    color: rgba(232,220,196,0.55);
    max-width: 52ch;
}

.caption {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--coffee);
    margin-top: 1.2em;
    text-transform: uppercase;
}

/* ---------- Saul-Bass-style illustrations ---------- */
.bass-illustration {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin-top: 1em;
    filter: drop-shadow(2px 2px 0 rgba(42,42,62,0.08));
}

.bass-illustration.small {
    max-width: 360px;
    margin-top: 2em;
}

/* ---------- Afternoon timeline margin ---------- */
.timeline-margin {
    background: var(--stock);
    border-right: 1px solid var(--coffee);
}

.time-marks {
    list-style: none;
    padding: 12vh 4vw;
    display: flex;
    flex-direction: column;
    gap: 2.4em;
}

.time-marks li {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--coffee);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    border-left: 2px solid var(--terracotta);
    padding-left: 0.9em;
}

.time-marks .t {
    color: var(--ink);
    font-size: 18px;
    letter-spacing: 0.14em;
}

.time-marks .t-label {
    color: var(--coffee);
}

/* ---------- Afternoon poster strip ---------- */
.poster-strip {
    margin-top: 3em;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 480px;
}

.poster-block {
    aspect-ratio: 1 / 1.4;
}

.poster-block.b1 { background: var(--amber); }
.poster-block.b2 { background: var(--ink); }
.poster-block.b3 { background: var(--terracotta); }
.poster-block.b4 { background: var(--olive); }

/* ---------- Evening thin stripe ---------- */
.thin-stripe {
    background: var(--ink);
    color: var(--amber);
}

.vertical-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
    font-family: var(--font-mono);
    font-size: 16px;
    letter-spacing: 0.4em;
    color: var(--amber);
    white-space: nowrap;
}

.panel-content-evening {
    padding-top: 14vh;
}

/* ---------- Night ---------- */
.section-night {
    background: var(--ink);
}

.panel-content-night {
    padding: 18vh 8vw 14vh;
    max-width: 760px;
}

/* ---------- Registration marks ---------- */
.reg-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0.55;
    z-index: 4;
    pointer-events: none;
}

.reg-corner svg {
    width: 100%;
    height: 100%;
}

.reg-corner.offset {
    transform: translate(1px, 1px);
}

.reg-corner.dim {
    opacity: 0.35;
    filter: invert(1) hue-rotate(180deg);
}

.reg-tl { top: 14px; left: 14px; }
.reg-tr { top: 14px; right: 14px; }
.reg-bl { bottom: 14px; left: 14px; }
.reg-br { bottom: 14px; right: 14px; }

/* ---------- Scroll cue (dawn) ---------- */
.scroll-cue {
    position: absolute;
    bottom: 36px;
    left: 7vw;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
}

.scroll-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--coffee);
}

.scroll-arrow {
    display: inline-block;
    width: 38px;
    height: 1px;
    background: var(--coffee);
    position: relative;
    animation: arrowDrift 2.6s ease-in-out infinite;
}

.scroll-arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: -3px;
    width: 7px;
    height: 7px;
    border-right: 1px solid var(--coffee);
    border-top: 1px solid var(--coffee);
    transform: rotate(45deg);
}

@keyframes arrowDrift {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(8px); opacity: 0.5; }
}

/* ---------- Section-specific palette nudges ---------- */
.section-morning .panel-left { background: var(--paper); }
.section-morning .panel-right { background: var(--stock); color: var(--type-brown); }
.section-morning .panel-right .panel-content { color: var(--type-brown); }

.section-afternoon .panel-right { background: var(--paper); color: var(--type-brown); }
.section-afternoon .panel-right .panel-content { color: var(--type-brown); }

.section-evening .panel-right { background: var(--stock); color: var(--type-brown); }
.section-evening .panel-right .panel-content { color: var(--type-brown); }

/* ---------- Small viewport tweaks ---------- */
@media (max-width: 720px) {
    .boundary-title {
        font-size: 22px;
        padding: 0.2em 0.4em;
    }
    .panel-content {
        padding: 10vh 6vw 6vh;
    }
    .time-marks {
        padding: 10vh 4vw;
        gap: 1.6em;
    }
    .scroll-cue { left: 6vw; }
    .colophon { font-size: 10px; }
}
