/* ==========================================================================
   Fonts (self-hosted Poppins, latin subset, with metric-matched fallback
   so the swap from Arial causes no layout shift)
   ========================================================================== */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/poppins-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/poppins-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/poppins-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/poppins-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial adjusted to Poppins metrics (values from fontaine) */
@font-face {
  font-family: 'Poppins Fallback';
  src: local('Arial');
  ascent-override: 93.62%;
  descent-override: 31.21%;
  line-gap-override: 8.92%;
  size-adjust: 112.16%;
}

/* ==========================================================================
   Design tokens (locked values from design spec)
   ========================================================================== */
:root {
  /* Frosted-glass effect knobs (tuned in design phase, not colors).
     Do not adjust without a spec update. */
  --blur: 47px;
  --falloff: 51;
  --softness: 32;
  --tint: 0.99;
  --width: 68;
  --content-max: 760px;

  /* ======================================================================
     Every color the site paints lives here. Dark is the default theme;
     :root[data-theme="light"] at the bottom of this file re-points these
     same tokens to a warm cream set. Rules only ever reference var(--*),
     so a surface can never be off-theme.
     ====================================================================== */

  /* Page backgrounds */
  --bg-dark: #060912;
  --bg-mid: #0a0f1a;
  --bg-light: #f7f9fc;

  /* Text */
  --ink: #e6ecf4;
  --ink-mute: #cfd8e3;
  --ink-dim: #9bb5d6;
  --heading: #ffffff;         /* headings + strong body text */
  --heading-hover: #ffffff;   /* text that brightens on hover */

  /* Accent */
  --accent: #3b6fe5;
  --accent-light: #7aa7ff;
  --accent-hover: #2f5ec4;
  --on-accent: #ffffff;       /* text sitting on an accent fill */
  --accent-soft: 123, 167, 255;      /* rgb, used with inline alpha for tints */
  --accent-glow: rgba(59, 111, 229, 0.4);
  --selection: rgba(59, 111, 229, 0.55);

  /* Neutral overlay channel (rgb + inline alpha): light films on dark,
     warm-dark films on cream. Borders, hairlines, faint fills, sheens. */
  --wash: 255, 255, 255;

  /* Raised surfaces */
  --surface-1: rgba(255, 255, 255, 0.03);        /* cards */
  --surface-1-hover: rgba(255, 255, 255, 0.05);
  --fill-2: rgba(255, 255, 255, 0.05);           /* chips, secondary buttons */
  --fill-2-hover: rgba(255, 255, 255, 0.09);
  --fill-3: rgba(255, 255, 255, 0.05);           /* skill tags */
  --border: rgba(255, 255, 255, 0.07);           /* card / panel border */
  --code-bg: rgba(0, 0, 0, 0.4);                 /* code blocks */

  /* Shadow channel (rgb + inline alpha) */
  --shadow: 0, 0, 0;

  /* Whites that always sit on the dark image tiles, plus the pdf frame */
  --plate: #ffffff;           /* app-icon plates */
  --on-tile: #ffffff;         /* text on a dark tile */
  --viewer-bg: var(--mask-on)000;

  /* Sticky chrome: translucent dark now, translucent cream in light mode */
  --topbar-bg: rgba(6, 9, 18, 0.85);

  /* Dark image-container tiles (project thumbnails, award icons, hero mosaic).
     Intentionally constant across themes: they hold white logos and read as
     premium thumbnails on cream. */
  --tile-base: #0a0f1a;
  --tile-deep: #05080f;
  --tile-mosaic: #0f1b33;
  --tile-default: #1e3a8a;
  --tile-games: #1a2436;
  --tile-access: #1a3a30;
  --tile-ai: #2d2456;
  --tile-mobile: #1e3a55;
  --award-silver: #4a3a7e;
  --award-blue: #1e5a8a;
  --award-green: #2d6e5e;
  --glyph-silver: #b09ee0;
  --glyph-blue: #8ec5e8;
  --glyph-green: #7ad1b0;

  /* Hero frosted-glass tint (rgb + inline alpha); hero is dark in both themes */
  --glass: 6, 9, 18;
  --mask-on: #000;              /* opaque stop for blur-falloff masks (alpha stencil, not a color) */

  /* Badges */
  --badge-award-bg: rgba(255, 200, 80, 0.10);
  --badge-award-fg: #f4c266;
  --badge-award-border: rgba(244, 194, 102, 0.3);
  --badge-ship-bg: rgba(122, 209, 176, 0.12);
  --badge-ship-fg: #7ad1b0;
  --badge-ship-border: rgba(122, 209, 176, 0.3);
}

/* Global */
html {
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: 'Poppins', 'Poppins Fallback', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-mid);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  margin: 0 0 15px;
  letter-spacing: normal;
  text-wrap: balance;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--on-accent);
}

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

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

main { display: block; }

/* Inline SVG icons (replaces the Font Awesome webfont) */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
}

/* Scroll-reveal (replaces the AOS library). Elements with data-aos start
   hidden only when JS is running; the IntersectionObserver in myscripts.js
   adds .aos-animate as they enter the viewport. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-aos] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .js [data-aos].aos-animate {
    opacity: 1;
    transform: none;
  }
}

/* Skip layout/paint work for sections below the first viewport */
#experience,
#skills,
.awards-v2,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Generic section wrappers (work + skills use these)
   ========================================================================== */
#experience,
#skills {
  padding: 90px 64px;
}
#experience h2,
#skills h2 {
  font-size: clamp(26px, 1.2vw + 22px, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 36px;
  color: var(--heading);
  text-align: left;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
#experience { background: var(--bg-mid); }
#skills { background: var(--bg-dark); }

/* ==================== */
/* WORK EXPERIENCE      */
/* ==================== */
.work-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.job-titles {
  flex: 0 0 200px;
  text-align: left;
}
.job-titles .job-btn {
  display: block;
  width: 100%;
  background: var(--fill-2);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: var(--ink-mute);
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0 6px 6px 0;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}
.job-titles .job-btn.active,
.job-titles .job-btn:hover {
  background: rgba(var(--accent-soft), 0.08);
  border-left-color: var(--accent);
  color: var(--accent-light);
}
.job-details {
  flex: 1;
  text-align: left;
  position: relative;
  min-height: 200px;
}
.job-description {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.job-description.hidden {
  opacity: 0;
  transform: translateX(-15px);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.job-description:not(.hidden) {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}
.job-description h3 {
  color: var(--heading);
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.job-meta {
  color: var(--ink-mute);
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.job-note {
  color: var(--ink-dim);
  font-size: 0.82rem;
  font-style: italic;
  margin-bottom: 16px;
}
.job-description ul {
  padding-left: 20px;
  margin: 0;
}
.job-description li {
  color: var(--ink-mute);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

/* ==================== */
/* SKILLS SECTION       */
/* ==================== */
.skills-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}
.skill-category {
  text-align: left;
}
.skill-category h3 {
  color: var(--heading);
  font-size: 0.92rem;
  margin-bottom: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.skill-category h3 .icon {
  color: var(--accent-light);
  margin-right: 8px;
  font-size: 0.85rem;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.skill-tags span {
  background: var(--fill-3);
  border: 1px solid rgba(var(--wash), 0.08);
  color: var(--ink-mute);
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1.4;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.skill-tags span:hover {
  border-color: rgba(var(--accent-soft), 0.4);
  color: var(--accent-light);
}

/* ==========================================================================
   FOOTER (replaces old contact section)
   ========================================================================== */
.site-footer {
  background: var(--bg-dark);
  padding: 36px 32px 28px;
  border-top: 1px solid rgba(var(--wash), 0.05);
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .footer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.site-footer .footer-links {
  display: flex;
  gap: 18px;
}
.site-footer .footer-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  font-size: 15px;
  background: var(--fill-2);
  border: 1px solid rgba(var(--wash), 0.06);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.site-footer .footer-links a:hover {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
.site-footer .footer-meta {
  font-size: 12px;
  color: var(--ink-dim);
  margin: 0;
}

/* ==========================================================================
   PROJECT DETAIL PAGES (blog-style layout)
   ========================================================================== */
.project-body { background: var(--bg-mid); }

/* Top bar: back button + optional github/steam/external link buttons */
.project-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px max(24px, calc((100vw - var(--content-max)) / 2 + 24px));
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(var(--wash), 0.06);
}
.project-topbar .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--fill-2);
  border: 1px solid rgba(var(--wash), 0.10);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.project-topbar .back-btn:hover {
  background: rgba(var(--wash), 0.08);
  border-color: var(--accent-light);
  color: var(--heading-hover);
}
.project-topbar .topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-accent);
  background: var(--accent);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.project-topbar a.topbar-action:hover { background: var(--accent-hover); transform: translateY(-1px); }
.project-topbar .topbar-disabled {
  background: rgba(var(--wash), 0.04);
  border: 1px solid rgba(var(--wash), 0.10);
  color: var(--ink-dim);
  opacity: 0.7;
  cursor: default;
}

/* Project hero (title block) */
.project-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.project-hero { margin-bottom: 40px; }
.project-hero-logo {
  display: grid; place-items: center;
  width: 64px; height: 64px; padding: 11px;
  margin: 0 0 20px;
  background: var(--plate); border-radius: 22%;
  box-shadow: 0 14px 34px -12px rgba(var(--shadow), 0.6);
}
.project-hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.project-hero .project-eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.project-hero h1 {
  font-size: clamp(32px, 2.2vw + 24px, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0 0 14px;
}
.project-hero .project-subtitle {
  font-size: 18px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin: 0 0 20px;
  max-width: 640px;
}
.project-hero .project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-hero .project-tech span {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(var(--accent-soft), 0.10);
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-soft), 0.20);
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Hero media (full-width image or video below title) */
.project-hero-media {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 0 48px;
  border: 1px solid rgba(var(--wash), 0.06);
}

/* Live-site handoff band, between the demo and the build log */
.project-live-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 48px;
  padding: 20px 24px;
  border: 1px solid rgba(var(--accent-soft), 0.20);
  border-radius: 14px;
  background: rgba(var(--accent-soft), 0.06);
}
.project-live-cta .live-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.project-live-cta .live-line {
  margin: 0;
  font-size: 15px;
  color: var(--ink-mute);
  max-width: 46ch;
}
.project-live-cta .live-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}
.project-live-cta .live-btn:hover { transform: translateY(-2px); background: var(--accent-light); }
.project-live-cta .live-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Full-width key-art banner: sharp image centered, blurred fill on the sides */
.project-banner {
  position: relative;
  width: 100%;
  height: clamp(220px, 30vw, 380px);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(var(--wash), 0.06);
  background: var(--tile-deep);
  isolation: isolate;
}
.project-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--banner-img);
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(1.15);
  transform: scale(1.25);
  opacity: 0.6;
}
.project-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  box-shadow: inset 0 0 80px 24px rgba(var(--glass), 0.6);
}
.project-banner img {
  position: relative;
  height: 82%;
  width: auto;
  max-width: 94%;
  object-fit: contain;
  display: block;
  margin: 0;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(var(--shadow), 0.5);
}

/* Blog-style content typography */
.project-content {
  color: var(--ink-mute);
  font-size: 16px;
  line-height: 1.75;
}
.project-content > * + * { margin-top: 1.2em; }
.project-content h2 {
  font-size: 26px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
  margin-top: 2.4em;
  margin-bottom: 0.6em;
  text-align: left;
}
.project-content h2::after { display: none; }
.project-content h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--heading);
  margin-top: 1.8em;
  margin-bottom: 0.4em;
}
.project-content p { margin: 0; }
.project-content a {
  color: var(--accent-light);
  border-bottom: 1px solid rgba(var(--accent-soft), 0.3);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.project-content a:hover { color: var(--heading-hover); border-color: var(--accent-light); }
.project-content ul, .project-content ol { padding-left: 1.4em; margin: 1em 0; }
.project-content li { margin-bottom: 0.4em; }
.project-content li::marker { color: var(--accent-light); }
.project-content strong { color: var(--heading); }
.project-content em { color: var(--ink); font-style: italic; }
.project-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(var(--accent-soft), 0.10);
  border-radius: 4px;
  color: var(--accent-light);
}
.project-content pre {
  background: var(--code-bg);
  border: 1px solid rgba(var(--wash), 0.06);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}
.project-content pre code { background: none; padding: 0; color: var(--ink); }
.project-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  color: var(--ink-mute);
  font-style: italic;
  margin-left: 0;
}
.project-content img,
.project-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 8px;
  border: 1px solid rgba(var(--wash), 0.06);
}
.project-content video { width: 100%; }

/* PDF embed block */
.project-pdf {
  margin: 56px 0 0;
}
.project-pdf h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 14px;
}
.project-pdf .deck-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.project-pdf .deck-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: none;
}
.project-pdf .deck-download.pdf-download {
  background: var(--accent);
  color: var(--on-accent);
}
.project-pdf .deck-download.pdf-download:hover { background: var(--accent-hover); }
.project-pdf .deck-download.pptx-download {
  background: var(--fill-2);
  border: 1px solid rgba(var(--wash), 0.12);
  color: var(--ink);
}
.project-pdf .deck-download.pptx-download:hover {
  background: var(--fill-2-hover);
}
.project-pdf .deck-note {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}
.project-pdf .pdf-embed {
  display: block;
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 1px solid rgba(var(--wash), 0.08);
  border-radius: 10px;
  background: var(--viewer-bg);
}

/* Image gallery below content */
.project-images {
  margin: 64px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-images img,
.project-images video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(var(--wash), 0.06);
}
.project-images img:first-child:last-child,
.project-images video:first-child:last-child {
  grid-column: span 2;
}

/* Project shell: wraps optional sidebar + main content.
   No-op wrapper unless .with-sidebar is present, so single-page projects
   are visually unchanged. */
.project-shell.with-sidebar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.project-shell.with-sidebar .project-page {
  max-width: none;
  padding: 56px 0 80px;
}

/* Sidebar nav */
.project-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 56px 0 0;
}
.sidebar-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.sidebar-project-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 18px;
  letter-spacing: -0.005em;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid rgba(var(--wash), 0.08);
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
  display: block;
  padding: 8px 14px;
  margin-left: -1px;
  font-size: 14px;
  color: var(--ink-mute);
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sidebar-nav a:hover {
  color: var(--heading-hover);
  background: rgba(var(--wash), 0.03);
}
.sidebar-nav a.active {
  color: var(--accent-light);
  border-left-color: var(--accent-light);
  background: rgba(var(--accent-soft), 0.06);
}

/* Sidebar collapses to a horizontal pill nav above content on tablet/phone */
@media (max-width: 899px) {
  .project-shell.with-sidebar {
    display: block;
    max-width: var(--content-max);
    padding: 0;
  }
  .project-sidebar {
    position: static;
    padding: 28px 24px 0;
  }
  .sidebar-eyebrow { display: none; }
  .sidebar-project-name { font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; }
  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-left: none;
    border-top: 1px solid rgba(var(--wash), 0.08);
    padding-top: 10px;
  }
  .sidebar-nav a {
    margin-left: 0;
    border-left: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
  }
  .sidebar-nav a.active {
    border-left: none;
    background: rgba(var(--accent-soft), 0.12);
  }
  .project-shell.with-sidebar .project-page {
    padding: 24px 24px 60px;
  }
}

@media (max-width: 639px) {
  .project-topbar { padding: 12px 18px; gap: 8px; flex-wrap: wrap; }
  .project-topbar a, .project-topbar a + a { padding: 8px 12px; font-size: 12px; }
  /* Hide label visually but keep it for screen readers so icon-only buttons
     still have an accessible name on mobile. */
  .project-topbar .back-btn span,
  .project-topbar a + a span {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }
  .project-page { padding: 36px 18px 60px; }
  .project-hero .project-subtitle { font-size: 16px; }
  .project-content { font-size: 15px; }
  .project-content h2 { font-size: 22px; }
  .project-images { grid-template-columns: 1fr; }
  .project-sidebar { padding: 20px 18px 0; }
  .project-shell.with-sidebar .project-page { padding: 20px 18px 60px; }
}

/* Skip-to-content link for keyboard users (overridden by .skip-link at top of file) */
._unused_skip {
  color: inherit;
  text-decoration: none;
}


/* ==========================================================================
   HERO v2 (split layout with frosted glass + tilted project mosaic)
   ========================================================================== */
.hero-v2 {
  position: relative;
  height: 680px;
  background: var(--bg-dark);
  overflow: hidden;
  color: var(--ink);
  isolation: isolate;
}

/* Mosaic background -------------------------------------------------------- */
.mosaic-bg {
  position: absolute;
  top: -120px;
  bottom: -120px;
  left: -8%;
  right: -8%;
  transform: rotate(-12deg);
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 1;
}

.mosaic-reel {
  display: flex;
  flex: none;
  will-change: transform;
}

/* Tile: 320px wide + 22px right margin = 342px per slot.
   12 tiles total per reel (6 unique + 6 duplicates). 50% of full width lands
   exactly on the start of the duplicate set — no seam jump. */
.mosaic-tile {
  position: relative;
  flex: none;
  width: 320px;
  height: 200px;
  margin-right: 22px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tile-mosaic) center/cover no-repeat;
  box-shadow: 0 4px 20px rgba(var(--shadow), 0.35), 0 0 0 1px rgba(var(--wash), 0.04);
  text-decoration: none;
}

/* Tile images come from _data/mosaic.yml, applied as inline background-image
   by the Liquid loop in index.html. */
.mosaic-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(var(--wash), 0.03) 0 2px, transparent 2px 14px);
  pointer-events: none;
}

.mosaic-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--glass), 0.4), transparent 60%);
  pointer-events: none;
}

/* Keyframes: each row scrolls in alternating directions at varied speeds.
   Translate -50% lands exactly on the start of the duplicate set thanks to
   the margin-right approach above (no flex gap → no off-by-gap seam). */
@keyframes mosaic-scroll-l { 0% { transform: translateX(0); }    100% { transform: translateX(-50%); } }
@keyframes mosaic-scroll-r { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

.reel-a { animation: mosaic-scroll-l 50s linear infinite; }
.reel-b { animation: mosaic-scroll-r 65s linear infinite; transform: translateX(-200px); }
.reel-c { animation: mosaic-scroll-l 75s linear infinite; }
.reel-d { animation: mosaic-scroll-r 55s linear infinite; transform: translateX(-150px); }
.reel-e { animation: mosaic-scroll-l 60s linear infinite; }
.reel-f { animation: mosaic-scroll-r 70s linear infinite; transform: translateX(-300px); }

/* Frosted-glass stack ------------------------------------------------------ */
/* Three layers: glass-3 widest/softest, glass-1 narrowest/strongest.
   The mask gradient stops are computed from --softness so we can re-tune the
   single value in :root and the falloff curve updates everywhere. */
.glass {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
}

.glass-3 {
  width: calc(var(--falloff) * 1% + 20%);
  backdrop-filter: blur(calc(var(--blur) * 0.15)) saturate(110%);
  -webkit-backdrop-filter: blur(calc(var(--blur) * 0.15)) saturate(110%);
  background: linear-gradient(90deg,
    rgba(var(--glass), calc(var(--tint) * 0.08)) 0%,
    rgba(var(--glass), 0) 100%);
  mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.15) 92%,
    rgba(var(--shadow), 0) 100%);
  -webkit-mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.15) 92%,
    rgba(var(--shadow), 0) 100%);
}

.glass-2 {
  width: calc(var(--falloff) * 1% + 5%);
  backdrop-filter: blur(calc(var(--blur) * 0.45)) saturate(125%);
  -webkit-backdrop-filter: blur(calc(var(--blur) * 0.45)) saturate(125%);
  background: linear-gradient(90deg,
    rgba(var(--glass), calc(var(--tint) * 0.45)) 0%,
    rgba(var(--glass), calc(var(--tint) * 0.3)) 45%,
    rgba(var(--glass), 0) 100%);
  mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.25) 85%,
    rgba(var(--shadow), 0) 100%);
  -webkit-mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.25) 85%,
    rgba(var(--shadow), 0) 100%);
}

.glass-1 {
  width: calc(var(--width) * 1%);
  backdrop-filter: blur(calc(var(--blur) * 1px)) saturate(145%);
  -webkit-backdrop-filter: blur(calc(var(--blur) * 1px)) saturate(145%);
  background: linear-gradient(90deg,
    rgba(var(--glass), var(--tint)) 0%,
    rgba(var(--glass), calc(var(--tint) * 0.8)) 40%,
    rgba(var(--glass), calc(var(--tint) * 0.4)) 70%,
    rgba(var(--glass), calc(var(--tint) * 0.1)) 88%,
    rgba(var(--glass), 0) 100%);
  mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.3) 80%,
    rgba(var(--shadow), 0) 100%);
  -webkit-mask-image: linear-gradient(90deg,
    var(--mask-on) 0%,
    var(--mask-on) calc((100 - var(--softness)) * 1%),
    rgba(var(--shadow), 0.3) 80%,
    rgba(var(--shadow), 0) 100%);
}

/* Foreground content ------------------------------------------------------- */
.hero-content {
  position: relative;
  z-index: 4;
  width: 58%;
  height: 100%;
  padding: 70px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin: 0 0 18px;
}

.hero-name {
  font-size: clamp(38px, 3.2vw + 26px, 64px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  color: var(--heading);
}

.about-lines {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  color: var(--ink-mute);
  line-height: 1.4;
}

.about-ico {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(var(--accent-soft), 0.12);
  border: 1px solid rgba(var(--accent-soft), 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  margin-top: 1px;
}

.about-text {
  padding-top: 4px;
}

.about-text strong {
  color: var(--heading);
  font-weight: 600;
}

.about-meta {
  display: block;
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 2px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
}

.hero-ctas a {
  padding: 13px 26px;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.15s ease;
}

.hero-ctas a:hover { transform: translateY(-1px); }

.cta-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.cta-primary:hover { color: var(--on-accent); background: var(--accent-hover); }

.cta-secondary {
  border: 1px solid rgba(var(--wash), 0.18);
  color: var(--ink);
  background: var(--fill-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.cta-secondary:hover { color: var(--heading-hover); background: var(--fill-2-hover); }

/* ==========================================================================
   PROJECTS v2 (dark theme, standardized cards)
   ========================================================================== */
.projects-v2 {
  padding: 90px 64px;
  background: var(--bg-mid);
  color: var(--ink);
}
.projects-v2 .projects-head {
  max-width: 1100px;
  margin: 0 auto 28px;
}
.projects-head h2 {
  font-size: clamp(26px, 1.2vw + 22px, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 0;
  text-align: left;
}

/* Filter chips */
.filter-row {
  max-width: 1100px;
  margin: 0 auto 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-chip {
  font-family: inherit;
  padding: 9px 18px;
  font-size: 13px;
  border-radius: 22px;
  border: 1px solid rgba(var(--wash), 0.12);
  color: var(--ink-mute);
  background: var(--fill-2);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.filter-chip:hover { border-color: var(--accent-light); color: var(--heading-hover); }
.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.filter-count {
  opacity: 0.65;
  margin-left: 4px;
  font-weight: 400;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Projects grid */
.projects-grid-v2 {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.project-card {
  background: var(--surface-1);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-soft), 0.35);
  background: var(--surface-1-hover);
  box-shadow: 0 18px 40px -16px rgba(var(--shadow), 0.55);
}
.project-card:active {
  transform: translateY(-1px);
  transition-duration: 0.08s;
}
.project-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.project-card.is-hidden { display: none; }

/* Card media (image, video, or no-image stack tile): every card has the same
   aspect ratio so the grid stays uniform regardless of image presence. */
.card-media,
.project-card .card-stack-tile {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--tile-default), var(--tile-base));
  object-fit: cover;
  border-bottom: 1px solid rgba(var(--wash), 0.04);
}
picture.card-media { overflow: hidden; }
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .card-media img { transform: scale(1.045); }
video.card-media { object-fit: cover; }

/* No-image variant: project name centered on a tinted block. No glyph. */
.project-card .card-stack-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tile-games) 0%, var(--tile-base) 100%);
}
.project-card .card-stack-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(var(--accent-soft), 0.05) 0 2px, transparent 2px 18px);
  pointer-events: none;
}
.card-stack-name {
  position: relative; z-index: 1;
  font-size: 26px;
  font-weight: 700;
  color: var(--on-tile);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Per-domain tint for the no-image tile */
.card-stack-tile[data-stack-color="games"]         { background: linear-gradient(135deg, var(--tile-games) 0%, var(--tile-base) 100%); }
.card-stack-tile[data-stack-color="accessibility"] { background: linear-gradient(135deg, var(--tile-access) 0%, var(--tile-base) 100%); }
.card-stack-tile[data-stack-color="ai"]            { background: linear-gradient(135deg, var(--tile-ai) 0%, var(--tile-base) 100%); }
.card-stack-tile[data-stack-color="mobile"]        { background: linear-gradient(135deg, var(--tile-mobile) 0%, var(--tile-base) 100%); }

/* Demo tile: a live demo (video or screenshot) sitting under a branded logo
   cover. The cover fades out on hover, keyboard focus, or once the card has
   dwelled in view (initDemoReveal adds .is-revealed). A small logo badge
   fades into the top-left as it opens, so the brand stays on screen. */
.card-demo { position: relative; overflow: hidden; }
.card-demo .card-demo-media { position: absolute; inset: 0; }
.card-demo .card-demo-media img,
.card-demo .card-demo-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-logo-cover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tile-games) 0%, var(--tile-base) 100%);
  opacity: 1;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-demo[data-stack-color="mobile"]        .card-logo-cover { background: linear-gradient(135deg, var(--tile-mobile) 0%, var(--tile-base) 100%); }
.card-demo[data-stack-color="accessibility"] .card-logo-cover { background: linear-gradient(135deg, var(--tile-access) 0%, var(--tile-base) 100%); }
.card-demo[data-stack-color="ai"]            .card-logo-cover { background: linear-gradient(135deg, var(--tile-ai) 0%, var(--tile-base) 100%); }

/* App-icon plate so dark/transparent logos read on the dark cover */
.card-logo-plate {
  display: grid; place-items: center;
  background: var(--plate); border-radius: 22%;
  box-shadow: 0 12px 30px -10px rgba(var(--shadow), 0.6);
}
.card-logo-plate img { width: 100%; height: 100%; object-fit: contain; }
.card-logo-cover .card-logo-plate { width: 30%; aspect-ratio: 1; padding: 12px; }

.card-logo-badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  width: 40px; height: 40px; padding: 6px; border-radius: 26%;
  opacity: 0; transform: translateY(-5px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Reveal on hover, keyboard focus, or JS dwell */
.project-card:hover .card-demo .card-logo-cover,
.project-card:focus-visible .card-demo .card-logo-cover,
.card-demo.is-revealed .card-logo-cover { opacity: 0; }
.project-card:hover .card-logo-badge,
.project-card:focus-visible .card-logo-badge,
.card-demo.is-revealed .card-logo-badge { opacity: 1; transform: none; }

/* Card body (same for all card variants) */
.card-body {
  padding: 22px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--heading);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-ext {
  font-size: 11px;
  color: var(--accent-light);
  opacity: 0.8;
}
.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.card-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.card-body p {
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin: 0;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.card-tags span {
  font-size: 10.5px;
  padding: 3px 9px;
  background: rgba(var(--accent-soft), 0.10);
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-soft), 0.20);
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card-badge {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
}
.card-badge .icon { margin-right: 4px; }
.badge-award { background: var(--badge-award-bg); color: var(--badge-award-fg); border-color: var(--badge-award-border); }
.badge-ship  { background: var(--badge-ship-bg); color: var(--badge-ship-fg); border-color: var(--badge-ship-border); }

/* ==========================================================================
   AWARDS v2 (static 4-card grid)
   ========================================================================== */
.awards-v2 {
  padding: 90px 64px;
  background: var(--bg-mid);
  color: var(--ink);
}
.awards-v2 .awards-head {
  max-width: 1100px;
  margin: 0 auto 36px;
}
.awards-head h2 {
  font-size: clamp(26px, 1.2vw + 22px, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 0;
  text-align: left;
}

.awards-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.award-card {
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.award-card:hover {
  border-color: rgba(var(--accent-soft), 0.3);
  background: var(--surface-1-hover);
}

.award-icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent-light);
  background: linear-gradient(135deg, var(--tile-default), var(--tile-base));
  position: relative;
  overflow: hidden;
}
.award-icon::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(var(--wash), 0.06) 0 2px, transparent 2px 12px);
}
.award-icon[data-icon-color="silver"] { background: linear-gradient(135deg, var(--award-silver), var(--tile-base)); }
.award-icon[data-icon-color="silver"] i { color: var(--glyph-silver); }
.award-icon[data-icon-color="blue"]   { background: linear-gradient(135deg, var(--award-blue), var(--tile-base)); }
.award-icon[data-icon-color="blue"] i   { color: var(--glyph-blue); }
.award-icon[data-icon-color="green"]  { background: linear-gradient(135deg, var(--award-green), var(--tile-base)); }
.award-icon[data-icon-color="green"] i  { color: var(--glyph-green); }

.award-info { flex: 1; min-width: 0; }
.award-when {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin: 0 0 4px;
}
.award-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.3;
  margin: 0 0 3px;
}
.award-venue {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Responsive — Tablet (640–1023px)
   ========================================================================== */
@media (max-width: 1023px) {
  .hero-v2 {
    height: auto;
    min-height: 640px;
  }
  .hero-content {
    width: 100%;
    padding: 48px 32px 40px;
  }
  .mosaic-bg {
    top: auto;
    bottom: 0;
    height: 280px;
    transform: rotate(-8deg);
  }
  .mosaic-tile { width: 240px; height: 150px; }
  /* Single softer glass layer; mobile-Safari can't handle the 3-stack well */
  .glass-2, .glass-3 { display: none; }
  .glass-1 {
    width: 100%;
    backdrop-filter: blur(32px) saturate(120%);
    -webkit-backdrop-filter: blur(32px) saturate(120%);
    background: linear-gradient(180deg,
      rgba(var(--glass), 0.85) 0%,
      rgba(var(--glass), 0.6) 65%,
      rgba(var(--glass), 0.2) 100%);
    mask-image: linear-gradient(180deg,
      var(--mask-on) 0%, var(--mask-on) 55%, rgba(var(--shadow),0.6) 80%, rgba(var(--shadow),0) 100%);
    -webkit-mask-image: linear-gradient(180deg,
      var(--mask-on) 0%, var(--mask-on) 55%, rgba(var(--shadow),0.6) 80%, rgba(var(--shadow),0) 100%);
  }

  #experience, #skills { padding: 70px 32px; }
  .work-container { flex-direction: column; gap: 20px; }
  .job-titles {
    flex: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .job-titles .job-btn {
    flex: none;
    width: auto;
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px;
    padding: 10px 16px;
  }
  .job-titles .job-btn.active,
  .job-titles .job-btn:hover {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .projects-v2 { padding: 70px 32px; }
  .projects-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Filter chip row becomes a horizontal scroller with edge fade */
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 8px;
    mask-image: linear-gradient(90deg, transparent, var(--mask-on) 4%, var(--mask-on) 96%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, var(--mask-on) 4%, var(--mask-on) 96%, transparent);
  }
  .filter-chip { flex: none; }

  .awards-v2 { padding: 70px 32px; }
  .awards-grid { grid-template-columns: 1fr; }

  .skills-container { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================================
   Responsive — Phone (<640px)
   ========================================================================== */
@media (max-width: 639px) {
  .hero-v2 { min-height: 560px; }
  .hero-content { padding: 36px 22px 32px; }
  .hero-name { margin-bottom: 18px; }
  .hero-eyebrow { margin-bottom: 12px; }

  /* Hide the mosaic entirely on phone; solid dark panel only */
  .mosaic-bg { display: none; }
  .glass-1 {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(var(--glass), 0.92);
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* About lines drop the icon tile, become plain stacked rows */
  .about-line { gap: 0; flex-direction: column; align-items: stretch; }
  .about-ico { display: none; }
  .about-text { padding-top: 0; }
  .about-meta { display: inline; margin-top: 0; }
  .about-meta::before { content: ' · '; color: var(--ink-dim); }

  .hero-ctas { flex-direction: column; }
  .hero-ctas a { text-align: center; }

  #experience, #skills { padding: 56px 22px; }

  .projects-v2 { padding: 56px 22px; }
  .projects-grid-v2 { grid-template-columns: 1fr; }

  .awards-v2 { padding: 56px 22px 70px; }
  .award-card { padding: 18px 18px; gap: 14px; }
  .award-icon { width: 48px; height: 48px; font-size: 20px; }
  .award-info h3 { font-size: 14px; }

  .site-footer .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}

/* ==========================================================================
   Motion preferences and feature fallbacks
   ========================================================================== */

/* Stop the hero mosaic and remove filter-card transitions under reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mosaic-reel { animation: none !important; }
  .project-card { transition: none; }
  .project-card:hover, .project-card:active { transform: none; }
  .card-media img { transition: none; }
  .project-card:hover .card-media img { transform: none; }
  .card-logo-cover, .card-logo-badge { transition: none; }
  .job-description { transition: none; }
  .hero-ctas a { transition: none; }
  .hero-ctas a:hover { transform: none; }
}

/* Comfortable touch targets on coarse pointers */
@media (pointer: coarse) {
  .filter-chip { padding: 12px 18px; }
  .site-footer .footer-links a,
  .social-links a { width: 44px; height: 44px; }
  .job-titles .job-btn { padding: 14px 18px; }
}

/* backdrop-filter unsupported: fall back to solid tinted panel */
@supports not (backdrop-filter: blur(10px)) {
  .glass-1 {
    background: rgba(var(--glass), 0.85) !important;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .glass-2, .glass-3 { display: none; }
  .cta-secondary {
    background: var(--fill-2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* mask-image unsupported: drop the edge fade on the filter row. */
@supports not (mask-image: linear-gradient(90deg, transparent, var(--mask-on))) {
  .filter-row {
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* ==========================================================================
   THEME TOGGLE + LIGHT MODE

   Dark is the default theme. The whole palette lives in the tokens at the top
   of this file; light mode below only re-points those tokens, it never styles
   a surface directly. An inline <head> script sets data-theme before paint so
   there is no flash. The photo-mosaic hero stays dark in both themes (a cream
   wash over a photo grid reads wrong), so its themed tokens are pinned locally.
   ========================================================================== */

/* Fixed top-left toggle, above the sticky topbar */
.theme-toggle {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 1000;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background: var(--fill-2);
  border: 1px solid rgba(var(--wash), 0.16);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 6px 20px -8px rgba(var(--shadow), 0.5);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.theme-toggle:hover { transform: translateY(-1px); background: var(--fill-2-hover); border-color: var(--accent-light); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.theme-ico { display: block; }
/* Dark theme shows the sun (tap for light); light theme shows the moon. */
.theme-ico-moon { display: none; }
:root[data-theme="light"] .theme-ico-sun { display: none; }
:root[data-theme="light"] .theme-ico-moon { display: block; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
  .theme-toggle:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Light theme: warm cream. Token re-points only.
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  --bg-dark: #efe7d6;    /* deeper sand: skills, footer */
  --bg-mid: #f7f2e8;     /* main ivory */
  --bg-light: #ffffff;

  --ink: #38322a;
  --ink-mute: #574f43;
  --ink-dim: #837968;
  --heading: #2a241c;
  --heading-hover: #1f1b15;

  --accent: #3b6fe5;
  --accent-light: #2f5ec4;         /* deeper so accent text reads on cream */
  --accent-hover: #2551ad;
  --on-accent: #ffffff;
  --accent-soft: 47, 94, 196;      /* deeper tint so soft chips read on cream */
  --accent-glow: rgba(59, 111, 229, 0.28);
  --selection: rgba(59, 111, 229, 0.22);

  --wash: 58, 48, 30;              /* warm-dark films on cream */

  --surface-1: #fffdf7;            /* raised warm white card */
  --surface-1-hover: #ffffff;
  --fill-2: #fffaf0;               /* chips, secondary buttons */
  --fill-2-hover: #fff4e2;
  --fill-3: #fff9ee;               /* skill tags */
  --border: rgba(58, 48, 30, 0.14);
  --code-bg: rgba(58, 48, 30, 0.06);

  --shadow: 58, 48, 30;            /* warm soft shadows */

  --topbar-bg: rgba(247, 242, 232, 0.85);

  --badge-award-fg: #a9741a;       /* darker gold/green for cream contrast */
  --badge-ship-fg: #1f8a63;
}

/* Pin the hero dark in light mode: re-point its themed tokens back to dark so
   every child that reads a token keeps its dark value. No per-element rules. */
:root[data-theme="light"] .hero-v2 {
  --ink: #e6ecf4;
  --ink-mute: #cfd8e3;
  --ink-dim: #9bb5d6;
  --heading: #ffffff;
  --heading-hover: #ffffff;
  --accent-light: #7aa7ff;
  --accent-soft: 123, 167, 255;
  --wash: 255, 255, 255;
  --fill-2: rgba(255, 255, 255, 0.05);
  --fill-2-hover: rgba(255, 255, 255, 0.09);
  --shadow: 0, 0, 0;
  --bg-dark: #060912;
  background: #060912;
}

/* Narrow project pages: keep the back button clear of the fixed toggle.
   ponytail: a fixed nudge, not a layout rewrite. */
@media (max-width: 860px) {
  .project-topbar { padding-left: 72px; }
}
