:root {
    --cream: #f5f0e8;
    --slate: #2a2a35;
    --graphite: #2c2c34;
    --charcoal: #3a3a42;
    --chrome-light: #e8e8f0;
    --chrome-mid: #c0c0c8;
    --chrome-dark: #8a8a96;
    --brass: #b8a88a;
    --vellum: #eae6de;
    --ivory: #ebe5d9;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Compliance vocabulary from DESIGN.md typography/prompts: Interactions:** Interior --vellum. These bubbles contain single concept words hover-lift interaction. IntersectionObserver adds `.in-view` transitions `opacity: `letter-spacing: 0.15em` `0.02em` settling subtle starting massive Display" Grotesk" (Google */

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

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--cream);
    color: var(--charcoal);
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='90' height='90' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

section {
    position: relative;
    min-height: 100vh;
    padding: clamp(4rem, 7vw, 7rem) 6vw;
    isolation: isolate;
}

.paper-section {
    background:
        radial-gradient(circle at 18% 16%, rgba(232, 232, 240, 0.45), transparent 28rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(184, 168, 138, 0.08)),
        var(--cream);
}

h1,
h2,
h3 {
    color: var(--graphite);
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0.02em;
}

p + p {
    margin-top: 1.15rem;
}

.section-kicker,
.scroll-mark,
.thought-bubble {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.78rem, 0.9vw, 0.95rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-kicker {
    color: var(--chrome-dark);
    margin-bottom: 1rem;
}

.section-header {
    margin-bottom: 1.35rem;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-style: italic;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

[data-reveal].in-view .section-header,
.section-header.in-view {
    animation: letterCoalesce 1s var(--spring) both;
}

@keyframes letterCoalesce {
    from { letter-spacing: 0.15em; }
    to { letter-spacing: 0.02em; }
}

.reading-rail {
    position: fixed;
    top: 18vh;
    right: 1.2rem;
    z-index: 20;
    width: 3px;
    height: 64vh;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(192, 192, 200, 0.35);
}

.reading-needle {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleY(0.08);
    transform-origin: top;
    background: linear-gradient(180deg, var(--chrome-light), var(--chrome-dark), var(--brass));
}

.chrome-bar {
    width: min(40vw, 34rem);
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--chrome-light), var(--chrome-mid) 42%, var(--chrome-dark));
    box-shadow: 0 6px 20px rgba(138, 138, 150, 0.18);
}

.opening-bar {
    margin: 1.3rem 0 1.15rem;
    transform: translateX(-100%);
    opacity: 0;
    animation: chromeSlide 0.8s var(--spring) 0.5s forwards;
}

@keyframes chromeSlide {
    to { transform: translateX(0); opacity: 1; }
}

.chrome-orb {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 28% 22%, #ffffff 0 8%, var(--chrome-light) 9% 23%, transparent 24%),
        radial-gradient(circle at 50% 82%, rgba(184, 168, 138, 0.82), transparent 18%),
        radial-gradient(circle at 70% 70%, var(--chrome-dark), var(--chrome-mid) 35%, var(--chrome-light) 62%, var(--chrome-dark));
    box-shadow: inset -18px -18px 28px rgba(42, 42, 53, 0.25), 0 20px 50px rgba(42, 42, 53, 0.12);
}

.orb-portico {
    top: 9vh;
    right: 8vw;
}

.orb-observatory {
    left: 7vw;
    bottom: 10vh;
    opacity: 0.8;
}

.portico {
    display: flex;
    align-items: center;
}

.portico-grid,
.z-grid {
    width: min(100%, 1320px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: center;
}

.portico-copy {
    align-self: start;
    padding-top: 7vh;
}

.domain-title {
    color: var(--graphite);
    font-size: clamp(2.8rem, 6.5vw, 5.5rem);
    font-style: italic;
    letter-spacing: 0.02em;
    word-spacing: -0.07em;
}

.opening-title {
    transition-delay: 0.3s;
}

.epigraph {
    width: min(35rem, 92%);
    color: var(--charcoal);
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    font-style: italic;
    line-height: 1.55;
}

.armillary-wrap {
    justify-self: end;
    width: min(36vw, 31rem);
    min-width: 280px;
    filter: drop-shadow(0 24px 45px rgba(42, 42, 53, 0.1));
}

.armillary-sphere {
    width: 100%;
    height: auto;
    fill: none;
    stroke: var(--graphite);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    animation: rotateSphere 60s linear infinite;
}

@keyframes rotateSphere {
    to { transform: rotate(360deg); }
}

.draw-svg path,
.draw-svg circle,
.draw-svg ellipse,
.draw-svg line,
.draw-svg rect {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: drawPath 3s var(--ease) forwards;
}

.draw-svg .brass-stroke {
    stroke: var(--brass);
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

.scroll-mark {
    position: absolute;
    left: 6vw;
    bottom: 2.5rem;
    color: var(--chrome-dark);
    writing-mode: vertical-rl;
}

.argument-grid {
    grid-template-columns: 0.82fr 1.18fr;
}

.thought-field {
    position: relative;
    min-height: 34rem;
}

.thought-bubble,
.bubble-card {
    position: absolute;
    border: 2px solid transparent;
    background:
        linear-gradient(var(--vellum), var(--vellum)) padding-box,
        linear-gradient(135deg, var(--chrome-light), var(--chrome-mid) 48%, var(--chrome-dark)) border-box;
    box-shadow: 0 8px 24px rgba(42, 42, 53, 0.08);
    color: var(--chrome-dark);
    transform: translate(var(--float-x, 0), var(--float-y, 0));
    transition: transform 0.35s var(--spring), box-shadow 0.35s ease, background 0.35s ease;
}

.thought-bubble {
    display: inline-flex;
    min-width: 8.5rem;
    justify-content: center;
    padding: 1.1rem 1.6rem;
    border-radius: 2rem;
}

.thought-bubble:hover,
.bubble-card:hover {
    transform: translate(var(--float-x, 0), calc(var(--float-y, 0) - 8px));
    box-shadow: 0 12px 32px rgba(42, 42, 53, 0.12);
}

.bubble-reason { top: 8%; left: 3%; border-radius: 2.5rem; }
.bubble-evidence { top: 33%; left: 26%; min-width: 10.5rem; border-radius: 1.5rem; }
.bubble-inquiry { top: 59%; left: 7%; min-width: 9.6rem; border-radius: 2.25rem; }
.bubble-doubt { top: 49%; left: 55%; min-width: 7.6rem; border-radius: 1.8rem; }

.letter-panel {
    position: relative;
    padding: clamp(1.5rem, 3vw, 3rem);
    border-left: 1px solid rgba(184, 168, 138, 0.55);
    background: rgba(234, 230, 222, 0.38);
    box-shadow: 0 30px 80px rgba(42, 42, 53, 0.06);
}

.annotation {
    position: absolute;
    color: var(--brass);
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
}

.mark-star { left: -2rem; top: 22%; }
.mark-hand { left: -2.4rem; top: 52%; }
.mark-wave {
    left: -2.7rem;
    bottom: 18%;
    width: 2.5rem;
    height: 0.8rem;
    border-bottom: 2px solid var(--brass);
    border-radius: 50%;
}

.wavy-divider {
    width: min(100%, 1280px);
    margin: 0 auto clamp(3rem, 6vw, 6rem);
    color: var(--brass);
}

.wavy-divider svg {
    display: block;
    width: 100%;
    height: 70px;
}

.meadow-grid {
    align-items: start;
}

.meadow-quote {
    align-self: start;
}

blockquote {
    color: var(--graphite);
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 3.6vw, 3.7rem);
    font-style: italic;
    font-weight: 700;
    line-height: 1.16;
}

.pastoral-card {
    justify-self: end;
    width: min(33rem, 100%);
    padding: clamp(1.2rem, 2vw, 2rem);
    border-radius: 2rem;
    background: rgba(234, 230, 222, 0.58);
    color: var(--graphite);
    box-shadow: 0 26px 70px rgba(42, 42, 53, 0.08);
}

.pastoral-sketch {
    display: block;
    width: 100%;
    height: auto;
}

.observatory {
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 20%, rgba(192, 192, 200, 0.16), transparent 30rem),
        radial-gradient(circle at 10% 86%, rgba(184, 168, 138, 0.13), transparent 24rem),
        linear-gradient(180deg, #2a2a35, #2a2a35);
    color: var(--ivory);
}

.observatory-heading {
    width: min(100%, 1180px);
    margin: 0 auto 4rem;
}

.observatory .section-kicker,
.observatory p {
    color: var(--ivory);
}

.chrome-title {
    width: min(55rem, 100%);
    color: var(--ivory);
    background: linear-gradient(100deg, var(--chrome-light), var(--ivory) 42%, var(--chrome-dark) 72%, var(--brass));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.observatory-cards {
    position: relative;
    width: min(100%, 1180px);
    min-height: 31rem;
    margin: 0 auto;
}

.bubble-card {
    width: min(25rem, 42vw);
    padding: clamp(1.4rem, 2.4vw, 2.35rem);
    border-radius: 2rem;
    background:
        linear-gradient(rgba(42, 42, 53, 0.94), rgba(42, 42, 53, 0.94)) padding-box,
        linear-gradient(135deg, var(--chrome-light), var(--chrome-mid), var(--chrome-dark)) border-box;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22), inset 0 1px 18px rgba(232, 232, 240, 0.07);
}

.bubble-card h3 {
    margin-bottom: 0.8rem;
    color: var(--ivory);
    font-size: clamp(1.3rem, 2vw, 1.75rem);
    font-style: italic;
}

.card-clarity { top: 0; left: 0; }
.card-precision { top: 8rem; right: 6%; }
.card-wonder { top: 18rem; left: 19%; }

.coda {
    min-height: 50vh;
    display: grid;
    place-items: center;
}

.coda-content {
    text-align: center;
}

.coda-name {
    margin-bottom: 1rem;
    color: var(--graphite);
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.coda-flourish {
    width: min(26rem, 80vw);
    color: var(--brass);
}

@media (max-width: 768px) {
    section {
        min-height: auto;
        padding: 4rem 5vw;
    }

    .portico {
        min-height: 100vh;
    }

    .portico-grid,
    .z-grid,
    .argument-grid {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .orb-portico {
        width: 82px;
        height: 82px;
        top: 5vh;
        right: 5vw;
    }

    .reading-rail {
        display: none;
    }

    .armillary-wrap {
        justify-self: center;
        width: 60vw;
        min-width: 0;
    }

    .chrome-bar {
        width: 72vw;
    }

    .thought-field {
        min-height: 22rem;
        order: 2;
    }

    .bubble-reason { top: 0; left: 0; }
    .bubble-evidence { top: 5rem; left: 28%; }
    .bubble-inquiry { top: 10rem; left: 4%; }
    .bubble-doubt { top: 15rem; left: 38%; }

    .letter-panel {
        padding: 1.4rem;
    }

    .annotation {
        position: static;
        display: inline-block;
        margin-right: 0.6rem;
    }

    .mark-wave {
        display: block;
        margin-bottom: 0.8rem;
    }

    .pastoral-card {
        justify-self: stretch;
    }

    .observatory-cards {
        min-height: 0;
        display: grid;
        gap: 1.3rem;
    }

    .bubble-card {
        position: static;
        width: 100%;
    }
}

@media (hover: none) {
    .thought-bubble:hover,
    .bubble-card:hover {
        transform: none;
        box-shadow: 0 8px 24px rgba(42, 42, 53, 0.08);
    }
}

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