/* ==========================================================================
   Hanover Detailing — styles.css
   Palette: glacial blue on deep near-black. Type: Space Grotesk + Inter.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0B0D10;   /* page background */
  --surface:   #14181E;   /* cards, form, header base */
  --surface-2: #1A2028;   /* input fields, hover states */
  --accent:    #8FC6E4;   /* glacial blue — buttons, eyebrows, slider handle */
  --accent-strong: #AFD9EF;
  --text:      #F2F5F7;   /* primary text */
  --muted:     #9CA6B0;   /* secondary text */
  --gold:      #EFC75E;   /* review stars */
  --line:      rgba(255, 255, 255, 0.08); /* hairline borders */

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body:    "Inter", "Segoe UI", sans-serif;

  --container: 1120px;
  --header-h: 72px;
  --radius: 10px;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

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

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding-block: clamp(2.5rem, 5vw, 3.5rem); }

/* ---------- Shared type ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.section-sub { color: var(--muted); max-width: 46ch; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

/* small dash before eyebrow text, as in the mockup */
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0B0D10;
  padding: 0.85rem 1.6rem;
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(143, 198, 228, 0.55);
}

.btn-primary:active { transform: translateY(0); }

/* ==========================================================================
   1. Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 13, 16, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.5vw, 2rem);
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text); }

.nav-cta { padding: 0.6rem 1.2rem; }

/* Hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 13, 16, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1.25rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }

  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link { padding: 0.9rem 0.25rem; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 1rem; justify-content: center; }
}

/* ==========================================================================
   2. Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: max(88svh, 560px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(11, 13, 16, 0.55) 0%, rgba(11, 13, 16, 0.25) 45%, rgba(11, 13, 16, 0.9) 100%),
    linear-gradient(100deg, rgba(11, 13, 16, 0.72) 0%, rgba(11, 13, 16, 0.25) 60%, rgba(11, 13, 16, 0.1) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: calc(var(--header-h) + 2rem) 4rem;
  max-width: none;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 12ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero-sub {
  margin-top: 1.1rem;
  font-size: clamp(1rem, 2vw, 1.1875rem);
  color: rgba(242, 245, 247, 0.9);
  max-width: 34ch;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.hero-cta { margin-top: 2rem; }

/* Load-in animation (skipped for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .hero-title, .hero-sub, .hero-cta {
    opacity: 0;
    transform: translateY(18px);
    animation: hero-in 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
  }
  .hero-sub { animation-delay: 0.15s; }
  .hero-cta { animation-delay: 0.3s; }

  @keyframes hero-in {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ==========================================================================
   3. Who we are
   ========================================================================== */
.who-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.who-copy { margin-top: 1.4rem; color: var(--muted); max-width: 52ch; }

.who-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.who-photo img { width: 100%; height: auto; }

@media (max-width: 860px) {
  .who-grid { grid-template-columns: 1fr; }
  .who-photo { max-width: 480px; }
}

/* ==========================================================================
   4. Reviews
   ========================================================================== */
.reviews { background: linear-gradient(to bottom, rgba(255,255,255,0.015), transparent); }

.rating-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.rating-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 6vw, 4.25rem);
  line-height: 1;
}

.stars { color: var(--gold); letter-spacing: 0.2em; font-size: 1.25rem; }
.stars-sm { font-size: 0.8rem; letter-spacing: 0.15em; }

.reviews-grid {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.review-card:hover {
  border-color: rgba(143, 198, 228, 0.35);
  transform: translateY(-3px);
}

.review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.review-name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
}

.review-quote { color: var(--muted); font-size: 0.9375rem; }

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

/* ==========================================================================
   5. Before & After sliders
   ========================================================================== */
.results-head { margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.results-head .section-sub { margin-top: 1rem; }

.ba-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 4vw, 3rem);
}

.ba-slider {
  position: relative;
  width: min(100%, var(--max-w, 600px));
  aspect-ratio: var(--ratio);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  --pos: 50%;             /* handle position, updated by JS */
  touch-action: pan-y;    /* keep vertical page scroll on touch */
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The AFTER layer sits on top and is clipped: visible to the RIGHT of
   the handle, so "before" reads on the left as in the mockup. */
.ba-after-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--pos));
}

.ba-label {
  position: absolute;
  top: 0.9rem;
  z-index: 2;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  background: rgba(11, 13, 16, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.ba-label-before { left: 0.9rem; }
.ba-label-after { right: 0.9rem; color: var(--accent); }

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  z-index: 3;
  cursor: ew-resize;
}

/* Widen the handle's touch/click target without changing its look */
.ba-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -16px;
  right: -16px;
}

.ba-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #0B0D10;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease;
}

.ba-slider:hover .ba-grip,
.ba-handle:focus-visible .ba-grip {
  transform: translate(-50%, -50%) scale(1.08);
}

/* Keyboard focus: ring the grip instead of outlining the full-height line */
.ba-handle:focus-visible {
  outline: none;
}

.ba-handle:focus-visible .ba-grip {
  box-shadow: 0 0 0 3px rgba(143, 198, 228, 0.55), 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   6. Gallery carousel
   ========================================================================== */
.gallery { padding-inline: 0; }

.gallery-inner { position: relative; }

.gallery-heading-wrap { margin-bottom: 2rem; }

.gallery-heading { max-width: 12ch; }

.carousel {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: #07090b;
}

.carousel-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: max-content;
  padding-block: 10px;
  will-change: transform;
}

.carousel-item {
  height: clamp(200px, 30vw, 280px);
  width: auto;
  flex: none;
  border-radius: 6px;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
}

.carousel { cursor: grab; }
.carousel.dragging { cursor: grabbing; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.carousel-arrow:hover {
  background: rgba(143, 198, 228, 0.18);
  border-color: rgba(143, 198, 228, 0.5);
}

.carousel-prev { left: clamp(0.75rem, 3vw, 2rem); }
.carousel-next { right: clamp(0.75rem, 3vw, 2rem); }

/* ==========================================================================
   7. Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.contact-phone:hover { color: var(--accent); }

.phone-icon { color: var(--accent); flex: none; }

.contact-address { margin-top: 0.9rem; color: var(--muted); font-size: 0.9375rem; }

.contact-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 40ch;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.form-field { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-input::placeholder { color: rgba(156, 166, 176, 0.55); }

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #1D242D;
}

.form-input.field-error { border-color: #E07A6B; }

.form-textarea { resize: vertical; min-height: 120px; }

.form-submit { width: auto; }
.form-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.form-status {
  margin-top: 1rem;
  font-size: 0.9375rem;
  min-height: 1.4em;
}

.form-status.success { color: #8FDCA8; }
.form-status.error { color: #E07A6B; }

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

/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.footer-copy { margin-top: 0.4rem; font-size: 0.8125rem; }

/* ==========================================================================
   Scroll-reveal animations
   [data-reveal] blocks fade/slide in when they enter the viewport;
   [data-reveal-child] elements stagger inside them. JS adds .in-view.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] [data-reveal-child],
  [data-reveal]:not(:has([data-reveal-child])) {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s cubic-bezier(0.22, 0.8, 0.3, 1),
                transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
  }

  [data-reveal].in-view [data-reveal-child],
  [data-reveal].in-view:not(:has([data-reveal-child])) {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger children */
  [data-reveal].in-view [data-reveal-child]:nth-child(1) { transition-delay: 0s; }
  [data-reveal].in-view [data-reveal-child]:nth-child(2) { transition-delay: 0.09s; }
  [data-reveal].in-view [data-reveal-child]:nth-child(3) { transition-delay: 0.18s; }
  [data-reveal].in-view [data-reveal-child]:nth-child(4) { transition-delay: 0.27s; }
}

/* Reduced motion: everything visible, no transitions or auto-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
