/* =========================================================
   rational.today &mdash; v2 stylesheet
   Aesthetic: cyberpunk + opulent terracotta
   Layout: organic-flow (S-curve)
   Typography: elegant-serif (Cormorant Garamond + Raleway)
   ========================================================= */

:root {
    --terracotta-deep: #A0522D;
    --clay-dark: #2A1A10;
    --burnished-copper: #C48B5A;
    --warm-cream: #F5E8D8;
    --nature-olive: #6B7B4A;
    --royal-gold: #D4A040;
    --earth-shadow: #3D2A1A;
    --copper-glow: rgba(196, 139, 90, 0.30);
    --gold-glow: rgba(212, 160, 64, 0.35);

    --font-headline: 'Cormorant Garamond', 'Times New Roman', serif;
    --font-body: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Fira Code', 'Menlo', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--clay-dark);
    color: var(--warm-cream);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(16px, 1.5vw, 18px);
    overflow-x: hidden;
}

/* ---------- ghostly S-curve guide ---------- */

.guide-path {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.06;
    z-index: 0;
}

.guide-path path {
    fill: none;
    stroke: var(--burnished-copper);
    stroke-width: 0.5;
}

/* ---------- grand atrium ---------- */

#grand-atrium {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--terracotta-deep) 0%, var(--earth-shadow) 55%, var(--clay-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 1.5rem;
}

.wave-layer {
    position: absolute;
    left: 0;
    right: 0;
    width: 110%;
    height: 220px;
    pointer-events: none;
}

.wave-layer path {
    fill: none;
    stroke-width: 1.5;
}

.wave-layer-1 {
    bottom: 35%;
    animation: wave-shift 14s ease-in-out infinite;
}
.wave-layer-1 path { stroke: var(--burnished-copper); opacity: 0.30; }

.wave-layer-2 {
    bottom: 22%;
    animation: wave-shift 10s ease-in-out infinite reverse;
}
.wave-layer-2 path { stroke: var(--royal-gold); opacity: 0.22; }

.wave-layer-3 {
    bottom: 50%;
    animation: wave-shift 18s ease-in-out infinite;
}
.wave-layer-3 path { stroke: var(--burnished-copper); opacity: 0.18; }

@keyframes wave-shift {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(-4%); }
    100% { transform: translateX(0); }
}

.atrium-branch {
    position: absolute;
    width: 220px;
    height: 440px;
    pointer-events: none;
    opacity: 0.55;
}

.atrium-branch-left {
    bottom: 4%;
    left: 2%;
}

.atrium-branch path {
    fill: none;
    stroke: var(--burnished-copper);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: branch-grow 2.4s ease-out forwards;
    animation-delay: 0.8s;
}

.atrium-branch circle {
    fill: var(--royal-gold);
    opacity: 0;
    animation: leaf-fade 1.6s ease-out forwards;
    animation-delay: 2.4s;
}

@keyframes branch-grow {
    to { stroke-dashoffset: 0; }
}
@keyframes leaf-fade {
    to { opacity: 0.9; }
}

.atrium-mountains {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 220px;
    pointer-events: none;
    opacity: 0.55;
}
.atrium-mountains .mountain-back  { fill: var(--earth-shadow); opacity: 0.7; }
.atrium-mountains .mountain-mid   { fill: var(--nature-olive); opacity: 0.5; }
.atrium-mountains .mountain-front { fill: var(--clay-dark);    opacity: 0.85; }

#atrium-content {
    position: relative;
    z-index: 2;
    text-align: left;
    max-width: 720px;
    margin-left: clamp(1.5rem, 8vw, 8rem);
    margin-right: auto;
    padding: 1rem 0;
    opacity: 0;
    animation: atrium-fade 1.6s ease-out forwards;
    animation-delay: 1.2s;
}

@keyframes atrium-fade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.atrium-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--royal-gold);
    margin: 0 0 1.2rem 0;
}

#wordmark {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(48px, 7vw, 96px);
    line-height: 1.0;
    margin: 0 0 1.6rem 0;
    color: var(--warm-cream);
    text-shadow: 0 0 24px var(--gold-glow);
    letter-spacing: -0.005em;
}

.atrium-tagline {
    font-family: var(--font-headline);
    font-size: clamp(20px, 2.4vw, 28px);
    line-height: 1.5;
    color: var(--burnished-copper);
    margin: 0 0 2.5rem 0;
    max-width: 32em;
}

.atrium-tagline .italic {
    display: block;
    font-style: italic;
    color: var(--warm-cream);
    margin-top: 0.6rem;
}

.atrium-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    color: var(--burnished-copper);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    align-items: center;
}

.meta-glyph {
    color: var(--royal-gold);
}

/* ---------- long river main ---------- */

#long-river {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, var(--clay-dark) 0%, #1A0F08 100%);
    padding: clamp(4rem, 8vw, 8rem) 0;
}

.content-section {
    position: relative;
    max-width: 65vw;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.2rem, 3vw, 2rem);
    margin-bottom: clamp(3rem, 6vw, 6rem);
}

.flow-left {
    margin-left: 5vw;
}

.flow-right {
    margin-left: 30vw;
}

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--royal-gold);
    margin: 0 0 0.9rem 0;
}

.content-section h2 {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.15;
    color: var(--warm-cream);
    margin: 0 0 1.6rem 0;
    border-left: 3px solid var(--royal-gold);
    padding-left: 1.2rem;
}

.content-section .lede {
    font-family: var(--font-headline);
    font-style: italic;
    font-size: clamp(18px, 2vw, 22px);
    color: var(--burnished-copper);
    line-height: 1.65;
    margin: 0 0 1.6rem 0;
}

.dropcap {
    font-family: var(--font-headline);
    font-weight: 700;
    color: var(--royal-gold);
    float: left;
    font-size: 4em;
    line-height: 0.85;
    padding: 0.1em 0.12em 0 0;
    text-shadow: 0 0 12px var(--gold-glow);
}

/* ---------- the ledger ---------- */

.ledger {
    list-style: none;
    counter-reset: ledger;
    padding: 0;
    margin: 0;
}

.ledger-row {
    counter-increment: ledger;
    display: grid;
    grid-template-columns: 96px 1fr;
    column-gap: 1.6rem;
    padding: 1.4rem 0 1.4rem 0;
    border-bottom: 1px solid rgba(196, 139, 90, 0.18);
    transition: border-bottom-color 0.3s ease, background-color 0.3s ease;
}

.ledger-row:hover {
    border-bottom-color: var(--royal-gold);
    background-color: rgba(212, 160, 64, 0.03);
}

.ledger-row:last-child {
    border-bottom: none;
}

.ledger-time {
    font-family: var(--font-mono);
    color: var(--royal-gold);
    font-size: 0.95rem;
    align-self: start;
    padding-top: 0.3rem;
    letter-spacing: 0.08em;
}

.ledger-row::before {
    content: counter(ledger, decimal-leading-zero);
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    font-family: var(--font-mono);
    color: var(--burnished-copper);
    font-size: 0.78rem;
    opacity: 0.55;
    align-self: start;
}

.ledger-claim {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    margin: 0 0 0.5rem 0;
    color: var(--warm-cream);
    font-size: 1.05rem;
}

.ledger-revision {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    margin: 0;
    font-family: var(--font-headline);
    font-style: italic;
    color: var(--burnished-copper);
    font-size: 1rem;
    line-height: 1.55;
}

/* ---------- section divider ---------- */

.section-divider {
    width: 100%;
    height: 70px;
    margin: clamp(2rem, 4vw, 4rem) 0;
    overflow: hidden;
}

.section-divider svg {
    width: 100%;
    height: 100%;
}

.section-divider path {
    fill: none;
    stroke: var(--burnished-copper);
    stroke-width: 1.2;
    opacity: 0.5;
}

.section-divider path.thin {
    stroke: var(--royal-gold);
    stroke-width: 0.8;
    opacity: 0.35;
}

/* ---------- almanac instruments ---------- */

.instrument {
    margin-bottom: 2rem;
    padding: 1.5rem 1.6rem;
    border-left: 2px solid rgba(196, 139, 90, 0.25);
    border-bottom: 2px solid transparent;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.instrument:hover {
    border-bottom-color: var(--royal-gold);
    background-color: rgba(196, 139, 90, 0.04);
}

.instrument h3 {
    font-family: var(--font-headline);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(20px, 2vw, 26px);
    color: var(--burnished-copper);
    margin: 0 0 0.8rem 0;
}

.instrument p {
    margin: 0 0 0.6rem 0;
}

.instrument-citation {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--royal-gold);
    letter-spacing: 0.12em;
    margin-top: 0.6rem !important;
    opacity: 0.85;
}

/* ---------- quiet quote ---------- */

.quiet-quote {
    margin: 0;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid rgba(196, 139, 90, 0.25);
    border-bottom: 1px solid rgba(196, 139, 90, 0.25);
    font-family: var(--font-headline);
    font-style: italic;
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.55;
    color: var(--warm-cream);
    text-shadow: 0 0 14px rgba(245, 232, 216, 0.05);
}

.quiet-quote p {
    margin: 0 0 1rem 0;
}

.quote-credit {
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    color: var(--royal-gold);
}

/* ---------- evening rite list ---------- */

.rite-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.rite-list li {
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(196, 139, 90, 0.16);
    transition: color 0.25s ease;
}

.rite-list li:hover {
    color: var(--burnished-copper);
}

.rite-list li:last-child {
    border-bottom: none;
}

.rite-mark {
    color: var(--royal-gold);
    margin-right: 0.8rem;
    font-size: 0.85em;
}

/* ---------- colophon ---------- */

#colophon {
    position: relative;
    background: linear-gradient(180deg, #1A0F08 0%, var(--earth-shadow) 100%);
    padding: clamp(3rem, 6vw, 6rem) 1.5rem clamp(2rem, 4vw, 4rem) 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(196, 139, 90, 0.18);
}

.colophon-tree {
    width: 110px;
    height: 110px;
    margin-bottom: 1.2rem;
    opacity: 0.85;
}

.colophon-tree path {
    fill: none;
    stroke: var(--burnished-copper);
    stroke-width: 1.2;
    stroke-linecap: round;
}

.colophon-tree circle {
    fill: var(--royal-gold);
    opacity: 0.85;
}

.colophon-line {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(22px, 2.6vw, 32px);
    color: var(--warm-cream);
    margin: 0 0 0.6rem 0;
    letter-spacing: 0.01em;
}

.colophon-meta {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--burnished-copper);
    margin: 0 0 1.2rem 0;
    line-height: 1.7;
}

.font-cormorant { font-family: var(--font-headline); font-style: italic; }
.font-raleway   { font-family: var(--font-body); font-weight: 600; }
.font-fira      { font-family: var(--font-mono); font-size: 0.85em; color: var(--royal-gold); letter-spacing: 0.08em; }

.colophon-stamp {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--burnished-copper);
    opacity: 0.75;
    margin: 0;
}

/* ---------- micro-interactions ---------- */

a {
    color: var(--burnished-copper);
    text-decoration: none;
    transition: text-shadow 0.2s ease, color 0.2s ease;
}

a:hover,
a:focus {
    text-shadow: 0 0 8px var(--copper-glow);
    color: var(--royal-gold);
}

::selection {
    background: var(--royal-gold);
    color: var(--clay-dark);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .content-section {
        max-width: 90vw;
    }
    .flow-left  { margin-left: 5vw; }
    .flow-right { margin-left: 5vw; }

    .atrium-branch-left {
        opacity: 0.25;
        width: 140px;
    }

    #atrium-content {
        margin-left: 1.5rem;
    }
}

@media (max-width: 600px) {
    .ledger-row {
        grid-template-columns: 60px 1fr;
        column-gap: 1rem;
    }
    .ledger-time {
        font-size: 0.85rem;
    }
    .atrium-mountains {
        width: 90%;
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wave-layer-1, .wave-layer-2, .wave-layer-3 {
        animation: none;
    }
    .atrium-branch path,
    .atrium-branch circle,
    #atrium-content {
        animation: none;
        stroke-dashoffset: 0;
        opacity: 1;
    }
}
