/* FUI Archive  --  single source of truth stylesheet
 *
 * Structure:
 *   0. Tokens
 *   1. Resets
 *   2. Layout (header, footer, film/entry/hero, about)
 *   3. Components (cards, sections, badges, tags, lists, ux-grid, prod-table, sidebar)
 *   4. Utilities
 *   5. Mobile (all media queries)
 *
 * No inline <style> blocks in HTML pages. Any new component style goes here.
 */

/* ============================================================
 * 0. TOKENS
 * ============================================================ */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --border: #222222;
  --border-soft: #1d1d1d;
  --text: #e8e8e8;
  --text-dim: #888888;
  --text-muted: #444444;
  --accent: #00cfff;
  --accent-dim: #007a99;
  --accent-glow: rgba(0, 207, 255, 0.08);
  --accent-ink: #000;
  --red: #ff4444;
  --green: #44ff88;
  --amber: #ffaa00;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-serif: 'IBM Plex Serif', Georgia, serif;
  --line: 1px solid var(--border);
  --radius: 2px;
  --max: 1200px;
}

/* ============================================================
 * 1. RESETS
 * ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
 * 2. LAYOUT
 * ============================================================ */

/* Site header (all pages) */
.site-header {
  border-bottom: var(--line);
  padding: 20px 32px;
  display: flex;
  align-items: baseline;
  gap: 24px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .wordmark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.site-header .wordmark span { color: var(--accent); }
.site-header .breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-header .breadcrumb a { color: var(--text-dim); }
.site-header .breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.site-header nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  align-items: baseline;
}
.site-header nav a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 4px;  /* small hit-area increase without visual weight */
}
.site-header nav a:hover,
.site-header nav a.active { color: var(--accent); text-decoration: none; }

/* Hamburger (mobile only) --  a stacked-block glyph in mono brackets */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-left: auto;
  min-height: 40px;
  min-width: 56px;
  transition: color 0.15s, border-color 0.15s;
}
.nav-toggle:hover, .nav-toggle:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

/* Slide-in mobile nav panel (right side) */
.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 82vw);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(10px);
  border-left: var(--line);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 32px;
  pointer-events: none;
}
.nav-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.nav-panel-close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 8px 12px;
  border-radius: var(--radius);
  min-height: 40px;
  min-width: 88px;
  cursor: pointer;
  margin-bottom: 32px;
  transition: border-color 0.15s;
}
.nav-panel-close:hover { border-color: var(--accent); }
.nav-panel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.nav-panel-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-panel-items a {
  display: block;
  padding: 16px 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: var(--line);
  min-height: 52px;
  transition: color 0.15s;
}
.nav-panel-items a .num {
  color: var(--accent);
  margin-right: 12px;
  font-weight: 500;
}
.nav-panel-items a:hover,
.nav-panel-items a.active { color: var(--accent); text-decoration: none; }
.nav-panel-foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}
.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
body.nav-open { overflow: hidden; }

/* Home hero */
.hero {
  padding: 80px 32px 64px;
  max-width: var(--max);
  margin: 0 auto;
  border-bottom: var(--line);
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  max-width: 720px;
  margin-bottom: 24px;
}
.hero p {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: var(--line);
}
.hero-stat .num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.hero-stat .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Home filter bar */
.filter-bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: var(--line);
  flex-wrap: wrap;
}
.filter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 8px;
}
.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Home entries grid */
.entries {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 32px;
}
.entries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  border: var(--line);
}
.entries-empty {
  padding: 40px 20px;
  border: var(--line);
  margin-top: 16px;
  text-align: center;
}
.entries-empty p {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Home about section (two-column blurb below entries) */
.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 32px;
  border-top: var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.about h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 16px;
}
.about p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* Film page layout (two-column article + sidebar) */
.film-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
}
.film-main { border-right: var(--line); padding: 56px 48px 80px 0; }
.film-sidebar { padding: 56px 0 80px 36px; }

.film-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.film-title {
  font-family: var(--font-sans);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 8px;
}
.film-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 32px; }

/* FUI spec entry layout (two-column article + sidebar) */
.entry-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
}
.entry-main {
  border-right: var(--line);
  padding: 56px 48px 80px 0;
}
.entry-sidebar {
  padding: 56px 0 80px 36px;
}
.entry-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.entry-title {
  font-family: var(--font-sans);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 8px;
}
.entry-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.entry-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: var(--line);
}

/* Footer */
footer {
  border-top: var(--line);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ============================================================
 * 3. COMPONENTS
 * ============================================================ */

/* --- Cards (home film cards + film-page FUI cards) --- */
/* Two variants share ~all behavior. Structural class = .entry-card (home)
 * or .fui-card (film page). Both use the same flexbox row + right-image
 * pattern. Consolidated selectors handle both. */
.entry-card,
.fui-card {
  background: var(--surface);
  display: flex;
  flex-direction: row;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.15s;
}
.entry-card { height: 160px; border: none; }
.fui-card { height: 152px; }
.entry-card:hover,
.fui-card:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.entry-card:hover .card-arrow,
.fui-card:hover .card-arrow { opacity: 1; }

.card-thumb,
.fui-card-thumb {
  height: 100%;
  object-fit: cover;
  display: block;
  border-left: var(--line);
  flex-shrink: 0;
  order: 2;
}
.card-thumb { width: 30%; max-width: 320px; }
.fui-card-thumb { width: 34%; max-width: 300px; }

.card-body,
.fui-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  order: 1;
  min-width: 0;
}
.card-body { padding: 24px 30px; gap: 12px; }
.fui-card-body { padding: 22px 28px; gap: 8px; }

.card-arrow {
  position: absolute;
  color: var(--accent);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}
.entry-card .card-arrow { top: 22px; right: calc(30% + 20px); }
.fui-card .card-arrow { top: 14px; right: calc(34% + 18px); }

.card-meta { display: flex; gap: 10px; align-items: center; }
.card-type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 2px 7px;
  border-radius: var(--radius);
}
.card-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.card-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.card-significance {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags,
.fui-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.fui-card-title { font-size: 17px; font-weight: 500; color: var(--text); }
.fui-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* FUI grid on film page */
.fui-grid { display: grid; gap: 1px; border: var(--line); }
.fui-status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}
.fui-status.draft { color: var(--text-muted); }

/* --- Sections (all article pages) --- */
.section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: var(--line);
}
.section:last-child { border-bottom: none; }
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 10px 5px;
  margin-bottom: 24px;
  border-radius: var(--radius);
}
.section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.section p:last-child { margin-bottom: 0; }

/* --- Badges (FUI spec entry-badges row) --- */
.badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius);
}
.badge-type { color: var(--accent); border: 1px solid var(--accent-dim); }
.badge-year { color: var(--text-muted); border: 1px solid var(--border); }
.badge-tag { color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); }

/* --- Tags (shared: mono chip, small, uppercase) --- */
.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius);
}
.entry-card:hover .tag,
.fui-card:hover .tag { background: var(--bg); }

/* --- UX analysis grid (FUI spec pages) --- */
.ux-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: var(--line);
  margin-bottom: 24px;
}
.ux-cell {
  padding: 16px 20px;
  background: var(--surface);
}
.ux-cell .ux-key {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ux-cell .ux-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.ux-score {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ux-score .num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--amber);
}
/* Score color modifiers: apply on parent .ux-score */
.ux-score.score-good .num { color: var(--green); }
.ux-score.score-amber .num { color: var(--amber); }
.ux-score.score-poor .num { color: var(--red); }
.ux-score .denom {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.ux-score .label {
  font-size: 12px;
  color: var(--text-dim);
}

/* --- Observation lists (Key observations, Design lessons, Anti-patterns) --- */
.obs-list { list-style: none; }
.obs-list li {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  padding: 12px 0;
  border-bottom: var(--line);
  padding-left: 16px;
  position: relative;
}
.obs-list li:last-child { border-bottom: none; }
.obs-list li::before {
  content: '—';  /* CSS bullet marker  --  visual glyph, not prose */
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.obs-list.lessons li::before { color: var(--green); content: '+'; }
.obs-list.anti li::before { color: var(--red); content: '×'; }

/* --- Production credit table --- */
.prod-table { width: 100%; }
.prod-table tr { border-bottom: var(--line); }
.prod-table tr:last-child { border-bottom: none; }
.prod-table td {
  padding: 10px 0;
  font-size: 13px;
  vertical-align: top;
}
.prod-table td:first-child {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: 130px;
  padding-right: 16px;
  padding-top: 13px;
}
.prod-table td:last-child { color: var(--text-dim); }

/* --- Sidebar blocks --- */
.sb-block {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: var(--line);
}
.sb-block:last-child { border-bottom: none; }
.sb-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* --- Color palette (FUI spec sidebar) --- */
.palette {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.palette-hue {
  font-size: 12px;
  color: var(--text-dim);
}

/* --- FUI profile rows (sidebar) --- */
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: var(--line);
}
.profile-row:last-child { border-bottom: none; }
.profile-row .pk {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.profile-row .pv {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  max-width: 160px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-on { background: var(--green); }
.dot-off { background: var(--text-muted); }

/* --- Reference list (sidebar links) --- */
.ref-list { list-style: none; }
.ref-list li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: var(--line);
}
.ref-list li:last-child { border-bottom: none; }
.ref-list a { color: var(--text-dim); font-size: 12px; }
.ref-list a:hover { color: var(--accent); }

/* --- Full tags section (FUI spec sidebar) --- */
.tags-section { margin-bottom: 8px; }
.tags-section .ts-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

/* --- S+S dev-only callout block --- */
.ss-block {
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  padding: 20px 24px;
  border-radius: var(--radius);
}
.ss-block .ss-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.ss-block p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 8px;
}
.ss-block p:last-child { margin-bottom: 0; }

/* --- Carousel (top-of-page hero for FUI spec pages) ---
   Curated 3-4 slides: video-first if a reference clip exists, then 2-3
   signature stills. Not the full gallery -- the comprehensive gallery
   lives lower on the page. 16:9 crop for consistent frame across slides.

   Markup contract:
   <div class="carousel" data-carousel>
     <div class="carousel-label">// carousel  --  N frames</div>
     <div class="carousel-stage">
       <div class="carousel-slide is-active" data-type="video">
         <video src="..." muted loop playsinline autoplay preload="metadata"></video>
       </div>
       <div class="carousel-slide" data-type="image">
         <img src="..." alt="..." loading="lazy">
       </div>
       ...
     </div>
     <div class="carousel-caption" data-caption>...</div>
     <div class="carousel-ui">
       <div class="carousel-counter"><span data-current>01</span> / <span data-total>04</span></div>
       <button class="carousel-nav prev" data-prev aria-label="Previous slide">[ &larr; ]</button>
       <div class="carousel-ticks" data-ticks></div>
       <button class="carousel-nav next" data-next aria-label="Next slide">[ &rarr; ]</button>
     </div>
   </div>
*/
.carousel {
  margin: 0 0 48px;
  border: var(--line);
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
}
.carousel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 16px;
  border-bottom: var(--line);
  background: var(--surface);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.carousel-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.carousel-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease-out;
}
.carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
}
.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-caption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 10px 16px 12px;
  background: var(--surface);
  border-top: var(--line);
  min-height: 42px;
  line-height: 1.55;
}
.carousel-caption .caption-mark {
  color: var(--accent);
  margin-right: 6px;
}
.carousel-ui {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: var(--line);
}
.carousel-nav {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.carousel-nav:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.carousel-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.carousel-nav:disabled:hover {
  color: var(--text-dim);
  border-color: var(--border);
}
.carousel-ticks {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 22px;  /* stable frame; big enough for a real touch target */
  padding: 4px 0;
}
.carousel-tick {
  flex: 1 1 auto;
  height: 3px;
  background: var(--border);
  border: none;
  padding: 0;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.15s, height 0.15s, box-shadow 0.15s;
  align-self: center;
  /* Invisible click-target padding to make ticks easy to hit without visual weight */
  position: relative;
}
.carousel-tick::before {
  content: '';
  position: absolute;
  inset: -10px 0;  /* expand hit area vertically ~20px total without affecting layout */
}
.carousel-tick:hover {
  background: var(--text-muted);
}
.carousel-tick.is-active {
  background: var(--accent);
  height: 4px;
  box-shadow: 0 1px 6px 0 var(--accent-glow);
}

@media (max-width: 620px) {
  .carousel-nav { padding: 6px 10px; font-size: 10px; }
  .carousel-ui { gap: 8px; }
  .carousel-label { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* --- Reference gallery (comprehensive; lower on FUI spec pages) ---
   3-column at desktop, collapses to 2 then 1 on smaller viewports.
   Each item is click-to-lightbox via _/lightbox.js. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: var(--line);
}
.gallery-item {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  cursor: zoom-in;
  transition: background 0.15s;
}
.gallery-item:hover { background: var(--surface-2); }
.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: opacity 0.15s;
}
.gallery-item:hover img { opacity: 0.9; }
.gallery-caption {
  padding: 8px 12px 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.55;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.gallery-caption.is-select { color: var(--accent); }
.gallery-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.gallery-note .mark {
  color: var(--accent);
}

/* --- Lightbox overlay (used by both gallery and, optionally, carousel) ---
   Injected/toggled by _/lightbox.js. Hidden by default. */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 40px 32px 28px;
}
.lightbox.is-open { display: flex; }
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
  padding: 16px 24px 8px;
  max-width: 900px;
  margin: 0 auto;
  min-height: 32px;
}
.lightbox-caption .caption-mark {
  color: var(--accent);
  margin-right: 6px;
}
.lightbox-ui {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  gap: 14px;
}
.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lightbox-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.lightbox-nav {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lightbox-nav:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}
.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
body.lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .gallery { grid-template-columns: 1fr; }
  .lightbox { padding: 48px 12px 20px; }
  .lightbox-close { top: 10px; right: 10px; }
}

/* --- Minor interfaces grid (film page: 2-column card grid of minor UI fragments) --- */
.minor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: var(--line);
  margin-bottom: 8px;
}
.minor-card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: background 0.15s;
}
.minor-card:hover {
  background: var(--surface-2);
}
.minor-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: var(--line);
}
.minor-card-body {
  padding: 16px 20px;
}
.minor-card-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.minor-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* 404 -- served for any missing path, at any depth */
.notfound {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 16vh, 200px) 24px;
}
.notfound-code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 20px;
}
.notfound-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}
.notfound-body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 62ch;
  margin-bottom: 40px;
}
.notfound-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
}
.notfound-links a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: color 0.15s, border-color 0.15s;
}
.notfound-links a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ============================================================
 * 5. MOBILE
 * ============================================================ */

/* Tablet / small desktop */
@media (max-width: 900px) {
  .film-layout,
  .entry-layout {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }
  /* Sidebar-first on mobile: metadata orients before the deep read. */
  .film-main,
  .entry-main {
    border-right: none;
    border-top: var(--line);
    padding: 40px 0 40px;
    order: 2;
  }
  .film-sidebar,
  .entry-sidebar {
    padding: 32px 0 24px;
    order: 1;
    border-bottom: none;
  }
  .ux-grid { grid-template-columns: 1fr; }
  .minor-grid { grid-template-columns: 1fr; }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
  html { font-size: 14.5px; }  /* subtle body downshift */
  .site-header { padding: 14px 18px; gap: 14px; }
  .site-header nav { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-header .breadcrumb { font-size: 10px; max-width: 60vw; }
  .hero { padding: 44px 20px 36px; }
  .hero h1 { font-size: clamp(28px, 8vw, 42px); }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .filter-bar { padding: 14px 18px; gap: 8px; }
  .filter-btn {
    padding: 10px 14px;   /* ~40px height */
    font-size: 11px;
    min-height: 40px;
  }
  .entries { padding: 20px 18px; }
  footer { padding: 14px 18px; flex-direction: column; gap: 8px; align-items: flex-start; }
  .ref-list li { padding: 10px 0; }  /* larger tap area on sidebar links */
}

/* Phone -- cards collapse to vertical */
@media (max-width: 620px) {
  .entry-card,
  .fui-card {
    height: auto;
    flex-direction: column;
  }
  .card-thumb,
  .fui-card-thumb {
    width: 100%;
    max-width: none;
    aspect-ratio: 16/9;
    height: auto;
    border-left: none;
    border-bottom: var(--line);
    order: 1;
  }
  .card-body,
  .fui-card-body { order: 2; padding: 20px 20px 22px; }
  .entry-card .card-arrow { right: 18px; top: auto; bottom: 18px; }
  .fui-card .card-arrow { right: 14px; top: auto; bottom: 14px; }
  .entry-title,
  .film-title { font-size: clamp(26px, 8vw, 38px); }
  .section-label { font-size: 10.5px; }
  .entry-badges { gap: 8px; margin-bottom: 32px; padding-bottom: 32px; }
  .badge { padding: 6px 12px; font-size: 9.5px; min-height: 30px; display: inline-flex; align-items: center; }
  .archive-block { padding: 20px; margin-bottom: 20px; }
}

/* ============================================================
 * ARCHIVE-SPECIFIC STYLING
 * ============================================================ */

/* Archive entry blocks - unified with site card system */
.archive-block {
  background: var(--surface);
  margin-bottom: 24px;
  padding: 24px;
  position: relative;
  transition: background 0.15s;
  border: var(--line);
}

.archive-block:hover {
  background: var(--surface-2);
}

.archive-header {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.archive-header h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}

.archive-header h3 a {
  color: var(--accent);
  text-decoration: none;
}

.archive-header h3 a:hover {
  text-decoration: underline;
}

.archive-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.archive-block p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.archive-block p:last-of-type {
  margin-bottom: 0;
}

.archive-credit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 8px;
  border-top: var(--line);
}

