/* Palette: a dark screening room where the product footage supplies the color.
   Amber is the "on air" tally light: it marks what runs in production and what has focus. */
:root {
  --ink: #0b1020;
  --ink-2: #10172b;
  --panel: #151d35;
  --line: rgba(150, 170, 220, 0.16);
  --text: #eef2fb;
  --muted: #8e9ab8;
  --dim: #5d6888;
  --tally: #ffb547;
  --violet: #7c3aed;
  --blue: #3b82f6;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
s { text-decoration: none; }
:focus-visible { outline: 2px solid var(--tally); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--text); color: var(--ink); padding: 8px 12px; border-radius: 6px; }

/* ---------- shared bits ---------- */
.live {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--tally); box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.6);
  margin-right: 10px; vertical-align: 1px; flex: none;
  animation: tally 2.4s ease-out infinite;
}
@keyframes tally { 0% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 181, 71, 0); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); text-decoration: none;
  font: 500 15px/1 var(--body); white-space: nowrap;
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.btn:hover { border-color: rgba(238, 242, 251, 0.5); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--text); color: var(--ink); border-color: var(--text); font-weight: 600; }
.btn-primary:hover { background: #fff; }
.btn-copy { background: none; cursor: pointer; font-variant-numeric: tabular-nums; }
.btn-copy[data-copied] { border-color: var(--tally); color: var(--tally); }

.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 5px; font-weight: 500; transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: var(--tally); }

.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(238, 242, 251, 0.9); flex: none; }
.avatar-mono { display: grid; place-items: center; background: linear-gradient(135deg, #263156, #151d35); font: 600 18px/1 var(--display); letter-spacing: .02em; color: var(--text); }

/* ---------- screen: a product window that plays a reel ---------- */
.screen {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 40px 90px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(150, 170, 220, 0.12);
}
.screen-bar { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; background: #1a2340; }
.screen-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2f3a5e; }
.screen-title { margin-left: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-stage { position: relative; aspect-ratio: 16 / 9; background: #0f1528; overflow: hidden; }
.screen-stage > img, .screen-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.screen-stage > .layer { transition: opacity .7s ease; }
.screen-stage > .layer.out { opacity: 0; }
.screen-stage > img.kb { animation: kenburns 9s ease-out both; transform-origin: 30% 20%; }
@keyframes kenburns { from { transform: scale(1.0); } to { transform: scale(1.07); } }
.screen-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font: 500 18px var(--display); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 28px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 60% at 78% 45%, rgba(124, 58, 237, 0.26), transparent 70%),
    radial-gradient(40% 50% at 95% 100%, rgba(59, 130, 246, 0.16), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); gap: clamp(32px, 4vw, 64px); align-items: center; }

.who { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.who-name { font: 600 17px/1.3 var(--display); }
.who-place { font-size: 14px; color: var(--muted); }

.headline { font: 600 clamp(38px, 4.4vw, 64px)/1.03 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.headline .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.headline .line > span { display: inline-block; }
.headline .line + .line > span { color: var(--muted); }

.intro { margin-top: 22px; max-width: 34ch; font-size: clamp(17px, 1.4vw, 19px); color: #c3cbe0; }
.creds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.creds li { font-size: 13.5px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; color: #cdd4e6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-stage { perspective: 1800px; margin-right: calc(-1 * var(--gutter) - 6vw); }
.hero-tilt { transform: rotateY(-13deg) rotateX(5deg) translateZ(0); transform-style: preserve-3d; transition: transform .8s var(--ease); }
.screen-hero { border-radius: 16px; }

.reel-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.reel-tabs button {
  all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 4px 0 6px;
  color: var(--dim); font-size: 14px; transition: color .25s;
}
.reel-tabs button:hover, .reel-tabs button[aria-pressed="true"] { color: var(--text); }
.reel-tabs button:focus-visible { outline: 2px solid var(--tally); outline-offset: 4px; }
.reel-bar { display: block; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 12px; }
.reel-bar > span { display: block; height: 100%; width: 0; background: var(--text); }
.reel-tabs button[aria-pressed="true"] .reel-bar > span { background: var(--tally); }
.reel-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the one orchestrated moment: page load */
.js .headline .line > span { transform: translateY(105%); }
.js .who, .js .intro, .js .creds, .js .hero-actions, .js .reel-tabs { opacity: 0; transform: translateY(14px); }
.js .hero-tilt { opacity: 0; transform: rotateY(-38deg) rotateX(8deg) translateX(14%) scale(0.92); }
.ready .headline .line > span { transform: none; transition: transform 1s var(--ease); }
.ready .headline .line:nth-child(2) > span { transition-delay: .12s; }
.ready .who, .ready .intro, .ready .creds, .ready .hero-actions, .ready .reel-tabs { opacity: 1; transform: none; transition: opacity .8s ease, transform .8s var(--ease); }
.ready .who { transition-delay: 0s; }
.ready .intro { transition-delay: .35s; }
.ready .creds { transition-delay: .45s; }
.ready .hero-actions { transition-delay: .55s; }
.ready .reel-tabs { transition-delay: 1s; }
.ready .hero-tilt { opacity: 1; transform: rotateY(-13deg) rotateX(5deg); transition: transform 1.6s var(--ease) .25s, opacity 1s ease .25s; }
.ready.settled .hero-tilt { transition: transform .8s var(--ease); transform: rotateY(calc(-13deg + var(--rx, 0deg))) rotateX(calc(5deg + var(--ry, 0deg))); }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 11vw, 150px) 0 0; }
.section-tight { padding-top: clamp(72px, 9vw, 120px); }
.section-title { font: 600 clamp(30px, 3.4vw, 44px)/1.1 var(--display); letter-spacing: -0.025em; }
.section-sub { margin-top: 12px; max-width: 52ch; color: var(--muted); }

/* ---------- projects ---------- */
.projects { display: grid; gap: clamp(96px, 12vw, 168px); margin-top: clamp(48px, 6vw, 80px); }
.project-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: end; margin-bottom: 32px; }
.project-name { font: 600 clamp(30px, 3.8vw, 52px)/1.04 var(--display); letter-spacing: -0.03em; }
.project-name a { text-decoration: none; }
.project-name a:hover { color: #fff; }
.project-what { color: #c3cbe0; font-size: 18px; max-width: 46ch; justify-self: end; }
.project-screen { display: block; text-decoration: none; border-radius: 16px; }
.screen-scroll { transform: scale(var(--s, 1)); transform-origin: 50% 0; will-change: transform; }
.project-screen .screen { transition: box-shadow .4s; }
.project-screen:hover .screen { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 50px 110px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 181, 71, 0.35); }

.project-foot { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; margin-top: 36px; align-items: start; }
.project-role { display: flex; align-items: center; font-weight: 500; }
.project-stack { margin-top: 6px; color: var(--muted); font-size: 15px; }
.project-meta .link { display: inline-block; margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.stat { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 16px; }
.stat-from { font: 500 18px/1 var(--display); color: #7f8bab; position: relative; align-self: flex-start; margin-bottom: 8px; }
.stat-from::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; background: var(--tally); transform-origin: left; }
.stat-value { font: 600 clamp(32px, 3.3vw, 46px)/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-label { margin-top: 10px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.js .stat-from::after { transform: scaleX(0); transition: transform .7s var(--ease) .2s; }
.js .in .stat-from::after { transform: scaleX(1); }

.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.highlights li { border-top: 1px solid var(--line); padding-top: 16px; font: 500 18px/1.35 var(--display); letter-spacing: -0.01em; }

/* ---------- inside Metrike ---------- */
.wins { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
.win { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(0, 3fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.win-num { display: flex; flex-direction: column; }
.win-num .stat-value { font-size: clamp(28px, 2.6vw, 36px); }
.win-text h3 { font: 600 18px/1.3 var(--display); letter-spacing: -0.01em; }
.win-text p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- experience ---------- */
.exp { margin-top: 32px; }
.exp li { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.exp li:last-child { border-bottom: 1px solid var(--line); }
.exp-when { color: var(--dim); font-variant-numeric: tabular-nums; }
.exp-what { font-weight: 500; }
.exp-where { color: var(--muted); text-align: right; }

/* ---------- contact ---------- */
.contact { margin-top: clamp(64px, 8vw, 112px); padding: clamp(72px, 9vw, 120px) 0 56px; background: linear-gradient(180deg, transparent, var(--ink-2) 40%); border-top: 1px solid var(--line); }
.contact-line { font: 600 clamp(32px, 4.6vw, 64px)/1.05 var(--display); letter-spacing: -0.035em; max-width: 18ch; text-wrap: balance; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.fineprint { margin-top: 64px; font-size: 13px; color: var(--dim); }

/* ---------- case pages ---------- */
.case-nav { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.who-mini { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 15px var(--display); }
.who-mini .avatar { width: 36px; height: 36px; font-size: 13px; border-width: 1.5px; }
.case-hero { padding-top: clamp(32px, 6vw, 72px); }
.case-title { font: 600 clamp(34px, 5vw, 64px)/1.04 var(--display); letter-spacing: -0.035em; max-width: 22ch; text-wrap: balance; }
.case-role { display: flex; align-items: center; margin-top: 18px; color: #c3cbe0; }
.case-screen { margin-top: 48px; }
.stats-wide { margin-top: 40px; }
.case-body { padding-top: clamp(56px, 8vw, 96px); }
.prose { max-width: 68ch; }
.prose h2 { font: 600 clamp(22px, 2.2vw, 28px)/1.2 var(--display); letter-spacing: -0.02em; margin: 56px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: #c9d0e3; margin-top: 14px; }
.prose ul { margin-top: 14px; display: grid; gap: 12px; }
.prose li { position: relative; padding-left: 22px; color: #c9d0e3; }
.prose li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 2px; background: var(--tally); }
.prose strong { color: var(--text); font-weight: 600; }
.gallery { margin-top: 96px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.gallery figure { border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(0, 0, 0, .7); }
.gallery img { width: 100%; height: auto; }
.next { display: block; margin-top: 120px; padding: 40px 0; border-top: 1px solid var(--line); text-decoration: none; }
.next-label { display: block; color: var(--muted); font-size: 15px; }
.next-name { display: block; margin-top: 8px; font: 600 clamp(30px, 4.4vw, 56px)/1.05 var(--display); letter-spacing: -0.03em; transition: color .2s; }
.next:hover .next-name { color: var(--tally); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { min-height: 0; padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { margin-right: 0; perspective: none; }
  .hero-tilt, .ready .hero-tilt, .ready.settled .hero-tilt { transform: none; }
  .js .hero-tilt { transform: translateY(24px); }
  .reel-tabs { display: flex; overflow-x: auto; gap: 20px; margin-top: 28px; scrollbar-width: none; }
  .reel-tabs li { flex: 0 0 auto; width: 150px; }
  .project-head, .project-foot { grid-template-columns: 1fr; gap: 16px; }
  .project-what { justify-self: start; }
  .project-foot { gap: 32px; }
  .wins { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .who { margin-bottom: 28px; }
  .stats, .highlights { grid-template-columns: 1fr; gap: 20px; }
  .stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
  .stat-from { margin-bottom: 0; }
  .stat-label { flex-basis: 100%; margin-top: 6px; }
  .win { grid-template-columns: 1fr; gap: 10px; }
  .win-num { flex-direction: row; align-items: baseline; gap: 12px; }
  .exp li { grid-template-columns: 1fr; gap: 2px; }
  .exp-where { text-align: left; }
  .gallery { grid-template-columns: 1fr; }
  .screen-bar { height: 22px; }
  .screen-bar i { width: 7px; height: 7px; }
  .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .headline .line > span, .js .who, .js .intro, .js .creds, .js .hero-actions, .js .reel-tabs, .js .hero-tilt { opacity: 1; transform: none; }
  .hero-tilt { transform: rotateY(-13deg) rotateX(5deg); }
  .js .stat-from::after { transform: scaleX(1); }
  .screen-scroll { transform: none; }
}
