/* Mountain View Auto Ltd. — design tokens & global styles */
:root {
  /* Brand */
  --charcoal: #1A1A1A;
  --charcoal-2: #242424;
  --charcoal-3: #2E2E2E;
  --charcoal-line: #3A3A3A;
  --steel: #4A5568;
  --copper: #B87333;
  --copper-2: #C9924A;
  --copper-soft: rgba(184, 115, 51, 0.12);
  --forest: #2D6A4F;
  --forest-soft: rgba(45, 106, 79, 0.15);
  --slate: #3D5A80;
  --slate-soft: rgba(61, 90, 128, 0.15);
  --ice: #C9D6E8;
  --fog: #8AA0BF;
  --bone: #F1F3F7;
  --white: #FFFFFF;

  /* backward-compatible aliases */
  --navy: var(--charcoal);
  --navy-2: var(--charcoal-2);
  --navy-3: var(--charcoal-3);
  --navy-line: var(--charcoal-line);
  --orange: var(--copper);
  --orange-2: var(--copper-2);
  --orange-soft: var(--copper-soft);

  /* semantic */
  --bg: var(--charcoal);
  --bg-elev: var(--charcoal-2);
  --bg-card: var(--charcoal-3);
  --line: var(--charcoal-line);
  --text: #F5F8FC;
  --text-dim: #A7B6CC;
  --text-mute: #6E7E96;
  --accent: var(--copper);

  /* Type */
  --f-display: "Montserrat", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --maxw: 1320px;
  --nav-h: 76px;
  --radius: 4px;
  --radius-lg: 8px;
}

[data-theme="light"] {
  --bg: #F5F1EA;
  --bg-elev: #EDE7DD;
  --bg-card: #FFFFFF;
  --line: #DDD4C4;
  --text: #1A1A1A;
  --text-dim: #3D4A60;
  --text-mute: #6E7E96;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  overflow-x: clip;
  scroll-behavior: smooth;
}
main {
  max-width: 100%;
  overflow-x: clip;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
html.page-ready main {
  opacity: 1;
  transform: none;
}
main.page-exit {
  opacity: 0 !important;
  transform: translateY(-6px) !important;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

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

/* Typography utilities */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--orange);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 26px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--copper);
  color: #FFFFFF;
}
.btn--primary:hover { background: var(--copper-2); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.25);
}
[data-theme="light"] .btn--ghost { border-color: rgba(10,20,40,0.25); }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn--block { width: 100%; }

/* Sticky Navbar */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(26, 26, 26, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .25s ease, border-color .25s ease;
}
[data-theme="light"] .nav {
  background: rgba(245, 241, 234, 0.85);
  border-bottom: 1px solid rgba(10,20,40,0.08);
}
.nav.is-scrolled {
  background: rgba(26, 26, 26, 0.94);
}
[data-theme="light"] .nav.is-scrolled { background: rgba(245, 241, 234, 0.95); }
.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 36px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}
@media (max-width: 480px) {
  .brand-logo {
    width: 52px;
    height: 52px;
  }
}
.brand-name {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-name b {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-name small {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.nav__menu {
  display: flex; gap: 32px;
  margin-left: 12px;
}
.nav__menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  position: relative;
  padding: 6px 0;
  transition: color .15s ease;
}
.nav__menu a:hover { color: var(--text); }
.nav__menu a.is-active { color: var(--text); }
.nav__menu a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--orange);
}
.nav__right {
  margin-left: auto;
  display: flex; align-items: center; gap: 18px;
}
.nav__phone {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.nav__phone svg { width: 16px; height: 16px; color: var(--orange); }
.nav__phone .num { letter-spacing: 0.02em; }
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  background: transparent;
  color: var(--text);
  transition: border-color .15s, color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--orange); color: var(--orange); }
.nav__cta {
  padding: 12px 18px;
  font-size: 12px;
}
.nav__burger {
  display: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  align-items: center; justify-content: center;
}
.nav__burger span {
  width: 16px; height: 1.5px;
  background: var(--text);
  position: relative;
}
.nav__burger span::before, .nav__burger span::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 1.5px;
  background: var(--text);
}
.nav__burger span::before { top: -5px; }
.nav__burger span::after  { top: 5px; }

@media (max-width: 980px) {
  .nav__menu, .nav__phone { display: none; }
  .nav__burger { display: flex; }
  .nav__cta { display: none; }
}

@media (max-width: 480px) {
  .nav__inner { padding: 0 16px; gap: 12px; }
}

/* Section header common */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 56px;
}
.sec-head__left { max-width: 760px; }
.sec-head h2 {
  font-family: var(--f-display);
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 14px 0 0;
}
.sec-head h2 em {
  font-style: normal;
  color: var(--orange);
}
.sec-head__right {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 360px;
  line-height: 1.7;
}
@media (max-width: 820px) {
  .sec-head { flex-direction: column; align-items: stretch; }
  .sec-head__right { max-width: 100%; }
}

section { position: relative; }
.section { padding: 120px 0; }
@media (max-width: 720px) { .section { padding: 80px 0; } }

/* Footer */
.footer {
  background: #111111;
  color: var(--text-dim);
  padding: 80px 0 32px;
  border-top: 1px solid var(--line);
}
[data-theme="light"] .footer {
  background: #E8E1D2;
  color: #3D4A60;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 820px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 540px) {
  .footer__grid { grid-template-columns: 1fr; }
}
.footer__col h5 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 20px;
}
.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__col a:hover { color: var(--orange); }
.footer__brand p {
  margin: 18px 0 24px;
  font-size: 14px;
  line-height: 1.7;
  max-width: 340px;
}
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.location-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-soft);
}
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-mute);
}
@media (max-width: 720px) {
  .footer__bottom { flex-direction: column; gap: 12px; }
}

/* Floating Chat */
.fab-chat {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--orange);
  color: #0A1428;
  padding: 14px 18px 14px 14px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 13px;
  box-shadow: 0 14px 40px rgba(184, 115, 51, 0.32), 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.fab-chat:hover { transform: translateY(-2px); }
.fab-chat__dot {
  width: 36px; height: 36px;
  background: #0A1428;
  color: var(--orange);
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.fab-chat__dot::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #22C55E;
  border: 2px solid var(--orange);
  border-radius: 50%;
}
@media (max-width: 540px) {
  .fab-chat span.lbl { display: none; }
  .fab-chat { padding: 10px; }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .8s cubic-bezier(.2,.6,.2,1),
    transform .8s cubic-bezier(.2,.6,.2,1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Page hero entrance (inner pages) */
.page-hero .hero-eyebrow {
  opacity: 0;
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.page-hero .hero-title {
  opacity: 0;
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.page-hero .hero-lead {
  opacity: 0;
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}
.page-hero .hero-extra {
  opacity: 0;
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.34s forwards;
}

/* Home hero word stagger */
@keyframes heroWordIn {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-word {
  display: inline-block;
  opacity: 0;
  animation: heroWordIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* View Transitions API (manual via navigateTo) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-old(root) {
  animation-name: pageVtOut;
}
::view-transition-new(root) {
  animation-name: pageVtIn;
}
@keyframes pageVtOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes pageVtIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main,
  .reveal,
  .hero-word,
  .page-hero .hero-eyebrow,
  .page-hero .hero-title,
  .page-hero .hero-lead,
  .page-hero .hero-extra {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

#book {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.booking-form {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg-card);
  max-height: min(72vh, calc(100vh - var(--nav-h) - 48px));
  overflow: hidden;
}

.booking-form--done {
  max-height: none;
  opacity: 1;
  transform: none;
}

.booking-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.booking-actions {
  flex-shrink: 0;
  padding: 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

@media (max-width: 720px) {
  .booking-form {
    max-height: min(78vh, calc(100vh - var(--nav-h) - 32px));
  }
  .booking-body {
    padding: 24px 20px;
  }
}

/* Tabular numerals where useful */
.num-tab { font-variant-numeric: tabular-nums; }

/* About — team grid (5 members: 3 + 2 centered) */
.team-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px;
}
.team-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.team-card:nth-child(4) { grid-column: 2 / span 2; }
.team-card:nth-child(5) { grid-column: 4 / span 2; }
.team-card__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #111;
  border: 1px solid var(--line);
  overflow: hidden;
}
.team-card__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(26, 26, 26, 0.55) 100%);
  pointer-events: none;
}
.team-card__badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  background: var(--copper);
  color: #fff;
  padding: 7px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.team-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 22px 0 0;
}
.team-card__role {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  line-height: 1.45;
}
.team-card__name {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.05;
}
.team-card__bio {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  flex: 1;
}
@media (max-width: 980px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .team-card,
  .team-card:nth-child(4),
  .team-card:nth-child(5) {
    grid-column: auto;
  }
}
@media (max-width: 540px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Services page */
.service-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.service-filter-btn {
  padding: 10px 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  transition: all .2s ease;
}
.service-cat-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.service-cat-num {
  font-size: clamp(36px, 10vw, 56px);
  color: var(--copper-soft);
  line-height: 0.8;
  flex-shrink: 0;
}
.service-cat-icon {
  color: var(--forest);
  flex-shrink: 0;
}
.service-cat-text {
  min-width: 0;
  flex: 1 1 160px;
}
.service-cat-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 6px;
}
.service-cat-title {
  font-size: clamp(22px, 5vw, 40px);
  margin: 0;
  overflow-wrap: break-word;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  container-type: inline-size;
}
.service-card {
  background: var(--bg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  min-height: 200px;
}
.service-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.service-card-name {
  font-family: var(--f-display);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: break-word;
}
.service-card-price {
  font-family: var(--f-mono);
  font-size: clamp(9px, 2.5vw, 10px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  text-align: right;
  flex: 0 1 160px;
  padding-top: 4px;
  line-height: 1.4;
  overflow-wrap: break-word;
}
@container (max-width: 420px) {
  .service-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .service-card-price {
    flex-basis: auto;
    max-width: 100%;
    text-align: left;
  }
}
@media (max-width: 820px) {
  .cat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .service-filter-btn {
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 8px 12px;
  }
  .service-card { padding: 20px; }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
