/* ============ TOKENS ============ */
  :root {
    /* neutrals biased cool-slate so the warm amber accent reads as a deliberate choice */
    --bg:        #eef1f5;
    --bg-dot:    rgba(20, 32, 54, 0.045);
    --surface:   #ffffff;
    --surface-2: #f6f8fb;
    --ink:       #121821;
    --ink-soft:  #47525f;
    --muted:     #7b8794;
    --hair:      #dde3ea;
    --hair-2:    #e8edf2;

    --accent:      #c9781a;   /* warm signal amber — reserved for the "live link" affordance */
    --accent-ink:  #a35f10;
    --accent-wash: rgba(201, 120, 26, 0.10);

    --live:      #17916a;
    --live-wash: rgba(23, 145, 106, 0.12);
    --prog:      #b06d0c;
    --prog-wash: rgba(176, 109, 12, 0.12);

    --shadow:    0 1px 2px rgba(16,24,33,.05), 0 1px 3px rgba(16,24,33,.04);
    --shadow-lift: 0 14px 30px -12px rgba(16,24,33,.28), 0 4px 10px -6px rgba(16,24,33,.15);

    --sans: 'Inter', system-ui, sans-serif;
    --font-disp: 'Bricolage Grotesque', system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

    --maxw: 1180px;
    --radius: 15px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --bg:        #0b0e13;
      --bg-dot:    rgba(150, 180, 220, 0.05);
      --surface:   #14191f;
      --surface-2: #191f27;
      --ink:       #eef1f5;
      --ink-soft:  #aeb8c4;
      --muted:     #78828f;
      --hair:      #262d38;
      --hair-2:    #20262f;

      --accent:      #f0ab4d;
      --accent-ink:  #f6c079;
      --accent-wash: rgba(240, 171, 77, 0.13);

      --live:      #35c493;
      --live-wash: rgba(53, 196, 147, 0.14);
      --prog:      #f0ab4d;
      --prog-wash: rgba(240, 171, 77, 0.14);

      --shadow:    0 1px 2px rgba(0,0,0,.4);
      --shadow-lift: 0 16px 34px -12px rgba(0,0,0,.7), 0 4px 12px -6px rgba(0,0,0,.5);
    }
  }
  /* explicit toggle wins over the media query in BOTH directions */
  :root[data-theme="light"] {
    --bg:#eef1f5; --bg-dot:rgba(20,32,54,.045); --surface:#fff; --surface-2:#f6f8fb;
    --ink:#121821; --ink-soft:#47525f; --muted:#7b8794; --hair:#dde3ea; --hair-2:#e8edf2;
    --accent:#c9781a; --accent-ink:#a35f10; --accent-wash:rgba(201,120,26,.10);
    --live:#17916a; --live-wash:rgba(23,145,106,.12); --prog:#b06d0c; --prog-wash:rgba(176,109,12,.12);
    --shadow:0 1px 2px rgba(16,24,33,.05), 0 1px 3px rgba(16,24,33,.04);
    --shadow-lift:0 14px 30px -12px rgba(16,24,33,.28), 0 4px 10px -6px rgba(16,24,33,.15);
  }
  :root[data-theme="dark"] {
    --bg:#0b0e13; --bg-dot:rgba(150,180,220,.05); --surface:#14191f; --surface-2:#191f27;
    --ink:#eef1f5; --ink-soft:#aeb8c4; --muted:#78828f; --hair:#262d38; --hair-2:#20262f;
    --accent:#f0ab4d; --accent-ink:#f6c079; --accent-wash:rgba(240,171,77,.13);
    --live:#35c493; --live-wash:rgba(53,196,147,.14); --prog:#f0ab4d; --prog-wash:rgba(240,171,77,.14);
    --shadow:0 1px 2px rgba(0,0,0,.4);
    --shadow-lift:0 16px 34px -12px rgba(0,0,0,.7), 0 4px 12px -6px rgba(0,0,0,.5);
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background-color: var(--bg);
    background-image: radial-gradient(var(--bg-dot) 1px, transparent 1.4px);
    background-size: 24px 24px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
  }

  .page { max-width: var(--maxw); margin: 0 auto; padding: clamp(22px, 4vw, 52px) clamp(16px, 4vw, 34px) 72px; }

  /* ============ MASTHEAD ============ */
  .masthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
  .kicker {
    font-family: var(--mono);
    font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase;
    color: var(--accent-ink); font-weight: 600;
    display: inline-flex; align-items: center; gap: 9px;
  }
  .kicker::before { content:""; width: 22px; height: 1.5px; background: var(--accent); opacity:.75; display:inline-block; }
  h1 {
    font-family: var(--font-disp);
    font-size: clamp(30px, 5.2vw, 48px);
    line-height: 1.02; letter-spacing: -0.025em; font-weight: 780;
    margin: 14px 0 0; text-wrap: balance;
  }
  .lede { margin: 12px 0 0; max-width: 60ch; color: var(--ink-soft); font-size: 15.5px; }

  .theme-toggle {
    flex: none;
    font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
    display: inline-flex; align-items: center; gap: 9px;
    padding: 9px 14px; border-radius: 999px;
    background: var(--surface); color: var(--ink-soft);
    border: 1px solid var(--hair); cursor: pointer;
    box-shadow: var(--shadow); transition: border-color .18s, color .18s, transform .18s;
  }
  .theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
  .theme-toggle:active { transform: scale(.97); }
  .theme-toggle .ico { width: 15px; height: 15px; display: grid; place-items: center; }
  .theme-toggle .lbl-dark, .theme-toggle .ico-moon { display: none; }
  :root[data-theme="dark"] .theme-toggle .lbl-light, :root[data-theme="dark"] .theme-toggle .ico-sun { display: none; }
  :root[data-theme="dark"] .theme-toggle .lbl-dark, :root[data-theme="dark"] .theme-toggle .ico-moon { display: inline; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle .lbl-light, :root:not([data-theme]) .theme-toggle .ico-sun { display: none; }
    :root:not([data-theme]) .theme-toggle .lbl-dark, :root:not([data-theme]) .theme-toggle .ico-moon { display: inline; }
  }

  /* ============ CONTROLS ============ */
  .controls {
    margin: 0 0 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
  }
  .filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .pill {
    font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
    padding: 7px 13px; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--ink-soft);
    border: 1px solid var(--hair); transition: all .16s;
    display: inline-flex; align-items: center; gap: 7px;
  }
  .pill .c { color: var(--muted); font-size: 11px; }
  .pill:hover { border-color: var(--accent); color: var(--ink); }
  .pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .pill[aria-pressed="true"] .c { color: var(--bg); opacity: .7; }
  .count { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
  .count:empty { display: none; }   /* only a filtered view has a count to show */

  /* ============ GRID + CARDS ============ */
  /* No card is narrower than 340px (or the viewport on a small phone), which is
     the width every two-line blurb is written to fit. */
  .grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  }
  .card {
    position: relative; background: var(--surface);
    border: 1px solid var(--hair); border-radius: var(--radius);
    padding: 20px 20px 17px; box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
    animation: rise .5s both;
  }
  .card.is-linked { cursor: pointer; }
  .card.is-linked:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
  .card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
  /* Keyboard focus only: a mouse click on the Details row leaves focus on it, and
     the whole card would stay ringed. */
  .card:focus-within:not(:has(:focus-visible)) { outline: none; }

  /* stretched primary link */
  .card-primary { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
  .card-primary:focus { outline: none; }
  .card.is-linked:hover .card-name { color: var(--accent-ink); }

  .card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
  .chip {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
    color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--hair-2);
    padding: 4px 9px; border-radius: 6px; font-weight: 600;
  }
  .status { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-weight: 600; }
  .status .dot { width: 7px; height: 7px; border-radius: 50%; }
  .status.live { color: var(--live); background: var(--live-wash); }
  .status.live .dot { background: var(--live); box-shadow: 0 0 0 3px var(--live-wash); }
  .status.prog { color: var(--prog); background: var(--prog-wash); }
  .status.prog .dot { background: var(--prog); }
  .status.retired { color: var(--muted); background: var(--surface-2); border: 1px solid var(--hair-2); }
  .status.retired .dot { background: var(--muted); }

  .card-name { font-family: var(--font-disp); font-size: 20px; font-weight: 720; letter-spacing: -0.018em; margin: 0; line-height: 1.15; transition: color .2s; }
  .tagline { margin: 5px 0 0; font-size: 13px; color: var(--accent-ink); font-weight: 550; }

  /* The card's description: a blurb written to fit two lines, clamped there as a
     ceiling for the widths it wasn't written for. The detail waits in .more. */
  .blurb {
    margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    text-wrap: balance;   /* two even lines rather than one word left over */
  }

  .tech { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

  /* The detail behind the blurb. The whole row toggles it and sits above the
     card's stretched link (z-index 2, like .repo), so a tap near the label opens
     the detail rather than the site. */
  .more { position: relative; z-index: 2; margin-top: 4px; }
  .more > summary {
    display: block; padding: 11px 0 12px;
    list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none;
    font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted);
    border-radius: 6px; transition: color .16s;
  }
  .more > summary::-webkit-details-marker { display: none; }
  .more > summary::after {
    content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 9px; vertical-align: middle;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: translateY(-3px) rotate(45deg); transition: transform .18s;
  }
  .more[open] > summary::after { transform: translateY(0) rotate(-135deg); }
  .more > summary:hover, .more[open] > summary { color: var(--accent-ink); }
  .more > .desc {
    margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft);
    cursor: auto; animation: more-in .2s ease-out;
  }
  /* A written case study (internal builds in the lead): headed parts in place of
     the one paragraph. */
  .more > .study { margin: 0 0 14px; display: grid; gap: 11px; cursor: auto; animation: more-in .2s ease-out; }
  .study dt {
    font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
    font-weight: 700; color: var(--accent-ink); margin: 0 0 3px;
  }
  .study dd { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
  @keyframes more-in { from { opacity: 0; transform: translateY(-4px); } }
  @media (prefers-reduced-motion: reduce) { .more > .desc, .more > .study { animation: none; } }

  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tech li { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--hair-2); border-radius: 5px; padding: 3px 7px; background: var(--surface-2); }

  .card-foot {
    margin-top: auto; padding-top: 15px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border-top: 1px solid var(--hair-2);
  }
  .domain { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
  .domain .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card.is-linked:hover .domain { color: var(--ink-soft); }

  .open { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: color .2s, gap .2s; }
  .open .arw { transition: transform .2s; }
  .card.is-linked:hover .open { color: var(--accent-ink); }
  .card.is-linked:hover .open .arw { transform: translate(2px, -2px); }

  .repo { position: relative; z-index: 2; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; border-radius: 5px; transition: color .16s; }
  .repo:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
  .repo svg { width: 13px; height: 13px; }

  /* Private source: stated, not linked — a "code" link nobody can open is a 404 with extra steps. */
  .repo-private {
    font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
    color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap;
  }
  .repo-private svg { width: 10px; height: 10px; flex: none; }

  /* Internal / employer work: on the record, deliberately not a destination. */
  .int-tag {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
    font-weight: 700; color: var(--ink-soft); background: var(--surface-2);
    border: 1px solid var(--hair); border-radius: 5px; padding: 3px 7px;
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  }
  .int-tag svg { width: 9px; height: 9px; flex: none; }

  .card.is-static { background: var(--surface-2); }
  .card.is-static .card-foot { color: var(--muted); }
  .note { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .02em; }

  /* ============ TIERS: hub / featured / also-built ============ */
  /* Section eyebrows encode prominence, which is real information here:
     featured = start here, all builds = the catalog, also built = the long tail. */
  .sec { margin-top: 40px; }
  .sec:first-of-type { margin-top: 0; }
  .sec-label {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .19em;
    text-transform: uppercase; color: var(--muted); font-weight: 600;
    margin: 0 0 12px; display: flex; align-items: baseline; gap: 9px;
  }
  .sec-label::after { content:""; flex: 1; height: 1px; background: var(--hair); }
  .sec-label .c { font-weight: 500; opacity: .75; }
  .card-top-l { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }

  /* Hub — the curated portfolio this index feeds. One full-width row, not a build
     card: eyebrow, name and tagline on a line, wrapping on a phone. */
  .hub {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    background: var(--accent-wash); border: 1px solid var(--accent);
    border-radius: var(--radius); padding: 14px 20px;
    transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s;
    color: inherit; text-decoration: none;
  }
  .hub:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
  .hub:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
  .hub-body { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; min-width: 0; }
  .hub-eyebrow {
    margin: 0; font-family: var(--mono); font-size: 10px; letter-spacing: .17em; text-transform: uppercase;
    color: var(--accent-ink); font-weight: 700;
  }
  .hub-name { font-family: var(--font-disp); font-size: 19px; font-weight: 740; letter-spacing: -0.02em; margin: 0; }
  .hub-desc { margin: 0; font-size: 14px; color: var(--ink-soft); }
  .hub-go { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--accent-ink); flex: none; }
  .hub-go .arw { display: inline-block; transition: transform .2s; }
  .hub:hover .hub-go .arw { transform: translate(2px,-2px); }
  @media (max-width: 560px) { .hub-eyebrow { flex-basis: 100%; } }

  /* Featured — wider tracks and a marked card, no decorative rail. The section
     label already says so, so the cards keep their tag for the filtered grids. */
  .grid.feat { grid-template-columns: repeat(auto-fill, minmax(408px, 1fr)); }
  @media (max-width: 560px){ .grid.feat { grid-template-columns: 1fr; } }
  .card.is-feat { background: color-mix(in srgb, var(--accent-wash) 55%, var(--surface)); }
  .card.is-feat .card-name { font-size: 22.5px; }
  .grid.feat .feat-tag { display: none; }
  .feat-tag {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase;
    font-weight: 700; color: var(--accent-ink); border: 1px solid var(--accent);
    border-radius: 5px; padding: 3px 7px;
  }

  /* Also built — compact rows, deliberately not cards. */
  .also { border-top: 1px solid var(--hair); }
  .also-row {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    padding: 11px 4px; border-bottom: 1px solid var(--hair-2);
    text-decoration: none; color: inherit;
  }
  a.also-row:hover { background: var(--surface-2); }
  a.also-row:hover .also-name { color: var(--accent-ink); }
  .also-name { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; min-width: 190px; }
  .also-tag { font-size: 13px; color: var(--ink-soft); flex: 1; min-width: 180px; }
  .also-host { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

  /* ============ FOOTER ============ */
  .foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .foot p { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
  .foot a { color: var(--accent-ink); text-decoration: none; }
  .foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) {
    .card { animation: none !important; }
    * { transition: none !important; }
  }
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }


  /* Search Box Styling */
  .search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 240px;
  }
  .search-box svg {
    position: absolute;
    left: 14px;
    color: var(--muted);
    pointer-events: none;
  }
  .search-box input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border-radius: 999px;
    border: 1px solid var(--hair);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
  }

  /* Bento Grid Glow Effects */
  .card {
    background: linear-gradient(145deg, var(--surface), var(--surface-2));
    border: 1px solid var(--hair);
    position: relative;
    overflow: hidden;
  }
  .card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .card:hover::before {
    opacity: 1;
  }


  /* ==================== COMMAND PALETTE ==================== */
  .cmd-palette {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: flex-start; justify-content: center;
    padding-top: max(10vh, 60px); opacity: 0; transition: opacity 0.2s ease;
  }
  .cmd-palette.open { display: flex; opacity: 1; }
  .cmd-overlay {
    position: absolute; inset: 0;
    background: rgba(8, 12, 20, 0.75);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .cmd-dialog {
    position: relative; z-index: 2; width: min(640px, 92vw);
    background: var(--surface, #14191f);
    border: 1px solid var(--hair, #262d38);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px var(--accent);
    display: flex; flex-direction: column;
    max-height: 70vh; animation: cmdPop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes cmdPop {
    from { transform: scale(0.96) translateY(-10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
  }
  .cmd-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--hair, #262d38);
    background: transparent;
  }
  .cmd-input-wrap svg { color: var(--accent); flex-shrink: 0; }
  .cmd-input-wrap input {
    flex: 1; background: transparent; border: none; outline: none;
    font-family: var(--sans); font-size: 16px; color: var(--ink, #fff);
  }
  .cmd-kbd {
    font-family: var(--mono, monospace); font-size: 11px;
    padding: 3px 7px; border-radius: 5px;
    background: var(--surface-2, rgba(255,255,255,0.06));
    border: 1px solid var(--hair, rgba(255,255,255,0.1));
    color: var(--muted);
  }
  .cmd-results {
    overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px;
  }
  .cmd-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-radius: 8px; cursor: pointer;
    color: var(--ink, #fff); text-decoration: none; font-size: 14px;
    transition: background 0.15s;
  }
  .cmd-item:hover, .cmd-item.active {
    background: var(--accent-wash, rgba(99,102,241,0.15));
    color: var(--accent-ink, #8b5cf6);
  }
  .cmd-item-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
  .cmd-item-badge {
    font-family: var(--mono, monospace); font-size: 10px;
    padding: 2px 6px; border-radius: 4px; background: var(--surface-2);
    color: var(--muted); text-transform: uppercase;
  }
  .cmd-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-top: 1px solid var(--hair, #262d38);
    font-family: var(--mono, monospace); font-size: 11px; color: var(--muted);
    background: var(--surface-2, rgba(0,0,0,0.2));
  }
  .cmd-footer kbd {
    background: var(--surface); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--hair);
  }

  /* Kbd shortcut pill on masthead / nav */
  .cmd-trigger-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--hair);
    color: var(--muted); font-family: var(--mono); font-size: 12px;
    cursor: pointer; transition: border-color 0.2s, color 0.2s;
  }
  .cmd-trigger-btn:hover { border-color: var(--accent); color: var(--ink); }

  /* Clickable tech tags */
  .tech li {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  .tech li:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
    background: var(--accent-wash);
  }


/* ==================== TELEMETRY HUD BAR ==================== */
.telemetry-hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; overflow-x: auto; padding: 10px 20px;
  background: var(--surface-2, rgba(13, 19, 34, 0.8));
  border: 1px solid var(--hair, rgba(255,255,255,0.1));
  border-radius: 999px; margin: 20px 0 30px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--mono, monospace); font-size: 11.5px;
  scrollbar-width: none;
}
.telemetry-hud::-webkit-scrollbar { display: none; }
.hud-item {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.hud-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal, #14b8a6);
  box-shadow: 0 0 8px var(--teal, #14b8a6);
  animation: hudPulse 2s infinite ease-in-out;
}
@keyframes hudPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hud-label { color: var(--muted, #8b96ab); text-transform: uppercase; letter-spacing: 0.08em; }
.hud-val { color: var(--ink, #fff); font-weight: 700; }
.hud-sep { color: var(--hair, rgba(255,255,255,0.15)); }

/* ==================== SPECULAR CURSOR GLARE ==================== */
.card, .project-card, .hub, .stat-item {
  --glare-x: 50%;
  --glare-y: 50%;
  --glare-opacity: 0;
  position: relative;
}
.card::after, .project-card::after, .hub::after, .stat-item::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(
    500px circle at var(--glare-x) var(--glare-y),
    rgba(255, 255, 255, 0.14),
    transparent 50%
  );
  opacity: var(--glare-opacity);
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}
[data-theme="light"] .card::after,
[data-theme="light"] .project-card::after,
[data-theme="light"] .hub::after,
[data-theme="light"] .stat-item::after {
  background: radial-gradient(
    500px circle at var(--glare-x) var(--glare-y),
    rgba(99, 102, 241, 0.12),
    transparent 50%
  );
}


/* The build cube (build_cube.js, shared byte-for-byte with lukewade.net) brings
   its own styles and reads this page's tokens: --surface, --ink, --muted, --hair,
   --font-disp, --mono. This only places it, and reserves its height so the page
   doesn't jump when it mounts. It sits under the lead block, at the head of the
   catalog it filters; with a filter on, the lead is hidden and the cube follows
   the status strip. */
#build-cube { margin: 44px 0 28px; min-height: 548px; }
@media (max-width: 800px) { #build-cube { min-height: 860px; } }
#lead[hidden] { display: none; }

/* Filter chip (set by the cube, ?stack= or ?filter=), styled like the pills
   but tinted with the cube side's colour (--sc). */
.stack-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 5px 4px 11px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--sc) 60%, transparent);
  background: color-mix(in srgb, var(--sc) 14%, transparent);
}
.stack-chip[hidden] { display: none; }
.stack-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 8px var(--sc); }
.stack-chip button {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-soft); font-size: 15px; line-height: 1; cursor: pointer;
}
.stack-chip button:hover { background: color-mix(in srgb, var(--sc) 24%, transparent); color: var(--ink); }
.stack-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* "This one": after a palette jump or a #b-… deep link, the card holds an accent
   border while builds.js pulses a ring via element.animate(). Not a CSS
   animation: that would replace the card's entrance animation, which then
   replays the moment the class comes off. */
.card.is-flash { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .card.is-flash { outline: 2px solid var(--accent); outline-offset: 2px; } }

/* ============ APP STORE (2026-09) ============ */
/* Builds that also ship natively. The tag sits in the card-top row beside the
   category chip; the badge is a real link layered ABOVE the stretched card link
   (z-index 2, like .repo) so the card still opens the site and the badge opens
   the store. Kept black in both themes, as Apple's badge guidelines ask. */
.as-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--hair); border-radius: 5px; padding: 3px 7px 3px 6px;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.as-tag svg { width: 10px; height: 10px; flex: none; margin-top: -1px; }

.appstore-btn {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  margin-top: 12px; padding: 7px 14px 7px 11px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.22); border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.appstore-btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.5); box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.appstore-btn svg { width: 18px; height: 18px; flex: none; }
.appstore-btn-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore-btn-kicker { font-size: 9px; letter-spacing: .07em; text-transform: uppercase; opacity: .85; font-family: var(--sans); }
.appstore-btn-store { font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; font-family: var(--sans); }
@media (prefers-reduced-motion: reduce) { .appstore-btn { transition: none; } .appstore-btn:hover { transform: none; } }

/* App Store row: the badge plus the live version line from Apple's lookup.
   The row sits above the card's stretched link so the badge stays clickable;
   the version text passes clicks through to the card. */
.as-row {
  position: relative; z-index: 2; pointer-events: none;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  margin-top: 12px;
}
.as-row .appstore-btn { margin-top: 0; pointer-events: auto; }
.as-meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  color: var(--muted); white-space: nowrap;
}
/* Cards swapped in after the live lookup don't replay the entrance animation. */
.card.no-anim { animation: none; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── Status strip: every item visible at every width ─────────────── */
/* Six items never fit one pill below ~1100px (they overflowed with no hint
   that they scrolled). Wide screens get one evenly spaced row; narrower ones a
   grid of label-over-value cells: three columns, then two on phones. */
.telemetry-hud { overflow: visible; font-size: 11px; }
.hud-sep { display: none; }
@media (max-width: 1099px) {
  .telemetry-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 14px 18px;
    border-radius: 18px;
  }
  .hud-item { flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
  .hud-item .hud-dot { display: none; }
  .hud-label { font-size: 10px; }
  .hud-val { white-space: normal; }
}
@media (max-width: 560px) {
  .telemetry-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Card tag rows wrap as whole chips. "KNOWLEDGE BASE" and "In progress" used
   to break onto two lines inside their own pills on narrow cards. */
.card-top { flex-wrap: wrap; row-gap: 8px; }
.card-top-l { flex-wrap: wrap; row-gap: 6px; }
.chip, .status, .feat-tag, .as-tag { white-space: nowrap; }
/* When the tag row wraps on narrow cards, the status pill keeps to the right. */
.card-top > .status { margin-left: auto; }

/* A card's stack, in its side's colour: the build cube doubles as this
   catalog's legend. */
.chip-dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px;
  background: var(--sc); box-shadow: 0 0 6px color-mix(in srgb, var(--sc) 60%, transparent);
}

/* ── Masthead actions: the theme toggle and search sit together on the right ──
   With three children on space-between, the toggle floated mid-row on desktop.
   On phones the pair wraps under the lede, side by side. */
.mast-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* The hub card and the Featured label below it had 6px between them. */
.hub + .sec { margin-top: 26px; }

/* ⌘K means nothing without a keyboard: touch screens keep the words only. */
@media (hover: none) and (pointer: coarse) { .cmd-trigger-btn .cmd-kbd { display: none; } }

/* A card without a detail row still keeps its chips off the footer rule. */
.tech:not(:has(+ .more)) { margin-bottom: 15px; }

/* ============ PICTURES AND DEMOS (2026-11 makeover) ============ */
/* A card opens with a plate: its live site in a small browser frame (a real
   screenshot, scripts/media.cjs), its App Store icon in the corner, and a Watch
   button when the build has a narrated demo. The plate bleeds to the card's edges
   and belongs to the card's stretched link, so a click on the picture opens the
   site; the Watch button sits above that link, like the App Store badge. */
.plate {
  position: relative; margin: -20px -20px 16px; overflow: hidden;
  background: #0a0c10; border-bottom: 1px solid var(--hair);
}
.plate-bar {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px;
  background: #12161d; border-bottom: 1px solid rgba(255,255,255,.07);
}
.plate-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.16); flex: none; }
.plate-bar span {
  margin-left: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em; color: #8792a4;
}
.plate-img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top center; background: #0a0c10;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.card.is-linked:hover .plate-img { transform: scale(1.035); }
.plate-icon {
  position: absolute; left: 14px; bottom: 12px; width: 52px; height: 52px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2); box-shadow: 0 8px 20px rgba(0,0,0,.5); background: #000;
}
/* No picture to show: an internal tool has no public page, and a gated build's
   page is a sign-in form. The plate says which, in the build's stack colour. */
.plate-locked {
  aspect-ratio: 16 / 10; margin-bottom: 16px; padding-top: 26px;   /* the frame's height, so plates line up across a row */
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--sc) 26%, transparent), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 13px),
    #0d1016;
}
.plate-lock {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: #e7ebf2; background: rgba(8,10,14,.55); border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent);
}
.plate-lock svg { width: 12px; height: 12px; flex: none; color: var(--sc); }

/* Watch: the one control on a plate. */
.watch, .play-all {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .03em;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap;
  border-radius: 999px; transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.watch {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 8px 13px 8px 12px;
  color: #fff; background: rgba(8,10,14,.74); border: 1px solid rgba(255,255,255,.26);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.watch:hover, .watch:focus-visible { background: var(--accent); border-color: var(--accent); color: #14171c; }
.watch:active, .play-all:active { transform: scale(.97); }
.watch-ico { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.watch-dur { font-weight: 500; opacity: .72; }
/* A phone gets a target a thumb can hit. */
@media (hover: none) and (pointer: coarse) { .watch { min-height: 44px; padding: 0 16px 0 15px; } .play-all { min-height: 44px; padding: 0 16px 0 15px; } }

/* A section's label, with room for one action on the right. */
.sec-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.sec-head .sec-label { flex: 1; margin: 0; }
.play-all {
  flex: none; padding: 7px 13px 7px 12px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow);
}
.play-all:hover, .play-all:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
.play-all .watch-ico { color: var(--accent); }
@media (max-width: 520px) { .sec-head { flex-wrap: wrap; } .sec-head .sec-label { flex-basis: 100%; } }

/* With pictures the lead reads best three across (two on a tablet, one on a
   phone): the same tracks as the catalog, so a featured row is two rows of three. */
.grid.feat { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

/* A phone's catalog cards keep their picture short and lose the frame's bar, so
   sixteen of them don't double the page. The lead keeps the full plate. */
@media (max-width: 640px) {
  .card:not(.is-feat) .plate-bar { display: none; }
  .card:not(.is-feat) .plate-img { aspect-ratio: 21 / 9; }
  .card:not(.is-feat) .plate-locked { aspect-ratio: 21 / 9; padding-top: 0; }
}

/* The hub row carries a thumbnail of the site it opens. */
.hub-shot {
  flex: none; width: 92px; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center;
  border-radius: 8px; border: 1px solid var(--hair); background: #0a0c10;
}
.hub { justify-content: flex-start; }
.hub .hub-go { margin-left: auto; }
@media (max-width: 560px) { .hub-shot { width: 68px; } }

@media (prefers-reduced-motion: reduce) { .card.is-linked:hover .plate-img { transform: none; } }

/* A card shows its first four tech chips; the rest appear with its detail. The
   "+N" chip sits above the card's stretched link so a tap opens the detail, not
   the site. A card with no detail row has nothing to open, so it shows them all. */
.tech-x { display: none; }
.tech-more { position: relative; z-index: 2; color: var(--ink-soft); border-style: dashed; }
.card:has(.more[open]) .tech-x { display: list-item; }
.card:has(.more[open]) .tech-more, .tech:not(:has(+ .more)) .tech-more { display: none; }
.tech:not(:has(+ .more)) .tech-x { display: list-item; }
