/* Preamar — navy on cream, Inter, the bridge-and-waves mark, and the tide. */
:root {
  --cream: #F3EBDD; --navy: #0B1F2A; --paper: #FBF7EF;
  --muted: #4E5D63; --wave: #7C8A8D; --rule: #D9CFBE; --sand: #E7DCC6;
  --bg: var(--cream); --ink: var(--navy); --water: var(--navy);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: var(--navy); --ink: var(--cream); --water: var(--cream); --paper: #112A37; --muted: #A9B3B3; --wave: #6E7F86; --rule: #22394A; --sand: #1A3240; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, label:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
h2 { margin: 0 0 1rem; font-weight: 600; font-size: .95rem; color: var(--muted); }
p { margin: 0 0 1rem; } p:last-child { margin-bottom: 0; }

/* ---- header ---- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 3rem; padding-top: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; margin: 0; color: var(--ink); text-decoration: none; }
.lang { display: inline-flex; gap: .15rem; font-size: .85rem; font-weight: 500; letter-spacing: .06em; }
.lang a, .lang span { padding: .3rem .5rem; border-radius: 4px; text-decoration: none; color: var(--muted); }
.lang span { color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.lang a:hover { color: var(--ink); }
.mark { width: 3.1rem; height: auto; display: block; }
.wordmark { font-weight: 600; font-size: 1.35rem; letter-spacing: .18em; line-height: 1; padding-top: .1em; }

/* ---- hero with tide ---- */
.hero { position: relative; }
.hero .wrap { position: relative; z-index: 1; padding-bottom: 1.5rem; }
.batch-no { margin: 0 0 .5rem; font-weight: 500; font-size: .95rem; color: var(--muted); }
h1 { margin: 0; font-weight: 700; font-size: clamp(2.5rem, 10.5vw, 4rem); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.hero-home h1 { font-size: clamp(2rem, 7.5vw, 2.9rem); line-height: 1.1; letter-spacing: -.025em; font-weight: 600; }
.origin { margin: .9rem 0 0; font-size: 1.15rem; color: var(--muted); max-width: 30rem; }
.keys { list-style: none; margin: 2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
.keys li { display: grid; gap: .1rem; }
.keys span { font-size: .8rem; color: var(--muted); }
.keys strong { font-weight: 600; display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.tide { display: block; width: 100%; height: 130px; margin-top: -4px; overflow: hidden; }
.tide-back path { fill: var(--wave); opacity: .75; }
.tide-front path { fill: var(--water); }
@media (prefers-reduced-motion: no-preference) {
  .tide-front { animation: drift 22s linear infinite, rise 1.4s cubic-bezier(.2,.7,.2,1) both; }
  .tide-back { animation: drift 34s linear infinite reverse, rise 1.4s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes drift { from { transform: translateX(0); } to { transform: translateX(-1200px); } }
  @keyframes rise { from { translate: 0 44px; } to { translate: 0 0; } }
}

/* gauge: five bars, the tide in miniature */
.gauge { display: inline-flex; gap: 2px; align-items: flex-end; height: .85rem; }
.gauge i { display: block; width: 4px; border-radius: 1px; background: var(--rule); }
.gauge i:nth-child(1) { height: 25%; } .gauge i:nth-child(2) { height: 45%; } .gauge i:nth-child(3) { height: 62%; } .gauge i:nth-child(4) { height: 80%; } .gauge i:nth-child(5) { height: 100%; }
.gauge i.on { background: var(--ink); }

/* ---- main sections ---- */
main { padding-top: 1rem; }
main > section, .read { padding: 2rem 0; border-bottom: 1px solid var(--rule); }
main > :last-child { border-bottom: 0; }
.lead { color: var(--muted); max-width: 34rem; }

.cup .tasting { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem .6rem; font-weight: 500; font-size: 1.45rem; line-height: 1.25; letter-spacing: -.015em; }
.cup .tasting span::after { content: "·"; color: var(--rule); margin-left: .6rem; }
.cup .tasting span:last-child::after { content: none; }

/* when to drink it */
.tl { margin: 2rem 0 1.25rem; }
.tl-bar { position: relative; height: 12px; border-radius: 6px; background: var(--sand); overflow: visible; }
.tl-rest { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px 0 0 6px; background: repeating-linear-gradient(135deg, var(--rule) 0 4px, transparent 4px 8px); }
.tl-sweet { position: absolute; top: 0; height: 100%; background: var(--ink); border-radius: 6px; }
.tl-today { position: absolute; top: -6px; width: 2px; height: 24px; margin-left: -1px; background: var(--ink); }
.tl-today b { position: absolute; top: -1.35rem; left: 50%; translate: -50% 0; font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--ink); }
.tl-ticks { position: relative; height: 1.4rem; margin-top: .4rem; font-size: .75rem; color: var(--muted); }
.tl-ticks span { position: absolute; white-space: nowrap; }
.tl-ticks span:not(:first-child):not(.end) { translate: -50% 0; }
.tl-ticks .end { right: 0; }
.tl-legend { margin: 0; display: grid; gap: .6rem; }
.tl-legend div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem 1rem; align-items: baseline; }
.tl-legend dt { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.tl-legend dd { margin: 0; color: var(--muted); font-size: .95rem; }
.tl-legend i { width: 14px; height: 10px; border-radius: 3px; flex: none; }
.k-rest { background: repeating-linear-gradient(135deg, var(--rule) 0 3px, transparent 3px 6px); border: 1px solid var(--rule); }
.k-sweet { background: var(--ink); } .k-after { background: var(--sand); }

.notes blockquote { margin: 0; padding-left: 1.1rem; border-left: 3px solid var(--ink); font-size: 1.1rem; }

/* brewing guide: method tabs, no JavaScript */
.methods { margin-top: 1.25rem; }
.methods > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mtabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.mtabs label { font-weight: 500; font-size: .92rem; padding: .45rem .85rem; border: 1px solid var(--rule); border-radius: 99px; cursor: pointer; color: var(--muted); background: transparent; }
.mtabs label:hover { color: var(--ink); border-color: var(--ink); }
.mpanel { display: none; gap: 1rem; }
#m0:checked ~ .mtabs label[for="m0"], #m1:checked ~ .mtabs label[for="m1"], #m2:checked ~ .mtabs label[for="m2"], #m3:checked ~ .mtabs label[for="m3"], #m4:checked ~ .mtabs label[for="m4"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#m0:checked ~ .mpanels [data-i="0"], #m1:checked ~ .mpanels [data-i="1"], #m2:checked ~ .mpanels [data-i="2"], #m3:checked ~ .mpanels [data-i="3"], #m4:checked ~ .mpanels [data-i="4"] { display: grid; }
.methods > input:focus-visible ~ .mtabs { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.mpanel h3 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.mkeys { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; padding: 1rem 1.1rem; background: var(--paper); border-radius: 10px; }
.mkeys dt { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.mkeys dd { margin: 0; font-weight: 500; font-size: .98rem; line-height: 1.45; }
.dots { display: inline-flex; align-items: center; gap: 3px; margin-right: .5rem; vertical-align: -1px; }
.dots i { width: var(--s); height: var(--s); border-radius: 50%; border: 1.5px solid var(--ink); opacity: .35; }
.dots i.on { background: var(--ink); opacity: 1; }
.recipe p { margin-bottom: .75rem; }

.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: .1rem 0 0; font-weight: 500; }

/* ---- long reading ---- */
.read { display: grid; gap: 1.5rem; }
.toc ol { margin: 0; padding: 0 0 0 1.25rem; font-size: .95rem; line-height: 1.55; }
.toc li { padding: .1rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.long { scroll-margin-top: 1rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.long-wrap > .long:first-child { padding-top: 0; border-top: 0; }
.long h2 { font-size: 1.4rem; color: var(--ink); letter-spacing: -.02em; margin-bottom: .75rem; }
.long p { max-width: 36rem; }
@media (min-width: 64rem) {
  body.batch .read { grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; margin-left: -16rem; }
  body.batch .toc { position: sticky; top: 1.5rem; align-self: start; }
}

/* ---- home ---- */
.batches { list-style: none; margin: 0; padding: 0; }
.batches a { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: .2rem 1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--rule); text-decoration: none; }
.batches li:first-child a { border-top: 0; padding-top: .25rem; }
.h-no { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.h-main { min-width: 0; display: grid; gap: .1rem; }
.h-name { font-weight: 600; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.01em; }
.batches a:hover .h-name { text-decoration: underline; text-underline-offset: 4px; }
.h-meta { font-size: .95rem; color: var(--muted); }
.h-lv { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.legend { margin: 1.25rem 0 0; font-size: .85rem; color: var(--muted); }
.about { border-top: 0; padding-top: 1.5rem; }
.how p { color: var(--ink); }
.seas { margin-top: 1.25rem; font-size: .9rem; color: var(--muted); }

.foot { border-top: 1px solid var(--rule); margin-top: 2rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding-top: 1.5rem; padding-bottom: 3rem; font-size: .9rem; color: var(--muted); }

@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr; } .mkeys { grid-template-columns: 1fr; }
  .batches a { grid-template-columns: 4rem 1fr; } .h-lv { grid-column: 2; }
  .tl-legend div { grid-template-columns: 1fr; gap: .1rem; }
}
@media print {
  .lang, .mtabs { display: none; } .mpanel { display: grid !important; margin-bottom: 1rem; } .tide { height: 40px; }
}
