/* ============================================================
   DRIVE MASTER ACADEMY — Shared Stylesheet
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo:wght@500;600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/* ---- Tokens ---- */
:root {
  --red:        #D81324;   /* primary, refined deeper red */
  --red-hot:    #FF2436;   /* energetic accent */
  --red-deep:   #9E0E1A;   /* shadow / hover */
  --ink:        #141414;   /* near-black */
  --ink-soft:   #2A2A2A;
  --paper:      #F6F4F1;   /* warm off-white */
  --paper-2:    #ECE8E3;
  --white:      #FFFFFF;
  --line:       #E2DCD4;
  --muted:      #6B6660;
  --muted-2:    #908A82;

  --shadow-sm: 0 2px 10px rgba(20,20,20,.06);
  --shadow-md: 0 12px 34px rgba(20,20,20,.10);
  --shadow-lg: 0 30px 70px rgba(20,20,20,.16);
  --shadow-red: 0 16px 40px rgba(216,19,36,.30);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);

  --display: 'Anton', 'Arial Narrow', sans-serif;
  --ui: 'Archivo', system-ui, sans-serif;
  --body: 'Hanken Grotesk', system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: clamp(16px, 1.05vw, 18px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

/* ---- Type helpers ---- */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--ui);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .74rem;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.eyebrow.on-dark { color: var(--red-hot); }
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: currentColor;
  display: inline-block;
}
.text-red { color: var(--red); }

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 130px); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark {
  width: 42px; height: 42px; flex-shrink: 0;
}
.brand__logo { height: 46px; width: auto; display: block; }
.brand__logo--inv { filter: brightness(0) invert(1); }
.brand__word {
  font-family: var(--display);
  font-size: 1.42rem;
  line-height: .82;
  text-transform: uppercase;
  letter-spacing: .01em;
  font-style: italic;
}
.brand__word .b1 { color: var(--red); }
.brand__word .b2 { color: var(--ink); }
.brand__word small {
  display: block;
  font-family: var(--ui);
  font-style: normal;
  font-weight: 800;
  font-size: .46rem;
  letter-spacing: .42em;
  color: var(--muted);
  margin-top: 3px;
}

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  font-family: var(--ui);
  font-weight: 600;
  font-size: .92rem;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__links a:hover { color: var(--red); background: var(--paper-2); }
.nav__links a.active { color: var(--red); }

.nav__right { display: flex; align-items: center; gap: 14px; }
.nav__phone {
  font-family: var(--ui);
  font-weight: 800;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .95rem;
}
.nav__phone svg { width: 16px; height: 16px; color: var(--red); }

.nav__toggle {
  display: none;
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  border: 1px solid var(--line);
}
.nav__toggle span { width: 22px; height: 2.4px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7.4px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7.4px) rotate(-45deg); }

/* ---- Buttons ---- */
.btn {
  font-family: var(--ui);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .86rem;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--red); color: #fff; box-shadow: var(--shadow-red); }
.btn--primary:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: 0 22px 48px rgba(216,19,36,.4); }
.btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--onred { background: var(--ink); color: #fff; }
.btn--onred:hover { background: #fff; color: var(--red); transform: translateY(-2px); }
.btn--lg { padding: 17px 34px; font-size: .95rem; }
.btn--sm { padding: 10px 18px; font-size: .76rem; }

/* ---- Mobile nav drawer ---- */
.mnav {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 24px var(--gutter) 40px;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  visibility: hidden;
}
.mnav.open { transform: translateX(0); visibility: visible; }
.mnav__top { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.mnav__close { width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.mnav__close svg { width: 22px; height: 22px; }
.mnav__links { margin-top: 36px; display: flex; flex-direction: column; gap: 4px; }
.mnav__links a {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  line-height: 1.06;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 10px 0;
  transition: color .2s, padding-left .25s var(--ease);
}
.mnav__links a:hover, .mnav__links a.active { color: var(--red-hot); padding-left: 12px; }
.mnav__foot { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.mnav__foot .btn { justify-content: center; }
.mnav__foot a.tel { font-family: var(--ui); font-weight: 800; font-size: 1.3rem; color: var(--red-hot); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: #fff; padding-block: clamp(56px, 8vw, 96px) 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; }
.footer-brand .display { font-size: clamp(2.4rem, 5vw, 3.6rem); color: #fff; }
.footer-brand .display .text-red { color: var(--red-hot); }
.footer-tag { font-family: var(--display); text-transform: uppercase; color: var(--red-hot); font-size: 1.4rem; margin-top: 6px; }
.footer-brand p { color: rgba(255,255,255,.6); margin-top: 18px; max-width: 38ch; }
.footer-col h4 { font-family: var(--ui); text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; color: var(--muted-2); margin-bottom: 18px; }
.footer-col a, .footer-col li { color: rgba(255,255,255,.78); display: block; padding: 6px 0; transition: color .2s; }
.footer-col a:hover { color: var(--red-hot); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.5); font-size: .85rem; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; color: #fff; }
.footer-social a:hover { background: var(--red); border-color: var(--red); }
.footer-social svg { width: 18px; height: 18px; }

/* ============================================================
   REUSABLE UI
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-weight: 700; font-size: .8rem;
  padding: 7px 14px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line); color: var(--ink-soft);
}
.pill svg { width: 15px; height: 15px; color: var(--red); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* Page hero (interior pages) */
.page-hero { background: var(--ink); color: #fff; padding-block: clamp(60px, 9vw, 120px) clamp(48px, 7vw, 90px); position: relative; overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; right: -8%; top: -30%;
  width: 540px; height: 540px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--red) 0%, transparent 62%);
  opacity: .5; pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { font-family: var(--display); text-transform: uppercase; font-size: clamp(2.8rem, 8vw, 5.4rem); line-height: 1.04; margin-top: 14px; letter-spacing: .02em; }
.page-hero h1 .text-red { color: var(--red-hot); }
.page-hero p { color: rgba(255,255,255,.72); max-width: 56ch; margin-top: 18px; font-size: 1.08rem; }
.breadcrumb { font-family: var(--ui); font-weight: 600; font-size: .82rem; color: rgba(255,255,255,.5); }
.breadcrumb a:hover { color: var(--red-hot); }

/* Section heading block */
.sec-head { max-width: 62ch; }
.sec-head.center { margin-inline: auto; }
.sec-head h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(2.1rem, 5.4vw, 3.7rem); line-height: 1.06; margin-top: 14px; letter-spacing: .02em; }
.sec-head h2 .text-red { color: var(--red); }
.sec-head p { color: var(--muted); margin-top: 16px; font-size: 1.05rem; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* Image slot defaults */
image-slot {
  --slot-bg: #20201f;
  display: block;
  background: var(--ink);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ============================================================
   EXIT-INTENT POPUP
   ============================================================ */
.ep-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.ep-overlay.is-open { opacity: 1; pointer-events: all; }
.ep__backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,20,.6); backdrop-filter: blur(4px);
}
.ep__card {
  position: relative; background: #fff; border-radius: var(--r-xl);
  padding: clamp(32px,5vw,52px) clamp(28px,5vw,48px);
  max-width: 480px; width: calc(100% - 32px);
  box-shadow: 0 32px 80px rgba(0,0,0,.22);
  transform: translateY(24px) scale(.97);
  transition: transform .35s var(--ease);
}
.ep-overlay.is-open .ep__card { transform: none; }
.ep__close {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper-2); display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: var(--muted); line-height: 1;
  transition: background .2s, color .2s;
}
.ep__close:hover { background: var(--line); color: var(--ink); }
.ep__badge {
  display: inline-block;
  background: rgba(216,19,36,.1); color: var(--red);
  font-family: var(--ui); font-weight: 800; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 18px;
}
.ep__title {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(2rem,5vw,2.8rem); line-height: .94;
}
.ep__title span { color: var(--red); }
.ep__sub { color: var(--muted); margin-top: 12px; font-size: 1rem; line-height: 1.55; }
.ep__form { margin-top: 24px; }
.ep__fields { display: flex; flex-direction: column; gap: 12px; }
.ep__fields input {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  padding: 13px 16px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.ep__fields input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(216,19,36,.1); }
.ep__fields input.ep--error { border-color: var(--red); }
.ep__cta {
  display: flex; width: 100%; justify-content: center;
  margin-top: 14px; padding: 15px; font-size: 1.05rem; border-radius: var(--r-sm);
  background: var(--red); color: #fff; font-family: var(--ui); font-weight: 800;
  letter-spacing: .02em; transition: background .2s, transform .2s;
}
.ep__cta:hover { background: var(--red-deep); transform: translateY(-1px); }
.ep__note { text-align: center; margin-top: 10px; font-size: .78rem; color: var(--muted-2); }
.ep__success {
  display: none; flex-direction: column; align-items: center;
  text-align: center; padding: 8px 0 4px; gap: 14px;
}
.ep__success.show { display: flex; }
.ep__success svg { width: 56px; height: 56px; color: var(--red); }
.ep__success strong { font-family: var(--ui); font-weight: 800; font-size: 1.2rem; }
.ep__success p { color: var(--muted); font-size: .96rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .nav__links, .nav__phone { display: none; }
  .nav__toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .nav__right .btn--primary { padding: 13px 18px; }
}
