/* ============================================================
   ZMG CAR TRADE — css/ct-base.css
   SELF-CONTAINED base layer.

   This file replaces the dependency on the root ZMG stylesheet
   (../css/style.css) so the Car Trade sub-site works ON ITS OWN —
   upload the car-trade/ folder alone and nothing breaks.

   It carries only what Car Trade actually uses from the ZMG
   design system: brand tokens, the font stacks, fluid type scale,
   a light reset and the shared utility classes (.wrap, .kicker,
   .section-head, .lead, .mono, .muted, .skip-link, .grain).

   Loaded BEFORE car-trade.css.
   ============================================================ */

/* ---------- Brand + system tokens (mirror of the ZMG design system) ---------- */
:root {
  /* Brand */
  --zmg-red: #e30613;
  --zmg-blue: #0057d9;
  --black: #08090b;
  --graphite: #15181d;
  --navy: #0a1420;
  --white: #f7f8fa;
  --gray: #8c96a3;
  --gold: #c9a45c;

  /* Type */
  --font-display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Fluid type scale */
  --fs-kicker: clamp(0.68rem, 0.62rem + 0.3vw, 0.82rem);
  --fs-small: clamp(0.82rem, 0.78rem + 0.25vw, 0.92rem);
  --fs-body: clamp(0.95rem, 0.9rem + 0.3vw, 1.08rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
  --fs-h3: clamp(1.25rem, 1.05rem + 1.1vw, 2rem);
  --fs-h2: clamp(1.8rem, 1.4rem + 2.4vw, 3.2rem);
  --fs-h1: clamp(2.2rem, 1.6rem + 3.4vw, 4.4rem);

  /* Layout */
  --gutter: clamp(1.1rem, 4vw, 3.5rem);
  --section-y: clamp(4.5rem, 2rem + 8vw, 9.5rem);
  --max: 1360px;
  --radius: 3px;
  --radius-lg: 6px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.62;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-loading {
  overflow: hidden;
}
img,
svg,
video {
  max-width: 100%;
  display: block;
}
img {
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
p {
  margin: 0;
}
figure,
blockquote {
  margin: 0;
}
input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h3);
}

/* Visible keyboard focus */
:focus-visible {
  outline: 2px solid var(--zmg-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Layout shell ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide {
  max-width: 1600px;
}

/* ---------- Shared type utilities (used by Car Trade markup) ---------- */
.kicker {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-kicker);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--zmg-red);
  padding-left: 2.2em;
}
.kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.6em;
  height: 1px;
  background: var(--zmg-red);
  transform: translateY(-50%);
}
.kicker--blue {
  color: var(--zmg-blue);
}
.kicker--blue::before {
  background: var(--zmg-blue);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: rgba(247, 248, 250, 0.82);
}
.section-head {
  max-width: 64ch;
}
.section-head .kicker {
  margin-bottom: 1rem;
}
.section-head h2 {
  margin-bottom: 1rem;
}
.section-head p {
  margin-bottom: 0;
}

.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--gray);
}

/* ---------- Grain overlay (subtle premium texture) ---------- */
.grain {
  position: relative;
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  z-index: 1;
}
.grain > * {
  position: relative;
  z-index: 2;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  left: 1rem;
  top: -100px;
  z-index: 3000;
  padding: 0.8em 1.2em;
  background: var(--zmg-red);
  color: #fff;
  font-size: 0.85rem;
  border-radius: var(--radius);
  transition: top 0.3s var(--ease);
}
.skip-link:focus {
  top: 1rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
