/* ============================================================
   Houston Mobile Mechanic & Diesel Repair LLC
   Composition: bleached cream + oxblood + navy
   Typography: deliberately wrong weight (thin H1 / bold body)
   Layout: full-bleed image gallery
   Motion: anchor-positioned scroll-linked labels (no JS)
   Signature: restraint
   Background: layered radial + linear gradient depth
   ============================================================ */

:root {
  --bg: #f4ecdc;
  --bg-deep: #ece0c9;
  --ink: #1a1b2e;
  --ink-soft: #4a4a5e;
  --accent: #6b1f1a;
  --accent-bright: #8d2a22;
  --secondary: #1e2a4a;
  --rule: rgba(26, 27, 46, 0.16);
  --wash-a: rgba(107, 31, 26, 0.10);
  --wash-b: rgba(30, 42, 74, 0.10);
  --card: rgba(255, 252, 245, 0.62);
  --shadow: 0 1px 0 rgba(26, 27, 46, 0.06);

  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-body: "Bricolage Grotesque", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 62ch;
}

/* ---------- dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14151f;
    --bg-deep: #0e0f16;
    --ink: #f0e8d8;
    --ink-soft: #b3ac9e;
    --accent: #d98a7c;
    --accent-bright: #e8a294;
    --secondary: #9fb0d8;
    --rule: rgba(240, 232, 216, 0.18);
    --wash-a: rgba(217, 138, 124, 0.12);
    --wash-b: rgba(159, 176, 216, 0.12);
    --card: rgba(255, 255, 255, 0.05);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #14151f;
  --bg-deep: #0e0f16;
  --ink: #f0e8d8;
  --ink-soft: #b3ac9e;
  --accent: #d98a7c;
  --accent-bright: #e8a294;
  --secondary: #9fb0d8;
  --rule: rgba(240, 232, 216, 0.18);
  --wash-a: rgba(217, 138, 124, 0.12);
  --wash-b: rgba(159, 176, 216, 0.12);
  --card: rgba(255, 255, 255, 0.05);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  /* deliberately wrong weight: body is heavy, headings are thin */
  font-weight: 700;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.62;
  letter-spacing: -0.008em;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 8% -5%, var(--wash-a) 0%, transparent 62%),
    radial-gradient(ellipse 80% 55% at 100% 100%, var(--wash-b) 0%, transparent 58%),
    linear-gradient(178deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  text-wrap: pretty;
}

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
  font-variation-settings: "SOFT" 0, "WONK" 1;
}

h1 { font-size: clamp(2.6rem, 9vw, 6.6rem); }
h2 { font-size: clamp(1.85rem, 4.6vw, 3.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 300; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-bright); }

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

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

/* ---------- shared bits ---------- */
.wrap {
  padding-inline: var(--gutter);
  max-width: 1180px;
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 54ch;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px) saturate(1.3);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--rule);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
}
.brand:hover { color: var(--ink); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  letter-spacing: -0.02em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.head-actions { display: flex; align-items: center; gap: 0.6rem; }

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  background: var(--accent);
  color: #fdf7ec;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.call-btn:hover { background: var(--secondary); border-color: var(--secondary); color: #fdf7ec; }
.call-btn:active { transform: translateY(1px); }

.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 180ms ease, background 180ms ease;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--wash-a); }

/* ---------- hero (full bleed) ---------- */
.hero { position: relative; isolation: isolate; }

.hero__media { position: relative; }
.hero__media img {
  width: 100%;
  height: clamp(340px, 62vh, 640px);
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--bg) 96%, transparent) 0%,
    color-mix(in srgb, var(--bg) 55%, transparent) 32%,
    transparent 72%
  );
  pointer-events: none;
}

.hero__body {
  margin-top: -3.5rem;
  position: relative;
  z-index: 2;
  padding-bottom: 1rem;
}

.hero h1 { max-width: 16ch; }
.hero h1 em {
  font-style: italic;
  font-weight: 200;
  color: var(--accent);
  font-variation-settings: "WONK" 1;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- anchor-positioned scroll labels ---------- */
.label {
  display: none;
}

@supports (anchor-name: --x) {
  @media (min-width: 1100px) {
    .label {
      display: block;
      position: absolute;
      position-anchor: --section-head;
      position-area: right span-block;
      margin-left: 1.5rem;
      font-family: var(--font-mono);
      font-size: 0.66rem;
      font-weight: 500;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--ink-soft);
      white-space: nowrap;
      writing-mode: vertical-rl;
      opacity: 0;
      animation: label-in linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 45%;
    }
    .section-head { anchor-name: --section-head; }
  }
}

@keyframes label-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- section scaffolding ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.section-head {
  position: relative;
  display: grid;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

/* ---------- full-bleed gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
}
.gallery > * { grid-column: 1 / -1; }
.gallery > .half { grid-column: span 12; }

@media (min-width: 760px) {
  .gallery > .half { grid-column: span 6; }
}

.gallery figure { margin: 0; position: relative; overflow: hidden; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gallery figure:hover img { transform: scale(1.025); }

.gallery .tall img { aspect-ratio: 4 / 5; }
.gallery .wide img { aspect-ratio: 16 / 9; }
.gallery .band img { aspect-ratio: 21 / 9; }

.gallery figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  padding: clamp(1rem, 3vw, 2rem);
  background: linear-gradient(to top, rgba(12, 12, 20, 0.78), transparent);
  color: #f6efe2;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- services ---------- */
.services {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.service {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2rem;
  padding-block: clamp(1.4rem, 3vw, 2.1rem);
  border-bottom: 1px solid var(--rule);
  transition: background 220ms ease;
}
.service:hover { background: var(--wash-a); }

@media (min-width: 820px) {
  .service { grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.35fr); align-items: baseline; }
}

.service__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.service h3 { font-weight: 300; }
.service p { margin: 0; color: var(--ink-soft); font-weight: 500; font-size: 0.97rem; }

/* ---------- split block ---------- */
.split {
  display: grid;
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--flip > :first-child { order: 2; }
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

/* ---------- hours ---------- */
.hours { list-style: none; margin: 0; padding: 0; }
.hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.62rem;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.95rem;
}
.hours li:last-child { border-bottom: 0; }
.hours .day { font-weight: 500; color: var(--ink-soft); }
.hours .time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}
@media (min-width: 820px) {
  .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.contact-block h3 { margin-bottom: 0.6rem; }
.contact-block p { font-size: 0.97rem; color: var(--ink-soft); font-weight: 500; }

.phone-big {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1em;
  transition: color 180ms ease;
}
.phone-big:hover { color: var(--secondary); }

.note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1.4rem;
}

/* ---------- reviews ---------- */
.reviews {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}
@media (min-width: 820px) {
  .reviews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.review {
  border-top: 2px solid var(--accent);
  padding-top: 1.1rem;
}
.review blockquote {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.review cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rating-line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rating-line strong {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}

/* ---------- service area ---------- */
.areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}
.areas li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--card);
}

/* ---------- closing band ---------- */
.closing {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(120deg, var(--wash-a), transparent 55%, var(--wash-b));
}
.closing h2 { max-width: 22ch; }
.closing p { margin-top: 1.2rem; }

/* ---------- footer ---------- */
.site-foot {
  padding-block: clamp(2.5rem, 6vw, 4rem) 5rem;
  font-size: 0.9rem;
}
.foot-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 820px) {
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.foot-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.8rem;
}
.foot-grid p, .foot-grid a { font-size: 0.92rem; font-weight: 500; }
.foot-grid a { color: var(--ink); text-decoration-color: var(--rule); }
.foot-grid a:hover { color: var(--accent); }

.claim-banner {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.9rem;
  background: var(--wash-b);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: border-color 180ms ease, color 180ms ease;
}
.claim-banner:hover { border-color: var(--secondary); color: var(--secondary); }

.attribution {
  position: static;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.55;
  letter-spacing: 0.06em;
}
.attribution a { color: inherit; }

/* ---------- motion safety ---------- */
@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;
  }
  .label { opacity: 1 !important; transform: none !important; }
  .gallery figure:hover img { transform: none; }
}
