/* ============================================================
   QUINTA DO FIO — styles.css
   O RIO FAZ O VINHO. The contour line is the entire visual
   system: borders, dividers, charts, the label itself.
   Letterpress register: EB Garamond display, Inter Tight body,
   ink pressed into paper — nothing glows, nothing bounces.
   Mobile-first: base styles are the 390px experience.
   ============================================================ */

:root {
  --paper: #F2EDE3;
  --paper-deep: #EAE3D4;   /* the mat: label paper, lightbox passe-partout */
  --schist: #3B3730;
  --schist-deep: #2F2C26;  /* dark-section gradient floor */
  --ink: #33302A;
  --ink-70: rgba(51, 48, 42, 0.72);
  --ink-45: rgba(51, 48, 42, 0.46);
  --hairline: rgba(51, 48, 42, 0.18);
  --douro: #4A5D46;
  --douro-bright: #7E9873; /* the river when it runs across dark schist */
  --garrafeira: #5A1F23;
  --paper-90: rgba(242, 237, 227, 0.92);
  --paper-60: rgba(242, 237, 227, 0.60);
  --paper-30: rgba(242, 237, 227, 0.30);
  --hairline-l: rgba(242, 237, 227, 0.16);
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter Tight', 'Helvetica Neue', sans-serif;
  --gutter: clamp(20px, 5vw, 84px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--garrafeira); color: var(--paper); }

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--garrafeira); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

html { scrollbar-width: thin; scrollbar-color: var(--ink-45) var(--paper); }

/* ---------- type utilities ---------- */

.micro {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.7;
}

.en-sub {
  font-size: clamp(13px, 1vw, 15px);
  color: var(--ink-45);
  line-height: 1.6;
}
.theme-dark .en-sub { color: var(--paper-60); }

/* section opener: contour tick + PT title (serif) + EN echo (sans, quiet) */
.sec-head { margin-bottom: clamp(36px, 7vh, 84px); }
.sec-head .micro {
  color: var(--garrafeira);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.sec-head .micro::before {
  content: '';
  width: 26px;
  height: 9px;
  flex: none;
  background:
    linear-gradient(var(--garrafeira), var(--garrafeira)) 0 0 / 26px 1px no-repeat,
    linear-gradient(var(--garrafeira), var(--garrafeira)) 3px 4px / 18px 1px no-repeat,
    linear-gradient(var(--garrafeira), var(--garrafeira)) 6px 8px / 10px 1px no-repeat;
}
.theme-dark .sec-head .micro { color: var(--paper-60); }
.theme-dark .sec-head .micro::before {
  background:
    linear-gradient(var(--paper-60), var(--paper-60)) 0 0 / 26px 1px no-repeat,
    linear-gradient(var(--paper-60), var(--paper-60)) 3px 4px / 18px 1px no-repeat,
    linear-gradient(var(--paper-60), var(--paper-60)) 6px 8px / 10px 1px no-repeat;
}
.sec-title {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(34px, 6vw, 74px);
  line-height: 1.04;
  letter-spacing: -0.005em;
}
.sec-en { margin-top: 10px; }

/* ---------- contour divider (site-wide section punctuation) ---------- */

.divider {
  display: flex;
  justify-content: center;
  padding: clamp(28px, 5vh, 52px) var(--gutter);
}
.divider svg { width: 140px; height: 26px; overflow: visible; }
.divider path { fill: none; stroke: var(--ink-45); stroke-width: 1; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
  color: #C4BFB4; /* difference against paper ≈ schist ink; against schist ≈ paper */
  transition: transform 0.6s var(--ease);
}
.nav.is-hidden { transform: translateY(-130%); }
.nav-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav-links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current] { border-bottom-color: currentColor; }

/* 390px: one line, no wraps — "Colheita 2022" collapses to "2022" */
@media (max-width: 719px) {
  .nav { align-items: center; }
  .nav-mark, .nav-links a { white-space: nowrap; }
  .nav-links { gap: 16px; }
  .nav-links a { padding: 12px 2px; }
  .nav-long { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  color: var(--paper);
  overflow: clip;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { object-position: 62% 42%; }
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(47, 44, 38, 0.30), rgba(47, 44, 38, 0) 26%),
    linear-gradient(4deg, rgba(47, 44, 38, 0.78), rgba(47, 44, 38, 0.22) 46%, rgba(47, 44, 38, 0) 68%);
}
.hero-inner {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 var(--gutter) clamp(30px, 6vh, 72px);
}
.hero-kicker { color: var(--paper-60); margin-bottom: 18px; }
.hero-title {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(58px, 12.5vw, 176px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: block; }
.hero-sub {
  margin-top: 20px;
  max-width: 44ch;
  color: var(--paper-90);
  font-size: clamp(14px, 1.15vw, 17px);
}
.hero-cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(30px, 6vh, 72px);
  width: 34px;
  height: 46px;
  display: none;
}
.hero-cue path { fill: none; stroke: var(--paper-60); stroke-width: 1; }

/* ---------- generic section shell ---------- */

.section { padding: clamp(90px, 16vh, 190px) var(--gutter); }
.theme-dark {
  background: linear-gradient(180deg, var(--schist), var(--schist-deep));
  color: var(--paper-90);
}

/* ---------- manifesto ---------- */

.manifesto { padding-top: clamp(110px, 20vh, 230px); }
.manifesto-text {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(27px, 4.6vw, 62px);
  line-height: 1.22;
  max-width: 21em;
  letter-spacing: -0.002em;
}
.manifesto-text em {
  font-style: italic;
  color: var(--garrafeira);
}
.manifesto-en { margin-top: 26px; max-width: 52ch; }
.manifesto-figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 3vw, 44px);
  margin-top: clamp(48px, 9vh, 110px);
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
  max-width: 760px;
}
.mf .val {
  font-family: var(--serif);
  font-weight: 480;
  font-size: clamp(26px, 2.6vw, 40px);
  line-height: 1.1;
}
.mf .key { color: var(--ink-45); margin-top: 4px; }

/* ---------- the topography (signature) ---------- */

.topo-outer { height: 320vh; position: relative; }
.topo-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: clip;
  display: block;
}
.topo-map { position: absolute; inset: 0; width: 100%; height: 100%; }

/* contour stroke grammar — dark context (the map itself) */
.topo-map .c-fine  { fill: none; stroke: var(--paper-30); stroke-width: 0.8px; vector-effect: non-scaling-stroke; }
.topo-map .c-index { fill: none; stroke: var(--paper-60); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.topo-map .c-river { fill: none; stroke: var(--douro-bright); stroke-width: 2.4px; vector-effect: non-scaling-stroke; }
.topo-map .c-fio   { fill: none; stroke: var(--douro-bright); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.topo-map .elev {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: var(--paper-60);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--schist);
  stroke-width: 4px;
}
.topo-map .water-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  fill: var(--douro-bright);
}
.topo-map .water-name-fio { font-size: 14px; }
.topo-map .parcel-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  fill: var(--paper);
  paint-order: stroke;
  stroke: var(--schist);
  stroke-width: 5px;
}
.topo-map .parcel-band {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  fill: var(--paper-60);
  paint-order: stroke;
  stroke: var(--schist);
  stroke-width: 4px;
}
.topo-map .parcel-dot { fill: var(--paper); }

/* map furniture (HTML overlays) */
.topo-head {
  position: absolute;
  top: clamp(76px, 12vh, 120px);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 2;
  pointer-events: none;
}
.topo-head .sec-head { margin-bottom: 0; }
.topo-scale {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  z-index: 2;
  color: var(--paper-60);
}
.topo-scale .bar {
  width: 90px;
  height: 4px;
  border: 1px solid var(--paper-60);
  border-top: 0;
  margin-top: 6px;
}
.topo-cta {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  z-index: 2;
}
/* 390px: scale and CTA share the bottom edge — stack them instead */
@media (max-width: 719px) {
  .topo-scale { bottom: 18px; }
  .topo-cta { left: var(--gutter); right: auto; bottom: 76px; }
}

/* contour grammar — paper context (fragments, crops).
   Fragments render through <use>, so they are styled with inherited
   custom properties (see buildTopoDefs in contours.js). */
.topo-frag {
  display: block; width: 100%; height: 100%;
  --ct-fine: rgba(51, 48, 42, 0.30);  --ctw-fine: 0.8px;
  --ct-index: rgba(51, 48, 42, 0.55); --ctw-index: 1.3px;
  --ct-river: var(--douro);           --ctw-river: 2.2px;
  --ct-fio: var(--douro);             --ctw-fio: 1.2px;
}

/* ---------- the wine + the code label ---------- */

.wine-grid {
  display: grid;
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
}
.bottle-fig {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--schist-deep);
}
.bottle-onlabel {
  position: absolute;
  left: 37.4%;
  top: 56.5%;
  width: 19.4%;
  opacity: 0.94;
  border-radius: 4px / 7px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.bottle-onlabel::after {
  /* the glass curvature pressed over the paper */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.12) 22%,
    rgba(255, 246, 224, 0.10) 47%,
    rgba(0, 0, 0, 0.16) 78%, rgba(0, 0, 0, 0.55));
}
.bottle-onlabel svg { display: block; width: 100%; height: auto; }
.bottle-caption { margin-top: 14px; color: var(--ink-45); }

.label-stage { max-width: 400px; }
.label-artifact {
  filter: drop-shadow(0 14px 26px rgba(51, 48, 42, 0.16));
}
.label-artifact svg { display: block; width: 100%; height: auto; }
.label-note {
  margin-top: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--ink-70);
}
.label-note .en { display: block; font-family: var(--sans); font-style: normal; margin-top: 4px; }

.vintage-picker {
  display: flex;
  gap: 6px;
  margin-top: 26px;
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
}
.vintage-picker button {
  font-family: var(--serif);
  font-weight: 480;
  font-size: 19px;
  padding: 8px 14px;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink-45);
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.vintage-picker button:hover { color: var(--ink); }
.vintage-picker button[aria-pressed="true"] {
  color: var(--garrafeira);
  border-bottom-color: var(--garrafeira);
}
.vintage-data { margin-top: 12px; color: var(--ink-45); min-height: 2.6em; }

/* the label's own strokes (paper artifact) */
.wine-label .lbl-paper { fill: var(--paper-deep); stroke: var(--hairline); stroke-width: 1; }
.wine-label .lbl-rule-heavy { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.wine-label .lbl-rule-fine { fill: none; stroke: var(--ink-45); stroke-width: 0.6; }
.wine-label text { fill: var(--ink); }
.wine-label .lbl-house { font-family: var(--serif); font-weight: 550; font-size: 21px; letter-spacing: 0.24em; }
.wine-label .lbl-doc { font-family: var(--sans); font-weight: 500; font-size: 6.4px; letter-spacing: 0.22em; fill: var(--ink-70); }
.wine-label .lbl-parcel { font-family: var(--serif); font-style: italic; font-size: 11.5px; fill: var(--ink-70); }
.wine-label .lbl-year { font-family: var(--serif); font-weight: 520; font-size: 58px; letter-spacing: 0.06em; fill: var(--garrafeira); }
.wine-label .lbl-cuvee { font-family: var(--sans); font-weight: 500; font-size: 9px; letter-spacing: 0.3em; }
.wine-label .lbl-data { font-family: var(--sans); font-weight: 450; font-size: 7.2px; letter-spacing: 0.14em; fill: var(--ink-70); }
.wine-label .lbl-fine { font-family: var(--sans); font-weight: 450; font-size: 6.4px; letter-spacing: 0.2em; fill: var(--ink-45); }
.wine-label .lbl-frag {
  --ct-fine: rgba(51, 48, 42, 0.34);  --ctw-fine: 0.55px;
  --ct-index: rgba(51, 48, 42, 0.60); --ctw-index: 0.9px;
  --ct-river: var(--douro);           --ctw-river: 1.5px;
  --ct-fio: var(--douro);             --ctw-fio: 0.9px;
}
/* the tiny copy on the bottle keeps hairlines readable at 90px wide */
.bottle-onlabel .lbl-frag {
  --ctw-fine: 0.3px; --ctw-index: 0.5px; --ctw-river: 0.9px; --ctw-fio: 0.5px;
}
.bottle-onlabel .lbl-rule-heavy { stroke-width: 1; }

/* ---------- vintage diary (teaser + full) ---------- */

.diary-strip { border: 1px solid var(--hairline); padding: clamp(22px, 4vw, 48px); }
.diary-chart { width: 100%; }
.diary-chart svg { display: block; width: 100%; height: auto; overflow: visible; }

/* temperature strokes follow the contour grammar. Lines (grid, day ticks,
   cursor) hold their width at any viewport via non-scaling-stroke; the two
   temperature PATHS must not — Chromium computes dash metrics in screen
   space under non-scaling-stroke, which breaks their dash-draw reveal.
   Their mobile widths are compensated in the 719px media query instead. */
.diary-chart line, .diary-chartrow line { vector-effect: non-scaling-stroke; }
.t-max { fill: none; stroke: var(--ink-70); stroke-width: 1.5px; }
.t-min { fill: none; stroke: rgba(51, 48, 42, 0.32); stroke-width: 0.9px; }
.t-grid { stroke: var(--hairline); stroke-width: 0.7px; }
.t-gridlabel { font-family: var(--sans); font-size: 9px; font-weight: 500; letter-spacing: 0.1em; fill: var(--ink-45); }
.t-month { font-family: var(--sans); font-size: 9px; font-weight: 500; letter-spacing: 0.14em; fill: var(--ink-45); text-anchor: middle; }
.t-day { stroke-width: 1px; stroke: var(--ink-45); }
.t-mark-frost circle { fill: none; stroke: var(--ink); stroke-width: 1.2px; }
.t-mark-heat circle { fill: var(--garrafeira); }
.t-mark-rain circle { fill: var(--douro); }
.t-mark text { font-family: var(--sans); font-size: 9.5px; font-weight: 550; letter-spacing: 0.12em; fill: var(--ink); }

.diary-days {
  display: grid;
  gap: clamp(18px, 3vw, 40px);
  margin-top: clamp(26px, 4vh, 44px);
  border-top: 1px solid var(--hairline);
  padding-top: clamp(22px, 3vh, 36px);
}
.dday .micro { color: var(--ink-45); }
.dday .micro b { color: var(--garrafeira); font-weight: 550; }
.dday-temp {
  font-family: var(--serif);
  font-weight: 480;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.05;
  margin: 6px 0 8px;
}
.dday p { color: var(--ink-70); font-size: 14px; max-width: 34ch; }
.diary-cta { margin-top: clamp(28px, 4vh, 40px); }

/* ---------- text buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn:hover { background: var(--garrafeira); border-color: var(--garrafeira); color: var(--paper); }
.theme-dark .btn { border-color: var(--paper-60); color: var(--paper-90); }
.theme-dark .btn:hover { background: var(--paper); border-color: var(--paper); color: var(--schist); }
.link-quiet {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-45);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link-quiet:hover { color: var(--garrafeira); border-bottom-color: var(--garrafeira); }
.theme-dark .link-quiet { border-bottom-color: var(--paper-60); color: var(--paper-90); }
.theme-dark .link-quiet:hover { color: var(--paper); border-bottom-color: var(--paper); }

/* ---------- figures & reveals ---------- */

.fig { position: relative; overflow: hidden; background: var(--paper-deep); }
.fig img { transform: scale(1.06); }
.fig .lb-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}
.figcap { margin-top: 12px; color: var(--ink-45); font-size: 13px; }
.theme-dark .figcap { color: var(--paper-60); }
.ar-169 { aspect-ratio: 16 / 9; }
.ar-219 { aspect-ratio: 21 / 9; }
.ar-43 { aspect-ratio: 4 / 3; }
.ar-34 { aspect-ratio: 3 / 4; }
.ar-11 { aspect-ratio: 1 / 1; }

/* JS-applied reveal rest-state (no-JS users see everything) */
.js .reveal { clip-path: inset(100% 0 0 0); }
.js .reveal img { transform: scale(1.14); }

/* ---------- winemaker ---------- */

.split {
  display: grid;
  gap: clamp(36px, 6vw, 90px);
  align-items: center;
}
.split-body .name {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.08;
  margin-bottom: 6px;
}
.split-body .role { color: var(--garrafeira); margin-bottom: 26px; }
.split-body p { max-width: 54ch; color: var(--ink-70); }
.split-body p + p { margin-top: 1em; }
.split-body .en-sub { margin-top: 22px; max-width: 48ch; }

/* ---------- interlude ---------- */

.interlude { padding: 0; }
.interlude .fig { width: 100%; }
.interlude figcaption {
  padding: 14px var(--gutter) 0;
  color: var(--ink-45);
  font-size: 13px;
}

/* ---------- allocation ---------- */

.allocation { border-top: 1px solid var(--hairline); }
.alloc-grid { display: grid; gap: clamp(44px, 7vw, 110px); }
.alloc-figure .big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(110px, 20vw, 250px);
  line-height: 0.9;
  color: var(--garrafeira);
  letter-spacing: -0.01em;
}
.alloc-figure .of {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(20px, 2.2vw, 30px);
  color: var(--ink);
  margin-top: 10px;
  max-width: 15em;
  line-height: 1.3;
}
.alloc-figure .en-sub { margin-top: 14px; max-width: 40ch; }
.alloc-note {
  margin-top: clamp(28px, 5vh, 48px);
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  max-width: 44ch;
  color: var(--ink-70);
}

.alloc-form { max-width: 520px; }
.alloc-form .field { margin-bottom: 26px; }
.alloc-form label { display: block; color: var(--ink-45); margin-bottom: 8px; }
.alloc-form input, .alloc-form textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-45);
  font: inherit;
  font-family: var(--serif);
  font-size: clamp(19px, 1.6vw, 24px);
  color: var(--ink);
  padding: 6px 0 10px;
  border-radius: 0;
  transition: border-color 0.3s var(--ease);
}
.alloc-form input:focus, .alloc-form textarea:focus {
  outline: none;
  border-bottom-color: var(--garrafeira);
}
.alloc-form textarea { resize: none; min-height: 74px; }
.alloc-form .btn { margin-top: 8px; }
.alloc-success {
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.4;
  max-width: 26em;
}
.alloc-success .en-sub { margin-top: 12px; font-family: var(--sans); }

/* ---------- footer ---------- */

.footer {
  background: var(--schist);
  color: var(--paper-90);
  padding: clamp(70px, 12vh, 130px) var(--gutter) 34px;
}
.footer-topo { display: flex; justify-content: center; margin-bottom: clamp(44px, 8vh, 80px); }
.footer-topo svg { width: min(420px, 80vw); height: 60px; overflow: visible; }
.footer-topo path { fill: none; stroke: var(--paper-30); stroke-width: 1; }
.footer-topo .f-river { stroke: var(--douro-bright); stroke-width: 1.6; }
.footer-mark {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1;
  letter-spacing: 0.01em;
  margin-bottom: clamp(40px, 7vh, 72px);
}
.footer-grid {
  display: grid;
  gap: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--hairline-l);
}
.footer-grid h4 { margin-bottom: 12px; color: var(--paper-60); }
.footer-grid li { list-style: none; line-height: 1.9; font-size: 14px; }
.footer-grid a { border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease); }
.footer-grid a:hover { border-bottom-color: var(--paper-60); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: space-between;
  margin-top: clamp(44px, 8vh, 80px);
  padding-top: 22px;
  border-top: 1px solid var(--hairline-l);
  color: var(--paper-60);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- lightbox: paper-mat letterpress ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.5s var(--ease); }
.lightbox figure {
  max-width: min(1080px, 100%);
  text-align: center;
}
.lightbox .mat {
  background: var(--paper);
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 60px rgba(51, 48, 42, 0.18);
  transform: translateY(16px);
  transition: transform 0.6s var(--ease);
}
.lightbox.is-open .mat { transform: translateY(0); }
.lightbox img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70vh, 70svh);
  display: block;
}
.lightbox figcaption { margin-top: 16px; color: var(--ink-45); }
.lightbox-close {
  position: absolute;
  top: clamp(16px, 3vh, 30px);
  right: var(--gutter);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-45);
}
.lightbox-close:hover { color: var(--garrafeira); border-bottom-color: var(--garrafeira); }

/* ============================================================
   INNER PAGES — the quiet register
   ============================================================ */

.inner-hero {
  padding: clamp(130px, 22vh, 220px) var(--gutter) clamp(50px, 9vh, 100px);
}
.inner-hero .crumb { color: var(--ink-45); margin-bottom: 26px; display: block; }
.inner-hero .crumb a:hover { color: var(--garrafeira); }
.inner-title {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(44px, 8.5vw, 110px);
  line-height: 1.0;
  letter-spacing: -0.008em;
}
.inner-sub { margin-top: 20px; max-width: 52ch; }
.inner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: clamp(30px, 5vh, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-45);
}
.inner-meta b { color: var(--garrafeira); font-weight: 550; }

/* ---------- the 14-day diary (vintage detail) ---------- */

.diary-outer { position: relative; height: 780vh; }
.diary-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: clip;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(76px, 11vh, 110px) var(--gutter) clamp(22px, 4vh, 40px);
}
.diary-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.diary-head .count { color: var(--ink-45); font-variant-numeric: tabular-nums; white-space: nowrap; }
.diary-stage { position: relative; display: grid; align-items: center; min-height: 0; }
.diary-entry { max-width: 620px; }
.diary-entry .ddate {
  color: var(--garrafeira);
  margin-bottom: 8px;
}
.diary-entry .dtemp {
  font-family: var(--serif);
  font-weight: 480;
  font-size: clamp(52px, 9vw, 120px);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.diary-entry .dtemp .lo { color: var(--ink-45); font-size: 0.42em; font-weight: 450; }
.diary-entry .dnote {
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.35;
  margin-top: 16px;
  max-width: 24em;
}
.diary-entry .den { margin-top: 10px; max-width: 52ch; }
.diary-chartrow { min-height: 0; }
.diary-chartrow svg { display: block; width: 100%; height: auto; max-height: 26svh; overflow: visible; }
.t-cursor { stroke: var(--garrafeira); stroke-width: 1px; }
.t-dot { fill: var(--garrafeira); }
.t-past { fill: none; stroke: var(--ink-70); stroke-width: 1.5px; }

/* reduced-motion / fallback: the diary as a plain ledger */
.diary-list { padding: clamp(60px, 10vh, 110px) var(--gutter); display: grid; gap: 0; }
.diary-list .dl-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}
.diary-list .dl-date { color: var(--garrafeira); }
.diary-list .dl-temp { font-family: var(--serif); font-size: 21px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.diary-list .dl-temp .lo { color: var(--ink-45); font-size: 0.8em; }
.diary-list p { color: var(--ink-70); font-size: 14px; max-width: 58ch; }

/* ---------- harvest sequence / poem / allocated-out ---------- */

.seq { display: grid; gap: clamp(44px, 8vh, 90px); }
.seq-item { display: grid; gap: 22px; }
.seq-item .seq-txt p { color: var(--ink-70); max-width: 46ch; }
.seq-item .seq-txt .micro { color: var(--garrafeira); margin-bottom: 12px; }
.seq-item .seq-txt .en-sub { margin-top: 12px; }

/* assets with a baked-in paper border (lagar-night): overscan past the frame.
   The bottom border (date stamp) is deeper than the top, so the crop leans up. */
.fig.fig-crop img { width: 124%; height: 124%; margin: -11% -12% -13%; }

.poem {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.poem-lines {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(24px, 3.6vw, 44px);
  line-height: 1.5;
}
.poem-lines em { color: var(--garrafeira); }
.poem .en-sub { margin-top: 28px; }
.poem-rule { margin: 0 auto clamp(30px, 5vh, 44px); }

.allocated-out {
  text-align: center;
  border-top: 1px solid var(--hairline);
}
.allocated-out .stamp {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 40px);
  color: var(--garrafeira);
  border: 2px solid var(--garrafeira);
  padding: 10px 26px;
  transform: rotate(-2deg);
  letter-spacing: 0.06em;
}
.allocated-out p { margin: 26px auto 30px; max-width: 44ch; color: var(--ink-70); }

/* ---------- the land: parcel rows ---------- */

.parcels { display: grid; gap: clamp(64px, 12vh, 140px); }
.parcel-row { display: grid; gap: 26px; align-items: center; }
.parcel-frag {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
  background: var(--paper);
}
/* the parcel's true anchor, marked the way the map marks it */
.parcel-frag::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(50% - 8.9%); /* the crop centre sits 20 map-units below the anchor */
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--garrafeira);
}
.parcel-frag .frag-elev {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--ink-45);
}
.parcel-idx { color: var(--ink-45); margin-bottom: 10px; }
.parcel-title {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}
.parcel-data {
  margin: 14px 0 18px;
  color: var(--garrafeira);
}
.parcel-body p { color: var(--ink-70); max-width: 46ch; }
.parcel-body .en-sub { margin-top: 12px; max-width: 46ch; }

/* ---------- interlude quote ---------- */

.quote-over {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 var(--gutter) clamp(30px, 6vh, 64px);
  color: var(--paper);
  pointer-events: none; /* the lb-open button underneath stays clickable */
  text-shadow: 0 1px 14px rgba(47, 44, 38, 0.55);
}
.quote-over blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(22px, 3.4vw, 40px);
  max-width: 20em;
  line-height: 1.3;
}
.quote-over .en-sub { color: var(--paper-60); margin-top: 10px; }

/* ---------- inner-page cross link ---------- */

.inner-next {
  padding-top: 0;
  display: flex;
  justify-content: center;
}

/* ============================================================
   MOTION HYGIENE
   ============================================================ */

html.reduced .topo-outer { height: auto; }
html.reduced .topo-sticky { position: relative; height: 100svh; }
html.reduced .hero-cue { display: none !important; }
html.reduced .js .reveal, html.reduced .reveal { clip-path: none !important; }
html.reduced .reveal img { transform: scale(1.02) !important; }
html.reduced .lightbox, html.reduced .lightbox .mat, html.reduced .btn, html.reduced .nav { transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============================================================
   BREAKPOINTS — desktop is the enhancement
   ============================================================ */

@media (max-width: 719px) {
  /* the year-strip chart keeps a 1000-unit viewBox; on a narrow screen its
     type, marks and path strokes are re-set in user units so they hold
     optical size (paths can't use non-scaling-stroke — see above) */
  .diary-chart .t-month, .diary-chart .t-gridlabel,
  .diary-chartrow .t-month, .diary-chartrow .t-gridlabel { font-size: 20px; }
  .diary-chart .t-mark text { font-size: 24px; }
  .diary-chart .t-mark circle { r: 9px; }
  .t-max, .t-past { stroke-width: 3.6px; }
  .t-min { stroke-width: 2.2px; }
}

@media (min-width: 720px) {
  .hero-cue { display: block; }
  .diary-days { grid-template-columns: repeat(3, 1fr); }
  .wine-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split.split-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split.split-flip .split-media { order: 2; }
  .alloc-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: start; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .seq-item { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .seq-item.seq-flip .seq-media { order: 2; }
  .parcel-row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 90px); }
  .parcel-row.parcel-flip .parcel-frag { order: 2; }
  .manifesto-figures { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1040px) {
  .section-inset { padding-left: calc(var(--gutter) + 8vw); padding-right: calc(var(--gutter) + 8vw); }
  .diary-entry { padding-left: 8vw; }
}
