/* ==========================================================================
   torti.dev — unified stylesheet
   Palette and type rebuilt from the real torti.dev design tokens (burnt
   orange primary, warm near-black neutrals, cream card surfaces, serif
   display headlines) — refined with a complementary secondary accent,
   tighter radii, and glow states.
   Single stylesheet shared by every page. Organized in sections:
   1. Design tokens   2. Reset & base   3. Layout helpers
   4. Header / nav    5. Buttons & tags 6. Hero
   7. Cards / grid    8. Timeline       9. Project template
   10. Galleries      11. Footer        12. Utilities & motion
   13. Responsive
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Palette — warm near-black base, burnt-orange primary (torti.dev's own
     system), a teal complement added for variety, cream "paper" surfaces
     for card content, echoing the reference site's light-on-dark cards. */
  --bg: #1c1917;
  --bg-soft: #221e1a;
  --surface: #2a2521;
  --surface-2: #342e28;
  --border: #4a3f34;
  --border-soft: #362f28;

  --navbar-bg: #201c1a;

  --text: #fdfaf6;
  --text-muted: #b8a99a;
  --text-faint: #8a7a6a;

  --accent: #d35b00;          /* burnt orange — primary CTA */
  --accent-strong: #f07a1f;   /* hover — brighter, not darker */
  --accent-dark: #993f00;
  --accent-ink: #2b1400;      /* text on accent-filled surfaces */
  --accent-alpha-10: rgba(211, 91, 0, 0.12);
  --accent-alpha-20: rgba(211, 91, 0, 0.22);

  --logo-orange: #d97a42;     /* wordmark / cursor — softer terracotta */
  --logo-orange-hover: #e8935f;
  --orange-glow: rgba(211, 91, 0, 0.55);
  --orange-glow-soft: rgba(211, 91, 0, 0.32);

  --accent-2: #2f9e8f;        /* teal complement — games / secondary */
  --accent-2-strong: #4dc0af;
  --accent-2-alpha: rgba(47, 158, 143, 0.16);

  --danger: #e5484d;

  /* Cream "paper" surface — used specifically for project-card content,
     the strongest, most distinctive element carried over from torti.dev. */
  --paper: #f4efe6;
  --paper-strong: #fffdf9;
  --paper-border: #e6dac8;
  --paper-ink: #241a10;
  --paper-secondary: #5a4c3c;
  --paper-muted: #8a7960;

  --font-headline: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-orange-glow: 0 0 18px var(--orange-glow), 0 0 30px var(--orange-glow-soft);
  --shadow-glass-glow: 0 0 15px rgba(255, 255, 255, 0.06);
  --shadow-text: 2px 2px 4px rgba(0, 0, 0, 0.55);

  --maxw: 1100px;
  --nav-h: 76px;

  color-scheme: dark;
}

/* ---------- 2. Reset & base ---------- */
* ,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  /* warm ambient wash, fixed so it doesn't affect layout/scroll perf */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 560px at 88% -12%, rgba(211, 91, 0, 0.14), transparent 60%),
    radial-gradient(760px 460px at -12% 15%, rgba(47, 158, 143, 0.07), transparent 55%),
    var(--bg);
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-headline); line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.005em; }
h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); position: relative; padding-bottom: 16px; }
h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 52px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
}
.center h2::after, h2.center::after { left: 50%; transform: translateX(-50%); }
h3 { font-size: 1.28rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

::selection { background: var(--accent); color: #fff; }

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

/* ---------- 3. Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

main { display: block; }

section { padding-block: 88px; }
section.tight { padding-block: 56px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--logo-orange);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--logo-orange);
  display: inline-block;
}

/* ---------- 4. Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(24, 20, 18, 0.95) 0%, rgba(32, 28, 25, 0.95) 50%, rgba(34, 30, 27, 0.95) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.nav {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--logo-orange);
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(217, 122, 66, 0.25);
  transition: color .15s ease, text-shadow .15s ease;
}
.brand:hover { color: var(--logo-orange-hover); text-shadow: var(--shadow-orange-glow); }
.brand .cursor-symbol {
  display: inline-block;
  animation: cursor-blink 1.3s infinite steps(1);
}
.brand:hover .cursor-symbol { animation-duration: 0.6s; }
@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0.15; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .brand .cursor-symbol { animation: none; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); box-shadow: var(--shadow-glass-glow); }
.nav-links a.is-active { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; box-shadow: var(--shadow-orange-glow); }

.nav-social {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: all .15s ease;
}
.nav-social a:hover { color: var(--logo-orange); border-color: var(--logo-orange); box-shadow: var(--shadow-orange-glow); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

.nav-right { display: flex; align-items: center; gap: 14px; }

/* breadcrumb back-link used on sub pages */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 0;
  transition: color .15s ease, gap .15s ease;
}
.back-link:hover { color: var(--logo-orange); gap: 11px; }

/* ---------- 5. Buttons & tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px -8px var(--orange-glow); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: var(--shadow-orange-glow); }

.btn-ghost { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.14); color: var(--text); }
.btn-ghost:hover { border-color: var(--logo-orange); color: var(--logo-orange-hover); box-shadow: var(--shadow-glass-glow); }

.btn-sm { padding: 8px 15px; font-size: 0.85rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-alpha-10);
  color: var(--accent-strong);
  border: 1px solid var(--accent-alpha-20);
}
.pill.orange { background: var(--accent-2-alpha); color: var(--accent-2-strong); border-color: rgba(47, 158, 143, 0.32); }
.pill.muted { background: var(--surface); color: var(--text-muted); border-color: var(--border); }

/* ---------- 6. Hero ---------- */
.hero {
  padding-top: 76px;
  padding-bottom: 60px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { margin-bottom: 18px; text-shadow: var(--shadow-text); }
.hero .lede { font-size: 1.15rem; max-width: 54ch; }
.hero .actions { margin-top: 30px; }

.hero-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin-inline: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #f6b46a 0%, #d35b00 55%, #7a3510 100%);
  border: 4px solid var(--logo-orange-hover);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-2), var(--shadow-orange-glow);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.stat {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
}
.stat .num { font-family: var(--font-headline); font-size: 1.7rem; font-weight: 700; color: var(--logo-orange); }
.stat .label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* Warm gradient band behind every page-level hero (echoes torti.dev's
   photographic page-hero banners, recreated in CSS so it stays
   dependency-free and consistent light/dark). */
.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 140% at 82% 0%, rgba(211, 91, 0, 0.22), transparent 60%),
    radial-gradient(90% 120% at 8% 10%, rgba(153, 63, 0, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(42, 30, 20, 0.55) 0%, transparent 75%);
}
.page-hero { position: relative; overflow: hidden; }

/* ---------- 7. Cards / grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-2); box-shadow: var(--shadow-orange-glow); }

/* Project cards: cream "paper" content area under the image — the
   single strongest, most distinctive pattern carried over from
   torti.dev, applied consistently across every project card here. */
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: var(--paper);
  border: 2px solid var(--paper-border);
}
.project-card:hover { border-color: var(--accent); background: var(--paper); box-shadow: var(--shadow-orange-glow); }
.project-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(155deg, rgba(211,91,0,0.18), rgba(47,158,143,0.10)), var(--surface-2);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--paper-border);
}
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-card .thumb .thumb-icon {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 2.4rem; color: var(--paper); opacity: 0.9;
}
.project-card .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-card .body h3 { margin-bottom: 0; color: var(--paper-ink); font-family: var(--font-headline); }
.project-card .role { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-dark); }
.project-card .desc { flex: 1; font-size: 0.94rem; color: var(--paper-secondary); }
.project-card .more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.88rem; color: var(--accent); margin-top: 4px; }
.project-card:hover .more { color: var(--accent-dark); gap: 9px; }

/* ---------- 8. Timeline (experience) ---------- */
.timeline {
  position: relative;
  border-left: 1px solid var(--border);
  margin-left: 6px;
  padding-left: 34px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-item {
  position: relative;
  padding: 22px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 28px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-item .when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: block;
}

.timeline-item .role-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.timeline-item .role-head .role-line { margin-bottom: 0; }
.role-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex: none;
  background: #fff;
}

.timeline-item .role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.timeline-item h3 { margin-bottom: 0; }
.timeline-item .org { color: var(--text-muted); font-size: 0.98rem; }

.timeline-item ul.bullets li.joke,
.r-entry ul li.joke {
  font-style: italic;
  opacity: 0.82;
}

.timeline-item ul.bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}
.timeline-item ul.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.timeline-item ul.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.85;
  transform: rotate(45deg);
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-strong);
  border: 1px solid var(--accent-alpha-20);
  background: var(--accent-alpha-10);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, box-shadow .15s ease;
}
.proj-link:hover { background: var(--accent-alpha-20); box-shadow: var(--shadow-glass-glow); }
.proj-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---------- 9. Project / article template ---------- */
.page-hero {
  padding-top: 52px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-soft);
}
.page-hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}
.page-hero h1 { text-shadow: var(--shadow-text); }
.page-hero .lede { font-size: 1.1rem; max-width: 68ch; }
.page-hero .hero-banner {
  margin-top: 34px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  background: var(--surface);
}
.page-hero .hero-banner img { width: 100%; height: auto; }

.prose {
  max-width: 74ch;
}
.prose h2 { margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; color: var(--text); }
.prose p { font-size: 1.02rem; }
.prose ul { margin: 1em 0 1.4em; padding-left: 1.3em; }
.prose ul li { color: var(--text-muted); margin-bottom: 0.55em; padding-left: 0.2em; }
.prose a:not(.btn) { color: var(--logo-orange); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(217,122,66,0.4); }
.prose a:not(.btn):hover { text-decoration-color: var(--logo-orange); }
.prose strong { color: var(--text); }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-style: italic;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.side-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}
.side-card h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.side-card dl { display: flex; flex-direction: column; gap: 10px; }
.side-card dt { font-size: 0.76rem; color: var(--text-faint); }
.side-card dd { margin: 2px 0 0; font-size: 0.94rem; color: var(--text); }

.divider { height: 1px; background: var(--border-soft); border: none; margin: 64px 0; }

/* callout / highlight box for "how it works" style explanations */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  margin: 1.8em 0;
}
.callout h4 { margin-bottom: 8px; font-size: 1rem; color: var(--accent-strong); font-family: var(--font-body); }
.callout p:last-child { margin-bottom: 0; }
.callout.orange { border-left-color: var(--accent-2); }
.callout.orange h4 { color: var(--accent-2-strong); }

/* embedded live tool frame */
.tool-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.tool-frame .tool-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.tool-frame .dots { display: flex; gap: 6px; }
.tool-frame .dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.tool-frame iframe { width: 100%; height: 520px; border: 0; background: #fff; display: block; }
.tool-frame-fallback {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- 10. Scrolling image gallery ---------- */
.gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 6px 20px;
  margin: 0 -6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.gallery::-webkit-scrollbar-track { background: transparent; }

.gallery figure {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: min(640px, 82vw);
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery figure img { width: 100%; height: auto; display: block; }
.gallery figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
}

.gallery-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
  margin-top: -10px;
  margin-bottom: 28px;
}

/* "How to play" downloadable-build card, used on game case-study pages */
.howto-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 4px 0 30px;
}
.howto-card > p.muted { margin-top: 0; }
.howto-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.howto-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
}
.howto-steps .step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-alpha-10);
  color: var(--accent-strong);
  border: 1px solid var(--accent-alpha-20);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}
.download-btn { display: inline-flex; align-items: center; gap: 10px; }
.download-btn svg { flex: none; }
.download-btn .btn-sub { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.85; margin-top: 1px; }
.download-note { display: none; }
@media (max-width: 720px) {
  .download-btn { display: none; }
  .download-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
  }
  .download-note svg { flex: none; margin-top: 1px; color: var(--text-faint); }
}

/* Embedded third-party (Scratch) project cards, used on the "older game projects" page */
.scratch-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}
.scratch-card .embed-wrap {
  background: #0b0b0b;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scratch-card .embed-wrap iframe {
  display: block;
  width: 485px;
  height: 402px;
  border: 0;
  margin: 0 auto;
}
.scratch-card .body { padding: 16px 18px 18px; border-top: 1px solid var(--border-soft); }
.scratch-card .body h4 { margin: 0 0 2px; }
.scratch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}

/* Illustrative art panels used in place of real screenshots (diagrams, wireframes, icon cards) */
.art-panel {
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
  background:
    linear-gradient(155deg, rgba(211,91,0,0.14), rgba(47,158,143,0.08)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 14px),
    var(--surface-2);
  padding: 18px;
}
.art-panel svg { width: 100%; height: 100%; max-height: 220px; }
.art-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--logo-orange);
  font-family: var(--font-mono);
}
.art-icon .glyph { font-size: 2.6rem; line-height: 1; }
.art-icon .cap { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

.diagram-block {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin: 1.6em 0;
}
.diagram-block svg { width: 100%; height: auto; display: block; }
.diagram-caption { margin-top: 12px; font-size: 0.85rem; color: var(--text-faint); font-family: var(--font-mono); }

/* Real screenshots placed inline within case-study prose */
.inline-figure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.6em 0;
}
.inline-figure img { width: 100%; height: auto; display: block; }
.inline-figure figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ---------- 11. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--navbar-bg);
  padding-block: 56px 40px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-muted); font-size: 0.94rem; transition: color .15s ease; }
.footer-links a:hover { color: var(--logo-orange); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- 12. Utilities & motion ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--text-muted); }
.accent { color: var(--logo-orange); }

/* Content stays fully visible/readable at all times (crawlers, no-JS, slow
   observers) — only a subtle position shift animates in on scroll. */
.reveal {
  transform: translateY(14px);
  transition: transform .5s ease;
}
.reveal.is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: none; }
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; max-width: 220px; }
  .content-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-card { flex: 1 1 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  section { padding-block: 60px; }
  .nav-links, .nav-social { display: none; }
  .nav-toggle { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .gallery figure { width: 88vw; }
  .tool-frame iframe { height: 420px; }

  body.nav-open .mobile-menu { display: flex; }
}

@media (max-width: 480px) {
  .wrap { padding-inline: 18px; }
  .stat-row { grid-template-columns: 1fr; }
}

/* mobile dropdown menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #221e1a 0%, #1e1a17 50%, #1a1614 100%);
  backdrop-filter: blur(10px);
  z-index: 99;
  flex-direction: column;
  padding: 20px 24px 40px;
  overflow-y: auto;
  gap: 10px;
}
.mobile-menu a {
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 1.05rem;
  color: var(--text);
}
.mobile-menu a.is-active { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.mobile-menu .mobile-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.mobile-menu .mobile-social a {
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
}
