/* johnmartines.com — the page is a dive. Sky and surface at the top, shallow water,
   a thermocline, then the deep and the bottom of the lake.
   Colors come from the Portico theme kit (17 palettes x 24 shades x 3 contrast
   levels): theme-init.js writes every token below onto <html>, measured for
   contrast. The hex values here are only the fallback if the scripts never run:
   Newton & Elk, "Light". Rules use tokens, never hex. Text sits only on grounds
   the contrast check measures: --bg / --bg-alt / --raised up top, --deep-1 /
   --deep-2 / --deep-raised below the thermocline. */

:root {
  --bg: #f1f5f5;
  --bg-alt: #e0eae8;
  --raised: #fafcfc;
  --ink: #252929;
  --ink-soft: #5b6563;
  --line: #d0dddb;
  --accent: #376b86;
  --accent-strong: #315465;
  --flag: #a2382a;
  --glow: rgba(235, 195, 125, 0.2);

  --deep-1: #253237;
  --deep-2: #0a0c0c;
  --deep-ink: #dee9e7;
  --deep-soft: #c0ccca;
  --deep-line: #434f53;
  --deep-raised: #2c393e;
  --deep-accent: #6faece;
  --on-deep-accent: #0a0c0c;

  --todo-bg: #fff1a0;
  --todo-ink: #3a3000;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: 1.25rem;
  --gauge-room: 0rem;
  color-scheme: light;
}
@media (min-width: 900px) { :root { --gauge-room: 7.5rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
cite { font-style: italic; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 calc(var(--gutter) + var(--gauge-room)) 0 var(--gutter); }
.wrap > *, .surface-grid > *, .logs > *, .water-book > * { min-width: 0; }

.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 40; background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; border-radius: 6px; }
.skip:focus { top: 0.75rem; }

/* ---------- header (above the water) ---------- */
.site-header { position: relative; background: var(--bg); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.wordmark {
  font: 700 1.15rem/1 var(--display); color: var(--ink); text-decoration: none;
  white-space: nowrap; margin-right: auto; padding: 0.75rem 0;
}
.wordmark::before {
  /* the diver-down flag: red field, white diagonal (a real flag, so the stripe stays white) */
  content: ""; display: inline-block; width: 0.85em; height: 0.62em; margin-right: 0.5em;
  vertical-align: -0.02em; border-radius: 2px;
  background: linear-gradient(to bottom right, var(--flag) 0 40%, #fff 40% 60%, var(--flag) 60%);
}
nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; order: 2; }
nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.7rem 0; }
nav a:hover { color: var(--accent); }
.theme { order: 3; }
@media (max-width: 639px) {
  .theme { order: 1; }
  nav { flex-basis: 100%; }
}

/* ---------- depth marks ---------- */
.mark {
  display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.5rem;
  font: 700 0.78rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.mark b { font-weight: 700; background: var(--accent); color: var(--bg); padding: 0.35rem 0.55rem; border-radius: 5px; letter-spacing: 0.06em; }
.mark::after { content: ""; flex: 1; border-top: 1px dashed currentColor; opacity: 0.5; }

.zone { position: relative; padding: clamp(4rem, 10vw, 7rem) 0; }
.zone h2 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1.25rem; }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.55; max-width: 40rem; margin-bottom: 2.5rem; text-wrap: pretty; }

/* ---------- surface: on the boat, sun glow ---------- */
.surface { background: radial-gradient(120% 100% at 85% -10%, var(--glow), transparent 62%), var(--bg); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.surface-grid { display: grid; gap: 2.5rem; align-items: end; }
@media (min-width: 900px) { .surface-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 3.5rem; } }
.surface h1 { font-size: clamp(3.1rem, 10vw, 7rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); max-width: 36rem; margin: 1.5rem 0 0; text-wrap: pretty; }
.brief {
  display: inline-flex; align-items: center; gap: 0.6rem; margin: 2.25rem 0 0;
  font: 500 0.85rem/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-soft);
}
.brief::before { content: "↓"; font-size: 1.1rem; color: var(--accent); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }

.plan { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem 1.4rem 1rem; }
.zone .plan-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 1.15rem; margin-bottom: 0.6rem; }
.plan-title span { font: 500 0.78rem var(--mono); color: var(--ink-soft); letter-spacing: 0.04em; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { position: relative; padding: 0.55rem 0 0.55rem 1.6rem; border-top: 1px solid var(--line); font-size: 0.98rem; line-height: 1.45; }
.plan li::before { content: ""; position: absolute; left: 0; top: 0.8rem; width: 0.85rem; height: 0.85rem; border: 2px solid var(--accent); border-radius: 50%; }

/* ---------- the waterline and the shallows ---------- */
.waterline { display: block; width: 100%; height: clamp(36px, 6vw, 80px); background: var(--bg); margin-bottom: -1px; }
.waterline path { fill: var(--bg-alt); }
.shallow { position: relative; overflow: hidden; background: var(--bg-alt); }
.rays {
  position: absolute; inset: 0 0 auto 0; height: 60%; pointer-events: none; opacity: 0.55;
  background: repeating-linear-gradient(100deg, transparent 0 70px, color-mix(in srgb, var(--raised) 55%, transparent) 70px 120px, transparent 120px 230px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
  animation: sway 14s ease-in-out infinite alternate;
}
@keyframes sway { from { transform: translateX(-40px) skewX(-2deg); } to { transform: translateX(40px) skewX(2deg); } }
.shallow .zone + .zone { padding-top: 0; }

.logs { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 760px) { .logs { grid-template-columns: 1fr 1fr; } }
.log { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.5rem 0.6rem; }
.log-label { font: 700 0.75rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.log ul { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.log li { padding: 0.6rem 0; border-top: 1px solid var(--line); line-height: 1.5; }
.log li:first-child { border-top: 0; padding-top: 0; }
.log h3 { font-size: clamp(1.45rem, 2.4vw, 1.75rem); margin-bottom: 0.25rem; }
.log-meta { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1rem; }
.log .ticks li { position: relative; border-top: 0; padding: 0.4rem 0 0.4rem 1.6rem; }
.log .ticks li::before { content: "✓"; position: absolute; left: 0; top: 0.4rem; font-weight: 700; color: var(--accent); }
.byday { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: -1rem 0 2rem; color: var(--ink-soft); }
.byday .log-label { margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-weight: 600; }
.links a { text-decoration: none; padding: 0.4rem 0; }
.links a:hover { text-decoration: underline; }

.shelf {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; gap: 1.75rem 1rem; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
}
.shelf img {
  width: 100%; aspect-ratio: 5 / 8; object-fit: cover; border-radius: 3px 7px 7px 3px; margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 12px 22px -10px rgb(0 0 0 / 0.4);
  transition: transform 0.25s ease;
}
.shelf li:hover img { transform: translateY(-4px) rotate(-1deg); }
.shelf span { display: block; font: 600 0.88rem/1.3 var(--display); }

/* ---------- thermocline: shallow turns deep. Its one line sits on solid --deep-1. ---------- */
.thermocline {
  display: flex; align-items: flex-end; height: clamp(9rem, 20vw, 13rem);
  background: linear-gradient(to bottom, var(--bg-alt) 0%, var(--deep-1) 72%, var(--deep-1) 100%);
}
.thermocline p { margin: 0 auto; padding-bottom: 1rem; font: 500 0.8rem/1 var(--mono); letter-spacing: 0.08em; color: var(--deep-soft); }

/* ---------- the deep ---------- */
.deep { position: relative; overflow: hidden; background: linear-gradient(to bottom, var(--deep-1), var(--deep-2) 90%); color: var(--deep-ink); }
.deep p, .deep li { color: var(--deep-soft); }
.deep h2, .deep h3, .deep .lead { color: var(--deep-ink); }
.deep a { color: var(--deep-accent); }
.deep a:hover { color: var(--deep-ink); }
.deep .mark, .deep .log-label { color: var(--deep-accent); }
.deep .mark b { background: var(--deep-accent); color: var(--on-deep-accent); }
.deep .log { background: var(--deep-raised); border-color: var(--deep-line); }
.deep .log li { border-color: var(--deep-line); }
.deep :focus-visible { outline-color: var(--deep-accent); }

.water-book { display: grid; gap: 1.75rem; align-items: center; margin-top: 3.5rem; padding-top: 3rem; border-top: 1px dashed var(--deep-line); }
@media (min-width: 760px) { .water-book { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 3rem; } }
.water-book img { width: min(14rem, 60%); border-radius: 3px 7px 7px 3px; box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.7); }
@media (min-width: 760px) { .water-book img { width: 100%; } }
.water-book h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.subtitle { font-style: italic; margin-top: 0.4rem; }
.water-book blockquote { margin: 1.5rem 0; padding-left: 1.1rem; border-left: 3px solid var(--deep-accent); }
.water-book blockquote p { font: 600 1.45rem/1.3 var(--display); color: var(--deep-ink); margin: 0; }
.status { font-weight: 600; }

.bottom { text-align: center; padding-bottom: clamp(5rem, 10vw, 7rem); }
.bottom .wrap { display: flex; flex-direction: column; align-items: center; }
.bottom .mark { width: 100%; }
.bottom .lead { margin-bottom: 1.5rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 48px; padding: 0.75rem 1.4rem;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 1.02rem;
  background: var(--deep-accent); color: var(--on-deep-accent); border: 1px solid transparent; cursor: pointer;
}
.deep .btn { color: var(--on-deep-accent); }
.deep .btn:hover { background: var(--deep-ink); color: var(--deep-2); }
.deep .btn-quiet { background: transparent; color: var(--deep-ink); border-color: var(--deep-line); }
.deep .btn-quiet:hover { background: var(--deep-raised); color: var(--deep-ink); }
.closer { font: 500 1.25rem/1.7 var(--display); color: var(--deep-ink); margin: 3.5rem 0 2.5rem; }
.deep .closer { color: var(--deep-ink); }
.fine { font-size: 0.85rem; margin: 2.5rem 0 0; }

/* bubbles: slow, few, and gone when motion is reduced */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubbles i {
  position: absolute; bottom: -20px; width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--deep-ink) 30%, transparent); animation: rise 16s linear infinite;
}
.bubbles i:nth-child(1) { left: 4%; }
.bubbles i:nth-child(2) { left: 11%; width: 5px; height: 5px; animation-delay: 4s; animation-duration: 12s; }
.bubbles i:nth-child(3) { left: 86%; animation-delay: 2s; animation-duration: 18s; }
.bubbles i:nth-child(4) { left: 92%; width: 5px; height: 5px; animation-delay: 7s; }
.bubbles i:nth-child(5) { left: 48%; width: 6px; height: 6px; animation-delay: 9s; animation-duration: 20s; }
.bubbles i:nth-child(6) { left: 70%; width: 4px; height: 4px; animation-delay: 5s; animation-duration: 13s; }
.bubbles i:nth-child(7) { left: 28%; width: 4px; height: 4px; animation-delay: 11s; animation-duration: 15s; }
.bubbles i:nth-child(8) { left: 62%; width: 7px; height: 7px; animation-delay: 1s; animation-duration: 22s; }
@keyframes rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translate(6px, -60vh); }
  100% { transform: translate(-4px, -120vh); opacity: 0; }
}

/* ---------- the gauge: a dive computer pinned to the right edge ---------- */
.gauge {
  position: fixed; z-index: 25; right: var(--gutter); top: 50%; transform: translateY(-50%);
  width: 6.25rem; padding: 0.9rem 0.75rem 0.8rem; border-radius: 18px;
  background: var(--deep-2); color: var(--deep-ink); border: 1px solid var(--deep-line);
  font-family: var(--mono); box-shadow: 0 14px 34px -12px rgb(0 0 0 / 0.55);
  pointer-events: none; /* decoration: never blocks a tap on what's under it */
}
.gauge[hidden] { display: none; }
.gauge-track { position: relative; height: min(32vh, 15rem); margin: 0.3rem 0 1rem 0.35rem; }
.gauge-track::before { content: ""; position: absolute; left: 0.35rem; top: 0; bottom: 0; width: 2px; background: var(--deep-line); border-radius: 2px; }
.tick {
  position: absolute; left: 0.35rem; top: calc(var(--at) * 1%); transform: translateY(-50%);
  display: flex; align-items: center; gap: 0.35rem; font-size: 0.68rem; line-height: 1; color: var(--deep-soft);
}
.tick::before { content: ""; width: 0.5rem; height: 2px; background: var(--deep-line); }
.needle {
  position: absolute; left: calc(0.35rem + 1px); top: calc(var(--d, 0) * 100%); transform: translate(-50%, -50%);
  width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--deep-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--deep-accent) 25%, transparent);
}
.readout p { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; margin: 0; font-size: 0.78rem; color: var(--deep-ink); }
.readout p + p { margin-top: 0.3rem; }
.r-label { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--deep-soft); }
.r-depth { flex-direction: column; align-items: flex-start !important; gap: 0.1rem !important; padding-bottom: 0.45rem; margin-bottom: 0.45rem !important; border-bottom: 1px solid var(--deep-line); }
.r-big { font-size: 1.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.r-big small { font-size: 0.75rem; font-weight: 500; margin-left: 0.2rem; color: var(--deep-soft); }
.gauge-warn {
  margin: 0.6rem 0 0; text-align: center; font: 700 0.8rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--deep-accent); color: var(--on-deep-accent); border-radius: 6px; padding: 0.35rem 0;
  animation: blink 0.5s steps(2, start) 4;
}
.gauge-warn[hidden] { display: none; }
@keyframes blink { to { visibility: hidden; } }

/* phones and narrow windows: a small pill in the corner instead of a tall gauge */
@media (max-width: 899px) {
  .gauge {
    top: auto; bottom: calc(0.9rem + env(safe-area-inset-bottom)); right: 0.9rem; transform: none;
    width: auto; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.85rem; border-radius: 999px;
  }
  .gauge[hidden] { display: none; }
  .gauge-track { display: none; }
  .readout { display: flex; align-items: baseline; gap: 0.75rem; }
  .readout p + p { margin-top: 0; }
  .r-depth { flex-direction: row; align-items: baseline !important; gap: 0.35rem !important; padding: 0; margin: 0 !important; border: 0; }
  .r-depth .r-label { display: none; }
  .r-big { font-size: 1.15rem; }
  .readout p:not(.r-depth) .r-label { margin-right: 0.3rem; }
  .gauge-warn { margin: 0; padding: 0.3rem 0.5rem; }
  [data-review="on"] .gauge { bottom: calc(4rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .readout p:last-child { display: none; } }

/* ---------- colors popover (Portico palettes, review mode only) ---------- */
.swatch { display: inline-block; flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 1px solid var(--line); }
.theme-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; min-height: 44px;
  font: 600 0.95rem var(--sans); color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.8rem 0.25rem 0.4rem;
}
.theme-btn[hidden] { display: none; }
.theme-btn:hover, .theme-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-soft); }
.theme-pop {
  position: absolute; right: var(--gutter); top: calc(100% - 0.35rem); z-index: 30;
  width: min(22rem, calc(100% - 2 * var(--gutter)));
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem; box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.45);
}
.theme-pop[hidden] { display: none; }
.pop-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font: 700 0.72rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 0.5rem;
}
.pop-label span { letter-spacing: 0.04em; text-transform: none; font: 600 0.9rem var(--sans); color: var(--ink); }
.palettes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; max-height: 15.5rem; overflow-y: auto; margin-bottom: 1.1rem; padding: 2px; }
.palette, .seg button {
  display: flex; align-items: center; gap: 0.5rem; min-width: 0; min-height: 44px; cursor: pointer;
  padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--ink); font: 600 0.9rem var(--sans); text-align: left;
}
.palette span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette:hover, .seg button:hover { background: var(--bg-alt); }
.palette[aria-pressed="true"], .seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--accent); }
.shade-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; cursor: pointer; font-size: 1rem; box-shadow: inset 0 0 0 1px var(--line); }
.shade-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 999px; background: var(--raised); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
.shade-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 999px; background: var(--raised); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
.shade-slider::-moz-range-track { background: transparent; }
.pop-ends { display: flex; justify-content: space-between; font: 500 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin: 0.4rem 0 1.1rem; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.seg button { justify-content: center; text-align: center; }

/* ---------- motion off, and the contrast levels (data-contrast, set by theme-init.js) ---------- */
@media (prefers-reduced-motion: reduce) {
  .bubbles, .rays { display: none; }
  .brief::before, .gauge-warn { animation: none; }
  .shelf img { transition: none; }
}
[data-contrast="high"] main a:not(.btn),
[data-contrast="max"] main a:not(.btn),
[data-contrast="max"] nav a { text-decoration: underline; }
[data-contrast="max"] .log,
[data-contrast="max"] .plan,
[data-contrast="max"] .gauge,
[data-contrast="max"] .theme-pop,
[data-contrast="max"] .theme-btn { border-width: 2px; }
[data-contrast="max"] :focus-visible { outline-width: 4px; }
[data-contrast="max"] .bubbles,
[data-contrast="max"] .rays { display: none; }

/* ---------- placeholders + review mode (never visible to the public) ---------- */
.todo { display: none !important; }
[data-review="on"] .todo { display: inline-flex !important; }
[data-review="on"] .todo::after {
  content: " [" attr(data-todo) "]";
  margin-left: 0.3em; background: var(--todo-bg); color: var(--todo-ink); font-weight: 700; font-size: 0.8em;
  padding: 0 0.3em; border-radius: 3px;
}
[data-review="on"] body { padding-bottom: 3.5rem; }
.review-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
  background: #1d1d1d; color: #f2f2f2; font-size: 0.92rem;
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.25);
}
.review-bar[hidden] { display: none; }
.review-tag { background: var(--todo-bg); color: var(--todo-ink); font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 4px; }
.review-note { color: #bdbdbd; }

/* book covers link to their page on Applied AI Insider */
.shelf a { display: block; color: var(--ink); text-decoration: none; }
.shelf a:hover span { color: var(--accent); text-decoration: underline; }
.shelf a:hover img { transform: translateY(-4px) rotate(-1deg); }

/* ---------- water: family, the dated barefoot log, videos ---------- */
.family {
  margin: 0 0 1.5rem; padding: 1.5rem 1.6rem 0.5rem; border-radius: 16px;
  background: var(--deep-raised); border: 1px solid var(--deep-line);
}
.family > p:not(.log-label) { color: var(--deep-ink); font-size: 1.05rem; line-height: 1.6; max-width: 46rem; }
.family blockquote { margin: 1.25rem 0 1rem; padding-left: 1.1rem; border-left: 3px solid var(--deep-accent); }
.family blockquote p { font: 600 1.35rem/1.3 var(--display); color: var(--deep-ink); margin: 0; }

.log .dated li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; }
.log .dated b { font: 700 0.85rem/1.5 var(--mono); color: var(--deep-accent); }
.log-note { font-size: 0.95rem; font-style: italic; }
.log-note + .log-note { font-style: normal; }

.videos { margin-top: 3rem; }
.vid-group { font: 700 0.75rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--deep-soft); margin: 1.5rem 0 0.75rem; }
.vid-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.vid { display: block; text-decoration: none; color: var(--deep-ink); }
.deep .vid, .deep .vid:hover { color: var(--deep-ink); }
.vid-thumb, .vid-frame {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px;
  background: var(--deep-raised); border: 1px solid var(--deep-line);
}
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.vid:hover .vid-thumb img { transform: scale(1.04); }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute; left: 50%; top: 50%; width: 3.25rem; height: 3.25rem; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--deep-accent); box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
}
.play::after {
  content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 0.6rem 0 0.6rem 0.95rem; border-color: transparent transparent transparent var(--on-deep-accent);
}
.vid-title { display: block; margin-top: 0.55rem; font: 600 0.95rem/1.35 var(--sans); }
.vid:hover .vid-title { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .vid-thumb img { transition: none; } }
.vid-intro { max-width: 40rem; margin: -0.25rem 0 0.9rem; }
.family-line { font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-soft); max-width: 36rem; margin: 0.9rem 0 0; }

/* ---------- work: the highlight row ---------- */
.stats {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats li {
  display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.1rem 1rem;
  background: var(--raised); border: 1px solid var(--line); border-radius: 14px;
}
.stats b { font: 800 clamp(2rem, 4.2vw, 2.8rem)/1 var(--display); letter-spacing: -0.03em; color: var(--accent); }
.stats span { font-size: 0.92rem; line-height: 1.4; color: var(--ink-soft); }
.lead-2 { font: 600 clamp(1.1rem, 1.8vw, 1.3rem)/1.45 var(--display); max-width: 40rem; margin: 0 0 2.25rem; text-wrap: pretty; }
[data-contrast="max"] .stats li { border-width: 2px; }
