/* ============================================================
   Northern Motorsport Mobile Mechanics
   Composition: warm earth editorial · diagonal split · expandable index
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg:        #f5efe4;
  --bg-deep:   #ece3d3;
  --ink:       #2b1e14;
  --ink-soft:  #5b4a3b;
  --ink-faint: #8a7767;
  --accent:    #c25a37;
  --accent-dk: #a2452a;
  --secondary: #6a7a4a;
  --line:      rgba(43, 30, 20, 0.16);
  --line-soft: rgba(43, 30, 20, 0.09);
  --paper-on-ink: #f0e7d8;
  --ink-on-ink-soft: rgba(240, 231, 216, 0.72);

  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans:  "DM Sans", "Inter", system-ui, -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 68ch;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(43, 30, 20, 0.06), 0 12px 32px -18px rgba(43, 30, 20, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #1a130d;
    --bg-deep:   #120d09;
    --ink:       #f0e7d8;
    --ink-soft:  #cbbcaa;
    --ink-faint: #9c8b79;
    --accent:    #e07a52;
    --accent-dk: #f0906c;
    --secondary: #9aad72;
    --line:      rgba(240, 231, 216, 0.20);
    --line-soft: rgba(240, 231, 216, 0.10);
    --paper-on-ink: #f0e7d8;
    --ink-on-ink-soft: rgba(240, 231, 216, 0.70);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 36px -20px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  overflow-x: hidden;
  text-wrap: pretty;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-dk); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); font-variation-settings: "opsz" 120; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.75rem, 4.2vw, 2.7rem); font-variation-settings: "opsz" 72; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-variation-settings: "opsz" 24; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { margin: 0; padding: 0; }
address { font-style: normal; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- animated noise field ---------- */
.grain-source { position: absolute; width: 0; height: 0; overflow: hidden; }
.grain {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  filter: url(#grain);
  mix-blend-mode: multiply;
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  .grain { opacity: 0.22; mix-blend-mode: screen; }
}

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 0.9rem;
  max-width: none;
}
.block-head { max-width: 62ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.block-lede { font-size: 1.08rem; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn--accent { background: var(--accent); color: #fff8f2; }
.btn--accent:hover { background: var(--accent-dk); color: #fff8f2; transform: translateY(-1px); }
.btn--ghost { border-color: currentColor; color: var(--paper-on-ink); }
.btn--ghost:hover { background: rgba(240, 231, 216, 0.12); color: var(--paper-on-ink); }
.btn--big { font-size: 1.05rem; padding: 1rem 2rem; min-height: 56px; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.wordmark { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.wordmark-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--ink); color: var(--bg);
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  border-radius: 2px;
  flex: none;
}
.wordmark-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark-text strong { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.wordmark-text em { font-style: normal; font-size: 0.68rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-faint); }

.site-nav { display: flex; gap: 1.4rem; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.6rem 0;
  border-bottom: 1.5px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.head-call {
  display: flex; flex-direction: column; align-items: flex-end;
  text-decoration: none; line-height: 1.2;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  min-height: 44px;
  justify-content: center;
}
.head-call:hover { background: var(--accent); color: #fff8f2; }
.head-call-label { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.head-call-num { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; }

/* ---------- diagonal split hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.hero-plane { position: relative; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.hero-plane--ink {
  background: var(--ink);
  color: var(--paper-on-ink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3.5rem), 0 100%);
  padding-bottom: clamp(5rem, 11vw, 8rem);
}
.hero-plane--paper {
  background: var(--bg);
  clip-path: polygon(0 3.5rem, 100% 0, 100% 100%, 0 100%);
  margin-top: -3.5rem;
  padding-top: clamp(5rem, 10vw, 7rem);
}
.hero-plane-inner { max-width: 46rem; }
.hero-plane--ink .eyebrow { color: var(--secondary); }
.hero-plane--ink h1 { color: var(--paper-on-ink); }
.hero-em { color: var(--accent); font-style: italic; }
.hero-lede { font-size: 1.12rem; color: var(--ink-on-ink-soft); max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.8rem 0 1.2rem; }
.hero-note { font-size: 0.86rem; color: var(--ink-on-ink-soft); margin: 0; max-width: 40ch; }

.hero-figure { margin: 0; max-width: 60rem; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-figure figcaption,
.how-figure figcaption,
.area-figure figcaption,
.about-figure figcaption {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.7rem;
  max-width: 52ch;
  line-height: 1.55;
}

/* ---------- trust strip ---------- */
.strip {
  position: relative; z-index: 1;
  background: var(--bg-deep);
  border-block: 1px solid var(--line-soft);
  padding: clamp(1.6rem, 4vw, 2.4rem) var(--gutter);
}
.strip-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.4rem 2.5rem;
  max-width: 78rem;
  margin: 0 auto;
}
.strip-list li { display: flex; flex-direction: column; gap: 0.15rem; }
.strip-k { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1; }
.strip-v { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- expandable index ---------- */
.index-block {
  position: relative; z-index: 1;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--gutter);
  max-width: 78rem;
  margin: 0 auto;
}
.index { border-top: 1px solid var(--line); }

.entry { border-bottom: 1px solid var(--line); }
.entry > summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.9rem 1.2rem;
  padding: 1.35rem 0.25rem;
  cursor: pointer;
  list-style: none;
  min-height: 56px;
  transition: color 0.18s ease, padding-left 0.22s ease;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { color: var(--accent); padding-left: 0.7rem; }
.entry > summary:focus-visible { outline-offset: -2px; }
.entry-num {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  padding-top: 0.35rem;
}
.entry-title {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.entry-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
  align-self: center;
}
.entry[open] > summary { color: var(--accent); }
.entry[open] > summary .entry-num { color: var(--accent); }

.entry-body {
  padding: 0 0.25rem 2rem;
  max-width: 64ch;
  animation: riseIn 0.45s ease both;
}
.entry-body p { color: var(--ink-soft); }
.entry-list { list-style: none; margin: 1.2rem 0; display: grid; gap: 0.5rem; }
.entry-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.97rem;
  color: var(--ink);
}
.entry-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 0.7rem; height: 1.5px;
  background: var(--accent);
}
.entry-meta {
  font-size: 0.84rem;
  color: var(--ink-faint);
  border-top: 1px dashed var(--line);
  padding-top: 0.9rem;
  margin: 0;
}

/* ---------- how it works ---------- */
.how {
  position: relative; z-index: 1;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--gutter);
  max-width: 78rem;
  margin: 0 auto;
}
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  counter-reset: step;
}
.step { border-top: 2px solid var(--ink); padding-top: 1.2rem; }
.step-num {
  display: block;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.step h3 { margin-bottom: 0.4rem; }
.step p { font-size: 0.97rem; color: var(--ink-soft); margin: 0; }
.how-figure { margin: clamp(2.5rem, 6vw, 4rem) 0 0; }
.how-figure img {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- contact / hours (diagonal split, inverted) ---------- */
.contact {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.contact-plane { padding: clamp(3rem, 8vw, 5.5rem) var(--gutter); }
.contact-plane--paper {
  background: var(--bg-deep);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3rem), 0 100%);
  padding-bottom: clamp(4.5rem, 10vw, 7rem);
}
.contact-plane--ink {
  background: var(--ink);
  color: var(--paper-on-ink);
  clip-path: polygon(0 3rem, 100% 0, 100% 100%, 0 100%);
  margin-top: -3rem;
  padding-top: clamp(4.5rem, 9vw, 6.5rem);
}
.contact-inner { max-width: 46rem; }
.contact-plane--ink h2 { color: var(--paper-on-ink); }
.contact-plane--ink .eyebrow { color: var(--secondary); }
.contact-lede { color: var(--ink-on-ink-soft); }

.hours { width: 100%; border-collapse: collapse; margin: 1.5rem 0 1.2rem; max-width: 34rem; }
.hours th, .hours td { text-align: left; padding: 0.62rem 0; border-bottom: 1px solid var(--line-soft); font-weight: 400; }
.hours th { font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); width: 45%; }
.hours td { font-size: 0.95rem; font-weight: 500; }
.hours-closed th, .hours-closed td { color: var(--ink-faint); }
.hours-closed td { font-weight: 400; }
.contact-note { font-size: 0.86rem; color: var(--ink-faint); max-width: 46ch; }
.contact-plane--ink .contact-note { color: var(--ink-on-ink-soft); }

.phone-big {
  display: inline-flex; flex-direction: column;
  text-decoration: none;
  margin: 0.5rem 0 2rem;
  padding: 1rem 1.4rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.phone-big:hover { background: var(--accent); color: #fff8f2; }
.phone-big-label { font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.phone-big-num { font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 600; line-height: 1.15; }

.address { font-size: 1rem; color: var(--ink-on-ink-soft); margin-bottom: 1.4rem; line-height: 1.6; }
.address-label {
  display: block;
  font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--secondary); margin-bottom: 0.3rem;
}

/* ---------- service area ---------- */
.area {
  position: relative; z-index: 1;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--gutter);
  max-width: 78rem;
  margin: 0 auto;
}
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.area-col h3 {
  font-size: 1.05rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0.9rem;
}
.area-col ul { list-style: none; display: grid; gap: 0.4rem; }
.area-col li { font-size: 0.95rem; color: var(--ink-soft); }
.area-figure { margin: clamp(2.5rem, 6vw, 4rem) 0 0; }
.area-figure img {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- about ---------- */
.about {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
}
.about-plane { padding: clamp(3rem, 8vw, 5.5rem) var(--gutter); }
.about-plane--paper {
  background: var(--bg);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3rem), 0 100%);
  padding-bottom: clamp(4.5rem, 10vw, 7rem);
}
.about-plane--ink {
  background: var(--ink);
  color: var(--paper-on-ink);
  clip-path: polygon(0 3rem, 100% 0, 100% 100%, 0 100%);
  margin-top: -3rem;
  padding-top: clamp(4.5rem, 9vw, 6.5rem);
}
.about-inner { max-width: 46rem; }
.about-inner p { color: var(--ink-soft); }
.about-figure { margin: 0 0 2.5rem; }
.about-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.about-plane--ink .about-figure figcaption { color: var(--ink-on-ink-soft); }
.house-line {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding-left: 1.4rem;
}
.house-line p {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--paper-on-ink);
  margin: 0;
  max-width: 40ch;
}

/* ---------- closing ---------- */
.closing {
  position: relative; z-index: 1;
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
  background: var(--bg-deep);
  border-top: 1px solid var(--line-soft);
}
.closing .eyebrow { text-align: center; }
.closing h2 { max-width: 22ch; margin-inline: auto; }
.closing-lede { max-width: 46ch; margin-inline: auto; color: var(--ink-soft); }
.closing-note { font-size: 0.84rem; color: var(--ink-faint); margin: 1.6rem 0 0; }

/* ---------- footer ---------- */
.site-foot {
  position: relative; z-index: 1;
  background: var(--ink);
  color: var(--paper-on-ink);
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 5.5rem;
}
.foot-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.8rem;
  max-width: 78rem;
  margin: 0 auto 2rem;
}
.foot-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 0.4rem; }
.foot-line { font-size: 0.9rem; color: var(--ink-on-ink-soft); margin: 0 0 0.35rem; }
.foot-line a { color: var(--paper-on-ink); text-decoration-color: var(--accent); }
.foot-line a:hover { color: var(--accent); }

.foot-claim { max-width: 78rem; margin: 0 auto 1.2rem; }
.claim-banner {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--ink-on-ink-soft);
  background: rgba(240, 231, 216, 0.07);
  border: 1px solid rgba(240, 231, 216, 0.16);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.claim-banner:hover { background: rgba(240, 231, 216, 0.14); color: var(--paper-on-ink); }

.attribution {
  max-width: 78rem;
  margin: 0 auto;
  font-size: 0.72rem;
  opacity: 0.55;
  font-family: var(--sans);
}
.attribution a { color: inherit; }

/* ---------- motion: staggered line reveal (CSS scroll-driven) ---------- */
@keyframes riseIn {
  from { opacity: 0; translate: 0 20px; }
  to   { opacity: 1; translate: 0 0; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .block-head,
    .strip-list li,
    .entry,
    .step,
    .area-col,
    .contact-inner > *,
    .about-inner > *,
    .closing > *,
    .hero-figure,
    .how-figure,
    .area-figure,
    .about-figure {
      animation: riseIn linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    .strip-list li:nth-child(2) { animation-range: entry 0% cover 46%; }
    .strip-list li:nth-child(3) { animation-range: entry 0% cover 52%; }
    .strip-list li:nth-child(4) { animation-range: entry 0% cover 58%; }
    .step:nth-child(2) { animation-range: entry 0% cover 46%; }
    .step:nth-child(3) { animation-range: entry 0% cover 52%; }
    .area-col:nth-child(2) { animation-range: entry 0% cover 46%; }
    .area-col:nth-child(3) { animation-range: entry 0% cover 52%; }
    .entry:nth-child(2n) { animation-range: entry 0% cover 44%; }
    .entry:nth-child(3n) { animation-range: entry 0% cover 48%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .grain { opacity: 0.18; }
}

/* ---------- wider screens ---------- */
@media (min-width: 900px) {
  .hero-plane { padding-inline: clamp(3rem, 7vw, 6rem); }
  .hero-plane-inner { max-width: 40rem; }
  .contact-plane, .about-plane { padding-inline: clamp(3rem, 7vw, 6rem); }
  .contact-inner, .about-inner { max-width: 40rem; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .wordmark-text em { display: none; }
  .head-call { padding: 0.4rem 0.65rem; }
  .head-call-num { font-size: 0.92rem; }
  .entry-tag { display: none; }
  .entry > summary { grid-template-columns: auto 1fr; }
  .hero-plane--ink { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), 0 100%); padding-bottom: 4rem; }
  .hero-plane--paper { clip-path: polygon(0 2rem, 100% 0, 100% 100%, 0 100%); margin-top: -2rem; padding-top: 4rem; }
  .contact-plane--paper { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), 0 100%); padding-bottom: 4rem; }
  .contact-plane--ink { clip-path: polygon(0 2rem, 100% 0, 100% 100%, 0 100%); margin-top: -2rem; padding-top: 4rem; }
  .about-plane--paper { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), 0 100%); padding-bottom: 4rem; }
  .about-plane--ink { clip-path: polygon(0 2rem, 100% 0, 100% 100%, 0 100%); margin-top: -2rem; padding-top: 4rem; }
}
