/* work.css — project cards, art bands, mock demo windows (term/streak/md/cam), stack grid; work-scoped media queries at end */
    .tag {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-family: var(--font-mono);
      font-size: 0.8rem;
      letter-spacing: 0.04em;
      padding: 0.26rem 0.6rem;
      border-radius: 999px;
      border: 1px solid var(--hairline-strong);
      color: var(--ink-muted);
      white-space: nowrap;
    }
    .tag img { display: block; }
    /* projects heading runs a step larger than the shared section title */
    .projects-title { font-size: clamp(2.3rem, 5.6vw, 3.9rem); max-width: none; }

    /* ---------- work / asymmetric bento ---------- */
    .work-grid {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 1.25rem;
      transition: opacity 0.3s var(--ease-out); /* filter swaps dip the grid briefly */
    }
    /* filter-swap entrance: freshly shown cards pop in with a spring */
    @keyframes filter-in {
      from { opacity: 0; transform: translateY(1.25rem) scale(0.96); }
      to   { opacity: 1; transform: none; }
    }
    .filter-in { animation: filter-in 0.5s var(--ease-spring) both; }
    .project {
      grid-column: span 12;
      position: relative;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      border-radius: 0.75rem;
      background: var(--glass-bg);
      -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
      backdrop-filter: var(--glass-blur) var(--glass-saturate);
      border: 1px solid var(--glass-border);
      box-shadow: var(--glass-shadow);
      transition:
        translate 0.55s var(--ease-spring),
        border-color 0.7s var(--ease-out),
        box-shadow 2s var(--ease-out);
      will-change: translate;
      content-visibility: auto;
      contain-intrinsic-size: 300px 350px;
    }
    .project:focus-visible { outline: none; }
    .project:hover,
    .project:focus-visible {
      translate: 0 -6px;
      border-color: color-mix(in srgb, var(--neon) 55%, transparent);
      box-shadow:
        0 20px 50px -8px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px color-mix(in srgb, var(--neon) 45%, transparent);
    }
    /* cursor-following spotlight (JS sets --mx/--my; touch devices never see it) */
    .project::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(122, 162, 247, 0.12), transparent 70%);
      opacity: 0;
      pointer-events: none;
    }
    .project:hover::after { opacity: 1; }
    .project-core {
      flex: 1;
      display: flex;
      flex-direction: column;
      border-radius: 0.75rem; /* matches the card shell */
      background: var(--bg-raised);
      box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04);
      overflow: hidden;
    }
    .project-art {
      position: relative;
      height: 13rem;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* platform badge — overlaid bottom-right ON the full-bleed mock; mocks stay
       dark in both themes, so the badge rides the fixed dark-window palette */
    .platform-badge {
      position: absolute;
      right: 0.8rem;
      bottom: 0.8rem;
      z-index: 1;
      display: inline-flex;
      align-items: center;
      gap: 0.42rem;
      font-family: var(--font-mono);
      font-size: 0.66rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--win-muted);
      background: rgba(26, 27, 38, 0.78);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      border: 1px solid var(--hairline-strong);
      border-radius: 999px;
      padding: 0.28rem 0.68rem;
    }
    .platform-badge img { display: block; }

    /* ---------- mock demo windows (in-palette product proof) ---------- */
    /* full-bleed: the mock window IS the art — flush to the card face edges */
    .mock {
      position: relative;
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      background: rgba(26, 27, 38, 0.92);
      overflow: hidden;
    }
    .mock-bar {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      gap: 0.42rem;
      padding: 0.5rem 0.85rem;
      border-bottom: 1px solid var(--hairline);
    }
    .mock-dot { width: 0.4rem; height: 0.4rem; border-radius: 999px; border: 1px solid var(--win-faint); opacity: 0.6; }
    .mock-title {
      margin-left: 0.35rem;
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--win-muted);
      letter-spacing: 0.04em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mock-body {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 0.15rem;
      padding: 0.55rem 0.85rem;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      line-height: 1.45;
      color: var(--ink-muted);
    }
    .tk-ink { color: var(--win-ink); }
    .tk-faint { color: var(--win-faint); }

    /* sortd — terminal session */
    .term-line { white-space: nowrap; }
    .term-prompt { color: var(--win-accent); margin-right: 0.7ch; }
    .term-cursor {
      display: inline-block;
      width: 0.55em;
      height: 1.05em;
      vertical-align: -0.2em;
      background: var(--win-accent);
      animation: cursor-blink 1.1s steps(2, start) infinite;
    }
    @keyframes cursor-blink { to { visibility: hidden; } }

    /* streak — compose habit list */
    .streak-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 1rem;
      padding-bottom: 0.4rem;
      margin-bottom: 0.35rem;
      border-bottom: 1px solid var(--hairline);
    }
    .streak-brand { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--win-ink); letter-spacing: -0.01em; }
    .streak-count { color: var(--win-accent); font-weight: 600; }
    .habit-row { display: flex; align-items: center; gap: 0.7rem; }
    .habit-name { flex: 1; min-width: 0; color: var(--win-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .wk { display: flex; gap: 0.26rem; flex-shrink: 0; }
    .wk i { width: 0.44rem; height: 0.44rem; border-radius: 999px; background: var(--win-accent); }
    .wk i.off { background: none; border: 1px solid var(--hairline-strong); }
    .wk i.today { background: none; border: 1px solid var(--win-accent-dim); }
    .habit-n { min-width: 1.5rem; text-align: right; color: var(--ink-muted); }

    /* oxide-notes — markdown source → rendered */
    .md-div {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      margin: 0.3rem 0;
      font-size: 0.7rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--win-muted);
      white-space: nowrap;
    }
    .md-div::before, .md-div::after { content: ""; height: 1px; flex: 1; background: var(--hairline-strong); }
    .md-h { font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; color: var(--win-ink); letter-spacing: -0.01em; line-height: 1.25; }
    .md-list { list-style: none; padding: 0; margin: 0.2rem 0 0; display: grid; gap: 0.2rem; color: var(--ink-muted); }
    .md-box {
      display: inline-block;
      width: 0.72em;
      height: 0.72em;
      margin-right: 0.55em;
      vertical-align: -0.02em;
      border-radius: 2px;
      border: 1px solid var(--win-accent-dim);
    }
    .md-done .md-box { background: var(--win-accent); border-color: var(--win-accent); }
    .md-done { text-decoration: line-through; text-decoration-color: var(--win-faint); }

    /* crab-cam — ASCII viewfinder */
    .cam-feed { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.4rem 0.5rem 1.35rem; }
    .cam-feed::after {
      content: "";
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(0deg, rgba(230, 237, 240, 0.04) 0px, rgba(230, 237, 240, 0.04) 1px, transparent 1px, transparent 3px);
      pointer-events: none;
    }
    .ascii-pre {
      margin: 0;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      line-height: 1.08;
      color: var(--win-accent-dim);
      user-select: none;
    }
    .corner { position: absolute; width: 0.95rem; height: 0.95rem; border: 1px solid var(--win-muted); }
    .corner.tl { top: 0.6rem; left: 0.6rem; border-right: 0; border-bottom: 0; }
    .corner.tr { top: 0.6rem; right: 0.6rem; border-left: 0; border-bottom: 0; }
    .corner.bl { bottom: 0.6rem; left: 0.6rem; border-right: 0; border-top: 0; }
    .corner.br { bottom: 0.6rem; right: 0.6rem; border-left: 0; border-top: 0; }
    .cam-rec {
      position: absolute;
      top: 0.68rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-family: var(--font-mono);
      font-size: 0.7rem;
      letter-spacing: 0.12em;
      color: var(--win-ink);
    }
    .cam-rec i { width: 0.48rem; height: 0.48rem; border-radius: 999px; background: var(--win-magenta); animation: cursor-blink 1.6s steps(2, start) infinite; }
    .cam-meta {
      position: absolute;
      bottom: 0.68rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1;
      font-family: var(--font-mono);
      font-size: 0.7rem;
      letter-spacing: 0.06em;
      color: var(--win-muted);
      white-space: nowrap;
    }
    .project-body { padding: 1.5rem 1.6rem 1.9rem; display: flex; flex-direction: column; gap: 0.8rem; }
    /* .project-text is a plain block (the one flex item where a float can live):
       pills float right, and title/subtitle/description LINES wrap around them */
    .project-body h3 {
      font-size: 1.65rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .project-sub {
      margin-top: 0.55rem; /* breathing room under the name (block flow — no body gap to ride anymore) */
      font-family: var(--font-mono);
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.04em;
      color: var(--ink-muted);
    }
    /* thick accent dot before the subtitle, matches the popup */
    .project-sub::before {
      content: "";
      display: inline-block;
      width: 0.42em;
      height: 0.42em;
      border-radius: 50%;
      background: var(--neon);
      margin-right: 0.55em;
    }
    /* pills float right inside the text stack: the description's lines bend around
       the pill block instead of the whole description box shifting down.
       (alignment scoped to cards — the popup reuses .project-tags as a plain row) */
    .project-tags { display: flex; flex-wrap: wrap; gap: 0.32rem; }
    .project .project-tags {
      float: right;
      justify-content: flex-end; /* rows pack RIGHT toward the card edge */
      max-width: 55%;
      margin-left: 1rem; /* gutter between pills and wrapping text */
      margin-bottom: 0.45rem; /* breathing room before full-width lines resume below the pills */
    }
    .project-blurb { color: var(--ink-muted); font-size: 1rem; max-width: 48ch; margin-top: 0.8rem; }

    /* ---------- category filter row ---------- */
    .project-filters {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      column-gap: 2.8rem;
      row-gap: 0.7rem;
      margin-top: 2.4rem;
      margin-bottom: 2.4rem;
    }
    .filter-pill {
      position: relative;
      font-family: var(--font-mono);
      font-size: 1rem;
      letter-spacing: 0.05em;
      color: var(--ink-faint);
      background: transparent;
      border: 0;
      padding: 0.15rem 0;
      cursor: pointer;
      transition: color 0.3s var(--ease-out);
    }
    /* single animated underline: grows from the left on hover, stays lit when active */
    .filter-pill::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -0.25em;
      height: 2px;
      background: var(--neon);
      transform: scaleX(0);
      transform-origin: center;
      transition: transform 0.22s var(--ease-out);
    }
    .filter-pill:hover { color: var(--neon); }
    .filter-pill:hover::after,
    .filter-pill:focus-visible::after,
    .filter-pill[aria-pressed="true"]::after { transform: scaleX(1); }
    .filter-pill[aria-pressed="true"] { color: var(--ink); }
    /* grouped state: while hovering the filter row, only the hovered pill
       keeps its underline (mirrors the topbar nav behavior) */
    .project-filters:hover .filter-pill[aria-pressed="true"]:not(:hover)::after {
      transform: scaleX(0);
    }
    .filter-pill:focus-visible { outline: 1px solid var(--neon); outline-offset: 4px; }
    @media (prefers-reduced-motion: reduce) {
      .filter-pill::after { transition: none; }
    }
    .noscript-note {
      margin-top: 1.4rem;
      font-family: var(--font-mono);
      font-size: 0.8rem;
      color: var(--ink-muted);
    }

    /* ---------- extra projects (revealed by "show more") ---------- */
    .work-extra {
      display: grid;
      gap: 1.4rem;
      margin-top: 1.4rem;
      grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    }
    .work-more { display: flex; justify-content: center; margin-top: 2rem; }
    .btn-more {
      font-family: var(--font-mono);
      font-size: 0.78rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--ink-muted);
      background: transparent;
      border: 0;
      border-radius: 0;
      padding: 0.35rem 0.15rem;
      cursor: pointer;
      transition: color 0.3s var(--ease-out);
    }
    .btn-more:hover { color: var(--neon); }
    .btn-more:focus-visible { outline: 2px solid var(--neon); outline-offset: 6px; }

/* ---------- stack: grouped chunks ---------- */
/* fill at least a full viewport so the body grid spans a complete screen while viewing */
#stack {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  /* drop the section's vertical padding so min-height routes entirely to
     flex centering — content centers in the full viewport instead of
     sitting in the shortened (100dvh − 2·padding) content box */
  padding-block: 0;
}
#stack .shell { width: 100%; }
.stack-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 300px 600px;
}
.stack-row {
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem 0.7rem;
  padding: 0.95rem 1.2rem;
}
.stack-row h3 {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0;
  padding: 0;
  border-bottom: 0;
  line-height: 1;
}
.stack-row ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}
.stack-row li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 0.32rem 0.62rem;
  border-radius: 0.375rem;
  border: 1px solid var(--hairline-strong);
  background: rgba(255,255,255,0.02);
}
.stack-row li.has-icon img { display: block; width: 16px; height: 16px; }
.stack-row li:hover {
  border-color: var(--neon-dim);
  transform: translateY(-1px);
  transition: border-color 0.3s var(--ease-out), transform 0.35s var(--ease-spring);
}

    @media (min-width: 900px) {
      /* wide/narrow alternation set by the renderer (proj-wide/proj-narrow),
         so the bento rhythm extends to any number of projects */
      .proj-wide { grid-column: span 7; }
      .proj-narrow { grid-column: span 5; }
      /* uniform band height: title/tag/blurb rows band cleanly across a row;
         the 7/5 column split carries the asymmetry instead */
      .project-art { height: 15rem; }
    }

    @media (max-width: 767px) {
      .stack-row { padding-block: 0.65rem; }
      /* compact art bands: trim demos to their hook, cut scroll cost */
      .project-art { height: 8.5rem; }
      .art-d.project-art { height: 10rem; } /* ascii face needs the rows */
      .platform-badge { right: 0.6rem; bottom: 0.6rem; padding: 0.34rem; border-radius: 999px; }
      .platform-badge .badge-label { display: none; } /* mobile: icon-only badge */
      .streak-head { padding-bottom: 0.25rem; margin-bottom: 0.2rem; }
      .mock-bar { padding: 0.35rem 0.85rem; }
      .mock-body { padding: 0.4rem 0.85rem; }
      .sm-hide { display: none !important; }
      .project-body { padding: 1.15rem 1.15rem 1.25rem; gap: 0.7rem; }
      .project-body h3 { font-size: 1.4rem; }
    }

    /* ---------- mobile performance: reduce backdrop-filter cost ---------- */
    @media (max-width: 767px) {
      .project,
      .stack-grid,
      .modal-panel,
      .menu-overlay {
        -webkit-backdrop-filter: blur(8px) saturate(110%);
        backdrop-filter: blur(8px) saturate(110%);
      }
      .platform-badge {
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
      }
    }

    /* ---------- reduced motion: disable backdrop-filter transitions ---------- */
    @media (prefers-reduced-motion: reduce) {
      .project,
      .stack-grid,
      .modal-panel,
      .menu-overlay,
      .platform-badge {
        transition: none !important;
      }
    }

    /* ---------- light theme page-surface overrides (mock windows stay dark) ---------- */
    [data-theme="light"] .project:hover,
    [data-theme="light"] .project:focus-visible {
      box-shadow:
        0 20px 50px -8px rgba(52, 59, 88, 0.4),
        inset 0 0 0 1px color-mix(in srgb, var(--neon) 45%, transparent);
    }
    [data-theme="light"] .project::after {
      background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(41, 89, 170, 0.10), transparent 70%);
    }

    /* light theme: tiny mono labels need full-strength ink (dimmed/muted fails at 11px) */
    [data-theme="light"] .tag { color: #343b58; }
    [data-theme="light"] .stack-row li { color: #343b58; }
    [data-theme="light"] .stack-row h3 { font-weight: 650; color: #2959aa; }
