:root {
  --canvas: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #0b8a5b;
  --on-accent: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.04), 0 24px 48px rgba(0, 0, 0, 0.1);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #000000;
    --surface: #111113;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2a2a2e;
    --accent: #34d399;
    --on-accent: #04130d;
    --glass: rgba(18, 18, 20, 0.66);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --canvas: #000000;
  --surface: #111113;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: #2a2a2e;
  --accent: #34d399;
  --on-accent: #04130d;
  --glass: rgba(18, 18, 20, 0.66);
  --glass-edge: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.6);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 1rem/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; top: -100px; left: 12px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--text); color: var(--canvas); font-weight: 500;
}
.skip:focus { top: 12px; }

/* Nav: translucent material, content scrolls beneath */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding: 12px var(--gutter);
  padding-top: max(12px, env(safe-area-inset-top));
}
.nav-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  transition: box-shadow 300ms ease;
}
.nav.scrolled .nav-inner { box-shadow: inset 0 0 0 1px var(--glass-edge), var(--shadow); }

.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; }
.logo-mark { width: 22px; height: 22px; fill: currentColor; color: var(--text); }
.logo-sm { font-size: 0.9375rem; }
.logo-sm .logo-mark { width: 18px; height: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border-radius: 999px;
  background: var(--text); color: var(--canvas);
  font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.01em;
  transition: transform 160ms var(--ease-out), opacity 200ms ease, background-color 200ms ease;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { opacity: 0.86; }
  .btn-ghost:hover { opacity: 1; background: var(--surface); }
}

/* Hero: full-bleed showreel, always dark, text on a scrim */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: 100svh;
  margin-bottom: clamp(56px, 9vw, 96px);
  background: #000; color: #f5f5f7;
}
.hero-poster, .hero-video { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity 900ms ease; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 38%, rgba(0, 0, 0, 0.35) 70%, rgba(0, 0, 0, 0.55) 100%);
  transition: opacity 900ms ease;
}
.hero-inner {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: clamp(140px, 22vh, 200px) var(--gutter) clamp(48px, 8vh, 88px);
  transition: opacity 600ms ease, transform 900ms var(--ease-out), visibility 0s linear 900ms;
}

/* Bottom bar that replaces the copy while the reel plays */
.hero-bar {
  position: absolute; inset: auto 0 0; z-index: 1;
  display: flex; align-items: center; justify-content: flex-end;
  max-width: var(--max); margin: 0 auto;
  padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 600ms ease 500ms, transform 900ms var(--ease-out) 500ms, visibility 0s linear 1.4s;
}
.hero-bar-actions { display: flex; gap: 8px; }
.hero-bar-actions .btn { min-width: 128px; }
.hero-bar-actions .btn-icon { min-width: 0; width: 36px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; fill: currentColor; }
.btn-icon .when-on, .btn-icon[aria-pressed="true"] .when-off { display: none; }
.btn-icon[aria-pressed="true"] .when-on { display: block; }
@media (max-width: 520px) {
  .hero-bar { justify-content: stretch; }
  .hero-bar-actions { flex: 1; }
  .hero-bar-actions .btn { flex: 1; min-width: 0; padding: 0 10px; }
  .hero-bar-actions .btn-icon { flex: none; padding: 0; }
}
.hero .btn.btn-glass {
  background: rgba(255, 255, 255, 0.1); color: #f5f5f7; border: 0; font: inherit; font-weight: 500; font-size: 0.875rem; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* "Scroll" cue, bottom centre; fades once the page moves */
.scroll-cue {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(245, 245, 247, 0.45);
  font-size: 0.5625rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  transform: translate(-50%, 0);
  transition: opacity 500ms ease, transform 500ms var(--ease-out), color 250ms ease;
}
/* a mouse outline whose wheel glides down and fades, on a slow loop */
.scroll-cue .mouse {
  position: relative; width: 18px; height: 28px; border-radius: 9px;
  box-shadow: inset 0 0 0 1.25px currentColor;
}
.scroll-cue .wheel {
  position: absolute; left: 50%; top: 6px; width: 2px; height: 5px; margin-left: -1px;
  border-radius: 2px; background: currentColor;
  animation: wheel 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  60% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(8px); opacity: 0; }
}
.past-top .scroll-cue { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .scroll-cue:hover { color: rgba(245, 245, 247, 0.85); transform: translate(-50%, 2px); }
}
@media (max-width: 520px) { .scroll-cue { bottom: 76px; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue .wheel { animation: none; opacity: 1; } }

/* Reel playing: copy steps aside, scrim lifts, the bar comes in */
.hero-poster { transition: opacity 900ms ease; }
.hero.playing .hero-video { opacity: 1; }
.hero.playing .hero-poster { opacity: 0; }
/* Tall screens would crop the reel's own type; show the whole frame instead */
@media (max-aspect-ratio: 1/1) {
  .hero-video { object-fit: contain; }
}
.hero.playing::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 18%);
}
/* The copy is a fallback: with JS it stays off screen (still read out) unless
   the reel can't play */
.js .hero:not(.fallback) .hero-inner {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.hero.fallback .hero-inner { animation: fade 600ms ease both; }
.hero.playing .hero-bar { opacity: 1; visibility: visible; transform: none; transition-delay: 500ms, 500ms, 0s; }
.hero .eyebrow { color: #34d399; }
.hero .lede { color: rgba(245, 245, 247, 0.72); max-width: 40ch; }
.hero .btn { background: #f5f5f7; color: #000; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.875rem; letter-spacing: 0.01em; margin-bottom: 14px; }
h1 {
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 13ch;
}
.lede { color: var(--muted); font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); line-height: 1.45; letter-spacing: -0.012em; max-width: 34ch; margin-top: 18px; }

/* Work */
.work { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.featured { display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.shot {
  display: block; position: relative; overflow: hidden;
  margin: 12px 12px 0; border-radius: calc(var(--radius) - 8px);
  aspect-ratio: 16 / 10;
  background: var(--line);
  box-shadow: 0 0 0 1px var(--glass-edge);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 600ms var(--ease-out); }

.meta { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; flex: 1; padding: 20px 22px 22px; }
.card h2, .card h3 { font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.022em; font-weight: 600; }
.card-lg h2, .card-lg h3 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); letter-spacing: -0.028em; }
.meta p { color: var(--muted); margin-top: 6px; font-size: 0.9375rem; line-height: 1.45; max-width: 46ch; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li {
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.005em;
  color: var(--muted); background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--line);
}

.links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.visit {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  color: var(--accent); font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.01em;
  padding: 6px 0;
  transition: transform 160ms var(--ease-out);
}
.visit svg { width: 16px; height: 16px; transition: transform 200ms var(--ease-out); }
.visit:active { transform: scale(0.97); }
.sub { color: var(--muted); font-size: 0.8125rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: color 200ms ease; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-lift); }
  .card:not([data-tilt]):hover { transform: translateY(-4px); }
  .card:hover .shot img { transform: scale(1.02); }
  .visit:hover svg { transform: translate(2px, -2px); }
  .sub:hover { color: var(--text); }
}

/* Group */
.group { margin-top: clamp(96px, 14vw, 160px); }
.group-head { margin-bottom: clamp(28px, 4vw, 44px); }
.group-head h2 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 700; }

.card-wide { flex-direction: row; }
.card-wide .shot { flex: 1.6; margin: 12px 0 12px 12px; }
.card-wide .meta { flex: 1; padding: 28px; }

.card-own { margin-bottom: clamp(20px, 3vw, 32px); }
.card-own .eyebrow { margin-bottom: 8px; }

.dealers { display: grid; gap: clamp(16px, 2.4vw, 24px); grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(16px, 2.4vw, 24px); }
.dealers .meta { padding: 16px 18px 18px; }
.dealers .meta p { font-size: 0.875rem; }

/* CTA */
.cta {
  max-width: var(--max); margin: clamp(120px, 16vw, 200px) auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.cta h2 { font-size: clamp(2.25rem, 6vw, 4.5rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; }
.cta .lede { margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.footer {
  max-width: var(--max); margin: clamp(120px, 16vw, 180px) auto 0;
  padding: 28px var(--gutter) max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.8125rem;
}
.footer .logo { color: var(--text); }

/* Responsive */
@media (max-width: 1024px) {
  .dealers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; }
  .card-wide { flex-direction: column; }
  .card-wide .shot { flex: none; margin: 12px 12px 0; }
  .card-wide .meta { padding: 20px 22px 22px; }
}
@media (max-width: 520px) {
  .dealers { grid-template-columns: 1fr; }
  .cta-actions { flex-direction: column; align-self: stretch; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* Motion: hero entrance (once, on load) */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.enter { animation: rise 900ms var(--ease-out) both; animation-delay: calc(var(--d) * 70ms + 80ms); }

/* Motion: scroll reveal, only when JS is running */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.js .reveal.in { opacity: 1; transform: none; }
.js .card.reveal.in { transition: opacity 700ms var(--ease-out), transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter { animation: fade 400ms ease both; }
  .js .reveal { transform: none; transition: opacity 400ms ease; }
  .card, .shot img, .visit svg { transition: none; }
  .card:hover, .card:not([data-tilt]):hover, .card:hover .shot img { transform: none !important; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-transparency: reduce) {
  .nav-inner { background: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .nav-inner, .card { box-shadow: inset 0 0 0 1px var(--text); }
}

/* Status badge for sites still on a staging link */
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.005em; white-space: nowrap;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
:root { --warn: #b25e09; }
:root[data-theme="dark"] { --warn: #fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn: #fbbf24; } }
