/* ==========================================================================
   patrickbenot.com — design system
   --------------------------------------------------------------------------
   Direction: a warm personal archive. Paper rather than screen — sun-bleached
   off-white, clay and ochre accents, generous margins, and photography given
   room to be the loudest thing on the page.

   Type: Fraunces (display serif, a little wonky on purpose) over Karla for
   body text, with DM Mono reserved for numbers. This site counts things
   constantly, so the numerals get their own face.

   Light is the default here. Dark is a genuine second theme — warm brown-black
   rather than the usual blue-black — not an inversion.
   ========================================================================== */

/* ---------- 1. Tokens ----------------------------------------------------- */

:root {
  color-scheme: light;

  /* Warm neutrals, lightest to darkest */
  --paper:     #fcf9f4;
  --paper-2:   #f6efe4;
  --card:      #ffffff;
  --card-2:    #faf5ed;
  --line:      #e8ddcc;
  --line-soft: #f0e8db;

  --ink:       #241f1a;
  --ink-2:     #4b4139;
  --muted:     #7d6f61;
  --faint:     #a2917f;

  /* Accents */
  --clay:      #bd5837;   /* primary — links, buttons, focus */
  --clay-deep: #99401f;   /* hover / pressed */
  --clay-wash: #f7e9e1;   /* tinted backgrounds */
  --ochre:     #b07d20;   /* numbers, counters */
  --sage:      #5d7352;   /* done, complete, success */
  --rose:      #b0453c;   /* errors */

  --bg:      var(--paper);
  --surface: var(--card);
  --border:  var(--line);
  --text:    var(--ink);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--2: clamp(0.70rem, 0.68rem + 0.10vw, 0.76rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.16vw, 1.09rem);
  --step-1:  clamp(1.18rem, 1.11rem + 0.36vw, 1.40rem);
  --step-2:  clamp(1.42rem, 1.28rem + 0.70vw, 1.85rem);
  --step-3:  clamp(1.70rem, 1.45rem + 1.25vw, 2.45rem);
  --step-4:  clamp(2.05rem, 1.60rem + 2.20vw, 3.30rem);
  --step-5:  clamp(2.45rem, 1.65rem + 4.00vw, 4.60rem);

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;
  --radius-pill: 999px;

  /* Warm shadows — brown-tinted, never grey */
  --shadow-sm: 0 1px 2px rgb(70 48 28 / 0.06), 0 2px 6px -2px rgb(70 48 28 / 0.08);
  --shadow:    0 2px 4px rgb(70 48 28 / 0.05), 0 12px 28px -14px rgb(70 48 28 / 0.28);
  --shadow-lg: 0 30px 70px -30px rgb(70 48 28 / 0.38);

  --wrap: 1140px;
  --ease: cubic-bezier(0.32, 0.08, 0.24, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper:     #17120e;
  --paper-2:   #1d1712;
  --card:      #221b15;
  --card-2:    #2a221b;
  --line:      #362c23;
  --line-soft: #2b231c;

  --ink:       #f4ece1;
  --ink-2:     #ddd0be;
  --muted:     #a89682;
  --faint:     #8a7867;

  --clay:      #e08a63;
  --clay-deep: #f0a483;
  --clay-wash: #33221a;
  --ochre:     #d9a851;
  --sage:      #8fa583;
  --rose:      #e0796d;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow:    0 2px 4px rgb(0 0 0 / 0.3), 0 14px 30px -16px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 30px 70px -30px rgb(0 0 0 / 0.8);
}

/* ---------- 2. Reset ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 40;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--clay-deep); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--clay-wash); color: var(--ink); }

hr { border: 0; border-top: 1px solid var(--line); }

/* ---------- 3. Layout ----------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.wrap-narrow {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.section-head h1,
.section-head h2 {
  font-size: var(--step-3);
  flex: 1 1 auto;
  min-width: 12ch;
}
.section-head > .eyebrow { flex: 1 0 100%; }
.section-head > .btn,
.section-head > .chips { margin-left: auto; }

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.6rem); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

.masonry {
  columns: 3 250px;
  column-gap: clamp(1rem, 2vw, 1.4rem);
}
.masonry > * {
  break-inside: avoid;
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
}

/* ---------- 4. Small text elements ---------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--clay);
  flex: 0 0 auto;
}
.eyebrow .count {
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: none;
}

.dim   { color: var(--muted); }
.small { font-size: var(--step--1); }
.mono  { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.hide  { display: none !important; }

.lead {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 62ch;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.72em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card-2);
  color: var(--muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.08em 0.34em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.6rem;
  z-index: 200;
  background: var(--clay);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { left: 0.6rem; color: #fff; }

/* ---------- 5. Buttons ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.btn-primary {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}
.btn-primary:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: #fff; }
[data-theme="dark"] .btn-primary { color: #1a120c; }
[data-theme="dark"] .btn-primary:hover { color: #1a120c; }

.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--card); box-shadow: var(--shadow-sm); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 6. Header ----------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  /* Solid first, so a browser without color-mix still gets an opaque header
     rather than page content showing through it while scrolling. */
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--ochre), var(--clay) 70%);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--clay-wash);
}
.brand .callsign {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.45rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-inline: auto;
  flex-wrap: wrap;
}
/* Ten items have to fit beside the brand and the tools inside a 1140px
   container, so the horizontal padding here is deliberately tight. Adding
   an eleventh item means dropping one, or raising the collapse breakpoint
   below along with --wrap. */
.nav a {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--clay-wash);
  color: var(--clay-deep);
  font-weight: 600;
}

.header-tools { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--muted);
  font-size: var(--step--1);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.search-trigger:hover { border-color: var(--clay); color: var(--ink); }
.search-trigger svg { width: 15px; height: 15px; }
.search-trigger .label { display: none; }

.nav-toggle { display: none; }

@media (max-width: 1120px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-3);
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); }
  .nav-toggle { display: inline-grid; }
  .header-inner { position: relative; }
  .brand { margin-right: auto; }
}

@media (min-width: 640px) {
  .search-trigger .label { display: inline; }
}

/* ---------- 7. Hero ------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 5vw, 3.5rem);
  position: relative;
  isolation: isolate;
}
.hero::before {
  /* Warm light falling across the top of the page. Kept inside the hero's
     own box on purpose — bleeding it sideways gives the page a horizontal
     scrollbar on narrow screens. */
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 80vh;
  background:
    radial-gradient(55% 55% at 22% 34%, color-mix(in srgb, var(--ochre) 22%, transparent), transparent 70%),
    radial-gradient(45% 45% at 78% 12%, color-mix(in srgb, var(--clay) 16%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-name {
  font-size: var(--step-5);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 100;
  letter-spacing: -0.03em;
  margin-block: var(--sp-5) var(--sp-4);
}
.hero-name .alias {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  margin-top: var(--sp-3);
}

.hero-quote {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  color: var(--ink-2);
  max-width: 36ch;
  margin-bottom: var(--sp-6);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-7); }

/* Elapsed-time readout — the ticking age counter carried over from the old site */

.elapsed {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--card), var(--card-2));
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 820px;
}

.elapsed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.elapsed-bar .live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sage);
  letter-spacing: 0.08em;
}
.elapsed-bar .live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.elapsed-grid { display: grid; grid-template-columns: repeat(6, 1fr); }

.elapsed-cell {
  padding: 1.15rem 0.6rem;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}
.elapsed-cell:last-child { border-right: 0; }
.elapsed-value {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-feature-settings: "tnum" 1;
  color: var(--ink);
  line-height: 1.1;
}
.elapsed-cell.is-seconds .elapsed-value { color: var(--clay); }
.elapsed-label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.3rem;
}
@media (max-width: 860px) {
  .elapsed-grid { grid-template-columns: repeat(3, 1fr); }
  .elapsed-cell:nth-child(3n) { border-right: 0; }
  .elapsed-cell:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 430px) {
  .elapsed-grid { grid-template-columns: repeat(2, 1fr); }
  /* The seconds figure is ten digits wide and has to fit a half-width cell. */
  .elapsed-value { font-size: var(--step-1); }
  .elapsed-cell { padding-inline: 0.35rem; }
  .elapsed-cell:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .elapsed-cell:nth-child(even) { border-right: 0; }
  .elapsed-cell:nth-child(-n+4) { border-bottom: 1px solid var(--line-soft); }
}

/* ---------- 8. Stat tiles ------------------------------------------------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr));
  gap: clamp(0.6rem, 1.4vw, 1rem);
}

.stat {
  display: block;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
a.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--clay) 40%, var(--line));
  color: inherit;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-feature-settings: "tnum" 1;
  color: var(--ochre);
  line-height: 1.1;
}
.stat-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step--1);
  margin-top: 0.35rem;
}
.stat-sub {
  font-size: var(--step--2);
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ---------- 9. Cards ------------------------------------------------------ */

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              border-color 0.22s var(--ease);
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--clay) 35%, var(--line));
  color: inherit;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper-2);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
a.card:hover .card-media img { transform: scale(1.045); }

.card-body { padding: 0.95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: 0.4rem; }
.card-title {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.3;
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 20;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
}

.tag-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.5rem;
  color: var(--ink-2);
  background: var(--paper-2);
}

.badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgb(28 20 14 / 0.72);
  color: #fdf8f1;
  backdrop-filter: blur(4px);
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgb(28 20 14 / 0.35));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
a.card:hover .play-badge { opacity: 1; }
.play-badge span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--clay);
  color: #fff;
  box-shadow: var(--shadow);
  transform: scale(0.85);
  transition: transform 0.25s var(--ease);
}
a.card:hover .play-badge span { transform: scale(1); }
.play-badge svg { width: 20px; height: 20px; margin-left: 2px; }

/* ---------- 10. Panels, notices, empty states ----------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}
.panel-flush { padding: 0; overflow: hidden; }

.notice {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--card);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.notice svg { width: 19px; height: 19px; flex: 0 0 auto; margin-top: 0.15rem; color: var(--muted); }
.notice-ok    { border-left-color: var(--sage);  background: color-mix(in srgb, var(--sage) 8%, var(--card)); }
.notice-ok svg { color: var(--sage); }
.notice-warn  { border-left-color: var(--ochre); background: color-mix(in srgb, var(--ochre) 10%, var(--card)); }
.notice-warn svg { color: var(--ochre); }
.notice-error { border-left-color: var(--rose);  background: color-mix(in srgb, var(--rose) 8%, var(--card)); }
.notice-error svg { color: var(--rose); }

.disclosure {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 0.95rem 1.15rem;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--sp-5);
}

.empty {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}
.empty h3 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.empty p { color: var(--muted); font-size: var(--step--1); max-width: 46ch; margin-inline: auto; }

/* ---------- 11. Toolbar, inputs, chips ------------------------------------ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: var(--sp-5);
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 0;
}
.field svg {
  position: absolute;
  left: 0.85rem;
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.field .input { padding-left: 2.4rem; }

.input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: var(--step--1);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 18%, transparent);
}
textarea.input { resize: vertical; min-height: 7rem; line-height: 1.6; }
select.input { cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--step--1);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              color 0.16s var(--ease);
}
.chip:hover { border-color: var(--clay); color: var(--ink); }
.chip .n {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--faint);
}
.chip[aria-pressed="true"],
.chip.active {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}
.chip[aria-pressed="true"] .n,
.chip.active .n { color: rgb(255 255 255 / 0.75); }
[data-theme="dark"] .chip[aria-pressed="true"],
[data-theme="dark"] .chip.active { color: #1a120c; }
[data-theme="dark"] .chip[aria-pressed="true"] .n,
[data-theme="dark"] .chip.active .n { color: rgb(26 18 12 / 0.7); }

/* ---------- 12. Link rows (gear, deals, certificates, karaoke) ------------- */

.link-rows {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.16s var(--ease);
}
.link-row:last-child { border-bottom: 0; }
a.link-row:hover { background: var(--paper-2); color: inherit; }

.link-row .name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: var(--step--1);
}
.link-row .note {
  display: block;
  font-weight: 400;
  font-size: var(--step--2);
  color: var(--muted);
}
.link-row .cat {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--faint);
  text-align: right;
}
.link-row .arrow { flex: 0 0 auto; color: var(--faint); }
a.link-row:hover .arrow { color: var(--clay); }

/* ---------- 13. Quotes ---------------------------------------------------- */

.quote-hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--clay-wash), var(--card) 65%);
  padding: clamp(1.75rem, 5vw, 3.25rem);
  box-shadow: var(--shadow-sm);
}
.quote-hero::before {
  content: "\201C";
  position: absolute;
  top: -0.1em;
  left: 0.35em;
  font-family: var(--font-display);
  font-size: 7rem;
  line-height: 1;
  color: var(--clay);
  opacity: 0.16;
  pointer-events: none;
}
.quote-hero blockquote {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 60;
  line-height: 1.35;
  color: var(--ink);
  max-width: 40ch;
  position: relative;
}
.quote-hero cite {
  display: block;
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--clay);
}

.quote-list { display: flex; flex-direction: column; gap: 0.7rem; }

.quote-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.quote-item:hover { border-color: color-mix(in srgb, var(--clay) 32%, var(--line)); box-shadow: var(--shadow-sm); }
.quote-item blockquote {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 20;
}
.quote-item .who {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
}

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
  padding-top: 0.1rem;
}
.vote button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  border-radius: 6px;
  color: var(--faint);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.vote button:hover:not(:disabled) { background: var(--clay-wash); color: var(--clay); }
.vote button:disabled { opacity: 0.4; cursor: default; }
.vote button svg { width: 15px; height: 15px; }
.vote .score {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-feature-settings: "tnum" 1;
  color: var(--ink);
}

/* ---------- 14. Life list & travel ---------------------------------------- */

.life-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.life-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}
.life-item:last-child { border-bottom: 0; }

.life-item .mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  color: transparent;
  background: var(--paper-2);
}
.life-item .mark svg { width: 12px; height: 12px; }
.life-item.done .mark {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.life-item .label { flex: 1 1 auto; min-width: 0; font-size: var(--step--1); }
.life-item.done .label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.life-item .cat {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--faint);
}
.life-item .year {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--sage);
}

.progress-shell {
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--ochre), var(--sage));
  transition: width 0.6s var(--ease);
}

/* ---------- 15. Charts (traffic dashboard) -------------------------------- */

.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--clay); opacity: 0.85; transition: opacity 0.15s var(--ease); }
.chart .bar:hover { opacity: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--faint); font-family: var(--font-mono); font-size: 11px; }

.bar-list { display: flex; flex-direction: column; gap: 0.7rem; }
.bar-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  align-items: baseline;
}
.bar-item .lbl {
  font-size: var(--step--1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-item .val {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
}
.bar-item .track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  overflow: hidden;
}
.bar-item .fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--clay);
  opacity: 0.8;
}

/* ---------- 16. Footer ---------------------------------------------------- */

.site-footer {
  margin-top: var(--sp-8);
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding-block: var(--sp-7) var(--sp-5);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.footer-col { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.35rem;
}
.footer-col a {
  font-size: var(--step--1);
  color: var(--ink-2);
  text-decoration: none;
  width: fit-content;
}
.footer-col a:hover { color: var(--clay); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: var(--step--2);
  color: var(--muted);
}

.counter-pill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--muted);
  text-decoration: none;
}
.counter-pill:hover { border-color: var(--clay); color: var(--ink); }
.counter-pill b { color: var(--ochre); font-weight: 500; }

/* ---------- 17. Command palette ------------------------------------------- */

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: clamp(1rem, 10vh, 8rem) 1rem 1rem;
  background: rgb(36 26 18 / 0.42);
  backdrop-filter: blur(3px);
}
.cmdk-backdrop.open { display: block; }

.cmdk {
  width: min(100%, 620px);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdk-in 0.22s var(--ease);
}
@keyframes cmdk-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
}
.cmdk-input-row svg { width: 17px; height: 17px; color: var(--faint); flex: 0 0 auto; }
.cmdk-input-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: var(--step-0);
}
.cmdk-input-row input::placeholder { color: var(--faint); }

.cmdk-results { max-height: min(52vh, 400px); overflow-y: auto; padding: 0.4rem; }

.cmdk-group {
  padding: 0.6rem 0.85rem 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--step--1);
}
.cmdk-item:hover,
.cmdk-item.sel { background: var(--clay-wash); color: var(--ink); }
.cmdk-item .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .k {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--faint);
}

.cmdk-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: var(--step--1); }

.cmdk-foot {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1.15rem;
  border-top: 1px solid var(--line-soft);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--faint);
}

/* ---------- 18. Lightbox -------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgb(24 17 11 / 0.88);
  backdrop-filter: blur(4px);
}
.lightbox.open { display: grid; }

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #f6ece0;
  background: rgb(255 255 255 / 0.1);
}
.lightbox-close:hover { background: rgb(255 255 255 / 0.2); color: #fff; }

.lightbox-inner { width: min(100%, 1000px); max-height: 90vh; overflow-y: auto; }
.lightbox-inner img {
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  margin-inline: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lightbox-inner .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
}
.lightbox-inner iframe { width: 100%; height: 100%; border: 0; }

.lightbox-caption {
  margin-top: 0.9rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: #d9cbba;
}

.lightbox-lyrics {
  margin-top: 1.1rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
  color: #ece0d2;
  font-size: var(--step--1);
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 34vh;
  overflow-y: auto;
}

/* ---------- 19. Toast ----------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1.5rem);
  z-index: 160;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 20. Print ----------------------------------------------------- */

@media print {
  .site-header, .site-footer, .toolbar, .chips,
  .cmdk-backdrop, .lightbox, .toast, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .link-rows, .life-list { box-shadow: none; border-color: #ccc; }
}
