/* Tokens. White ground, near-black ink, two greys, one blue, hairlines.
   Every colour has a value in both blocks. */
:root {
  --bg:        #ffffff;
  --ink:       #1d1d1f;
  --ink-2:     #6e6e73;
  --ink-3:     #86868b;
  --hair-soft: #e8e8ed;
  --hair:      #d2d2d7;
  --tint:      #f5f5f7;
  --link:      #0066cc;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap:   60rem;   /* the one column: every rule and every line of text share it */
  --gutter: 28px;
  --when:   10rem;   /* left-hand label column in .rows */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #000000;
    --ink:       #f5f5f7;
    --ink-2:     #a1a1a6;
    --ink-3:     #86868b;
    --hair-soft: #2a2a2e;
    --hair:      #38383d;
    --tint:      #1d1d1f;
    --link:      #2997ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.62 var(--font-sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.028em;
  text-wrap: balance;
  line-height: 1.08;
}
h1 { font-size: clamp(1.75rem, 3.6vw, 2.3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.28rem, 2.2vw, 1.55rem); }
h3 { font-size: 1.02rem; letter-spacing: -0.02em; line-height: 1.3; }
p { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.eyebrow { font: 500 0.8rem/1 var(--font-sans); letter-spacing: 0.01em; color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0; }

/* Masthead. Identical on every page: nav in the eyebrow slot, h1, standfirst,
   optional meta line. Same padding everywhere so nothing jumps between pages. */
header.top .wrap {
  padding-block: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.eyebrow-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; line-height: 1.4; margin-bottom: 14px; }
.eyebrow-nav a { color: var(--ink-3); }
.eyebrow-nav a:hover { color: var(--link); text-decoration: none; }
.eyebrow-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.sub {
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.55;
  letter-spacing: -0.012em;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.meta a { color: var(--ink-2); }
.meta a:hover { color: var(--link); text-decoration: none; }

/* Sections: hairline drawn inside the column, same width as the text */
section > .wrap { padding-bottom: 34px; }
section > .wrap::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 34px;
  background: var(--hair-soft);
}
section[id] { scroll-margin-top: 24px; }
.shead {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}
.shead .eyebrow { order: -1; }
.empty { color: var(--ink-3); }
.pill-link {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border: 1px solid var(--hair); border-radius: 980px;
  font-size: 0.84rem; font-weight: 500; line-height: 1.2; color: var(--ink); white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.pill-link:hover { border-color: var(--link); color: var(--link); text-decoration: none; }
.meta { align-items: center; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
a.pill-link--accent { color: var(--bg); }
.meta .pill-link { margin-left: auto; }
.pill-link--accent { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.meta a.pill-link--accent { color: var(--bg); }
.pill-link--accent:hover, .meta a.pill-link--accent:hover { background: var(--link); border-color: var(--link); color: #fff; }
@media (max-width: 640px) { .meta .pill-link { margin-left: 0; } }

/* Rows: mono label on the left, hairline between items. Baseline-aligned so
   the label sits on the first line of text. */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: var(--when) 1fr;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--hair-soft);
}
.row:first-child { border-top: none; padding-top: 0; }
.row__when {
  font: 400 0.82rem/1.55 var(--font-mono);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row__main {
  min-width: 0;
  font-size: 0.98rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.row__main p + p { margin-top: 0.5em; }
.row__title {
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.35;
}
.row__title a { color: inherit; }
.row__title a:hover { color: var(--link); text-decoration: none; }
.row__sub { font-size: 0.9rem; line-height: 1.5; color: var(--ink-3); }
.row__sub b { font-weight: 500; color: var(--ink-2); }
.row__note { font-size: 0.8rem; line-height: 1.5; color: var(--ink-3); }
.row__sub sup, .row__note sup { font-size: 0.7em; line-height: 0; vertical-align: 0.45em; }
.row__note sup { margin-right: 0.1em; }
.row__body { color: var(--ink-2); font-size: 0.95rem; }
.row__body ul { margin: 0.45em 0 0; padding-left: 1.15em; }
.row__body li + li { margin-top: 0.25em; }
.row__src {
  margin-top: 3px;
  font: 400 0.78rem/1.55 var(--font-mono);
  color: var(--ink-3);
  word-break: break-word;
}
.row__src a { color: var(--ink-2); }
.row__src a:hover { color: var(--link); }
.row__src a + a { margin-left: 14px; }
/* Gallery: photos and videos side by side at one height; swipe or scroll,
   the next item peeks in from the right. CSS scroll-snap, no JavaScript. */
.gallery {
  --slide: 23rem;
  margin-top: 10px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--hair) transparent;
}
.gallery > figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; height: var(--slide); }
.gallery img { display: block; height: 100%; width: auto; max-width: none; border-radius: 10px; }
.video { position: relative; display: block; height: 100%; border-radius: 10px; overflow: hidden; background: var(--tint); }
.video img { height: 100%; width: 100%; object-fit: cover; }
.video::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center / 34px no-repeat;
  transition: background-color 0.15s;
}
.video:hover::after { background-color: rgba(0, 0, 0, 0.8); }
.gallery .wide { width: calc(var(--slide) * 16 / 9); }
.gallery video { display: block; width: 100%; height: 100%; max-height: var(--slide); border-radius: 10px; background: #000; object-fit: cover; }
.gallery .tall { width: calc(var(--slide) * 3 / 4); overflow: hidden; border-radius: 10px; }

/* Prose: long-form review pages */
.prose { font-size: 1rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.28rem; margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose li > p { margin: 0; }
.prose blockquote { margin-left: 0; padding-left: 1em; border-left: 2px solid var(--hair); color: var(--ink-2); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0; }
.prose pre { background: var(--tint); padding: 12px 15px; border-radius: 10px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.6; letter-spacing: 0; }
.prose pre code { font-size: inherit; }
.prose .note { background: var(--tint); border-radius: 10px; padding: 13px 16px; font-size: 0.93rem; line-height: 1.55; color: var(--ink-2); }
.prose .note b { color: var(--ink); font-weight: 600; }
.prose .scroll { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.prose thead tr { border-bottom: 1px solid var(--hair); }
.prose th { text-align: left; padding: 0 14px 8px; vertical-align: bottom; font-weight: 500; }
.prose td { padding: 8px 14px; border-bottom: 1px solid var(--hair-soft); vertical-align: top; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose tbody tr:last-child td { border-bottom: none; }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose figure { margin: 0; }
.prose figure img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.prose figcaption { font-size: 0.84rem; color: var(--ink-3); margin-top: 0.5em; }
.backlink { font-family: var(--font-mono); font-size: 0.84rem; }

/* Footer */
.site-footer .wrap { padding-block: 0 44px; }
.site-footer .wrap::before { content: ""; display: block; height: 1px; margin-bottom: 30px; background: var(--hair-soft); }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; align-items: start; }
.footer-cols:has(.footer-portrait) { grid-template-columns: 120px repeat(3, minmax(0, 1fr)); column-gap: 48px; }
.footer-portrait { margin-right: 24px; }
.footer-portrait { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 50%; }
.footer-h { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em; color: var(--ink-3); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; line-height: 1.9; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--link); text-decoration: none; }
.footer-base { margin-top: 28px; font-size: 0.78rem; color: var(--ink-3); }
@media (max-width: 640px) {
  .footer-cols, .footer-cols:has(.footer-portrait) { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .footer-portrait { grid-column: 1 / -1; width: 96px; height: 96px; margin-right: 0; }
  .footer-cols > div:last-child { grid-column: 1 / -1; }
  .row__src { font-size: 0.82rem; line-height: 1.6; }
  .meta a:not(.pill-link) { display: inline-block; padding: 9px 0; }
  .row__src { line-height: 2.1; }
  .row__src a { padding: 8px 0; }
  .row__src a + a { margin-left: 18px; }
  .meta { gap: 0 20px; }
  .pill-link { padding: 9px 18px; font-size: 0.9rem; }
  .meta .pill-link { margin-top: 6px; }
  .eyebrow-nav a { display: inline-block; padding: 6px 0; }
  .eyebrow-nav { gap: 0 18px; }
  .gallery .wide { width: 88%; height: auto; aspect-ratio: 16 / 9; align-self: center; }
  .gallery .wide video { height: 100%; }
  .site-footer li { overflow-wrap: anywhere; }
}

/* Subscribe dialog */
.subscribe { width: min(420px, calc(100vw - 32px)); padding: 22px 26px 24px; border: 1px solid var(--hair-soft); border-radius: 14px; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,0.18); }
.subscribe::backdrop { background: rgba(0,0,0,0.35); }
.subscribe h2 { font-size: 1.28rem; margin-bottom: 6px; }
.subscribe__close-row { display: flex; justify-content: flex-end; margin: -8px -12px 0 0; }
.subscribe__close { all: unset; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--ink-3); padding: 4px 8px; border-radius: 6px; }
.subscribe__close:hover { color: var(--ink); }
.subscribe__note { color: var(--ink-2); font-size: 0.95rem; }
.subscribe__form { display: flex; gap: 8px; margin-top: 16px; }
.subscribe__form input { flex: 1; min-width: 0; font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg); padding: 8px 14px; border: 1px solid var(--hair); border-radius: 980px; outline: none; }
.subscribe__form input:focus { border-color: var(--link); }
.subscribe__form button { cursor: pointer; font: inherit; font-size: 0.9rem; font-weight: 500; }
.subscribe__fine { margin-top: 14px; font-size: 0.78rem; color: var(--ink-3); }
.subscribe__fine a { color: var(--ink-2); }

@media (max-width: 640px) {
  .wrap { padding-inline: 22px; }
  header.top .wrap { padding-block: 24px 22px; }
  section > .wrap { padding-bottom: 26px; }
  section > .wrap::before { margin-bottom: 26px; }
  .row { grid-template-columns: 1fr; row-gap: 4px; }
  .gallery { --slide: 16rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  :root { --bg: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; --link: #000; --hair-soft: #bbb; }
  .eyebrow-nav { display: none; }
  body { font-size: 10.5pt; }
  .row { break-inside: avoid; }
}
