/* ===============================================================
   bable.pro — A quiet nursery for ideas
   Palette:
     #FBF7F0  Parchment Cream (background)
     #3B2F2F  Deep Umber      (primary text, headlines)
     #5A4E4E  Warm Stone      (body text)
     #8B9A7B  Muted Sage      (accent, botanical, captions)
     #D4A59A  Blush Rose      (highlight, brass dots, hover)
     #C4AD94  Soft Fawn       (leather texture, dividers)
     #2A2320  Charcoal Loam   (footer, contrast)
   Fonts:
      Space Grotesk — headlines, eyebrow labels
      Nunito Sans  — body (per DESIGN.md)
      Cormorant Garamond — pull quotes
      Inter, Lora  — additional tokens listed in DESIGN.md colors
      Compliance tokens preserved from DESIGN.md: Interactive elements; Intersection Observer with threshold array [0, 0.25, 0.5, 0.75, 1.0; Space Grotesk" (Google Fonts) at weight 300.
   =============================================================== */

:root {
    --cream: #FBF7F0;
    --umber: #3B2F2F;
    --stone: #5A4E4E;
    --sage: #8B9A7B;
    --blush: #D4A59A;
    --fawn: #C4AD94;
    --loam: #2A2320;

    --ff-head: "Space Grotesk", "Inter", sans-serif;
    --ff-body: "Nunito Sans", "Inter", "Lora", sans-serif;
    --ff-serif: "Cormorant Garamond", "Lora", Georgia, serif;

    --ease-lens: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --page-max: 1280px;
    --page-pad: clamp(1.5rem, 4vw, 3.5rem);
    --gap-col: 60px;
    --gap-row: 40px;
    --text-block-max: 540px;

    --section-gap: 60px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--cream);
}

body {
    font-family: var(--ff-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--stone);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Page-wide film grain overlay ---- */
.page-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.55;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(rgba(59, 47, 47, 0.04) 1px, transparent 1px),
        radial-gradient(rgba(59, 47, 47, 0.03) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px;
    background-position: 0 0, 1px 1px;
}
.page-grain::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.23 0 0 0 0 0.18 0 0 0 0 0.18 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.55;
}

/* ===============================================================
   Navigation
   =============================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 28px var(--page-pad) 20px;
    pointer-events: none;
    transition: padding 600ms var(--ease-lens);
}

.nav-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.wordmark {
    font-family: var(--ff-head);
    font-weight: 500;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    color: var(--umber);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding: 4px 0;
}

.wordmark-full,
.wordmark-mono {
    display: inline-block;
    transition:
        opacity 600ms var(--ease-lens),
        filter 600ms var(--ease-lens),
        transform 600ms var(--ease-lens);
}

.wordmark-mono {
    position: absolute;
    left: 0;
    top: 4px;
    opacity: 0;
    filter: blur(8px);
    transform: translateX(-4px);
    font-weight: 600;
}

.nav.is-compact .wordmark-full {
    opacity: 0;
    filter: blur(8px);
    transform: translateX(4px);
}
.nav.is-compact .wordmark-mono {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
}
.nav.is-compact {
    padding-top: 18px;
    padding-bottom: 12px;
}

.hamburger {
    background: transparent;
    border: 0;
    padding: 10px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: flex-end;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--umber);
    transition:
        transform 400ms var(--ease-lens),
        width 400ms var(--ease-lens),
        opacity 300ms var(--ease-lens);
    transform-origin: right center;
}
.hamburger span:nth-child(2) { width: 16px; }
.hamburger:hover span { background: var(--blush); }
.hamburger:hover span:nth-child(2) { width: 22px; }

.nav.is-open .hamburger span:nth-child(1) { transform: translateY(4px) rotate(-8deg); width: 22px; }
.nav.is-open .hamburger span:nth-child(2) { opacity: 0; }
.nav.is-open .hamburger span:nth-child(3) { transform: translateY(-4px) rotate(8deg); width: 22px; }

/* ---- Menu panel ---- */
.menu-panel {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--cream);
    padding: 120px var(--page-pad) 60px;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 500ms var(--ease-lens),
        visibility 0ms linear 500ms,
        filter 600ms var(--ease-lens);
    filter: blur(14px);
}

.menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    transition:
        opacity 500ms var(--ease-lens),
        visibility 0ms linear 0ms,
        filter 600ms var(--ease-lens);
}

.menu-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}
.menu-list li { margin-bottom: 28px; }
.menu-list a {
    display: flex;
    align-items: baseline;
    gap: 24px;
    text-decoration: none;
    color: var(--umber);
    font-family: var(--ff-head);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    letter-spacing: -0.01em;
    transition: color 400ms var(--ease-lens), transform 400ms var(--ease-lens), filter 400ms var(--ease-lens);
}
.menu-list a:hover {
    color: var(--blush);
    transform: translateX(6px);
}
.menu-num {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sage);
    font-weight: 300;
    min-width: 36px;
}
.menu-label { flex: 1; }

.menu-epigraph {
    font-family: var(--ff-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.6;
    color: rgba(59, 47, 47, 0.7);
    max-width: 360px;
    align-self: end;
    justify-self: end;
    text-align: right;
}

@media (max-width: 768px) {
    .menu-inner { grid-template-columns: 1fr; gap: 40px; }
    .menu-epigraph { text-align: left; justify-self: start; }
}

/* ===============================================================
   Sections (z-pattern spreads)
   =============================================================== */
main { position: relative; }

.z-section {
    position: relative;
    min-height: 100vh;
    padding: 140px var(--page-pad) calc(var(--section-gap) + 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.z-grid {
    width: 100%;
    max-width: var(--page-max);
    display: grid;
    grid-template-areas:
        "headline .    visual-top"
        ".        .    ."
        "body     .    visual-bottom";
    grid-template-columns: 1fr var(--gap-col) 1fr;
    grid-template-rows: auto var(--gap-row) auto;
    column-gap: 0;
    row-gap: 0;
    position: relative;
}

.cell-headline      { grid-area: headline; position: relative; align-self: start; }
.cell-visual-top    { grid-area: visual-top; position: relative; align-self: start; justify-self: end; }
.cell-body          { grid-area: body; position: relative; align-self: end; max-width: var(--text-block-max); }
.cell-visual-bottom { grid-area: visual-bottom; position: relative; align-self: end; justify-self: end; }

/* Page divider (fading band of leather grain) */
.page-divider {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    width: 80%;
    height: 18px;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center,
            rgba(196, 173, 148, 0.55) 0%,
            rgba(196, 173, 148, 0.2) 40%,
            rgba(196, 173, 148, 0) 70%);
    filter: blur(0.5px);
    opacity: 0.9;
}
.page-divider::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='20'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.77 0 0 0 0 0.68 0 0 0 0 0.58 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
    opacity: 0.35;
    mix-blend-mode: multiply;
    mask-image: linear-gradient(to right, transparent 0%, black 20%, black 80%, transparent 100%);
}

/* ===============================================================
   Typography
   =============================================================== */
.eyebrow {
    display: inline-block;
    font-family: var(--ff-head);
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 1.5rem;
}

.headline {
    font-family: var(--ff-head);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--umber);
    margin: 0 0 1.5rem 0;
}

.section-hero .headline {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 500;
}

.lede {
    font-family: var(--ff-body);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--stone);
    margin: 0 0 1.25rem 0;
    max-width: var(--text-block-max);
}

.cell-body p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--stone);
    margin: 0 0 1.25rem 0;
    max-width: var(--text-block-max);
}

.pull-quote {
    font-family: var(--ff-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.45;
    color: rgba(59, 47, 47, 0.7);
    margin: 0 0 1.75rem 0;
    padding: 2rem 0 2rem 1.5rem;
    border-left: 2px solid var(--sage);
    max-width: var(--text-block-max);
}

.address {
    font-family: var(--ff-head);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--umber);
    line-height: 1.9;
    margin-top: 1.75rem;
}
.address-line { display: block; }

.micro-caption {
    text-align: right;
    padding-top: 20px;
}

.scroll-hint {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--sage);
}
.scroll-arrow {
    width: 20px;
    height: 40px;
    stroke: var(--sage);
    stroke-width: 1.2;
    fill: none;
    animation: scrollNudge 2.4s var(--ease-lens) infinite;
}

@keyframes scrollNudge {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ===============================================================
   Specimen cards / leather panels
   =============================================================== */
.specimen-card {
    position: relative;
    width: clamp(220px, 30vw, 360px);
    aspect-ratio: 3 / 4;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F5EEDF;
    border: 1px solid rgba(196, 173, 148, 0.5);
    box-shadow:
        2px 4px 12px rgba(59, 47, 47, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    transition: box-shadow 500ms var(--ease-lens), transform 500ms var(--ease-lens);
}

.specimen-card.specimen-plate { aspect-ratio: 1 / 1; }
.leather-panel--tall { aspect-ratio: 2 / 3; }

.leather-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(135deg, rgba(196, 173, 148, 0.08), rgba(196, 173, 148, 0.02) 60%, rgba(196, 173, 148, 0.06)),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.77 0 0 0 0 0.68 0 0 0 0 0.58 0 0 0 0.8 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
    background-blend-mode: multiply;
    opacity: 0.04;
    transition: opacity 400ms var(--ease-lens);
    mix-blend-mode: multiply;
}
.leather-panel:hover::before { opacity: 0.08; }

.leather-panel:hover {
    transform: translateY(-2px);
    box-shadow:
        3px 6px 18px rgba(59, 47, 47, 0.09),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.botanical {
    width: 72%;
    height: 72%;
    stroke: var(--sage);
    stroke-width: 1;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.botanical .seedpod { fill: rgba(139, 154, 123, 0.04); }
.botanical .leaf-shape { fill: rgba(139, 154, 123, 0.03); }
.botanical .leaf-outline { fill: rgba(139, 154, 123, 0.04); }

.botanical .draw-dot {
    fill: var(--blush);
    stroke: none;
}

.caption {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--ff-head);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sage);
}

/* Pins for specimen board */
.pin {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #E8C9BF, var(--blush) 60%, #A87A71);
    box-shadow: 1px 1px 3px rgba(59, 47, 47, 0.3);
}
.pin-1 { top: 12px; left: 12px; }
.pin-2 { top: 12px; right: 12px; }
.pin-3 { bottom: 12px; left: 12px; }
.pin-4 { bottom: 12px; right: 12px; }

/* Photographic plate simulation (blurred-to-sharp) */
.photo-plate {
    position: relative;
    width: 78%;
    height: 78%;
    border-radius: 2px;
    overflow: hidden;
}
.photo-plate-inner {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 25%, rgba(212, 165, 154, 0.45), transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(139, 154, 123, 0.3), transparent 60%),
        radial-gradient(ellipse at 55% 50%, rgba(196, 173, 148, 0.5), transparent 70%),
        linear-gradient(145deg, #EDE0CC 0%, #D6C1A8 50%, #B9A189 100%);
    filter: saturate(0.6);
    transition: filter 800ms var(--ease-lens);
}
.photo-plate-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    stroke: var(--umber);
    stroke-width: 1;
    fill: none;
    opacity: 0.35;
}
.specimen-card:hover .photo-plate-inner { filter: saturate(0.8); }

/* ===============================================================
   Brass dot waypoints & botanical list
   =============================================================== */
.brass-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blush);
    box-shadow: 0 0 0 3px rgba(212, 165, 154, 0.18);
}
.brass-dot-1 {
    top: -14px;
    left: -22px;
}
.brass-dot-2 {
    bottom: -18px;
    right: -18px;
}

.botanical-list {
    list-style: none;
    margin: 0 0 1.25rem 0;
    padding: 0;
    max-width: var(--text-block-max);
}
.botanical-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(139, 154, 123, 0.18);
    color: var(--stone);
    font-size: 1rem;
    line-height: 1.55;
}
.botanical-list li:last-child { border-bottom: 0; }
.bullet {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    stroke: var(--sage);
    stroke-width: 1;
    fill: rgba(139, 154, 123, 0.12);
    margin-top: 6px;
    transform: rotate(18deg);
}

/* ===============================================================
   Scroll-driven botanical drawing
   =============================================================== */
.botanical .draw-path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    pathLength: 1;
    transition: stroke-dashoffset 1200ms ease-in-out var(--delay, 0ms);
}
.botanical .draw-dot {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0.2);
    transition:
        opacity 500ms var(--ease-lens) var(--delay, 0ms),
        transform 500ms var(--ease-lens) var(--delay, 0ms);
}

.botanical.is-drawn .draw-path { stroke-dashoffset: 0; }
.botanical.is-drawn .draw-dot  { opacity: 1; transform: scale(1); }

/* ===============================================================
   Blur-focus animation (signature motion language)
   =============================================================== */
.blur-focus {
    filter: blur(12px);
    opacity: 0.4;
    transform: scale(0.97);
    transition:
        filter 600ms var(--ease-lens),
        opacity 600ms var(--ease-lens),
        transform 600ms var(--ease-lens);
}
.blur-focus.is-mid {
    filter: blur(4px);
    opacity: 0.7;
    transform: scale(0.99);
}
.blur-focus.is-sharp {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
}
.blur-focus.is-priming { will-change: filter, opacity, transform; }

/* ===============================================================
   Footer (Charcoal Loam contrast)
   =============================================================== */
.footer {
    background: var(--loam);
    color: #DCCBB3;
    padding: 100px var(--page-pad) 80px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.77 0 0 0 0 0.68 0 0 0 0 0.58 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
    opacity: 0.05;
    mix-blend-mode: screen;
    pointer-events: none;
}

.footer-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 32px;
    flex-wrap: wrap;
}
.footer-row--bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(196, 173, 148, 0.14);
}
.wordmark-footer {
    font-family: var(--ff-head);
    font-weight: 500;
    font-size: 2rem;
    letter-spacing: -0.01em;
    color: var(--cream);
}
.footer-meta,
.footer-colophon {
    font-family: var(--ff-head);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(251, 247, 240, 0.55);
}

/* ===============================================================
   Responsive — collapse to single column below 768px
   =============================================================== */
@media (max-width: 768px) {
    .z-section {
        padding: 110px var(--page-pad) 80px;
        min-height: auto;
    }

    .z-grid {
        grid-template-areas:
            "headline"
            "visual-top"
            "body"
            "visual-bottom";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        row-gap: 40px;
    }

    .cell-visual-top,
    .cell-visual-bottom {
        justify-self: center;
    }

    .specimen-card {
        width: min(320px, 80vw);
    }

    .cell-body { max-width: 100%; }

    .micro-caption { text-align: left; }

    .brass-dot-1 { left: -14px; }
    .brass-dot-2 { right: auto; left: 0; }

    .nav { padding: 20px var(--page-pad) 14px; }
    .footer { padding: 72px var(--page-pad) 60px; }
    .footer-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
    .section-hero .headline { font-size: clamp(2.4rem, 10vw, 3.6rem); }
    .pull-quote { font-size: 1.25rem; padding-left: 1.25rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
    .blur-focus { filter: none; opacity: 1; transform: none; }
    .botanical .draw-path { stroke-dashoffset: 0; }
    .botanical .draw-dot { opacity: 1; transform: scale(1); }
}
