/* brayanuno.com — shared stylesheet
   Source of truth for tokens: design-system/brayanuno-portfolio/MASTER.md */

:root {
  --bg: #0e0f12;
  --surface: #15161a;
  --surface-2: #17181d;
  --border: #26272d;
  --border-strong: #3a3b42;
  --text: #ecebe6;
  --text-2: #c9c8c1;
  --muted: #a3a29b;
  --accent: #ff7a2f;
  --on-accent: #141414;

  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Instrument Sans', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, monospace;

  --container: 1200px;
  --gutter: 1.5rem;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --ease: 200ms ease-out;

  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100dvh;
}

a { color: var(--text); text-decoration: none; transition: color var(--ease), border-color var(--ease), background-color var(--ease), opacity var(--ease); }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
ul, dl, dd { margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  padding: 0.6rem 1rem; background: var(--accent); color: var(--on-accent);
  border-radius: 999px; font-weight: 600; z-index: 100;
}
.skip-link:focus { top: 1rem; color: var(--on-accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Type helpers ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.display {
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.h2 {
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lede { font-size: 1.15rem; color: var(--text-2); max-width: 42rem; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 48px; padding: 0 1.4rem;
  border-radius: 999px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text);
}
.btn:hover { border-color: var(--text-2); color: #fff; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: #ff8f4f; border-color: #ff8f4f; color: var(--on-accent); }

.btn-sm { min-height: 44px; padding: 0 1.1rem; }

/* ---------- Header ---------- */

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.25rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; min-height: 44px;
}
.brand span { color: var(--accent); }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem; color: var(--text-2); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav .btn { margin-left: 0.5rem; }

.back-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem; color: var(--text-2); }
.back-link:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  display: flex; flex-direction: column; gap: 1.5rem;
  padding-top: 3.5rem; padding-bottom: 2.5rem;
}

.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

.role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: var(--accent);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; }

/* ---------- Media placeholders ---------- */

.media {
  position: relative;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  text-align: center; padding: 1.5rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
}
.media > img, .media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-16x9 { aspect-ratio: 16 / 9; border-radius: 10px; }
.media-16x10 { aspect-ratio: 16 / 10; }

.play-badge {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
}

/* Per-project tints while real media is missing */
.tint-explosion { background: #15202a; color: #a3b4c2; }
.tint-fire      { background: #2a1a10; color: #d1b19c; }
.tint-raccoon   { background: #2a2210; color: #d1c39c; }
.tint-earth     { background: #221d17; color: #c4b8a8; }
.tint-beach     { background: #17221d; color: #9fb5a8; }
.tint-tankforce { background: #1c2016; color: #aab59f; }

.reel { padding-bottom: 4.5rem; }

/* ---------- Sections ---------- */

.section { padding-bottom: 5rem; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem;
  margin-bottom: 1.75rem;
}

/* ---------- Work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
}

.work-card { display: flex; flex-direction: column; gap: 0.8rem; color: var(--text); }
.work-card .media { transition: border-color var(--ease); }
.work-card:hover .media { border-color: var(--border-strong); }
.work-card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.work-card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; transition: color var(--ease); }
.work-card:hover .work-card-title { color: var(--accent); }
.work-card-sub { font-size: 0.9rem; color: var(--muted); }

/* ---------- Production panel ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
}
.panel-intro { display: flex; flex-direction: column; gap: 1rem; }
.panel-intro .h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }

.feature-list { list-style: none; display: flex; flex-direction: column; }
.feature-list li { padding: 1rem 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.2rem; }
.feature-list li:last-child { border-bottom: 0; }
.feature-list strong { font-weight: 600; }
.feature-list span { color: var(--muted); font-size: 0.95rem; }

/* ---------- Small cards ---------- */

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}
.mini-card {
  display: flex; align-items: center; gap: 1rem; padding: 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.mini-card:hover { border-color: var(--border-strong); }
.mini-thumb {
  width: 96px; height: 64px; flex-shrink: 0; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.65rem;
}
.mini-card-text { display: flex; flex-direction: column; }
.mini-card-text strong { font-weight: 600; }
.mini-card-text span { color: var(--muted); font-size: 0.9rem; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}
.about-body { display: flex; flex-direction: column; gap: 1.5rem; }
.about-body p { font-size: 1.1rem; color: var(--text-2); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; font-size: 0.95rem; }
.facts dt { color: var(--muted); }

/* ---------- Contact footer ---------- */

.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 3.5rem; padding-bottom: 3.5rem; }
.footer-title { font-weight: 800; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; letter-spacing: -0.03em; }
.footer-email { font-size: clamp(1.1rem, 2.5vw, 1.5rem); color: var(--accent); }
.footer-email:hover { color: #ff8f4f; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.copyright { padding-top: 1.5rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

.site-footer-slim { border-top: 1px solid var(--border); }
.site-footer-slim .footer-inner {
  flex-direction: row; flex-wrap: wrap; justify-content: space-between;
  padding-top: 1.5rem; padding-bottom: 1.5rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
}
.site-footer-slim a { color: var(--accent); }

/* ---------- Project page ---------- */

.project-hero { display: flex; flex-direction: column; gap: 1rem; padding-top: 2.5rem; padding-bottom: 2rem; }
.project-hero .display { font-size: clamp(2.6rem, 7vw, 5rem); }
.project-media { padding-bottom: 2.5rem; }

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.specs > div { background: var(--surface); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.25rem; }
.specs dt { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.specs dd { font-weight: 600; }
.specs-section { padding-bottom: 4rem; }

.breakdown { display: flex; flex-direction: column; gap: 2rem; padding-bottom: 4rem; }
.breakdown .h2 { padding-top: 1.5rem; border-top: 1px solid var(--border); }
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 2.5rem 1.5rem;
}
.step { display: flex; flex-direction: column; gap: 0.8rem; }
.step h3 { font-family: var(--font-body); font-size: 1.15rem; font-weight: 600; }
.step p { color: var(--text-2); }

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}
.pager a {
  display: flex; flex-direction: column; gap: 0.25rem; min-height: 44px; padding: 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.pager a:hover { border-color: var(--border-strong); }
.pager a.next { align-items: flex-end; text-align: right; }
.pager-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =====================================================================
   Video hero (always-on looping background)
   ===================================================================== */

.site-header-overlay {
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  max-width: none;
}
.site-header-overlay .brand,
.site-header-overlay .site-nav a { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }

.video-hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: flex-end;
  padding-top: 6rem; padding-bottom: clamp(3rem, 8vh, 6rem);
  overflow: hidden;
  background: var(--bg);
}
@supports (min-height: 100dvh) { .video-hero { min-height: 100dvh; } }

.video-hero-media { position: absolute; inset: 0; z-index: 0; }
.video-hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background: var(--surface-2);
}
/* The YouTube iframe is oversized to a 16:9 box that always covers the viewport,
   then centred. pointer-events: none keeps it purely decorative. */
.video-hero-frame { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.video-hero-frame iframe {
  position: absolute; top: 50%; left: 50%;
  width: max(100vw, 177.78vh); height: max(100vh, 56.25vw);
  transform: translate(-50%, -50%);
  border: 0; pointer-events: none;
  opacity: 0; transition: opacity 600ms ease-out;
}
.video-hero-frame.is-ready iframe { opacity: 1; }
.video-hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(14, 15, 18, 0.96) 0%, rgba(14, 15, 18, 0.55) 45%, rgba(14, 15, 18, 0.25) 100%),
    linear-gradient(to right, rgba(14, 15, 18, 0.55), rgba(14, 15, 18, 0) 70%);
}

.video-hero-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 1.5rem;
  width: 100%;
}

.video-toggle {
  position: absolute; right: var(--gutter); bottom: 1.25rem; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(14, 15, 18, 0.6); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color var(--ease), background-color var(--ease);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.video-toggle:hover { border-color: var(--text-2); background: rgba(14, 15, 18, 0.8); }
.video-toggle .icon-play { display: none; }
.video-toggle.is-paused .icon-play { display: block; }
.video-toggle.is-paused .icon-pause { display: none; }

.reel { padding-top: 4.5rem; }

.subsection-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em;
  color: var(--text-2);
  margin: 3rem 0 1.25rem;
}

/* =====================================================================
   Experience: tabs + timeline
   ===================================================================== */

.tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--border); border-radius: 999px; }
.tab {
  min-height: 40px; padding: 0 1.1rem; border-radius: 999px;
  border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 500; cursor: pointer;
  transition: color var(--ease), background-color var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); }

.timeline { list-style: none; display: flex; flex-direction: column; }

.entry {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}
.entry:first-child { border-top: 0; padding-top: 0.25rem; }

.entry-mark {
  width: 56px; height: 56px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  overflow: hidden;
}
.entry-mark img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.entry-body { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.entry-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.2; }
.entry-org { font-family: var(--font-body); font-weight: 500; color: var(--muted); }
.entry-dates { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.entry-lede { color: var(--text-2); max-width: 42rem; }
.entry-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; padding-top: 0.25rem; color: var(--text-2); max-width: 42rem; }
.entry-list li { padding-left: 1rem; position: relative; }
.entry-list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.entry-list strong { color: var(--text); font-weight: 600; }

@media (max-width: 480px) {
  .entry { grid-template-columns: 44px 1fr; gap: 1rem; }
  .entry-mark { width: 44px; height: 44px; font-size: 0.7rem; }
}

/* =====================================================================
   About: portrait, software chips, skills
   ===================================================================== */

.about-head { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.portrait {
  width: 160px; aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.skills-title {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 1rem;
}
.skills-title + * { margin-top: -0.75rem; }

.chip-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 0.6rem;
}
.chip {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 48px; padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-weight: 500; font-size: 0.95rem;
}
.chip-mark {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-2);
  overflow: hidden;
}
.chip-mark img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.chip-placeholder { color: var(--muted); border-style: dashed; }

.skill-list {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.skill-list li {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 0.9rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 0.95rem; color: var(--text-2);
}

/* ---------- YouTube reel (click-to-load) ---------- */

.yt { padding: 0; cursor: pointer; }
.yt > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(14, 15, 18, 0.35);
  transition: background-color var(--ease);
}
.yt:hover::after { background: rgba(14, 15, 18, 0.2); }
.yt-play {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  width: 100%; height: 100%; border: 0; background: transparent; color: var(--text);
  font: inherit; cursor: pointer;
}
.yt-play .play-badge { transition: transform var(--ease); }
.yt-play:hover .play-badge { transform: scale(1.05); }
.yt-label { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.yt.is-playing::after, .yt.is-playing .yt-play, .yt.is-playing > img { display: none; }
.yt-fallback { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 3; color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; }

/* Logo tiles whose artwork needs a light field */
.entry-mark-light, .chip-mark-light { background: #fff; border-color: #fff; }
.entry-mark-light img { padding: 6px; }
/* Square logo artwork that fills its tile edge to edge */
.entry-mark-cover { border-color: transparent; }
.entry-mark-cover img { padding: 0; object-fit: cover; }

/* Several roles at one company (LinkedIn-style) */
.roles { list-style: none; display: flex; flex-direction: column; margin-top: 0.5rem; }
.role-row {
  position: relative; display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.9rem 0 0.9rem 1.5rem;
}
.role-row::before {
  content: ""; position: absolute; left: 0; top: 1.35rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
}
.role-row:first-child::before { background: var(--accent); border-color: var(--accent); }
.role-row::after {
  content: ""; position: absolute; left: 4px; top: 2.1rem; bottom: -0.5rem;
  width: 1px; background: var(--border);
}
.role-row:last-child::after { display: none; }
.role-name { font-weight: 600; font-size: 1.05rem; }

/* ---------- Work filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--border); border-radius: 999px; }
.filter {
  min-height: 40px; padding: 0 1rem; border-radius: 999px;
  border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 500; cursor: pointer;
  transition: color var(--ease), background-color var(--ease);
}
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.work-card.is-hidden { display: none; }
.work-empty { padding: 2rem 0; color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; }
.tint-pro   { background: #101a24; color: #9fb3c8; }
.tint-tools { background: #1a1a22; color: #b3b0c4; }
.section-first { padding-top: 4rem; }
.tint-tornado { background: #2a1c0e; color: #d6b58f; }

/* Breakdown sheet + contained step images */
.sheet { margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.sheet img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.media-contain > img { object-fit: contain; background: #4a4a4a; }


/* =====================================================================
   Work cards: title hidden until hover (always visible on touch)
   ===================================================================== */

.work-card { gap: 0; }
.work-card .media { transition: border-color var(--ease), transform var(--ease); }
.work-card .media > img { transition: transform 500ms ease-out; }
.work-card:hover .media > img, .work-card:focus-visible .media > img { transform: scale(1.04); }

.work-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 2.5rem 1rem 0.9rem;
  background: linear-gradient(to top, rgba(14, 15, 18, 0.92), rgba(14, 15, 18, 0.55) 55%, rgba(14, 15, 18, 0));
  text-align: left; font-family: var(--font-body);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--ease), transform var(--ease);
}
.work-card:hover .work-card-meta, .work-card:focus-visible .work-card-meta { opacity: 1; transform: none; }
.work-card-title { color: var(--text); font-size: 1.25rem; }
.work-card:hover .work-card-title { color: var(--text); }
.work-card-sub { color: var(--text-2); }

@media (hover: none) {
  .work-card-meta { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .work-card:hover .media > img, .work-card:focus-visible .media > img { transform: none; }
}

/* =====================================================================
   Project lightbox
   ===================================================================== */

.pm {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(960px, 100vw); max-width: 100vw; max-height: 100dvh;
  margin: auto;
}
.pm::backdrop { background: rgba(5, 6, 8, 0.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pm[open] { animation: pm-in 220ms ease-out; }
@keyframes pm-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pm[open] { animation: none; } }

.pm-inner {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  max-height: 100dvh; overflow-y: auto;
}
@media (max-width: 640px) { .pm { width: 100vw; } .pm-inner { border-radius: 0; border: 0; min-height: 100dvh; } }

.pm-close {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: rgba(14, 15, 18, 0.7); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}
.pm-close:hover { background: rgba(14, 15, 18, 0.95); border-color: var(--text-2); }

.pm-stage { position: relative; aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; }
.pm-stage > img, .pm-stage > video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pm-stage .media { position: absolute; inset: 0; border: 0; border-radius: 0; }

.pm-nav { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.pm-arrow {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}
.pm-arrow:hover { color: var(--text); border-color: var(--border-strong); }
.pm-arrow[disabled] { opacity: 0.35; cursor: default; }

.pm-thumbs { flex: 1; display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: thin; padding: 2px; }
.pm-thumb {
  position: relative; flex-shrink: 0; width: 88px; height: 56px; padding: 0;
  border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; opacity: 0.6;
  transition: opacity var(--ease), border-color var(--ease);
}
.pm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-thumb .ph { display: block; width: 100%; height: 100%; }
.pm-thumb:hover { opacity: 0.9; }
.pm-thumb[aria-selected="true"] { opacity: 1; border-color: var(--text); }
.pm-thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0, 0, 0, 0.25);
}

.pm-text { padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pm-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.05; }
.pm-subtitle { font-size: 1.15rem; color: var(--text-2); }
.pm-dates { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.pm-desc { margin-top: 0.75rem; color: var(--text-2); max-width: 60ch; }
.pm-note {
  padding: 1rem clamp(1.25rem, 5vw, 3rem) 1.25rem; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted); line-height: 1.5;
}


/* =====================================================================
   About: centred title, round portrait + bio, software/skills columns
   ===================================================================== */

.about { display: flex; flex-direction: column; gap: 3rem; }
.about-title { text-align: center; }

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; justify-items: center; gap: 2rem; }
  .about-copy { text-align: left; }
}

.about .portrait {
  width: 260px; aspect-ratio: 1 / 1; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  overflow: hidden;
}
.about .portrait img { width: 100%; height: 100%; object-fit: cover; }

.about-copy { display: flex; flex-direction: column; gap: 1.1rem; max-width: 62ch; }
.about-copy p { font-size: 1.1rem; line-height: 1.6; color: var(--text-2); }
.about-copy strong { color: var(--text); font-weight: 600; }

.about-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; padding-top: 0.75rem; }
.text-action {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px;
  font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.85rem;
  color: var(--text);
}
.text-action svg { color: var(--accent); }
.text-action:hover { color: var(--accent); }

.about-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 2.5rem 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}
.about-col { display: flex; flex-direction: column; gap: 1.25rem; }
.about-col .skills-title { margin-top: 0; }
.about-col .skills-title + * { margin-top: -0.5rem; }

/* Card titles: visible by default, hidden while hovering so the clip shows clean */
.work-card-meta { opacity: 1; transform: none; }
.work-card:hover .work-card-meta { opacity: 0; transform: translateY(6px); }
.work-card:focus-visible .work-card-meta { opacity: 1; transform: none; }
.work-card .media > video { transition: transform 500ms ease-out; }
.work-card:hover .media > video { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .work-card:hover .media > video { transform: none; } }

/* ArtStation-style grid: square tiles, four across on desktop, video badge */
.work-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.work-grid .media-16x10 { aspect-ratio: 1 / 1; }
.badge-video {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(14, 15, 18, 0.7); color: #fff;
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.badge-video svg { margin-left: 1px; }
.work-card-meta { padding: 2.5rem 0.9rem 0.8rem; }
.work-card-title { font-size: 1.1rem; }
.work-card-sub { font-size: 0.8rem; }


/* Engine badge on work tiles + lightbox engine row */
.badge-engine {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(14, 15, 18, 0.7);
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.badge-engine img { width: 20px; height: 20px; display: block; }
.chip-mark-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; display: block; }
.pm-engine {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.pm-engine img { width: 22px; height: 22px; display: block; opacity: 0.9; }

/* Engine badge sits bottom-right */
.badge-engine { top: auto; left: auto; bottom: 0.6rem; right: 0.6rem; z-index: 2; }
.work-card:has(.badge-engine) .work-card-meta { padding-right: 3rem; }
