/* ============================================================
   Mazda Screen Repair - Interface System v2 "Graphite"
   Tokens first, components second. One easing curve everywhere.
   Light: Porcelain. Dark: Graphite. Accent: Mazda crimson.
   ============================================================ */

@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-300.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ----------------------------- tokens ----------------------------- */
:root {
  /* color: Porcelain (light) */
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #ececef;
  --ink: #17171b;
  --muted: #5c5c66;
  --line: #e2e2e7;
  --line-strong: #cececi;
  --accent: #9e1f28;
  --accent-deep: #811820;
  --accent-text: #9e1f28;
  --accent-wash: #f7ebec;
  --glass: rgb(255 255 255 / 0.72);
  --glass-line: rgb(255 255 255 / 0.5);
  --shadow-1: 0 1px 2px rgb(23 23 27 / 0.05);
  --shadow-2: 0 1px 2px rgb(23 23 27 / 0.05), 0 12px 32px rgb(23 23 27 / 0.09);
  --shadow-3: 0 2px 4px rgb(23 23 27 / 0.06), 0 24px 64px rgb(23 23 27 / 0.14);

  /* type */
  --font: "Satoshi", -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-display: clamp(2.3rem, 4.4vw, 3.5rem);
  --text-h2: clamp(1.7rem, 3vw, 2.35rem);
  --text-h3: 1.18rem;
  --text-body: 1.0625rem;
  --text-small: 0.9rem;

  /* space (4px base) */
  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* shape */
  --r-card: 18px;
  --r-input: 12px;
  --r-image: 20px;
  --r-pill: 999px;

  /* motion: one curve, three speeds */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
  --med: 340ms;
  --slow: 700ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* color: Graphite (dark) */
    --bg: #0e0e11;
    --surface: #16161b;
    --surface-2: #1d1d24;
    --ink: #f4f4f6;
    --muted: #9c9ca7;
    --line: rgb(255 255 255 / 0.09);
    --line-strong: rgb(255 255 255 / 0.18);
    --accent: #b3252f;
    --accent-deep: #cb3540;
    --accent-text: #e05f68;
    --accent-wash: #2a181b;
    --glass: rgb(22 22 27 / 0.72);
    --glass-line: rgb(255 255 255 / 0.12);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5);
    --shadow-2: 0 1px 2px rgb(0 0 0 / 0.5), 0 16px 40px rgb(0 0 0 / 0.45);
    --shadow-3: 0 2px 4px rgb(0 0 0 / 0.5), 0 28px 72px rgb(0 0 0 / 0.55);
  }
}

/* ----------------------------- base ----------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--text-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 32px); }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ----------------------------- motion primitives ----------------------------- */
@media (prefers-reduced-motion: no-preference) {
  /* page-load choreography: elements tagged data-load rise in sequence */
  [data-load] {
    opacity: 0;
    animation: lx-rise var(--slow) var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
  @keyframes lx-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
  }

  /* scroll reveals */
  .reveal {
    opacity: 0; transform: translateY(18px);
    transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
  }
  .reveal.in { opacity: 1; transform: none; }

  /* image skeleton: shimmer behind, fade in when loaded */
  .frame img { opacity: 0; transition: opacity var(--slow) var(--ease); }
  .frame img.loaded, .no-js .frame img { opacity: 1; }
  .frame::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, var(--surface-2) 40%, var(--line) 50%, var(--surface-2) 60%);
    background-size: 200% 100%;
    animation: lx-shimmer 1.4s linear infinite;
  }
  @keyframes lx-shimmer {
    from { background-position: 120% 0; }
    to   { background-position: -80% 0; }
  }
  /* shimmer stops once the image has arrived */
  .frame:has(img.loaded)::before { animation: none; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame img { opacity: 1; }
}

.frame {
  position: relative; overflow: hidden;
  border-radius: var(--r-image);
  background: var(--surface-2);
  box-shadow: var(--shadow-2);
}
.frame img { position: relative; z-index: 1; width: 100%; height: auto; }

/* ----------------------------- nav ----------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-1);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: var(--s-4);
}
.brand {
  font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--accent-text); }
.nav-links { display: flex; align-items: center; gap: var(--s-5); }
.nav-links a.nav-plain {
  position: relative;
  color: var(--muted); text-decoration: none;
  font-size: 0.96rem; font-weight: 500;
  transition: color var(--fast) var(--ease);
}
.nav-links a.nav-plain::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px;
  height: 1.5px; background: var(--accent-text);
  transition: right var(--med) var(--ease);
}
.nav-links a.nav-plain:hover { color: var(--ink); }
.nav-links a.nav-plain:hover::after { right: 0; }
@media (max-width: 640px) {
  .nav-links a.nav-plain { display: none; }
}

/* ----------------------------- buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0.14), rgb(255 255 255 / 0) 45%), var(--accent);
  color: #fff;
  font-family: var(--font); font-weight: 500; font-size: 1rem;
  text-decoration: none; white-space: nowrap;
  padding: 13px 24px; border-radius: var(--r-pill);
  border: none; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              background-color var(--fast) var(--ease);
}
.btn:hover {
  background-color: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.btn:active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-1); }
.btn.small { padding: 10px 18px; font-size: 0.92rem; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; color: var(--ink);
  font-family: var(--font); font-weight: 500; font-size: 1rem;
  text-decoration: none; white-space: nowrap;
  padding: 13px 24px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); cursor: pointer;
  transition: transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.btn-ghost:hover {
  border-color: var(--muted);
  background: var(--surface);
  transform: translateY(-2px);
}
.btn-ghost:active { transform: translateY(0) scale(0.97); }

/* arrow inside buttons and cards nudges right on hover */
.btn .icon, .btn-ghost .icon { transition: transform var(--fast) var(--ease); }
.btn:hover .icon, .btn-ghost:hover .icon { transform: translateX(3px); }

/* ----------------------------- hero ----------------------------- */
.hero { padding: clamp(48px, 8vh, 88px) 0 var(--s-8); }
.hero-grid {
  display: grid; grid-template-columns: 1.08fr 1fr;
  gap: var(--s-7); align-items: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.06; letter-spacing: -0.025em;
  margin-bottom: var(--s-5);
}
.hero h1 em { font-style: normal; font-weight: 700; color: var(--accent-text); }
.hero .sub {
  font-size: 1.15rem; color: var(--muted);
  max-width: 44ch; margin-bottom: var(--s-6);
}
.hero-ctas { display: flex; gap: var(--s-4); flex-wrap: wrap; align-items: center; }
.hero-price {
  margin-top: var(--s-5); font-size: 0.98rem; color: var(--muted);
  display: flex; align-items: flex-start; gap: 10px;
}
.hero-price .icon { color: var(--accent-text); transform: translateY(4px); }
.hero-price strong { color: var(--ink); font-weight: 700; }
.hero-img { position: relative; }
.hero-img .frame img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center 65%; }
@media (max-width: 860px) {
  .hero { padding-top: var(--s-6); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ----------------------------- sections ----------------------------- */
section { padding: var(--s-9) 0; }
section.tight { padding: var(--s-8) 0; }
.section-head { max-width: 62ch; margin-bottom: var(--s-7); }
.section-head h2, .split h2 {
  font-size: var(--text-h2);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.12;
  margin-bottom: var(--s-3);
  text-wrap: balance;
}
.section-head p { color: var(--muted); font-size: 1.06rem; }

/* ----------------------------- model grid ----------------------------- */
.models { background: var(--surface); border-block: 1px solid var(--line); }
.model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.model-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-5);
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 5px;
  transition: transform var(--med) var(--ease),
              box-shadow var(--med) var(--ease),
              border-color var(--med) var(--ease);
}
.model-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.model-card .m-name { font-weight: 700; font-size: 1.18rem; letter-spacing: -0.01em; }
.model-card .m-years { color: var(--muted); font-size: var(--text-small); }
.model-card .m-price {
  margin-top: auto; padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-weight: 700; font-size: 1.06rem; color: var(--accent-text);
}
.model-card .m-years { margin-bottom: var(--s-3); }
.model-card .m-go {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.88rem; margin-top: 2px;
}
.model-card .m-go .icon { transition: transform var(--fast) var(--ease); }
.model-card:hover .m-go { color: var(--ink); }
.model-card:hover .m-go .icon { transform: translateX(4px); }
@media (max-width: 960px) { .model-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .model-grid { grid-template-columns: 1fr; } }

/* ----------------------------- split ----------------------------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s-7); align-items: center;
}
.split .frame img { aspect-ratio: 3 / 2; object-fit: cover; }
.split p { color: var(--muted); margin-bottom: var(--s-3); }
.split p strong { color: var(--ink); }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: var(--s-6); }
  .split.img-first .frame { order: -1; }
}

.symptoms { list-style: none; margin-top: var(--s-4); display: grid; gap: var(--s-3); }
.symptoms li { display: flex; gap: var(--s-3); align-items: baseline; color: var(--ink); }
.symptoms .icon {
  color: var(--accent-text); transform: translateY(3px);
}

/* ----------------------------- steps ----------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-7); }
.step {
  border-top: 1px solid var(--line);
  padding-top: var(--s-5);
  transition: border-color var(--med) var(--ease);
}
.step:hover { border-top-color: var(--accent); }
.step .n {
  font-size: 2.2rem; font-weight: 300; letter-spacing: -0.03em;
  color: var(--accent-text); line-height: 1; margin-bottom: var(--s-4);
}
.step h3 { font-size: var(--text-h3); font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.step p { color: var(--muted); font-size: 0.99rem; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ----------------------------- price band ----------------------------- */
.price-band { background: var(--surface); border-block: 1px solid var(--line); }
.price-flex {
  display: grid; grid-template-columns: auto 1fr;
  gap: var(--s-8); align-items: center;
}
.price-big {
  font-size: clamp(3.4rem, 8vw, 5.2rem); font-weight: 300;
  letter-spacing: -0.04em; line-height: 1; color: var(--ink);
}
.price-big .from {
  display: block; font-size: 0.98rem; font-weight: 500;
  color: var(--muted); letter-spacing: 0; margin-bottom: var(--s-3);
}
.price-notes { color: var(--muted); max-width: 54ch; }
.price-notes strong { color: var(--ink); }
.price-notes ul { list-style: none; margin-top: var(--s-4); display: grid; gap: var(--s-3); }
.price-notes li { display: flex; gap: var(--s-3); align-items: baseline; }
.price-notes .icon { color: var(--accent-text); transform: translateY(3px); }
@media (max-width: 720px) { .price-flex { grid-template-columns: 1fr; gap: var(--s-5); } }

/* ----------------------------- FAQ ----------------------------- */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 500; font-size: 1.07rem;
  padding: var(--s-5) 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  transition: color var(--fast) var(--ease);
}
.faq summary:hover { color: var(--accent-text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-weight: 300; color: var(--muted);
  font-size: 1.5rem; line-height: 1;
  transition: transform var(--med) var(--ease), color var(--fast) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent-text); }
.faq details p {
  color: var(--muted); padding-bottom: var(--s-5); max-width: 65ch;
}
@media (prefers-reduced-motion: no-preference) {
  .faq details[open] p { animation: lx-rise var(--med) var(--ease) both; }
}

/* ----------------------------- CTA band ----------------------------- */
.cta-band { background: var(--accent); padding: 0; }
.cta-band .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5); flex-wrap: wrap;
  padding-top: var(--s-8); padding-bottom: var(--s-8);
}
.cta-band h2 {
  color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.15;
}
.cta-band p { color: rgb(255 255 255 / 0.85); margin-top: 6px; }
.cta-band .btn { background: #fff; color: var(--accent); }
.cta-band .btn:hover { background: #f2f2f3; }

/* ----------------------------- footer ----------------------------- */
footer { padding: var(--s-8) 0 var(--s-7); border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-7); }
.foot-grid h4 { font-size: 0.96rem; font-weight: 700; margin-bottom: var(--s-3); }
.foot-grid ul { list-style: none; display: grid; gap: 9px; }
.foot-grid a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
  transition: color var(--fast) var(--ease);
}
.foot-grid a:hover { color: var(--ink); }
.foot-blurb { color: var(--muted); font-size: 0.95rem; max-width: 38ch; margin-top: var(--s-3); }
.foot-bottom {
  margin-top: var(--s-7); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.85rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2);
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ----------------------------- model page extras ----------------------------- */
.year-line { color: var(--muted); font-size: 1.05rem; margin-bottom: var(--s-5); max-width: 46ch; }
.year-line strong { color: var(--ink); }
.crosslinks { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.crosslinks a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.93rem;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 9px 18px; background: var(--surface);
  transition: border-color var(--fast) var(--ease),
              transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.crosslinks a:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}

/* ----------------------------- contact ----------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.contact-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-6);
  transition: transform var(--med) var(--ease),
              box-shadow var(--med) var(--ease),
              border-color var(--med) var(--ease);
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.contact-card .icon { width: 26px; height: 26px; color: var(--accent-text); margin-bottom: var(--s-3); }
.contact-card h3 { font-weight: 700; font-size: var(--text-h3); margin-bottom: 6px; letter-spacing: -0.01em; }
.contact-card p { color: var(--muted); margin-bottom: var(--s-4); }
.contact-card .big-link {
  font-size: 1.35rem; font-weight: 700; color: var(--accent-text);
  text-decoration: none; letter-spacing: -0.01em; word-break: break-word;
  transition: color var(--fast) var(--ease);
}
.contact-card .big-link:hover { color: var(--accent-deep); }
@media (prefers-color-scheme: dark) {
  .contact-card .big-link:hover { color: #ec7a82; }
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; gap: var(--s-4); } }

/* ----------------------------- forms (system-ready) -----------------------------
   Not rendered anywhere yet; tokens for when a booking form ships. */
.field { display: grid; gap: 8px; margin-bottom: var(--s-4); }
.field label { font-weight: 500; font-size: 0.95rem; }
.field input, .field textarea, .field select {
  font-family: var(--font); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-input); padding: 12px 14px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field .help { color: var(--muted); font-size: 0.88rem; }
.field .error { color: var(--accent-text); font-size: 0.88rem; }

/* ----------------------------- mobile call bar (glass) ----------------------------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: none;
  padding: 10px clamp(16px, 4vw, 24px) calc(10px + env(safe-area-inset-bottom));
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid var(--glass-line);
  box-shadow: 0 -8px 32px rgb(0 0 0 / 0.12);
  transform: translateY(110%);
  transition: transform var(--med) var(--ease);
}
.callbar.show { transform: none; }
.callbar-inner { display: flex; gap: var(--s-3); max-width: 480px; margin: 0 auto; }
.callbar .btn, .callbar .btn-ghost { flex: 1; justify-content: center; }
.callbar .btn-ghost { background: var(--surface); }
@media (max-width: 860px) { .callbar { display: block; } }
@media (prefers-reduced-transparency: reduce) {
  .callbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .callbar { transition: none; }
}
