/* Fast Car — fastcar.agency */

:root {
  --paddock: #F2F0EB;
  --asphalt: #141516;
  --ink: #0d0e0e;
  --charcoal: #1E1F21;
  --red: #D62718;
  --gold: #F4C21F;
  --muted: #8f8d87;
  --soft: #d8d6d0;
  --line: rgba(242, 240, 235, 0.24);

  --mono: 'Space Mono', ui-monospace, monospace;
  --bold: 'Inter Tight', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  /* Set by main.js */
  --h: 100vh;
  --slot: 100vh;
  --wordmark: 42vw;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paddock);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
a { color: var(--paddock); text-decoration: none; }
button { font: inherit; color: inherit; }
body.locked, body.is-loading { overflow: hidden; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  transition: background-color .9s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.preloader-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 30px;
  transform: translate(-50%, -50%);
  display: block;
}
.preloader.is-done { background-color: rgba(13, 14, 14, 0); }

/* ---------- Background ---------- */
.bg {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--h);
  overflow: hidden;
  z-index: 0;
}
.bg-inner {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  transform-origin: center top;
  will-change: transform, filter;
}
.bg-img { width: 100%; height: auto; }

.wordmark {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--h);
  color: #fff;
  mix-blend-mode: difference;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
  will-change: transform;
}
.wordmark-line {
  position: absolute;
  left: 0; right: 0;
  margin: 0;
  padding: 0 0.5vw;
  display: flex;
  justify-content: space-between;
  font-size: var(--wordmark);
  line-height: 0.74;
}
.wordmark-top { bottom: calc(50% + 60px); }
.wordmark-bottom { top: calc(50% + 60px); }

/* ---------- Content layer (isolated so the nav inverts only over content) ---------- */
.content {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--h) / 2 - 56px);
  z-index: 10;
  height: 112px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  mix-blend-mode: difference;
  will-change: top, opacity, transform;
}
.nav-btn {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--bold);
  font-weight: 900;
  font-size: clamp(36px, 5.6vw, 92px);
  line-height: 1;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  transition: opacity .2s ease;
  opacity: .9;
}
.nav-btn:hover { opacity: 1; }
.nav-menu { justify-self: start; color: var(--red); }
.nav-contact { justify-self: end; color: var(--red); }
.nav-logo { display: flex; align-items: center; min-height: 44px; }
.nav-logo svg { width: 80px; height: 30px; display: block; }

/* ---------- Intro ---------- */
.intro-track { position: relative; height: calc(var(--h) * 2); }
.intro {
  position: absolute;
  top: var(--h); left: 0; right: 0;
  height: var(--h);
  padding: 104px 40px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  will-change: opacity;
}
.intro-logos {
  list-style: none;
  margin: 0 0 72px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 32px 40px;
}
.intro-logos img { width: auto; max-width: 100%; }
.intro-heading {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 108px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

/* ---------- Shared section bits ---------- */
.slot { position: relative; min-height: var(--slot); }
.section-label {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-label h2 { margin: 0; font-size: 12px; font-weight: 400; }
.section-label span { color: var(--muted); }

/* ---------- Services ---------- */
.services {
  padding: 152px 40px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}
.services-grid {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.service-card {
  background: var(--asphalt);
  border: 1px solid var(--line);
  min-height: 480px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  text-align: center;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.45));
}
.service-title { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.service-title .num { font-size: 11px; letter-spacing: 0.1em; color: var(--gold); }
.service-title h3 {
  margin: 0;
  font-family: var(--bold);
  font-weight: 900;
  font-size: clamp(36px, 3.6vw, 56px);
  letter-spacing: -0.05em;
  line-height: 1;
}
.service-card p {
  margin: 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
  color: var(--soft);
}

/* Animated icons */
.ic { width: 112px; height: 112px; display: block; fill: none; stroke: var(--paddock); stroke-width: 1.2; }
.ic * { transform-box: fill-box; transform-origin: center; }
.ic-front { animation: icFloat 3.2s ease-in-out infinite; }
.ic-play { animation: icPulse 1.6s ease-in-out infinite; }
.ic-base { stroke-dasharray: 76; animation: icDraw 3.2s ease-in-out infinite; }
.ic-ring { animation: icRing 2.4s ease-out infinite; }
.ic-ring.d2 { animation-delay: 1.2s; }
.ic-dot { fill: var(--gold); stroke: var(--gold); animation: icBlink 1.2s steps(2, start) infinite; }
.ic-cross { transform-box: view-box; transform-origin: 60px 60px; animation: icSpin 14s linear infinite; }
.ic-chev { animation: icChev 1.4s ease-in-out infinite; }
.ic-chev.d2 { animation-delay: .18s; }
.ic-chev.d3 { animation-delay: .36s; }
.ic-speed { stroke-dasharray: 8 6; animation: icDash .6s linear infinite; }
@keyframes icFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(5px,-5px); } }
@keyframes icPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes icDraw { 0% { stroke-dashoffset: 76; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -76; } }
@keyframes icRing { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes icBlink { to { visibility: hidden; } }
@keyframes icSpin { to { transform: rotate(360deg); } }
@keyframes icChev { 0%,100% { opacity: .25; transform: translateX(-5px); } 50% { opacity: 1; transform: translateX(5px); } }
@keyframes icDash { to { stroke-dashoffset: -14; } }

/* ---------- Work carousel ---------- */
.work {
  height: var(--slot);
  padding: 136px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.work-label { max-width: 1160px; }
.carousel {
  width: 100%;
  max-width: 1160px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 700px;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--asphalt);
  border: 1px solid var(--line);
  overflow: hidden;
}
.project-band {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.project-name {
  margin: 0;
  font-family: var(--bold);
  font-weight: 900;
  font-size: clamp(32px, 3.8vw, 60px);
  line-height: 1;
  letter-spacing: -0.05em;
}
.tags { display: flex; gap: 8px; flex-shrink: 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.tags span { background: var(--paddock); color: var(--asphalt); padding: 5px 12px; }
.project-strip {
  background: var(--charcoal);
  padding: 14px 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-strip div { display: flex; flex-direction: column; gap: 4px; }
.project-strip small { font-size: 10px; color: var(--muted); }
.project-strip strong { font-family: var(--bold); font-weight: 900; font-size: 22px; letter-spacing: -0.03em; }
.project-strip .right { text-align: right; }
.project-strip .right strong { color: var(--gold); }
.project-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.project-media { position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.project-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-info { min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.project-info p { margin: 8px 0 0; font-family: var(--serif); font-size: 22px; line-height: 1.35; }
.service-list { margin-top: 8px; }
.service-list div {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.service-list div:last-child { border-bottom: 1px solid var(--line); }
.service-list span:first-child { font-size: 11px; color: var(--gold); }
.service-list span:last-child { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.2; }
.project-foot {
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.barcode {
  flex: 0 0 160px;
  height: 34px;
  background: repeating-linear-gradient(90deg, var(--paddock) 0 2px, transparent 2px 4px, var(--paddock) 4px 5px, transparent 5px 8px, var(--paddock) 8px 11px, transparent 11px 12px, var(--paddock) 12px 13px, transparent 13px 17px);
}
.carousel-controls {
  width: 100%;
  max-width: 1160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.arrow {
  width: 56px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid rgba(242, 240, 235, 0.4);
  cursor: pointer;
  transition: border-color .2s ease;
}
.arrow:hover { border-color: var(--paddock); }
.arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.carousel-count { margin: 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.carousel-count #projNum { color: var(--gold); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  height: var(--h);
  padding: 56px 40px 48px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 32px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  will-change: opacity;
}
.footer p { margin: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer a, .link-btn { opacity: .82; transition: opacity .2s ease; }
.footer a:hover, .link-btn:hover { opacity: 1; }
.link-btn { padding: 0; background: none; border: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; text-align: left; justify-self: start; }
.footer-row { display: flex; flex-wrap: wrap; gap: 32px 40px; }
.footer-mid { align-items: center; }
.pair { flex: 1 1 320px; display: grid; grid-template-columns: 140px 1fr; column-gap: 24px; row-gap: 28px; align-content: start; }
.pair-tight { row-gap: 0; }
.spacer, .footer-logo { flex: 1 1 320px; }
.footer-logo a { display: inline-flex; min-height: 44px; align-items: center; }
.footer-logo svg { width: 72px; height: 27px; display: block; }

/* ---------- Overlays ---------- */
.menu-page, .contact-page {
  position: fixed;
  inset: 0;
  padding: 28px 40px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.menu-page, .contact-page { visibility: hidden; }
.overlay-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.overlay-logo { width: 80px; height: 30px; display: block; }
.close-red { color: var(--red); text-transform: none; }
.close-light { color: var(--paddock); text-transform: none; }

.menu-page {
  z-index: 55;
  background: var(--ink);
  opacity: 0;
  transition: opacity .45s ease, visibility .45s;
}
.menu-page.open { opacity: 1; visibility: visible; }
.menu-links { flex: 1 1 auto; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.menu-links li { display: flex; align-items: baseline; gap: 24px; }
.menu-links span { font-size: 13px; color: var(--gold); }
.menu-links a, .menu-links button {
  padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--paddock);
  font-family: var(--bold);
  font-weight: 900;
  font-size: clamp(56px, 9vw, 140px);
  line-height: 1;
  letter-spacing: -0.055em;
  transition: color .2s ease;
}
.menu-links a:hover, .menu-links button:hover, .menu-links a:focus-visible, .menu-links button:focus-visible { color: var(--red); }
.menu-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.contact-page {
  z-index: 60;
  gap: 20px;
  background: var(--red);
  opacity: 0;
  transition: opacity .45s ease, visibility .45s;
}
.contact-page.open { opacity: 1; visibility: visible; }
.contact-step { margin: 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.progress { height: 6px; background: rgba(20, 21, 22, 0.3); }
.progress-fill { height: 100%; width: 16.66%; background: var(--gold); transition: width .45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.contact-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: 24px 0; }
.q-head { display: flex; flex-direction: column; gap: 14px; }
.q-title {
  margin: 0;
  max-width: 18ch;
  font-family: var(--bold);
  font-weight: 900;
  font-size: clamp(40px, 5.6vw, 92px);
  line-height: 1;
  letter-spacing: -0.05em;
}
.q-hint { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2vw, 28px); opacity: .92; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  min-height: 56px;
  padding: 0 24px;
  border: 1px solid rgba(242, 240, 235, 0.6);
  background: transparent;
  color: var(--paddock);
  font-family: var(--serif);
  font-size: clamp(22px, 2.1vw, 30px);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { border-color: var(--paddock); }
.chip[aria-pressed="true"] { background: var(--paddock); color: var(--asphalt); border-color: var(--paddock); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 40px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.field input, .notes {
  min-height: 56px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(242, 240, 235, 0.6);
  color: var(--paddock);
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 40px);
}
.notes { width: 100%; height: 180px; resize: none; padding: 16px 0; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.3; }
.field input::placeholder, .notes::placeholder { color: rgba(242, 240, 235, 0.55); }
.field input:focus, .notes:focus { outline: none; border-color: var(--gold); }
.done-title { margin: 0; font-family: var(--bold); font-weight: 900; font-size: clamp(48px, 7vw, 120px); line-height: 1; letter-spacing: -0.05em; }
.done-text { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.2vw, 32px); }
.contact-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.back-btn {
  min-height: 44px; padding: 0; background: none; border: 0; cursor: pointer;
  font-family: var(--bold); font-weight: 900; font-size: clamp(22px, 2.4vw, 36px); letter-spacing: -0.04em;
}
.back-btn[hidden] { display: none; }
.cta {
  min-height: 64px; padding: 0 36px; border: 0;
  background: var(--asphalt); color: var(--paddock); cursor: pointer;
  font-family: var(--bold); font-weight: 900; font-size: clamp(22px, 2.4vw, 36px); letter-spacing: -0.04em; text-transform: lowercase;
  transition: opacity .2s ease;
}
.cta:disabled { opacity: .4; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .nav, .intro, .services, .work, .footer, .menu-page, .contact-page { padding-left: 20px; padding-right: 20px; }
  .intro-logos { justify-content: center; gap: 20px 28px; }
  .intro-logos img { transform: scale(.6); }
  .project-strip { grid-template-columns: 1fr 1fr; }
  .project-strip .right { display: none; }
  .project-body { grid-template-columns: 1fr; grid-template-rows: 200px 1fr; }
  .project-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .tags span:first-child { display: none; }
  .barcode { display: none; }
  .footer { height: auto; min-height: var(--h); }
}

@media (prefers-reduced-motion: reduce) {
  .ic * { animation: none !important; }
  .carousel-track, .menu-page, .contact-page { transition: none; }
}
