/* ============================================================
   Mobile Mechanic Best in Houston
   Palette: cafe warmth — latte base, coffee ink, burgundy, olive
   ============================================================ */

:root {
  --bg: #f4ead8;
  --bg-alt: #efe2c9;
  --bg-deep: #e7d8ba;
  --ink: #3a2415;
  --ink-soft: #6b5540;
  --accent: #6b1f1a;
  --secondary: #5a5e3a;
  --rule: rgba(58, 36, 21, 0.18);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1240px;
}

/* Dark mode — same warmth, turned down for evening reading */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1410;
    --bg-alt: #241a14;
    --bg-deep: #2b1f17;
    --ink: #f0e3cf;
    --ink-soft: #bda98e;
    --accent: #e0836f;
    --secondary: #a8ad7c;
    --rule: rgba(240, 227, 207, 0.18);
  }
}

html[data-theme="light"] {
  --bg: #f4ead8;
  --bg-alt: #efe2c9;
  --bg-deep: #e7d8ba;
  --ink: #3a2415;
  --ink-soft: #6b5540;
  --accent: #6b1f1a;
  --secondary: #5a5e3a;
  --rule: rgba(58, 36, 21, 0.18);
}

html[data-theme="dark"] {
  --bg: #1c1410;
  --bg-alt: #241a14;
  --bg-deep: #2b1f17;
  --ink: #f0e3cf;
  --ink-soft: #bda98e;
  --accent: #e0836f;
  --secondary: #a8ad7c;
  --rule: rgba(240, 227, 207, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 420ms ease;
}

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

a { color: var(--accent); }

:focus-visible {
  outline: 3px 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;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- shared type ---------- */

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 1rem;
  font-weight: 600;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.lede {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad-x);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  animation: slide-down 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
}
.wordmark span {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  font-size: 0.85rem;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.6rem 0.15rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--accent); }

.nav-call {
  font-weight: 600;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.5rem 1rem !important;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-call:hover { background: var(--accent); color: var(--bg) !important; }

@media (max-width: 760px) {
  .nav a:not(.nav-call) { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 7rem) var(--pad-x) clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

/* signature: diagonal split, two panels that drift opposite ways */
.hero-split {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.panel {
  position: absolute;
  inset: -10% -5%;
  will-change: transform;
}
.panel-a {
  background: linear-gradient(160deg, color-mix(in srgb, var(--bg-alt) 92%, transparent), transparent 70%);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 88%);
  transform: translate3d(0, calc(var(--scroll, 0) * -1px), 0);
}
.panel-b {
  background: linear-gradient(20deg, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 65%);
  clip-path: polygon(0 88%, 100% 62%, 100% 100%, 0 100%);
  transform: translate3d(0, calc(var(--scroll, 0) * 1px), 0);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 18vw, 22rem);
  line-height: 0.85;
  letter-spacing: -0.045em;
  margin: 0 0 -0.4em;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  color: var(--ink);
  text-wrap: nowrap;
}

.hero-sub {
  position: relative;
  z-index: 3;
  max-width: 46ch;
  margin: 0 0 2rem;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  padding-top: 0.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hero-note {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0;
}

.hero-figure {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1.25rem;
}
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--rule);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 84%, black); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn-wide { width: 100%; margin-top: 1.5rem; }

/* ---------- gallery-wall labels ---------- */

.label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
}
.label-k {
  color: var(--accent);
  font-weight: 600;
}
.label-v { color: var(--ink-soft); }

/* ---------- sections ---------- */

section {
  padding: clamp(3.5rem, 8vw, 7rem) var(--pad-x);
}

.section-head {
  max-width: var(--maxw);
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
}

/* ---------- services wall ---------- */

.wall {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.work {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
}
.work:last-child { border-bottom: 0; padding-bottom: 0; }

.work:nth-child(even) .work-img { order: 2; }

.work-img { margin: 0; }
.work-img img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.work .label { margin-bottom: 0.9rem; }

.work-copy {
  grid-column: 2;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 46ch;
}
.work:nth-child(even) .work-copy { grid-column: 1; grid-row: 2; }
.work:nth-child(even) .label { grid-column: 1; grid-row: 1; }

@media (max-width: 820px) {
  .work,
  .work:nth-child(even) { grid-template-columns: 1fr; }
  .work:nth-child(even) .work-img { order: 0; }
  .work-copy,
  .work:nth-child(even) .work-copy { grid-column: 1; grid-row: auto; }
  .work:nth-child(even) .label { grid-column: 1; grid-row: auto; }
}

/* ---------- how it works ---------- */

.how { color: #f0e3cf; }
.how h2, .how h3 { color: #f4ead8; }
.how .eyebrow { color: #a8ad7c; }

.steps {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}

.step {
  border-top: 1px solid rgba(240, 227, 207, 0.28);
  padding-top: 1.25rem;
}
.step-n {
  display: block;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: #e0836f;
  margin-bottom: 0.5rem;
}
.step p {
  color: rgba(240, 227, 207, 0.78);
  font-size: 0.92rem;
  margin: 0;
}

.house-line {
  max-width: 46ch;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding: 0;
  border: 0;
}
.house-line p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  line-height: 1.35;
  color: #f4ead8;
  margin: 0;
}

/* ---------- service area ---------- */

.area-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.area-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 0.92rem;
}
.area-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
  color: var(--ink-soft);
}

.area-figure { margin: 0; }
.area-figure img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.area-figure .label { margin-top: 0.75rem; }

@media (max-width: 820px) {
  .area-grid { grid-template-columns: 1fr; }
  .area-list { columns: 1; }
}

/* ---------- hours ---------- */

.hours-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}
.hours-table th {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}
.hours-table td {
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.contact-card {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.contact-k {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.contact-phone {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.contact-phone:hover { text-decoration: underline; }

.contact-addr {
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.contact-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
}

@media (max-width: 820px) {
  .hours-grid { grid-template-columns: 1fr; }
}

/* ---------- about ---------- */

.about-cols {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.about-cols p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.footer {
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad-x) 2rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-deep);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.footer-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.footer-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}
.footer-meta a { color: var(--accent); }

.claim-banner {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--secondary) 14%, transparent);
  border: 1px solid var(--rule);
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  margin-bottom: 1.25rem;
}
.claim-banner:hover { color: var(--accent); border-color: var(--accent); }

.muted {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0;
}
.muted a { color: var(--ink-soft); }

/* ---------- motion: one-shot page-load orchestration ---------- */

@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes rise-in {
  from { transform: translateY(1.5rem); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}

@keyframes type-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.reveal {
  animation: rise-in 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.r1 { animation-delay: 120ms; }
.r2 { animation-delay: 240ms; animation-name: type-in; animation-duration: 900ms; }
.r3 { animation-delay: 360ms; }
.r4 { animation-delay: 480ms; }
.r5 { animation-delay: 600ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .panel { transform: none !important; }
  .reveal { clip-path: none; opacity: 1; transform: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .hero-figure { grid-template-columns: 1fr; }
  .display { font-size: clamp(3.5rem, 22vw, 8rem); }
  .hero-sub { background: none; }
}
