/* Sam Roolvink portfolio
   Anthracite + deep teal base, cyan + yellow accents.
   Motif: Blender-style keyframe diamonds and a dope-sheet timeline. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #1a1e21;
  --bg-raise: #22282c;
  --bg-raise-2: #2a3236;
  --teal-deep: #0d3a40;
  --teal: #13535b;
  --teal-glow: rgba(19, 83, 91, 0.45);
  --media: #3a383b;          /* matches the grey background of the Blender renders */

  --line: rgba(232, 238, 240, 0.09);
  --line-strong: rgba(232, 238, 240, 0.18);
  --text: #e8eef0;
  --text-muted: #a3b1b5;
  --text-faint: #75878c;

  --cyan: #4ee2ec;
  --yellow: #ffd23f;
  --on-yellow: #1a1e21;

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 16px;
  --radius-sm: 10px;

  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);   /* a little overshoot, like a good ease-out-back */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 12% -10%, var(--teal-glow), transparent 60%),
    radial-gradient(900px 600px at 100% 30%, rgba(13, 58, 64, 0.35), transparent 65%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; margin: 0; font-weight: 720; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--yellow); color: var(--on-yellow); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--on-yellow);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 650; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Keyframe diamond: the recurring motif */
.key {
  display: inline-block; width: 0.55em; height: 0.55em;
  background: var(--yellow); transform: rotate(45deg);
  border-radius: 1.5px; margin-right: 0.6em; vertical-align: 0.08em;
  flex: none;
}

.kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 1.25rem; display: flex; align-items: center;
}

.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--text); max-width: 38ch; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.35s var(--ease-pop), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.08s; }
.btn-primary { background: var(--yellow); color: var(--on-yellow); }
.btn-primary:hover { background: #ffdc66; }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background-color 0.3s, backdrop-filter 0.3s;
}
.site-header.is-scrolled {
  background: rgba(26, 30, 33, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo {
  display: flex; align-items: center; font-weight: 720; font-size: 1.1rem;
  text-decoration: none; letter-spacing: -0.01em; white-space: nowrap;
}
.logo .key { transition: transform 0.5s var(--ease-pop); }
.logo:hover .key { transform: rotate(225deg) scale(1.2); }
.logo-extra { font-weight: 500; color: var(--text-muted); }
@media (max-width: 760px) { .logo-extra { display: none; } }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--text-muted); font-weight: 560;
  padding: 8px 12px; border-radius: 999px; transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--text); background: var(--bg-raise); }
.frame-counter {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint);
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 76px; text-align: center;
}
.frame-counter b { color: var(--cyan); font-weight: 600; }

/* Scroll progress drawn as a timeline */
.scrub {
  height: 2px; background: transparent; position: relative;
}
.is-scrolled .scrub { background: var(--line); }
.scrub span {
  position: absolute; inset: 0; background: var(--cyan);
  transform-origin: left; transform: scaleX(var(--progress, 0));
}

/* ------------------------------------------------------------- hero */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
  padding-top: clamp(12px, 2.5vw, 32px); padding-bottom: clamp(56px, 8vw, 104px);
}
.hero h1 {
  font-size: clamp(2.6rem, min(5.4vw, 8.4vh), 4.4rem); line-height: 1; letter-spacing: -0.035em;
  font-weight: 780; margin-bottom: 1.25rem; max-width: 12ch;
}
.hero h1 em, .not-found h1 em {
  font-style: normal; color: var(--yellow); display: inline-block;
  transform-origin: 50% 100%;
}
.js .hero h1 em { animation: squash-stretch 1.4s var(--ease-out) 0.5s both; }
.hero h1 em:hover { animation: squash-stretch 0.9s var(--ease-out); }
@keyframes squash-stretch {
  0%   { transform: translateY(0) scale(1, 1); }
  12%  { transform: translateY(0) scale(1.12, 0.82); }
  30%  { transform: translateY(-0.28em) scale(0.9, 1.14); }
  48%  { transform: translateY(0) scale(1.1, 0.88); }
  62%  { transform: translateY(-0.06em) scale(0.97, 1.04); }
  78%, 100% { transform: translateY(0) scale(1, 1); }
}
.hero .lede { margin-bottom: 0.9rem; }
.hero .sub { color: var(--text-muted); max-width: 46ch; margin-bottom: 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* The "viewport": a looping reel with a tiny dope sheet */
.viewport {
  margin: 0; background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(78, 226, 236, 0.04);
}
.vp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted);
}
.vp-title { display: flex; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-title .key { width: 7px; height: 7px; margin-right: 10px; }
[data-vp-label] { color: var(--text); margin-left: 0.4em; }
.vp-toggle {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 0.7rem; color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}
.vp-toggle:hover { color: var(--cyan); border-color: var(--cyan); }
.vp-screen { position: relative; aspect-ratio: 1 / 1; background: var(--media); }
.vp-screen video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.6s ease-in-out;
}
.vp-screen video.is-active { opacity: 1; }
.vp-link { z-index: 1; }
.vp-link {
  position: absolute; right: 12px; bottom: 12px;
  font-family: var(--mono); font-size: 0.75rem; text-decoration: none;
  background: rgba(26, 30, 33, 0.82); color: var(--text);
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  transition: transform 0.35s var(--ease-pop), color 0.2s, border-color 0.2s;
}
.vp-link:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.vp-timeline { padding: 14px 16px 16px; }
.vp-track {
  position: relative; height: 26px; border-radius: 6px; cursor: ew-resize; touch-action: none;
  background:
    repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px 10%) 0 100% / 100% 40% no-repeat,
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 2.5%) 0 100% / 100% 22% no-repeat,
    var(--bg);
  border: 1px solid var(--line);
}
.vp-playhead {
  position: absolute; top: -4px; bottom: -1px; width: 2px; margin-left: -1px;
  left: calc(var(--p, 0) * 100%); background: var(--cyan);
}
.vp-playhead::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 10px; height: 8px;
  transform: translateX(-50%); background: var(--cyan); border-radius: 2px 2px 5px 5px;
}
.vp-meta {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 8px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint);
}
.vp-meta [data-vp-frame] { color: var(--cyan); }
.vp-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vp-key {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.vp-key .diamond {
  width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--text-faint); border-radius: 1px;
  transition: transform 0.4s var(--ease-pop), background-color 0.2s, border-color 0.2s;
}
.vp-key:hover { color: var(--text); border-color: var(--line-strong); }
.vp-key:hover .diamond { transform: rotate(45deg) scale(1.35); }
.vp-key[aria-pressed="true"] { color: var(--text); background: var(--bg-raise-2); border-color: var(--line-strong); }
.vp-key[aria-pressed="true"] .diamond { background: var(--yellow); border-color: var(--yellow); }

/* ------------------------------------------------------------- sections */

.section { padding-block: clamp(56px, 9vw, 112px); }
.section-head {
  display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 20px; row-gap: 6px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-num {
  font-family: var(--mono); font-size: 0.8rem; color: var(--yellow); letter-spacing: 0.06em;
  display: flex; align-items: center; margin: 0 0 0.55em; text-transform: uppercase;
}
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -0.03em; }
.section-note { grid-column: 1 / -1; color: var(--text-muted); margin: 6px 0 0; }

/* ------------------------------------------------------------- work grid */

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 28px); }
.card {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform 0.5s var(--ease-pop), border-color 0.25s, box-shadow 0.4s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(78, 226, 236, 0.4);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
}
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--media); overflow: hidden; }
.card-media img, .card-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s var(--ease-out), opacity 0.3s;
}
.card-media video { opacity: 0; }
.card.is-playing .card-media video { opacity: 1; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: baseline;
  padding: 18px 20px 20px;
}
.card h3 { font-size: 1.2rem; font-weight: 680; letter-spacing: -0.015em; }
.card-year { font-family: var(--mono); font-size: 0.75rem; color: var(--text-faint); }
.tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em; color: var(--text-muted);
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px;
}

/* ------------------------------------------------------------- about */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-lead { font-size: clamp(1.35rem, 2.1vw, 1.75rem); line-height: 1.4; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.about-text { font-size: 1.1rem; }
.about-text p { color: var(--text-muted); }

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(40px, 6vw, 64px); }
.skill { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.skill h3 {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--yellow); margin-bottom: 14px;
}
.skill li { position: relative; padding-left: 18px; margin: 6px 0; color: var(--text); }
.skill li::before {
  content: ""; position: absolute; left: 1px; top: 0.62em; width: 6px; height: 6px;
  border: 1.5px solid var(--cyan); transform: rotate(45deg); border-radius: 1px;
}

.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin: 16px 0 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius);
}
.facts dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.facts dd { margin: 4px 0 0; }

/* ------------------------------------------------------------- contact */

.contact {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(78, 226, 236, 0.14), transparent 60%),
    linear-gradient(140deg, var(--teal-deep), #0f2f34 60%, var(--bg-raise));
  border: 1px solid rgba(78, 226, 236, 0.16); border-radius: 24px;
  padding: clamp(28px, 6vw, 72px);
}
.contact h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; max-width: 16ch; margin-bottom: 1rem; }
.contact h2 span { color: var(--cyan); }
.contact h2 .contact-title { color: var(--text); }
.contact-note { color: var(--text-muted); font-size: 1.1rem; max-width: 46ch; margin-bottom: 2rem; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.avatar {
  display: block; width: 60px; height: 60px; flex: none; border-radius: 50%; overflow: hidden;
  background: linear-gradient(160deg, var(--teal), var(--teal-deep));
  border: 1px solid rgba(78, 226, 236, 0.3);
}
/* Zoom in on the face (the source photo is head-and-shoulders) */
.avatar img { width: 100%; height: 100%; transform: scale(1.3); transform-origin: 48% 30%; }
.email {
  font-family: var(--mono); font-size: clamp(1rem, 2.6vw, 1.6rem); font-weight: 600;
  text-decoration: none; color: var(--text); overflow-wrap: anywhere;
  background: linear-gradient(var(--yellow), var(--yellow)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 4px; transition: color 0.2s, background-size 0.4s var(--ease-out);
}
.email:hover { color: var(--yellow); }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2rem; }
.social a {
  display: inline-block; text-decoration: none; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-muted); font-weight: 560;
  transition: color 0.2s, border-color 0.2s, transform 0.35s var(--ease-pop);
}
.social a:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }

/* ------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); margin-top: clamp(24px, 4vw, 48px); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding-block: 28px; font-size: 0.9rem; color: var(--text-faint);
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--cyan); }

/* ------------------------------------------------------------- project pages */

.project { padding-top: clamp(24px, 4vw, 40px); padding-bottom: clamp(40px, 6vw, 72px); }
.back {
  display: inline-flex; gap: 8px; align-items: center; text-decoration: none;
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted);
  padding: 6px 0; transition: color 0.2s, gap 0.35s var(--ease-pop);
}
.back:hover { color: var(--cyan); gap: 12px; }
.project-head { padding-top: clamp(28px, 5vw, 56px); max-width: 900px; }
.project-head h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); letter-spacing: -0.035em; font-weight: 780; margin-bottom: 1.25rem; }
.project-head .lede { max-width: 52ch; color: var(--text-muted); }

.project-info {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(28px, 4vw, 48px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line);
}
.project-body { font-size: 1.1rem; max-width: 64ch; }
.related {
  margin-top: 1.5rem; padding: 14px 18px; border-left: 3px solid var(--cyan);
  background: rgba(19, 83, 91, 0.25); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-size: 1rem;
}
.related a { color: var(--cyan); font-weight: 600; text-decoration: none; white-space: nowrap; }
.related a:hover { text-decoration: underline; text-underline-offset: 3px; }
.credit { font-size: 0.9rem; color: var(--text-faint); margin-top: 1.25rem; }

.project-meta { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; align-self: start; }
.project-meta dl { margin: 0; display: grid; gap: 14px; }
.project-meta dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-faint); }
.project-meta dd { margin: 3px 0 0; }
.features { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.features h2 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--yellow); font-weight: 600; margin-bottom: 10px; }
.features ul { display: flex; flex-wrap: wrap; gap: 6px; }
.features li { font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--bg-raise-2); border: 1px solid var(--line); }

.block { margin-top: clamp(40px, 6vw, 72px); }
.block-title { display: flex; align-items: center; font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin-bottom: 18px; }
.block-title .key { width: 0.42em; height: 0.42em; }

.yt-grid { display: grid; gap: 20px; }
.yt-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.yt { margin: 0; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade { position: absolute; inset: 0; padding: 0; border: 0; cursor: pointer; background: #000; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.3s, transform 0.7s var(--ease-out); }
.yt-facade:hover img { opacity: 1; transform: scale(1.02); }
.yt-play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  border-radius: 50%; background: var(--yellow); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.45s var(--ease-pop);
}
.yt-play::after {
  content: ""; position: absolute; left: 31px; top: 25px;
  border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--on-yellow);
}
.yt-facade:hover .yt-play { transform: scale(1.12); }
.yt figcaption, .tile figcaption, .video-block figcaption {
  font-family: var(--mono); font-size: 0.76rem; color: var(--text-muted); margin-top: 10px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
}
.yt figcaption a { color: var(--text-faint); text-decoration: none; }
.yt figcaption a:hover { color: var(--cyan); }

.gallery { display: grid; gap: 16px; }
.gallery.cols-1 { grid-template-columns: minmax(0, 1fr); }
.gallery.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery.feature-first > :first-child { grid-column: 1 / -1; }
.gallery.narrow { max-width: 520px; }
.tile { margin: 0; min-width: 0; }
.tile-media {
  display: block; width: 100%; position: relative; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--media);
}
button.tile-media { cursor: zoom-in; }
.tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-out); }
button.tile-media:hover img { transform: scale(1.03); }
.fit-contain .tile-media { background: #1f2227; }
.fit-contain .tile-media img { object-fit: contain; }

.video-block { margin-left: 0; margin-right: 0; }
.video-block video { width: 100%; height: auto; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }

.project-nav {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 16px;
  margin-top: clamp(56px, 8vw, 96px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line);
}
.project-nav a {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  text-decoration: none; font-size: 1.25rem; font-weight: 680; letter-spacing: -0.015em;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; background: var(--bg-raise);
  transition: transform 0.5s var(--ease-pop), border-color 0.25s;
}
.project-nav a:hover { transform: translateY(-4px); border-color: rgba(78, 226, 236, 0.4); }
.project-nav .label { display: block; font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.project-nav .next { flex-direction: row; align-items: center; justify-content: flex-start; gap: 20px; padding: 14px; }
.project-nav .next img { width: 132px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--media); flex: none; }
.project-nav .next > span { display: flex; flex-direction: column; gap: 6px; }

/* Lightbox (created by main.js) */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none;
  width: 100vw; height: 100vh; margin: 0; display: none; place-items: center;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgba(12, 14, 16, 0.92); }
.lightbox img { max-width: 94vw; max-height: 90vh; width: auto; height: auto; border-radius: var(--radius-sm); }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg-raise); cursor: pointer; font-size: 1.4rem; line-height: 1;
}

/* 404 */
.not-found { padding-block: clamp(80px, 14vw, 180px); }
.not-found h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -0.035em; margin-bottom: 1.25rem; max-width: 14ch; }
.not-found .lede { color: var(--text-muted); margin-bottom: 2rem; }

/* ------------------------------------------------------------- decorative hexagons */

.hex {
  position: absolute; overflow: visible; pointer-events: none;
  fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-linejoin: round;
}
.hex polygon { vector-effect: non-scaling-stroke; }

/* Full-bleed background layer behind a section's content */
.hero, .section, .project { position: relative; }
.hero > :not(.deco), .section > :not(.deco), .project > :not(.deco) { position: relative; z-index: 1; }
.deco {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  overflow: hidden; pointer-events: none; z-index: 0;
}
.deco .hex, .contact .hex { animation: hex-float 16s ease-in-out infinite alternate; }
.deco .hex:nth-child(2n), .contact .hex:nth-child(2n) { animation-duration: 12s; animation-delay: -5s; }
.deco .hex:nth-child(3n), .contact .hex:nth-child(3n) { animation-duration: 19s; animation-delay: -9s; animation-direction: alternate-reverse; }
@keyframes hex-float {
  from { transform: translateY(-10px) rotate(-5deg); }
  to   { transform: translateY(12px) rotate(6deg); }
}

/* Hero */
.hex-a { width: 480px; right: 4%; top: 2%; opacity: 0.32; }
.hex-b { width: 110px; left: 47%; bottom: 9%; opacity: 0.55; }
.hex-c { width: 230px; left: -70px; top: 10%; opacity: 0.22; }
.hex-f { width: 64px; left: 36%; top: 7%; opacity: 0.5; }
.hex-g { width: 170px; right: -50px; bottom: 3%; opacity: 0.26; }
.hex-h { width: 42px; right: 31%; top: 5%; opacity: 0.65; }
.cl-1 { width: 150px; left: 3%; bottom: 4%; opacity: 0.3; }
/* Work */
.hex-w1 { width: 320px; right: -110px; top: 30px; opacity: 0.18; }
.hex-w2 { width: 58px; left: 2%; top: 140px; opacity: 0.5; }
.hex-w3 { width: 210px; left: -90px; bottom: 18%; opacity: 0.15; }
.cl-2 { width: 130px; right: 3%; bottom: 3%; opacity: 0.22; }
/* About */
.hex-ab1 { width: 280px; right: -80px; top: 6%; opacity: 0.18; }
.hex-ab2 { width: 50px; right: 24%; top: 40px; opacity: 0.55; }
.hex-ab3 { width: 130px; left: 46%; bottom: 2%; opacity: 0.22; }
.cl-5 { width: 120px; left: -30px; top: 42%; opacity: 0.18; }
/* Project pages */
.hex-p1 { width: 380px; right: -110px; top: 30px; opacity: 0.2; }
.hex-p2 { width: 64px; right: 32%; top: 100px; opacity: 0.45; }
.hex-p3 { width: 44px; right: 8%; top: 520px; opacity: 0.55; }
.cl-4 { width: 150px; left: -40px; top: 140px; opacity: 0.16; }

/* Contact panel */
.contact > :not(.hex) { position: relative; }
.hex-d { width: 440px; right: -120px; bottom: -170px; opacity: 0.45; }
.hex-e { width: 150px; right: 250px; top: -64px; opacity: 0.32; }
.hex-i { width: 40px; right: 40%; top: 30px; opacity: 0.55; }
.cl-3 { width: 170px; left: 46%; bottom: -60px; opacity: 0.22; }

/* ------------------------------------------------------------- cats */

.cat { display: block; overflow: visible; pointer-events: none; }
.cat-rim { fill: #1d6770; stroke: #1d6770; stroke-width: 7; stroke-linejoin: round; }
.cat-fur { fill: #0c0f11; }
.cat-tail-rim, .cat-tail-fur { fill: none; stroke-linecap: round; }
.cat-tail-rim { stroke: #1d6770; stroke-width: 19; }
.cat-tail-fur { stroke: #0c0f11; stroke-width: 12; }
.cat-ear { fill: #173a40; }
.cat-pupil { fill: #0c0f11; }
.cat-toes { fill: none; stroke: #1d6770; stroke-width: 2.2; stroke-linecap: round; }
.cat-whiskers { fill: none; stroke: rgba(232, 238, 240, 0.3); stroke-width: 1.3; stroke-linecap: round; }

.cat-eye { transform-box: fill-box; transform-origin: center; animation: cat-blink 6s infinite; }
.cat-eye + .cat-eye { animation-delay: 0.02s; }
.cat-peek .cat-eye { animation-duration: 7.5s; animation-delay: -3s; }
.cat-look { transform: translate(var(--look-x, 0px), var(--look-y, 0px)); transition: transform 0.25s var(--ease-out); }
.cat-tail { transform-box: fill-box; transform-origin: 0% 92%; animation: tail-sway 3.4s ease-in-out infinite alternate; }
@keyframes cat-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
  96% { transform: scaleY(1); }
}
@keyframes tail-sway {
  from { transform: rotate(-5deg); }
  to   { transform: rotate(6deg); }
}

/* Sitting on top of the hero viewport */
/* Room above for the cat. On short screens the video area gets less tall (not narrower),
   so the whole hero fits and the clip buttons keep their width. */
.viewport-wrap { position: relative; margin-top: 100px; }
.vp-screen { max-height: max(240px, calc(100svh - 470px)); width: 100%; }
.viewport-wrap .cat-sit { position: absolute; width: 112px; right: 40px; bottom: 100%; margin-bottom: -9px; z-index: 2; }

/* Peeking over the contact panel */
.contact-wrap { position: relative; margin-top: 64px; }
.contact-wrap .cat-peek { position: absolute; width: 150px; right: clamp(28px, 9%, 110px); bottom: 100%; margin-bottom: -20px; z-index: 2; }

/* 404 */
.not-found { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; }
.not-found .cat-sit { width: clamp(140px, 22vw, 240px); }

/* ------------------------------------------------------------- reveal on scroll */

.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-pop);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ============================================================= showpiece layer
   Extra motion and depth on top of the base design. All of it is decoration and switches
   off for visitors who prefer reduced motion (last rule in this file). */

/* Film grain over everything, very faint */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Smooth fade between pages (browsers that support cross-page view transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }

/* --- Hero: Blender-style viewport floor */
.hero-fx { z-index: 0; }
.hero-floor {
  position: absolute; left: -40%; right: -40%; bottom: 0; height: 130%;
  background-image:
    linear-gradient(rgba(78, 226, 236, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 226, 236, 0.2) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(900px) rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 70%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 70%);
  animation: floor-scroll 5s linear infinite;
}
/* The red X and green Y axis lines, like in Blender's viewport */
.hero-floor::before, .hero-floor::after { content: ""; position: absolute; }
.hero-floor::before { left: 0; right: 0; top: 88%; height: 2px; background: rgba(255, 92, 92, 0.45); }
.hero-floor::after { top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(130, 220, 90, 0.4); }
@keyframes floor-scroll { to { background-position: 0 64px, 0 0; } }

/* --- Hero: opening sequence */
@keyframes intro-rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes vp-pop { from { opacity: 0; transform: translateY(34px) scale(0.94); } }
.js .hero-copy > :not(h1) { animation: intro-rise 0.9s var(--ease-pop) both; }
.js .hero-copy > .kicker { animation-delay: 0.05s; }
.js .hero-copy > .lede { animation-delay: 0.55s; }
.js .hero-copy > .sub { animation-delay: 0.65s; }
.js .hero-copy > .cta { animation-delay: 0.75s; }
.js .hero .deco { animation: fade-in 1.8s ease 0.2s both; }
.hero h1 .word { display: inline-block; transform-origin: 50% 100%; animation: word-drop 0.85s var(--ease-out) both; animation-delay: calc(0.15s + var(--w) * 0.07s); }
@keyframes word-drop {
  0%   { opacity: 0; transform: translateY(-0.7em) scale(0.9, 1.18); }
  55%  { opacity: 1; transform: translateY(0.05em) scale(1.08, 0.88); }
  76%  { transform: translateY(-0.03em) scale(0.98, 1.03); }
  100% { transform: none; }
}
.js .viewport-wrap .viewport { animation: vp-pop 0.95s var(--ease-pop) 0.35s both; }
.js .viewport-wrap .cat-sit { transform-origin: 50% 100%; animation: cat-drop 1.1s var(--ease-out) 1.1s both; }
@keyframes cat-drop {
  0%   { opacity: 0; transform: translateY(-130px) scale(0.9, 1.14); }
  42%  { opacity: 1; transform: translateY(0) scale(1.2, 0.78); }
  60%  { transform: translateY(-16px) scale(0.95, 1.07); }
  78%  { transform: translateY(0) scale(1.05, 0.95); }
  100% { transform: none; }
}

/* ...then it meows: stretches up, mouth opens "me-ow", happy squint, speech bubble.
   Uses the separate `scale` property so it layers on top of the landing and the blinking. */
.cat-mouth { transform-box: fill-box; transform-origin: 50% 0%; transform: scale(0); }
.js .viewport-wrap .cat-sit { pointer-events: auto; cursor: pointer; }   /* click the cat to make it talk */
/* Short lines stay on one line; long ones wrap instead of running off small screens. */
.meow { width: max-content; max-width: min(250px, calc(100vw - 170px)); text-align: center; line-height: 1.25; }
/* (`both` keeps each meow animation around after it ends, so a click can replay it.) */
.js .viewport-wrap .cat-sit { animation: cat-drop 1.1s var(--ease-out) 1.1s both, meow-body 1.1s ease-in-out 2.3s both; }
.js .viewport-wrap .cat-mouth { animation: meow-mouth 1.1s ease-out 2.3s both; }
.js .viewport-wrap .cat-eye { animation: cat-blink 6s infinite, meow-eyes 1.1s ease-in-out 2.3s both; }
@keyframes meow-body {
  0%, 100% { scale: 1 1; }
  35%      { scale: 0.97 1.07; }
  55%      { scale: 1.02 0.98; }
  75%      { scale: 0.99 1.03; }
}
@keyframes meow-mouth {
  0%, 100% { transform: scale(0); }
  14%      { transform: scale(0.85); }
  28%      { transform: scale(0.55, 0.45); }   /* "me-" */
  46%      { transform: scale(1.1); }          /* "-ow" */
  70%      { transform: scale(1); }
  86%      { transform: scale(0); }
}
@keyframes meow-eyes {
  0%, 100%  { scale: 1 1; }
  25%, 70%  { scale: 1 0.32; }
}
/* Comic-style speech bubble: ink outline like the cat's toon look, teal drop shadow, action lines */
.meow {
  position: absolute; right: 160px; bottom: calc(100% + 76px); z-index: 3; pointer-events: none;
  font-family: var(--font); font-size: 1rem; font-weight: 760; letter-spacing: -0.01em; color: #0c0f11;
  background: var(--yellow); padding: 7px 15px 8px; border: 2.5px solid #0c0f11;
  border-radius: 18px 18px 6px 18px; opacity: 0; transform-origin: 100% 100%;
  filter: drop-shadow(4px 4px 0 #1d6770);
}
/* tail pointing at the cat */
.meow::after {
  content: ""; position: absolute; right: -9px; bottom: 7px; width: 14px; height: 14px;
  background: var(--yellow); border-top: 2.5px solid #0c0f11; border-right: 2.5px solid #0c0f11;
  border-radius: 0 3px 0 0; transform: rotate(45deg) skew(8deg, 8deg);
}
/* little action lines bursting off the top-left corner */
.meow::before {
  content: ""; position: absolute; left: -22px; top: -20px; width: 26px; height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='%234ee2ec' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M18 20 L 10 12'/%3E%3Cpath d='M22 14 L 18 3'/%3E%3Cpath d='M13 23 L 3 19'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* Too many clicks: the cat goes POOF (pieces are created by main.js) */
.boom { position: absolute; width: 0; height: 0; z-index: 4; pointer-events: none; }
.boom-p { position: absolute; left: 0; top: 0; display: block; }
.boom-fur { width: var(--s); height: var(--s); border-radius: 50%; background: #0c0f11; border: 2px solid #1d6770; }
.boom-smoke {
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 238, 240, 0.32), rgba(232, 238, 240, 0) 70%);
}
.boom-spark, .boom-spark-cyan { width: 9px; height: 9px; border-radius: 2px; background: var(--yellow); }
.boom-spark-cyan { background: var(--cyan); }
.boom-hex {
  width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,4 90,27 90,73 50,96 10,73 10,27' fill='none' stroke='%234ee2ec' stroke-width='9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.boom-star {
  position: absolute; left: 0; top: 0; width: 150px; height: 150px; translate: -50% -50%;
  display: grid; place-items: center; animation: boom-star 1s var(--ease-out) both;
}
.boom-star svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(4px 4px 0 #1d6770); }
.boom-star polygon { fill: var(--yellow); stroke: #0c0f11; stroke-width: 3; stroke-linejoin: round; }
.boom-star span { position: relative; font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; color: #0c0f11; rotate: -8deg; }
@keyframes boom-star {
  0%   { transform: scale(0) rotate(-25deg); opacity: 1; }
  22%  { transform: scale(1.18) rotate(5deg); }
  36%  { transform: scale(0.96) rotate(-2deg); }
  48%  { transform: scale(1) rotate(0deg); }
  78%  { opacity: 1; }
  100% { transform: scale(1.12); opacity: 0; }
}

.js .meow { animation: meow-bubble 1.6s var(--ease-out) 2.4s both; }
@keyframes meow-bubble {
  0%   { opacity: 0; transform: translate(14px, 10px) scale(0.4) rotate(10deg); }
  16%  { opacity: 1; transform: scale(1.12, 0.92) rotate(-6deg); }
  28%  { transform: scale(0.96, 1.05) rotate(-2deg); }
  40%  { transform: scale(1) rotate(-4deg); }
  80%  { opacity: 1; transform: scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.95) rotate(-4deg); }
}

/* --- Skills ticker */
.ticker {
  position: relative; overflow: hidden; padding: 15px 0; margin-bottom: -8px;
  border-block: 1px solid rgba(78, 226, 236, 0.2);
  background: linear-gradient(90deg, rgba(13, 58, 64, 0.7), rgba(13, 58, 64, 0.3) 50%, rgba(13, 58, 64, 0.7));
  transform: rotate(-1.2deg) scaleX(1.04);
}
.ticker-track { display: flex; width: max-content; animation: ticker 55s linear infinite; }
.ticker-track > div { display: flex; align-items: center; gap: 24px; padding-right: 24px; }
.ticker span:not(.key) {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap;
}
.ticker .key { margin: 0; width: 7px; height: 7px; }
.ticker-track > div > span:nth-child(4n + 2) { background: var(--cyan); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* --- Section titles: a timeline line draws in underneath */
.section-head::after {
  content: ""; grid-column: 1 / -1; height: 1px; margin-top: 18px;
  background: linear-gradient(90deg, var(--cyan), rgba(78, 226, 236, 0.15) 45%, transparent);
  transform-origin: left;
}
.js .section-head::after { transform: scaleX(0); transition: transform 1.6s var(--ease-out) 0.25s; }
.js .section-head.in::after { transform: scaleX(1); }

/* --- Work: featured tile, 3D tilt + glare, "View project" reveal */
.card {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.card:hover, .card:focus-visible {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
}
.card.is-tilting { transition: transform 0.15s ease-out, border-color 0.25s, box-shadow 0.4s; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.08), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover::after { opacity: 1; }
.card-cta {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text);
  padding: 6px 12px; border-radius: 999px; background: rgba(26, 30, 33, 0.85); border: 1px solid var(--line);
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.45s var(--ease-pop);
}
.card-cta span { display: inline-block; color: var(--yellow); transition: transform 0.3s var(--ease-out); }
.card:hover .card-cta, .card:focus-visible .card-cta { opacity: 1; transform: none; }
.card:hover .card-cta span { transform: translateX(3px); }
.featured .card h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.featured .card-cta { opacity: 1; transform: none; }
@media (min-width: 961px) {
  .work-grid { grid-auto-flow: dense; }
  .work-grid > .featured { grid-column: span 2; grid-row: span 2; }
  .featured .card-media { aspect-ratio: auto; flex: 1; min-height: 360px; }
}
@media (min-width: 601px) and (max-width: 960px) {
  .work-grid > .featured { grid-column: 1 / -1; }
  .featured .card-media { aspect-ratio: 16 / 9; }
}

/* --- Buttons lean toward the cursor */
.btn {
  translate: var(--mgx, 0px) var(--mgy, 0px);
  transition: transform 0.35s var(--ease-pop), translate 0.35s var(--ease-out), background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* --- Contact: a light travels around the panel's border */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.contact::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0deg 250deg, rgba(78, 226, 236, 0.95) 305deg, rgba(255, 210, 63, 0.95) 335deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: border-spin 7s linear infinite;
}
@keyframes border-spin { to { --spin: 360deg; } }

/* --- Project pages: ambient colour glow, title + viewport */
.project-ambient {
  position: absolute; top: 0; left: 0; right: 0; height: 780px; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center;
  filter: blur(80px) saturate(1.35); opacity: 0.26; transform: scale(1.25);
  -webkit-mask-image: linear-gradient(#000 25%, transparent); mask-image: linear-gradient(#000 25%, transparent);
}
.project-top {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 64px); align-items: end;
}
.project-top .project-head { max-width: none; }
.project-viewport {
  margin: 0; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.65);
}
.project-viewport .vp-title > span:last-child { color: var(--text); margin-left: 0.4em; }
.project-screen { position: relative; aspect-ratio: 4 / 3; background: var(--media); }
.project-screen img, .project-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.js .project-head > * { animation: intro-rise 0.85s var(--ease-pop) both; }
.js .project-head > h1 { animation-delay: 0.08s; }
.js .project-head > .lede { animation-delay: 0.16s; }
.js .project-viewport { animation: vp-pop 0.95s var(--ease-pop) 0.2s both; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .project-top { grid-template-columns: minmax(0, 1fr); }
  .project-viewport { max-width: 560px; }
  .hero h1 { max-width: 14ch; }
  .viewport-wrap { max-width: 560px; }
  .vp-screen { max-height: none; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-info { grid-template-columns: minmax(0, 1fr); }
  .gallery.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .skills, .facts { grid-template-columns: minmax(0, 1fr); }
  .yt-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .gallery.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-nav { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .viewport-wrap { margin-top: 84px; }
  .viewport-wrap .cat-sit { width: 92px; right: 28px; }
  .meow { right: 128px; bottom: calc(100% + 62px); font-size: 0.9rem; }
  .contact-wrap .cat-peek { width: 120px; }
  .hex-a { width: 320px; right: -80px; }
  .hex-b { left: 70%; }
  .hex-d { width: 300px; }
  .hex-e { right: 140px; }
  .not-found { grid-template-columns: minmax(0, 1fr); }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .frame-counter { display: none; }
  .nav a { padding: 8px 9px; }
  .header-inner { gap: 12px; }
  .gallery.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .project-nav .next img { width: 96px; }
}
@media (max-width: 380px) {
  .logo { font-size: 1rem; }
  .nav a { padding: 8px 6px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
