/* Tokens from DESIGN.md. Dark theme is fixed by design (footage-led portfolio). */
:root {
  --bg: #0F0F0E;
  --surface: #181816;
  --line: #2C2B28;
  --text: #EDEBE4;
  --muted: #8A877E;
  --accent: #E8D21D;
  --on-accent: #0F0F0E;
  --error: #FF8A7A;

  --gutter: 16px;
  --section: 96px;
  --radius: 2px;
  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --gutter: 40px; --section: 144px; }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; }

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

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 14px; z-index: 10; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 32px;
  min-height: 72px;
}
.wordmark {
  font-weight: 800;
  font-stretch: 115%;
  font-size: 1.125rem;
  text-decoration: none;
  margin-right: auto;
  padding-block: 12px;
}
.nav { display: flex; gap: 28px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding-block: 12px;
}
.nav a:hover { color: var(--text); }

.lang { display: flex; border: 1px solid var(--line); border-radius: var(--radius); }
.lang button {
  font: inherit; font-size: 0.875rem; font-weight: 600;
  background: none; border: 0; color: var(--muted);
  min-width: 44px; min-height: 44px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--text); background: var(--line); }
.lang button:hover { color: var(--text); }

@media (max-width: 719px) {
  .header-inner { padding-block: 8px; }
  .nav {
    order: 3; width: 100%;
    gap: 24px;
    border-top: 1px solid var(--line);
    font-size: 0.9375rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px;
  font: inherit; font-weight: 700;
  border-radius: var(--radius); border: 0;
  text-decoration: none; cursor: pointer;
}
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--text); }

/* Placeholders: visibly unfinished on purpose */
.ph {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px dashed var(--line);
}
.ph-label { font-weight: 700; font-size: 0.8125rem; color: var(--muted); }
.ph-note { font-size: 0.875rem; color: var(--muted); max-width: 40ch; }
.ph-inline { color: var(--muted); }

/* GCP marker: the identity motif, one per screen */
.gcp { width: 28px; height: 28px; color: var(--accent); flex: none; }

/* Hero */
.hero { padding-block: 56px var(--section); }
.hero-grid {
  display: grid;
  gap: 40px;
}
.hero-title {
  font-weight: 850;
  font-stretch: 112%;
  font-size: clamp(3.25rem, 11vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.hero-title span { display: block; }
.hero-lede { max-width: 46ch; color: var(--muted); margin-bottom: 32px; }
.ph-video { aspect-ratio: 16 / 10; }
.gcp-hero { position: absolute; left: 58%; top: 38%; }

@media (min-width: 960px) {
  .hero { padding-top: 96px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; align-items: end; gap: 56px; }
  .ph-video { aspect-ratio: 4 / 5; }
}

/* Sections */
.section { padding-bottom: var(--section); }
.section-title {
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-bottom: 56px;
}

/* Services: numbered rows, the lead one gets the most room */
.svc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-block: 40px;
  border-top: 1px solid var(--line);
}
.svc:first-of-type { border-top: 0; padding-top: 0; }
.svc-num {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}
.svc-title {
  font-weight: 800;
  font-stretch: 110%;
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  line-height: 1.1;
  margin-bottom: 20px;
}
.svc-lead .svc-title { font-size: clamp(2.25rem, 6vw, 4rem); }
.svc p + p { margin-top: 16px; }
.svc p { max-width: 62ch; }

.svc-cols { display: grid; gap: 32px; }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; align-content: start; }
.meta dt { color: var(--muted); }

.outputs { display: grid; gap: 24px; margin-top: 48px; }
.ph-out { aspect-ratio: 16 / 9; }
@media (min-width: 720px) { .ph-out { aspect-ratio: 4 / 3; } }
.outputs figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags li {
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 0.9375rem;
}
.ph-strip { aspect-ratio: 21 / 9; margin-top: 32px; }

.games-title {
  font-size: 1rem; font-weight: 700;
  margin: 40px 0 8px;
}
.games li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.g-name { font-weight: 600; }
.g-year { color: var(--muted); font-variant-numeric: tabular-nums; }
.g-link {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--accent);
  text-underline-offset: 4px;
}
.g-link:hover { color: var(--text); }

@media (min-width: 720px) {
  .svc { grid-template-columns: 80px 1fr; gap: 24px; padding-block: 56px; }
  .svc-cols { grid-template-columns: 1.6fr 1fr; gap: 56px; }
  .outputs { grid-template-columns: repeat(3, 1fr); }
  .games li { grid-template-columns: 1fr 64px 200px; }
  .g-link { grid-column: auto; justify-self: end; }
}
@media (min-width: 960px) {
  .svc-split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; }
}

/* Process: one line, four stops */
.steps { display: grid; gap: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding: 0 0 32px 28px;
  counter-increment: step;
}
.steps li:last-child { padding-bottom: 0; }
/* The track is a pseudo-element so it can be drawn in (see Motion). */
.steps li::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
  transform-origin: top;
}
.steps li::before {
  content: "";
  position: absolute; left: -4px; top: 8px; z-index: 1;
  width: 9px; height: 9px;
  background: var(--bg); border: 1px solid var(--text);
}
.steps h3 {
  font-weight: 700; font-size: 1.25rem; margin-bottom: 8px;
}
.steps h3::before {
  content: counter(step, decimal-leading-zero) "  ";
  color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: pre;
}
.steps p { color: var(--muted); max-width: 34ch; }

@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { padding: 28px 32px 0 0; }
  .steps li::after {
    left: 0; right: 0; top: 0; bottom: auto;
    width: auto; height: 1px;
    transform-origin: left;
  }
  .steps li::before { left: 0; top: -4px; }
}

/* About */
.about { display: grid; gap: 24px; }
.about .section-title { margin-bottom: 32px; }
.ph-text { min-height: 160px; }
@media (min-width: 720px) {
  .about { grid-template-columns: 1fr 1fr; }
  .about .section-title { grid-column: 1 / -1; }
}

/* Contact */
.contact-grid { display: grid; gap: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.contact-title {
  display: flex; gap: 16px; align-items: flex-start;
  font-weight: 850; font-stretch: 112%;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 0.98; letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.contact-title .gcp { margin-top: 0.15em; }
.contact-lede { color: var(--muted); max-width: 44ch; margin-bottom: 32px; }

.brief { display: grid; gap: 24px; align-content: start; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field [aria-invalid="true"] { border-color: var(--error); }
.hint { font-size: 0.875rem; color: var(--muted); }
.err { font-size: 0.875rem; color: var(--error); }
.status { font-size: 0.9375rem; color: var(--muted); min-height: 1.5em; }
.brief .btn { justify-self: start; }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 80px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 72px; color: var(--muted); font-size: 0.9375rem;
}
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-inner a:hover { color: var(--text); }

/* Motion (MOTION 2). Reasons per animation are in DESIGN.md.
   Everything below is skipped for prefers-reduced-motion, and the
   hidden start states only apply once JS has marked <html class="js">. */
:root { --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1); }

.btn { transition: background-color 0.2s ease, color 0.2s ease; }
.btn:active { transform: translateY(1px); }
.g-link, .footer-inner a, .lang button, .field input, .field select, .field textarea {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav a { position: relative; transition: color 0.2s ease; }
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 8px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

@media (prefers-reduced-motion: no-preference) {
  /* Hero: three lines rise in order, then the lede and CTA */
  .hero-title .line { overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
  .hero-title .line > span { animation: rise 0.9s var(--ease-out) both; }
  .hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
  .hero-title .line:nth-child(3) > span { animation-delay: 0.24s; }
  .hero-lede, .hero .btn { animation: fade-up 0.8s var(--ease-out) 0.5s both; }
  .hero .btn { animation-delay: 0.62s; }
  .hero-media { animation: fade-in 1.2s ease 0.3s both; }

  /* Survey scan over the footage, then the GCP marker locks on */
  .ph-video { overflow: hidden; }
  .ph-video::after {
    content: "";
    position: absolute; left: 0; right: 0; top: 0;
    height: 1px; background: var(--accent);
    opacity: 0;
    animation: scan 7s ease-in-out 0.9s infinite;
  }
  .gcp-hero { animation: lock 0.6s var(--ease-out) 2.4s both; }

  /* Scroll reveal: whole blocks, once */
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 0.1s);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .js .contact-grid .gcp { opacity: 0; }
  .js .contact-grid.is-in .gcp { animation: lock 0.6s var(--ease-out) 0.5s both; }

  /* Process: the track draws from Brief to Execution, step by step */
  .js .reveal-steps li::after {
    transform: scaleY(0);
    transition: transform 0.5s var(--ease-out) calc(var(--i) * 0.3s);
  }
  .js .reveal-steps li::before {
    opacity: 0;
    transition: opacity 0.3s ease calc(var(--i) * 0.3s), background-color 0.3s ease calc(var(--i) * 0.3s + 0.3s);
  }
  .js .reveal-steps li > * {
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.6s ease calc(var(--i) * 0.3s + 0.15s), transform 0.6s var(--ease-out) calc(var(--i) * 0.3s + 0.15s);
  }
  .js .reveal-steps.is-in li::after { transform: none; }
  .js .reveal-steps.is-in li::before { opacity: 1; background: var(--text); }
  .js .reveal-steps.is-in li > * { opacity: 1; transform: none; }
  @media (min-width: 900px) {
    .js .reveal-steps li::after { transform: scaleX(0); }
  }
}

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan {
  0% { top: 0; opacity: 0; }
  5% { opacity: 1; }
  40% { top: 100%; opacity: 1; }
  45%, 100% { top: 100%; opacity: 0; }
}
@keyframes lock {
  0% { opacity: 0; transform: scale(2.2) rotate(45deg); }
  70% { opacity: 1; transform: scale(0.92) rotate(0deg); }
  100% { opacity: 1; transform: none; }
}

/* Typing headline: one word at a time (owner request). main.js adds
   html.typing only when motion is allowed; otherwise the three static
   lines stay. Screen readers always get the sr-only sentence. */
.hero-type { display: none; }
.typing .hero-static { display: none; }
.typing .hero-type { display: block; white-space: nowrap; }
.hero-title .hero-type > span { display: inline-block; }
.caret {
  width: 0.09em;
  height: 0.82em;
  margin-left: 0.06em;
  background: var(--accent);
  vertical-align: -0.04em;
  animation: blink 1s steps(1) infinite;
}
.hero-type.is-typing .caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
