/* GoodDay Picks: a field guide to everyday things.
   Cloth binding (putty grey + field green) for the frame, a near-white page for reading,
   nine thumb-index colours for the aisles. One 8px module, one type ramp. */

:root {
  --cloth: #a8a8aa;
  --cloth-2: #b4b4b6;
  --cloth-ink: #0e0e0e;
  --green: #1f5c49;
  --green-2: #174636;
  --green-tint: #e3ece8;
  --page: #fafaf9;
  --paper: #ffffff;
  --ink: #141414;
  --ink-2: #474a48;
  --ink-3: #5f6361;
  --rule: #dcdcd8;
  --rule-2: #c9c9c4;
  --hl: #f4e27a;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  /* One ramp: each step 1.25x */
  --t-1: 0.8125rem;
  --t0: 1rem;
  --t1: 1.25rem;
  --t2: 1.5625rem;
  --t3: 1.953rem;
  --t4: 2.441rem;
  --t5: clamp(2.4rem, 1.6rem + 3vw, 3.815rem);

  --u: 8px;
  --gut: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --r: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --aisle: var(--green);
  --aisle-ink: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 var(--t0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--green);
  scrollbar-color: var(--cloth) var(--page);
}
::selection { background: var(--hl); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Promo strip ---------- */
.promo {
  display: flex; justify-content: center; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 10px var(--gut); background: var(--green); color: #fff;
  font-size: var(--t-1); text-decoration: none; text-align: center;
}
.promo__go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.promo__go .ico { transition: transform .3s var(--ease); }
.promo:hover .promo__go .ico { transform: translateX(3px); }

/* ---------- Masthead: the cloth cover ---------- */
.mast {
  background: var(--cloth);
  color: var(--cloth-ink);
}
.mast__row { display: flex; align-items: center; gap: 24px; min-height: 80px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo__mark svg { width: 34px; height: 34px; fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; }
.logo__mark circle { fill: var(--hl); }
.logo__word { font: 400 1.9rem/1 var(--serif); letter-spacing: -0.01em; }
.logo__word em { font-style: italic; color: var(--green); }
.mast__tag { font-size: var(--t-1); color: #2b2d2c; padding-left: 20px; border-left: 1px solid rgba(0,0,0,.25); }
.mast__links { margin-left: auto; display: flex; gap: 24px; font-size: .9375rem; font-weight: 500; }
.mast__links a, .foot a, .crumbs a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); padding: 6px 0; }
.mast__links a:hover, .foot a:hover, .crumbs a:hover { background-size: 100% 1px; }

/* Thumb index: tabs hanging from the cloth */
.index { position: relative; height: 0; z-index: 5; }
.index__row { display: flex; gap: 6px; overflow: hidden; padding-bottom: 16px; }
.tab {
  --drop: 30px;
  display: flex; align-items: flex-end; justify-content: center;
  min-width: 76px; height: calc(var(--drop) + 4px); padding: 0 14px 8px;
  background: var(--aisle); color: var(--aisle-ink);
  border-radius: 0 0 var(--r) var(--r);
  font-size: var(--t-1); font-weight: 600; letter-spacing: .01em; text-decoration: none;
  box-shadow: 0 6px 12px -8px rgba(0,0,0,.45);
  transition: height .35s var(--ease), transform .35s var(--ease);
  animation: tab-drop .7s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
.tab:hover { height: calc(var(--drop) + 12px); }
.tab:active { transform: translateY(1px); }
.tab.is-on { height: calc(var(--drop) + 20px); }
.seen .tab { animation: none; }
@keyframes tab-drop { from { transform: translateY(-100%); } to { transform: none; } }

main { display: block; padding-top: 72px; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r);
  font: 600 .9375rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(0,0,0,.45); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn--solid { background: var(--green); color: #fff; }
.btn--solid:hover { background: var(--green-2); }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--green-2); }
.btn--light:hover { background: var(--hl); }
.btn--ghost-light { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* Highlighter swipe on the one line that matters */
.hl {
  background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%) 0 0 / 100% 100% no-repeat;
  color: inherit; padding: 0 .1em;
  animation: hl-draw 1.1s var(--ease) .5s both;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@keyframes hl-draw { from { background-size: 0 100%; } }

/* ---------- Section heads ---------- */
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px 40px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--ink); margin-bottom: 32px; }
.sec-h { font: 400 var(--t4)/1.05 var(--serif); letter-spacing: -0.015em; }
.sec-sub { color: var(--ink-3); max-width: 44ch; font-size: .9375rem; }

/* ---------- Lead (pinned plate) ---------- */
.lead { padding-bottom: 96px; }
.lead__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 40px; align-items: center; min-height: calc(100svh - 230px); }
.lead__img { grid-column: 1 / 8; position: relative; display: block; overflow: hidden; border-radius: 2px; background: var(--cloth-2); }
.lead__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .8s var(--ease); }
.lead__img:hover img { transform: scale(1.025); }
.lead__body { grid-column: 8 / 13; display: grid; gap: 20px; }
.lead__h { font: 400 var(--t5)/1.02 var(--serif); letter-spacing: -0.02em; }
.lead__h a { text-decoration: none; }
.lead__h a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.lead__meta, .post-head__meta { font-size: var(--t-1); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.lead__ex { font-size: var(--t1); line-height: 1.45; color: var(--ink-2); }
.lead__pick { padding: 16px 0; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); line-height: 1.55; }
.lead__pick-name { display: block; font: italic 400 var(--t2)/1.2 var(--serif); margin-bottom: 4px; }

/* ---------- Plates (post cards) ---------- */
.latest { padding-bottom: 104px; }
.plates { display: grid; grid-template-columns: repeat(6, 1fr); gap: 48px 32px; }
.plate { grid-column: span 2; }
.plate--lg { grid-column: span 3; }
.plate__link { display: grid; gap: 10px; text-decoration: none; height: 100%; align-content: start; transition: transform .35s var(--ease); }
.plate__link:hover { transform: translateY(-2px); }
.plate__img { position: relative; overflow: hidden; border-radius: 2px; background: var(--cloth-2); margin-bottom: 8px; }
.plate__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s var(--ease); }
.plate--lg .plate__img img { aspect-ratio: 16 / 10; }
.plate__link:hover .plate__img img { transform: scale(1.03); }
.plate__tab, .lead__img .plate__tab {
  position: absolute; top: 0; right: 16px;
  padding: 14px 10px 8px; min-width: 64px; text-align: center;
  background: var(--aisle); color: var(--aisle-ink);
  font: 600 .75rem/1 var(--sans); letter-spacing: .02em;
  border-radius: 0 0 var(--r) var(--r);
}
.plate__title { font: 400 var(--t2)/1.12 var(--serif); letter-spacing: -0.01em; }
.plate--lg .plate__title { font-size: var(--t3); }
.plate__link:hover .plate__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.plate__pick { font-size: .9375rem; color: var(--ink-2); line-height: 1.45; }
.plate__pick span { font-weight: 600; color: var(--green); margin-right: 4px; }
.plate__meta { font-size: var(--t-1); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.img-missing { aspect-ratio: 3 / 2; background: var(--cloth-2); }

/* ---------- Pager ---------- */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: .9375rem; font-weight: 500; }
.pager__step { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.pager__step[rel="next"] { justify-self: end; }
.pager__step:hover { text-decoration: underline; text-underline-offset: 4px; }
.pager__nums { display: flex; gap: 6px; }
.pager__n { display: grid; place-items: center; min-width: 44px; height: 44px; border-radius: var(--r); text-decoration: none; font-variant-numeric: tabular-nums; transition: background-color .2s; }
a.pager__n:hover { background: var(--green-tint); }
.pager__n.is-on { background: var(--ink); color: #fff; }

/* ---------- The index (aisles) ---------- */
.aisles { padding-bottom: 104px; }
.aisle-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.aisle { border-bottom: 1px solid var(--rule); }
.aisle__link { display: grid; grid-template-columns: 14px 1fr auto; grid-template-areas: "tab name count" "tab last last"; gap: 2px 18px; padding: 20px 0; text-decoration: none; }
.aisle__tab { grid-area: tab; background: var(--aisle); border-radius: 0 3px 3px 0; transition: transform .35s var(--ease); transform-origin: left; }
.aisle__link:hover .aisle__tab { transform: scaleX(1.6); }
.aisle__name { grid-area: name; font: 400 var(--t3)/1.1 var(--serif); }
.aisle__count { grid-area: count; align-self: center; font-size: var(--t-1); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.aisle__last { grid-area: last; font-size: .9375rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aisle__link:hover .aisle__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* ---------- Tea band ---------- */
.tea { background: var(--green); color: #fff; padding: 72px 0; }
.tea__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; }
.tea__img { overflow: hidden; border-radius: 2px; }
.tea__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tea__body { display: grid; gap: 20px; max-width: 56ch; }
.tea__h { font: 400 var(--t4)/1.05 var(--serif); letter-spacing: -0.015em; }
.tea__body p { font-size: var(--t1); line-height: 1.5; color: #dfeae5; }

/* ---------- Category head ---------- */
.aisle-head { padding: 8px 0 48px; }
.aisle-head__grid { display: flex; justify-content: space-between; align-items: end; gap: 16px 40px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 4px solid var(--aisle); }
.aisle-head__h { font: 400 var(--t5)/1 var(--serif); letter-spacing: -0.02em; }
.aisle-head__count { color: var(--ink-3); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.latest--aisle { padding-top: 0; }

/* ---------- Post ---------- */
.post { position: relative; }
.edge-tab { position: fixed; right: 0; top: 50%; z-index: 4; transform: translateY(-50%); display: none; }
.edge-tab span {
  display: block; writing-mode: vertical-rl; padding: 18px 9px; background: var(--aisle); color: var(--aisle-ink);
  font: 600 .75rem/1 var(--sans); letter-spacing: .04em; border-radius: var(--r) 0 0 var(--r);
  box-shadow: -4px 4px 14px -8px rgba(0,0,0,.4);
}
@media (min-width: 1100px) { .edge-tab { display: block; } }
@media (max-width: 1099px) { .post-head__meta .plate-chip { display: inline-block; } .post-head__meta .plate-plain { display: none; } }

.post-head__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px 56px; align-items: end; padding-bottom: 40px; }
.post-head__text { display: grid; gap: 18px; }
.crumbs { font-size: var(--t-1); color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.post-head__h { font: 400 var(--t5)/1.02 var(--serif); letter-spacing: -0.02em; max-width: 18ch; }
.post-head__ex { font-size: var(--t1); line-height: 1.45; color: var(--ink-2); max-width: 52ch; }

.mark { position: relative; display: grid; gap: 10px; padding: 28px 24px 24px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 2px; }
.mark::before { content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 6px; background: var(--aisle); }
.mark__run { font: 600 var(--t-1)/1 var(--sans); font-style: normal; color: var(--green); letter-spacing: .02em; margin-right: 6px; vertical-align: .3em; }
.plate-chip { display: none; padding: 3px 8px; margin-right: 8px; border-radius: 0 0 4px 4px; background: var(--aisle); color: var(--aisle-ink); font-weight: 600; }
.mark__name { font: italic 400 var(--t3)/1.1 var(--serif); }
.mark__why { line-height: 1.55; color: var(--ink); }
.mark .btn { margin-top: 8px; justify-self: start; }

.post-cover { margin: 0 0 64px; overflow: hidden; border-radius: 2px; background: var(--cloth-2); }
.post-cover img { width: 100%; aspect-ratio: 21 / 10; object-fit: cover; }

.post-layout { display: grid; grid-template-columns: 220px minmax(0, 700px); gap: 64px; justify-content: center; padding-bottom: 96px; }
.toc__sticky { position: sticky; top: 32px; }
.toc__h { font: 600 var(--t-1)/1.3 var(--sans); color: var(--ink-3); letter-spacing: .02em; padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 24px 1fr; padding: 7px 0; font-size: .875rem; line-height: 1.35; text-decoration: none; color: var(--ink-2); transition: color .2s; }
.toc a::before { content: counter(toc); color: color-mix(in oklab, var(--aisle) 45%, var(--ink)); font-weight: 700; font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }
.toc a.is-on { color: var(--ink); font-weight: 600; }

.disclose { font-size: var(--t-1); color: var(--ink-3); padding: 12px 16px; background: #f0f0ed; border-radius: var(--r); margin-bottom: 40px; }
.disclose a { color: var(--green); }

/* Reading column */
.prose { font-size: 1.125rem; line-height: 1.7; color: #1d1f1e; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font: 400 var(--t3)/1.12 var(--serif); letter-spacing: -0.01em; margin-top: 2.2em; color: var(--ink); }
.prose h3 { font: 600 var(--t1)/1.3 var(--sans); margin-top: 1.8em; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--green); font-weight: 600; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 1px solid var(--ink); font: italic 400 var(--t2)/1.35 var(--serif); }
.prose code { font-size: .9em; background: #efefec; padding: 1px 5px; border-radius: 3px; }
.prose a.aff {
  display: inline-flex; align-items: center; min-height: 36px; margin-left: 6px; padding: 0 12px; border-radius: var(--r);
  background: var(--green); color: #fff; font: 600 .8125rem/1 var(--sans); text-decoration: none; vertical-align: middle;
}
.prose a.aff:hover { background: var(--green-2); }

/* Identification-key tables */
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; font-variant-numeric: tabular-nums; margin-top: 1.6em; }
.prose thead th { text-align: left; font-weight: 600; padding: 12px 14px; background: var(--aisle); color: var(--aisle-ink); }
.prose thead th:first-child { border-radius: 2px 0 0 0; }
.prose thead th:last-child { border-radius: 0 2px 0 0; }
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose tbody tr:nth-child(even) td { background: #f3f3f0; }
.prose tbody td:first-child { font-weight: 600; color: var(--ink); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 560px; }

.latest--related { padding-top: 8px; }

/* ---------- Plain pages ---------- */
.plain { padding: 16px 0 104px; }
.plain__wrap { max-width: 780px; }
.plain__h { font: 400 var(--t5)/1.02 var(--serif); letter-spacing: -0.02em; margin-bottom: 32px; }
.plain__lead { font-size: var(--t1); color: var(--ink-2); margin-bottom: 32px; }

/* ---------- Footer: back cover ---------- */
.foot { background: var(--cloth); color: var(--cloth-ink); padding: 64px 0 24px; }
.foot__grid { display: grid; grid-template-columns: 1.3fr 1.2fr .9fr; gap: 40px 48px; }
.foot__brand { display: grid; gap: 14px; align-content: start; }
.foot__brand p { max-width: 32ch; color: #1f2120; }
.foot__h { font: 600 var(--t-1)/1.3 var(--sans); letter-spacing: .02em; margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot__aisles { grid-template-columns: 1fr 1fr; column-gap: 24px; }
.foot li a { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: .9375rem; }
.dot { width: 10px; height: 14px; border-radius: 0 0 3px 3px; background: var(--aisle); flex: none; }
.foot__note { grid-column: 1 / -1; font-size: var(--t-1); color: #1f2120; max-width: 90ch; padding-top: 24px; border-top: 1px solid rgba(0,0,0,.18); }
.foot__base { margin-top: 24px; font-size: var(--t-1); color: #1f2120; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 700px); }
  .toc { display: none; }
  .plates { grid-template-columns: repeat(2, 1fr); }
  .plate, .plate--lg { grid-column: span 1; }
}
@media (max-width: 900px) {
  .mast__tag { display: none; }
  .lead__grid { gap: 28px; min-height: 0; }
  .lead__img, .lead__body { grid-column: 1 / -1; }
  .post-head__grid { grid-template-columns: 1fr; }
  .post-cover img { aspect-ratio: 3 / 2; }
  .tea__grid { grid-template-columns: 1fr; gap: 32px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mast__row { min-height: 68px; gap: 12px; }
  .logo__word { font-size: 1.6rem; }
  .logo__mark svg { width: 28px; height: 28px; }
  .mast__links { gap: 16px; font-size: .875rem; }
  .promo { flex-wrap: nowrap; justify-content: space-between; text-align: left; }
  .promo__more { display: none; }
  .index { height: auto; background: var(--page); }
  .index__row { overflow-x: auto; scrollbar-width: none; padding: 0 var(--gut) 8px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); }
  .index__row::-webkit-scrollbar { display: none; }
  .tab { min-width: 0; flex: none; scroll-snap-align: start; margin-top: 0; height: 40px; animation: none; }
  .tab:hover { height: 40px; }
  .tab.is-on { height: 48px; }
  main { padding-top: 40px; }
  .plates { grid-template-columns: 1fr; gap: 40px; }
  .aisle-list { grid-template-columns: 1fr; }
  .lead { padding-bottom: 72px; }
  .latest, .aisles { padding-bottom: 72px; }
  .prose { font-size: 1.0625rem; }
  .post-cover { margin-bottom: 40px; margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); border-radius: 0; }
  .actions .btn { flex: 1 1 100%; }
  .mark .btn { justify-self: stretch; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager__nums { grid-column: 1 / -1; grid-row: 1; justify-content: center; flex-wrap: wrap; }
  .foot__grid { grid-template-columns: 1fr; }
}

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