/* ==========================================================================
   APEX AUTO — base: tokens, font, reset, typography, utilities
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour: near-black foundation, warm white, titanium accent */
  --ink: #060607;
  --coal: #0b0b0d;
  --graphite: #131316;
  --steel: #1c1c20;
  --white: #f3f0ea;
  --dim: #b4b2ac;
  --mute: #86847f;
  --chrome: #c4c8cf;
  --chrome-hi: #eceff3;
  --chrome-lo: #7f848d;
  --line: rgba(243, 240, 234, 0.13);
  --line-strong: rgba(243, 240, 234, 0.3);
  --metal: linear-gradient(100deg, #adb2ba 0%, #f5f7f9 32%, #b8bdc5 52%, #eceff2 78%, #a9aeb6 100%);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 4.2vw, 72px);
  --maxw: 1520px;
  --section-y: clamp(96px, 12vw, 208px);
  --header-h: 80px;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-cine: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

address {
  font-style: normal;
}

::selection {
  background: var(--chrome);
  color: var(--ink);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 0.85em 1.3em;
  background: var(--white);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

/* Extended, uppercase, light-of-touch: the automotive voice */
.display {
  font-weight: 500;
  font-stretch: 125%;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(1.9rem, 4.5vw, 4.6rem);
}

/* Titanium: brushed-metal gradient on key words */
.chrome {
  background: var(--metal);
  background-size: 220% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 1em;
  font-size: 0.7rem;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--chrome);
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--metal);
}

.lede {
  font-size: clamp(1.02rem, 1.2vw, 1.18rem);
  line-height: 1.7;
  color: var(--dim);
  max-width: 36em;
}

/* --------------------------------------------------------------------------
   Reveals (only when JS is running)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s var(--ease-cine), transform 1s var(--ease-cine);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Curtain wipe for photography */
.js [data-reveal="wipe"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 calc(100% - 2px) 0); /* 2px sliver keeps IntersectionObserver aware of the element */
  transition: clip-path 1.4s var(--ease-cine);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal="wipe"].is-in {
  clip-path: inset(0 0 0 0);
}

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

  .js [data-reveal],
  .js [data-reveal="wipe"] {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
}
