/* ==========================================================
   WINE EDUCATION STARTER — DESIGN TOKENS + BASE COMPONENTS
   DNA source: Giscours, Aubert (verified CSS), Visit Napa
   Valley, Silver Oak. See ../design-dna-blueprint.md
   ========================================================== */

:root {
  /* Color — light estate base, wine + gold punctuation */
  --paper:        #faf7f1;
  --paper-warm:   #f2ede2;
  --putty:        #e9e4d8;   /* from Aubert #edebe6 (verified) */
  --ink:          #231f20;   /* verified, Aubert nav charcoal */
  --ink-body:     #40403e;   /* from Aubert #404040 (verified) */
  --gold:         #8d692c;   /* Aubert #bd9246 darkened to 4.69:1 on paper (AA) */
  --gold-bright:  #bd9246;   /* verified brand gold — display/decorative only */
  --bronze:       #765c2e;   /* verified Aubert hover */
  --wine:         #521a20;   /* sampled from LIV flyer burgundy band */
  --wine-deep:    #3d1418;   /* sampled from flyer footer */
  --warm-gray:    #7a7065;   /* 4.53:1 on paper (AA) */

  /* Type */
  --font-display: "Cormorant Garamond", "Cardo", Georgia, serif;
  --font-body:    "Jost", "Segoe UI", sans-serif;
  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-md: 1.06rem;
  --text-lg: 1.33rem;
  --text-xl: 1.66rem;
  --text-2xl: 2.3rem;
  --text-3xl: clamp(2.5rem, 5.5vw, 4rem);
  --track-label: 0.22em;
  --leading-body: 1.65;

  /* Space — 8px scale */
  --s-1: 0.5rem; --s-2: 1rem; --s-3: 1.5rem; --s-4: 2rem;
  --s-6: 3rem;  --s-8: 4rem; --s-12: 6rem;  --s-16: 8rem;
  --measure: 46rem;
  --shell: 1150px;

  /* Edges & elevation */
  --radius: 0;
  --rule: 1px solid rgba(169, 126, 53, 0.35);
  --rule-dotted: 1px dotted var(--gold-bright);
  --shadow-card: 0 2px 24px rgba(35, 31, 32, 0.07);

  /* Motion — the Aubert constant */
  --speed-fast: 300ms;
  --speed-slow: 600ms;
  --ease: ease;
  --ease-reveal: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.12; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

a { color: var(--gold); transition: color var(--speed-fast) var(--ease); }
a:hover { color: var(--bronze); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--shell); margin: 0 auto; padding: 0 6vw; }
section { padding: var(--s-12) 0; }
.band { background: var(--paper-warm); border-top: var(--rule); border-bottom: var(--rule); }

/* Eyebrow — the premium micro-label */
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s-2);
}

.lede { font-size: var(--text-lg); max-width: var(--measure); color: var(--ink-body); }

.gold-rule { width: 70px; height: 1px; background: var(--gold-bright); margin: var(--s-4) 0; border: 0; }

/* ---------- Skip link ---------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--wine); color: #fff; padding: var(--s-1) var(--s-2); z-index: 99; }
.skip:focus { left: 0; color: #fff; }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) 6vw;
  /* Frosted backing so the fixed bar is never see-through. Without this,
     page content shows through the bar and can smear under it while
     scrolling (worst on the shorter sub-page heroes). */
  background: rgba(250, 247, 241, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* Promote the bar to its own GPU compositor layer — stops a fixed,
     transparent element from leaving repaint "ghost" trails on scroll. */
  transform: translateZ(0);
  will-change: transform;
  transition: background var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.site-nav.scrolled { background: var(--paper); box-shadow: var(--shadow-card); }

.brand { font-family: var(--font-display); font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: 0.06em; }
.brand em { color: var(--gold-bright); }

.site-nav ul { display: flex; gap: var(--s-4); list-style: none; align-items: center; }
.site-nav ul a {
  font-size: var(--text-xs); letter-spacing: var(--track-label); text-transform: uppercase;
  text-decoration: none; color: var(--ink);
}
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.9rem 2.2rem;
  font-family: var(--font-body); font-size: var(--text-xs);
  letter-spacing: var(--track-label); text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: var(--radius);
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}
.btn-wine { background: var(--wine); color: #fff; border: 1px solid var(--wine); }
.btn-wine:hover { background: var(--wine-deep); border-color: var(--wine-deep); color: #fff; }
.btn-outline { background: transparent; color: var(--bronze); border: 1px solid var(--gold-bright); }
.btn-outline:hover { background: var(--gold-bright); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  min-height: 88vh; display: flex; align-items: center;
  background:
    linear-gradient(180deg, rgba(250,247,241,0.88) 0%, rgba(250,247,241,0.6) 55%, var(--paper) 100%),
    var(--paper-warm) center / cover no-repeat;
}
.hero .wrap { padding-top: var(--s-16); padding-bottom: var(--s-12); }
.hero h1 span { display: block; }
.hero h1 .accent { font-style: italic; color: var(--bronze); }
.btn-row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--s-3); margin-top: var(--s-6); }

.class-card {
  background: var(--putty); border: var(--rule);
  transition: transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.class-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.class-card .media { aspect-ratio: 4 / 5; background: var(--paper-warm); object-fit: cover; width: 100%; }
.class-card .body { padding: var(--s-3); }
.class-card .chip {
  display: inline-block; font-size: var(--text-xs); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--bronze); border: 1px solid var(--gold-bright);
  padding: 0.15rem 0.7rem; margin-bottom: var(--s-2);
}
.class-card .meta {
  display: flex; gap: var(--s-2); font-size: var(--text-sm); color: var(--warm-gray);
  border-top: var(--rule-dotted); margin-top: var(--s-2); padding-top: var(--s-2);
}

/* ---------- Quote band ---------- */
.quote { font-family: var(--font-display); font-style: italic; font-size: clamp(1.4rem, 3vw, 2.1rem); color: var(--ink); max-width: var(--measure); margin: 0 auto; text-align: center; }
.quote-attr { text-align: center; margin-top: var(--s-3); font-size: var(--text-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--warm-gray); }

/* ---------- Email capture ---------- */
.capture { max-width: 540px; margin: var(--s-6) auto 0; display: grid; gap: var(--s-2); }
.capture input[type="email"] {
  padding: 0.9rem 1rem; border: 1px solid var(--gold-bright); background: #fff;
  font-family: var(--font-body); font-size: var(--text-md); color: var(--ink);
}
.capture input[type="email"]:focus { outline: 2px solid var(--gold); }
.capture label.consent { font-size: var(--text-sm); color: var(--warm-gray); display: flex; gap: var(--s-1); align-items: flex-start; text-align: left; }

/* ---------- FAQ ---------- */
details { border-bottom: var(--rule-dotted); padding: var(--s-2) 0; }
details summary { font-family: var(--font-display); font-size: var(--text-xl); color: var(--ink); cursor: pointer; list-style: none; }
details summary::after { content: "+"; float: right; color: var(--gold-bright); }
details[open] summary::after { content: "–"; }

/* ---------- Footer ---------- */
footer { background: var(--paper-warm); border-top: var(--rule); padding: var(--s-8) 0 var(--s-4); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-4); }
footer h3 { font-size: var(--text-md); text-transform: uppercase; letter-spacing: var(--track-label); font-family: var(--font-body); color: var(--bronze); }
footer ul { list-style: none; display: grid; gap: var(--s-1); margin-top: var(--s-2); }
footer a { text-decoration: none; color: var(--ink-body); font-size: var(--text-sm); }
.compliance { margin-top: var(--s-6); font-size: var(--text-xs); color: var(--warm-gray); text-align: center; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- LIV additions: arch frames, burgundy band, pillars ---------- */

/* Arched photo mask — echoes the flyer's curved photo frame */
.arch { border-radius: 999px 999px 0 0; overflow: hidden; border: 1px solid var(--gold-bright); }
.arch img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s-8); align-items: center; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; } .hero-split .arch { max-width: 380px; margin: 0 auto; } }

.tagline { font-size: var(--text-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--bronze); }

/* Three E's pillar cards */
.pillar { background: #fff; border: var(--rule); transition: transform var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease); }
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.pillar .media { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; display: block; background: var(--paper-warm); }
.pillar .body { padding: var(--s-3) var(--s-3) var(--s-4); }
.pillar .num { font-family: var(--font-display); font-style: italic; color: var(--gold); letter-spacing: 0.15em; }
.pillar h3 { margin: var(--s-1) 0; }
.pillar p { font-size: var(--text-sm); }

/* Burgundy band — the flyer's "Wine Tastings" section as a web component */
.wine-band { background: linear-gradient(120deg, var(--wine-deep), var(--wine)); color: #f3ead9; }
.wine-band h2 { color: #f3ead9; }
.wine-band .eyebrow { color: var(--gold-bright); }
.wine-band .lede { color: rgba(243, 234, 217, 0.85); }
.band-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s-8); align-items: center; }
@media (max-width: 860px) { .band-split { grid-template-columns: 1fr; } }

/* Flyer fact stats */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-4); margin-top: var(--s-6); }
.fact { border-left: 1px solid var(--gold-bright); padding-left: var(--s-3); }
.fact .big { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--gold-bright); line-height: 1.1; }
.fact p { font-size: var(--text-sm); color: rgba(243, 234, 217, 0.85); margin-top: var(--s-1); }

/* Credential checklist (flyer sommelier block) */
.checklist { list-style: none; display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.checklist li { display: flex; gap: var(--s-2); align-items: baseline; }
.checklist li::before { content: "\2713"; color: var(--gold); border: 1px solid var(--gold-bright); border-radius: 50%; width: 1.35em; height: 1.35em; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8em; flex-shrink: 0; }

/* ---------- Reveal choreography (gated) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--speed-slow) var(--ease-reveal), transform var(--speed-slow) var(--ease-reveal); }
  .reveal.in { opacity: 1; transform: none; }
  .reveal:nth-child(2) { transition-delay: 120ms; }
  .reveal:nth-child(3) { transition-delay: 240ms; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Guided pages: sommelier prose ---------- */
.page-hero { min-height: 52vh; }
.page-hero .wrap { padding-top: var(--s-16); }

.prose { max-width: var(--measure); margin: 0 auto; }
.prose p { margin-bottom: var(--s-3); }
.prose p:first-of-type::first-letter {
  font-family: var(--font-display); font-size: 3.4em; float: left;
  line-height: 0.82; padding-right: 0.12em; color: var(--wine);
}

/* Chapter/theme header with gold numeral */
.chapter { max-width: var(--measure); margin: var(--s-8) auto var(--s-3); display: flex; align-items: baseline; gap: var(--s-2); }
.chapter .n { font-family: var(--font-display); font-style: italic; color: var(--gold-bright); font-size: var(--text-xl); }
.chapter h2 { font-size: var(--text-xl); }
.chapter::after { content: ""; flex: 1; border-bottom: var(--rule-dotted); transform: translateY(-0.35em); }

/* Sommelier aside */
.guide-note {
  max-width: var(--measure); margin: var(--s-4) auto; padding: var(--s-3) var(--s-4);
  background: var(--putty); border-left: 3px solid var(--gold-bright);
  font-family: var(--font-display); font-style: italic; font-size: var(--text-lg); color: var(--ink);
}
.guide-note cite { display: block; font-family: var(--font-body); font-style: normal; font-size: var(--text-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--warm-gray); margin-top: var(--s-1); }

/* Next-E pagination */
.next-e { display: flex; justify-content: space-between; gap: var(--s-2); max-width: var(--measure); margin: var(--s-8) auto 0; border-top: var(--rule); padding-top: var(--s-4); flex-wrap: wrap; }

.pillar-link { text-decoration: none; color: inherit; display: block; }

/* ---------- Prose figures (guided pages) ---------- */
.figure { max-width: var(--measure); margin: var(--s-6) auto; }
.figure img, .figure svg { width: 100%; display: block; border: 1px solid var(--gold-bright); background: var(--paper-warm); }
.figure figcaption { font-family: var(--font-display); font-style: italic; color: var(--warm-gray); margin-top: var(--s-2); text-align: center; }

/* "Book a Tasting" CTA — always white text, everywhere */
.site-nav ul a.btn-wine, .site-nav ul a.btn-wine:hover { color: #fff; }

/* ---------- Photo slots: show art-direction panel until the photo file exists ---------- */
.photo-slot .spec { display: none; }
.photo-slot.missing img { display: none; }
.photo-slot.missing .spec {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  aspect-ratio: 16 / 9; text-align: center; padding: var(--s-4);
  background: var(--putty); border: 1px solid var(--gold-bright);
}
.photo-slot.missing .spec .spec-tag {
  font-size: var(--text-xs); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--bronze); border: 1px solid var(--gold-bright); padding: 0.2rem 0.9rem; margin-bottom: var(--s-2);
}
.photo-slot.missing .spec p { font-family: var(--font-display); font-style: italic; font-size: var(--text-lg); color: var(--ink); max-width: 34rem; }
.photo-slot.missing .spec .spec-file { font-family: monospace; font-style: normal; font-size: var(--text-sm); color: var(--warm-gray); margin-top: var(--s-2); }
