/* =====================================================================
   STEEL AFFAIRS AUTOMOTIVE — shared foundation
   "The Ledger": dark-editorial quiet-money luxury. Bodoni Moda (display) +
   Archivo (body/numerals). Near-black ink ground; the CARS are the only color.
   Brass appears in exactly four roles. Motion whispers — three signature moves,
   everything else holds still. Do not add colors or motion outside this system.
   ===================================================================== */

/* ---- 1. TOKENS ---------------------------------------------------- */
:root {
  /* ink palette — essentially monochrome */
  --ink:        #0B0B0D;   /* page paper */
  --ink-raised: #131316;   /* cards, spec panels */
  --ink-hair:   #1C1C20;   /* hairline block fills, inputs */
  --bone:       #ECE8E0;   /* PRIMARY text — never pure #FFF */
  --smoke:      #B7B8BD;   /* secondary text */
  --steel:      #7C7E85;   /* labels, captions, metadata */
  --line:       rgba(236, 232, 224, 0.10); /* hairline dividers */
  --brass:      #AC8A57;   /* the single warm metallic accent */
  --brass-dim:  #6E5A3B;   /* brass at rest / borders */

  /* type */
  --display: "Bodoni Moda", "Times New Roman", serif;
  --body:    "Archivo", system-ui, -apple-system, sans-serif;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* slow, expensive settle */
  --rev:  1100ms;  /* reveal duration */
  --mi:   300ms;   /* micro-interaction */

  /* layout */
  --maxw: 1440px;
  --gutter: 24px;
  --margin: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(6rem, 12vw, 11rem);
  --radius: 2px;
}

/* ---- 2. RESET ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--brass); color: var(--ink); }

/* ---- 3. TYPOGRAPHY ------------------------------------------------ */
.display-xl {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-optical-sizing: auto;
}
.display-l {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.headline-m {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.ledger-num {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
/* italic-serif parenthetical eyebrow — the signature texture */
.eyebrow {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--steel);
  letter-spacing: 0.01em;
}
.lead {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--smoke);
  max-width: 52ch;
}
.body { color: var(--smoke); max-width: 65ch; }
.caption {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 500;
}
.tabular { font-variant-numeric: tabular-nums; }

/* ---- 4. LAYOUT ---------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--margin); }
.section { padding-block: var(--section-y); }
.rule { border: 0; border-top: 1px solid var(--line); } /* the ledger rule */
.grid { display: grid; gap: var(--gutter); }
.stack-sm > * + * { margin-top: 1rem; }
.stack   > * + * { margin-top: 1.5rem; }
.stack-lg > * + * { margin-top: 3rem; }

/* ---- 5. BUTTONS / LINKS ------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--body); font-weight: 500; font-size: 0.9375rem;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.95rem 1.6rem; border-radius: var(--radius);
  min-height: 44px;
  transition: background var(--mi) var(--ease), color var(--mi) var(--ease),
              border-color var(--mi) var(--ease);
}
.btn--brass { background: var(--brass); color: var(--ink); }
.btn--brass:hover { background: var(--bone); }
.btn--outline { border: 1px solid var(--brass-dim); color: var(--bone); }
.btn--outline:hover { border-color: var(--brass); color: var(--brass); }

/* text link with brass underline reveal */
.link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 500; letter-spacing: 0.02em; color: var(--bone);
  position: relative; transition: color var(--mi) var(--ease);
}
.link::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 100%;
  background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform var(--mi) var(--ease);
}
.link:hover { color: var(--brass); }
.link:hover::after { transform: scaleX(1); }
.link .arrow { transition: transform var(--mi) var(--ease); }
.link:hover .arrow { transform: translateX(4px); }

/* ---- 6. FRAMED / GRADED IMAGERY (consistency anchor) -------------- */
/* Every stock image passes through ONE house grade so mixed sources read as
   a single commissioned set. Never ship a raw, ungraded image. */
.graded { filter: grayscale(0.15) contrast(1.06) brightness(0.92) saturate(0.9); }

.frame {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--ink-raised);
}
.frame::after { /* shared ink-to-transparent bottom gradient on every framed image */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(11,11,13,0.55) 0%, transparent 45%);
}
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* in-frame car scale — the car moves, the frame holds (signature move #3) */
.frame--zoom img {
  transition: transform 700ms var(--ease);
  transform: scale(1.001); /* avoid subpixel edge shimmer */
}
.frame--zoom:hover img { transform: scale(1.04); }

/* ---- 7. CARDS ----------------------------------------------------- */
.card {
  background: var(--ink-raised); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--mi) var(--ease);
}
.card:hover { border-color: var(--brass-dim); }
.card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card__name { font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1.15rem; letter-spacing: 0.01em; }
.card__price { font-variant-numeric: tabular-nums; color: var(--brass); font-weight: 600;
  font-size: 1.1rem; }
.card__meta { color: var(--steel); font-size: 0.85rem; }

/* ---- 8. NAV ------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem var(--margin);
  transition: background var(--mi) var(--ease), border-color var(--mi) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: var(--ink); border-bottom-color: var(--line); }
.nav__brand { font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 1rem; }
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a { font-size: 0.9rem; letter-spacing: 0.03em; color: var(--smoke);
  transition: color var(--mi) var(--ease); }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--bone); }
.nav__phone {
  border: 1px solid var(--brass-dim); border-radius: var(--radius);
  padding: 0.55rem 1rem; font-variant-numeric: tabular-nums; color: var(--bone);
  transition: border-color var(--mi) var(--ease), color var(--mi) var(--ease);
}
.nav__phone:hover { border-color: var(--brass); color: var(--brass); }
.nav__toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; }
.nav__toggle span { display: block; width: 24px; height: 1.5px; background: var(--bone);
  position: relative; transition: background var(--mi); }
.nav__toggle span::before, .nav__toggle span::after {
  content: ""; position: absolute; left: 0; width: 24px; height: 1.5px; background: var(--bone);
  transition: transform var(--mi) var(--ease); }
.nav__toggle span::before { top: -7px; }
.nav__toggle span::after { top: 7px; }
body.menu-open .nav__toggle span { background: transparent; }
body.menu-open .nav__toggle span::before { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav__toggle span::after  { transform: translateY(-7px) rotate(-45deg); }

/* mobile full-screen ledger menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 0.4rem;
  padding: var(--margin);
  opacity: 0; visibility: hidden; transition: opacity var(--mi) var(--ease), visibility var(--mi);
}
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--display); text-transform: uppercase; font-weight: 700;
  font-size: clamp(2rem, 9vw, 3rem); line-height: 1.25; color: var(--bone);
  display: flex; align-items: baseline; gap: 1rem;
}
.mobile-menu a .idx { font-family: var(--body); font-size: 0.8rem; color: var(--steel);
  font-variant-numeric: tabular-nums; }
.mobile-menu .mm-contact { margin-top: 2rem; }

/* ---- 9. FOOTER ---------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 5rem); }
.footer__grid { display: grid; gap: 2.5rem; grid-template-columns: 1.4fr 1fr 1.2fr; }
.footer__brand { font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 1.1rem; }
.footer a { color: var(--smoke); transition: color var(--mi); }
.footer a:hover { color: var(--brass); }
.footer__col h4 { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--steel); font-weight: 500; margin-bottom: 1rem; }
.footer__col a, .footer__col p { display: block; font-size: 0.95rem; color: var(--smoke);
  margin-bottom: 0.5rem; }
.footer__legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--steel); }

/* ---- 10. REVEAL MOTION (JS toggles .is-in) ------------------------ */
[data-reveal] { opacity: 0; transform: translateY(24px); }
[data-reveal].is-in { opacity: 1; transform: none;
  transition: opacity var(--rev) var(--ease), transform var(--rev) var(--ease); }

/* masked clip-path type rise — each line unclips upward from baseline */
.reveal-mask { overflow: hidden; }
.reveal-mask > .line { display: block; transform: translateY(105%);
  transition: transform var(--rev) var(--ease); }
.reveal-mask.is-in > .line { transform: none; }
.reveal-mask.is-in > .line:nth-child(2) { transition-delay: 120ms; }
.reveal-mask.is-in > .line:nth-child(3) { transition-delay: 240ms; }

/* brass tick that draws under a landed number */
.tick { height: 2px; background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform 900ms var(--ease); }
.tick.is-in { transform: scaleX(1); }

/* hero frame: clipped to a thin center slit, wipes open vertically on load (signature #1) */
.hero-frame { clip-path: inset(48% 0 48% 0); }
.hero-frame[data-hero].is-in {
  clip-path: inset(0 0 0 0);
  transition: clip-path var(--rev) var(--ease);
}

/* ledger cell with a ghosted final numeral behind the live count-up (signature #2) */
.ledger-cell { position: relative; }
.ledger-ghost {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  font-family: var(--body); font-weight: 600; font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1; color: var(--bone); opacity: 0.08;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.ledger-cell .ledger-num { position: relative; z-index: 1; }

/* ---- 11. FOCUS / A11Y --------------------------------------------- */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 1px; }
.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brass); color: var(--ink); padding: 0.75rem 1.25rem; font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- 12. RESPONSIVE ----------------------------------------------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer__legal { flex-direction: column; }
}

/* ---- 13. REDUCED MOTION (reveals resolve to final state) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reveal-mask > .line { transform: none !important; }
  .tick { transform: scaleX(1) !important; }
  .frame--zoom:hover img { transform: none !important; }
  .hero-frame { clip-path: inset(0 0 0 0) !important; } /* resolves open instantly */
}
