/* ==========================================================================
   Driven to Detail — styles.css
   Structure:
     1. Design tokens — light theme, dark theme, and "chrome" (always-dark)
     2. Reset & base
     3. Layout helpers & buttons
     4. Header / nav / theme toggle
     5. Hero
     6. Sections & cards (services, testimonials)
     7. Gallery
     8. Contact form
     9. Footer
    10. Motion (load animation)
    11. Desktop media queries (mobile-first: these ADD desktop layout)

   THEMING: every color below is a variable. <html data-theme="light|dark">
   (set by the inline script in index.html, toggled in js/main.js) decides
   which set applies. The header, hero, and footer use the --chrome-* tokens,
   which stay dark in BOTH themes — that dark "stage" is the brand anchor;
   the content sections in between are what flip.
   ========================================================================== */

/* 1. DESIGN TOKENS -------------------------------------------------------- */
:root {
  /* Chrome: identical in both themes (header / hero / footer).
     Pure black on purpose — matches the baked-in background of
     images/Brandlogo.png so the logo blends seamlessly. */
  --chrome-bg:      #000000;
  --chrome-bg-soft: #101010;
  --chrome-text:    #e8edf2;
  --chrome-muted:   #94a3b2;

  /* Brand gold. Two roles, because gold is a LIGHT color:
     --color-brand    = the true brand hex; used as fills and on dark
                        backgrounds, always with dark text on top
     --color-accent   = theme-aware "gold ink" for text/links/outlines,
                        defined per theme below (true gold fails contrast
                        on light backgrounds, so light mode darkens it) */
  --color-brand:    #e8ba54;
  --color-brand-dk: #d3a238;  /* hover state for gold fills */
  --color-on-brand: #14181c;  /* text color on gold fills */

  --font-head: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Segoe UI", sans-serif;

  --radius: 10px;
  --container-max: 1100px;
  --section-pad: 4.5rem;
}

/* Light theme (default) */
[data-theme="light"] {
  --color-bg:      #f7f5f1;   /* warm paper, not sterile white */
  --color-bg-alt:  #edeae3;
  --color-surface: #ffffff;   /* cards, form inputs */
  --color-text:    #262a2e;
  --color-heading: #14181c;
  --color-muted:   #6b7480;
  --color-border:  #ddd8cf;
  --color-accent:  #8a681b;   /* darkened gold — readable on light bg */
  --color-success: #1a7f37;
  --shadow: 0 4px 18px rgba(20, 24, 28, 0.09);
}

/* Dark theme */
[data-theme="dark"] {
  --color-bg:      #10161d;
  --color-bg-alt:  #151d26;
  --color-surface: #1b2530;
  --color-text:    #d5dde4;
  --color-heading: #f2f6f9;
  --color-muted:   #8b99a7;
  --color-border:  #2a3745;
  --color-accent:  #e8ba54;   /* true brand gold reads fine on dark */
  --color-success: #4ec97a;  /* brighter green so it reads on dark */
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* 2. RESET & BASE --------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;   /* width includes padding/border — sane sizing */
  margin: 0;
}

html {
  scroll-behavior: smooth;              /* nav links glide, not jump */
  scroll-padding-top: 4.5rem;           /* stop sections hiding under the sticky header */
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease; /* soft theme switch */
}

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

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

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--color-heading);
  letter-spacing: 0.015em;   /* condensed fonts breathe better with a hair of tracking */
  text-transform: uppercase; /* leans into the automotive signage look */
}

/* 3. LAYOUT HELPERS & BUTTONS --------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: var(--section-pad); }
.section-alt { background: var(--color-bg-alt); }

.section-title {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
  text-align: center;
}
/* Short accent rule under every section title — small, repeated details
   like this are what make a design feel intentional. */
.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  background: var(--color-brand);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

.section-sub {
  text-align: center;
  color: var(--color-muted);
  max-width: 42rem;
  margin: 0.75rem auto 2.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: background-color 0.15s ease, color 0.15s ease,
              transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);  /* dark text — white fails contrast on gold */
  box-shadow: 0 4px 14px rgba(232, 186, 84, 0.35);
}
.btn-primary:hover { background: var(--color-brand-dk); }
.btn-outline { border-color: currentColor; color: inherit; }
.btn-outline:hover { background: rgba(128, 128, 128, 0.12); }
.btn-small { padding: 0.55rem 1.2rem; font-size: 0.95rem; }

/* 4. HEADER / NAV / THEME TOGGLE ------------------------------------------ */
.site-header {
  position: sticky;   /* stays visible while scrolling — keeps CTA reachable */
  top: 0;
  z-index: 100;
  background: var(--chrome-bg);
  color: var(--chrome-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: 0.5rem;
}

.logo {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: inherit;
  text-decoration: none;
}
.logo-accent { color: var(--color-brand); }

.header-controls { display: flex; align-items: center; gap: 0.25rem; }

.theme-toggle {
  background: none;
  border: 0;
  padding: 0.6rem;
  cursor: pointer;
  color: var(--chrome-text);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background-color 0.15s ease, transform 0.3s ease;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(20deg);
}
/* Show the icon of the theme you'd switch TO */
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: none; }

/* Hamburger button (mobile only — hidden on desktop in section 11) */
.nav-toggle { background: none; border: 0; padding: 0.75rem; cursor: pointer; }
.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--chrome-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger { position: relative; }
.hamburger::before { position: absolute; top: -7px; }
.hamburger::after  { position: absolute; top:  7px; }

/* Open state: bars form an X (class toggled by js/main.js) */
.nav-open .hamburger { transform: rotate(45deg); }
.nav-open .hamburger::before { opacity: 0; }
.nav-open .hamburger::after { transform: rotate(-90deg); top: 0; }

/* Mobile nav: hidden by default, dropped down when .nav-open is set on body */
.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--chrome-bg-soft);
  display: none;
}
.nav-open .site-nav { display: block; }

.site-nav ul { list-style: none; padding: 0.5rem 1.25rem 1rem; }
.site-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--chrome-text);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--color-brand); }
.nav-cta { color: var(--color-brand); }

/* 5. HERO ------------------------------------------------------------------ */
.hero {
  background:
    /* gold glow bleeding in from the corner — atmosphere, not flat color */
    radial-gradient(60rem 30rem at 85% -10%, rgba(232, 186, 84, 0.18), transparent 60%),
    /* faint diagonal pinstripes, like brushed metal */
    repeating-linear-gradient(-55deg,
      rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px),
    linear-gradient(165deg, var(--chrome-bg) 30%, var(--chrome-bg-soft) 100%);
  color: var(--chrome-text);
  text-align: center;
  padding-block: 2.75rem;   /* kept tight so the CTA buttons sit above the
                               fold — the hero has one job: the quote button */
  overflow: hidden;
}

.hero-logo {
  width: clamp(110px, 18vw, 150px);
  height: auto;              /* keep the aspect ratio from width/height attrs */
  margin-inline: auto;
  margin-bottom: 0.25rem;
  /* "screen" blending drops the logo's baked-in black box out against the
     dark hero — black contributes nothing in screen mode, gold survives */
  mix-blend-mode: screen;
}

.hero-eyebrow {
  color: var(--color-brand);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  color: var(--chrome-text);
  font-size: clamp(2.5rem, 7.5vw, 4.25rem);
  font-weight: 900;
  line-height: 1.02;
}

.hero-sub {
  max-width: 34rem;
  margin: 0.9rem auto 1.5rem;
  color: var(--chrome-muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;          /* buttons stack gracefully on narrow phones */
  gap: 0.75rem;
  justify-content: center;
}
.hero .btn-outline { color: var(--chrome-text); }
.hero .btn-outline:hover { background: rgba(255, 255, 255, 0.1); }

/* 6. CARDS (services & testimonials) --------------------------------------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  /* single column on mobile; desktop columns added in section 11 */
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              background-color 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); }

.service-card { display: flex; flex-direction: column; }
.service-card h3 { font-size: 1.6rem; font-weight: 800; }

.price {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--color-heading);
  margin: 0.25rem 0 0.75rem;
}
.price-note {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: none;
  color: var(--color-muted);
}

/* Per-vehicle-size pricing rows: label left, price right.
   space-between pushes the two to opposite edges of each row. */
.price-tiers {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.price-tiers li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-muted);
}
.price-tiers li span {
  font-weight: 700;
  color: var(--color-heading);
}

.service-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  flex-grow: 1;            /* pushes the button to the card bottom */
}

/* Add-ons bar: a slim card below the package grid, width-capped so the
   menu rows don't stretch into hard-to-scan full-width lines. */
.addons {
  max-width: 34rem;
  margin: 1.5rem auto 0;
  text-align: center;
}
.addons h3 { font-size: 1.4rem; }
.addons-note {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0.25rem 0 0.75rem;
}
.addons .price-tiers { margin-bottom: 0; text-align: left; }
.addons .price-tiers li:last-child { border-bottom: 0; }
.service-list li { padding: 0.35rem 0 0.35rem 1.5rem; position: relative; }
.service-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

.featured { border: 2px solid var(--color-brand); position: relative; }
.badge {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.testimonial p { font-style: italic; }

/* Testimonial carousel: the track is just a flex row that scrolls
   sideways. scroll-snap makes cards settle into place after a swipe. */
.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0.25rem 1rem;     /* room for card shadows + scrollbar */
  -webkit-overflow-scrolling: touch;
}
.carousel-track .testimonial {
  flex: 0 0 85%;            /* one card per view on phones, with a peek
                               of the next card hinting "swipe me" */
  scroll-snap-align: start;
}
.carousel-track .testimonial:hover { transform: none; } /* no lift while swiping */

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.carousel-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.carousel-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* 7. GALLERY ----------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);  /* 2-up on phones, 3-up on desktop */
}
.gallery-grid img {
  width: 100%;
  height: auto;            /* let aspect-ratio set the height — without this,
                              the HTML height="" attribute wins and each tile
                              renders at the photo's raw height */
  aspect-ratio: 4 / 3;     /* uniform tiles regardless of source image shape */
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.25s ease;
}
.gallery-grid img:hover { transform: scale(1.025); }

/* 8. CONTACT FORM -------------------------------------------------------------- */
.contact-inner { max-width: 44rem; }

.quote-form { display: grid; gap: 1.1rem; }

.form-row { display: grid; gap: 1.1rem; } /* becomes 2 columns on desktop */

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }

/* Honeypot: moved off-screen rather than display:none — some spam bots
   skip display:none fields, and off-screen still catches the dumber ones
   while staying invisible and non-interactive for humans. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-field label { font-weight: 600; font-size: 0.95rem; }

.form-field input,
.form-field select,
.form-field textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

/* Checkbox rows: label wraps the input so clicking the text toggles it */
.form-checks-label { font-weight: 600; font-size: 0.95rem; }
.checks-grid { display: grid; gap: 0.45rem; }  /* 2 columns on desktop below */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}
.form-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-brand);  /* gold check instead of browser blue */
  cursor: pointer;
}

.quote-form .btn { justify-self: start; }

.form-status { min-height: 1.5rem; font-weight: 600; color: var(--color-success); }

/* 9. FOOTER --------------------------------------------------------------------- */
.site-footer {
  background: var(--chrome-bg);
  color: var(--chrome-text);
  text-align: center;
  padding-block: 2.5rem;
  border-top: 3px solid var(--color-brand); /* thin brand stripe */
}
.footer-inner { display: grid; gap: 0.5rem; }
.footer-logo { width: 130px; height: auto; margin-inline: auto; }
.site-footer a { color: var(--chrome-text); }

/* Social icon row — used in BOTH the gallery section (themed background)
   and the footer (always-dark chrome). Base styles use theme variables;
   the .site-footer override below adapts it to the black chrome. */
.social-links {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
}
.social-links a {
  display: grid;
  place-items: center;      /* centers the icon inside the circle */
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.social-links a:hover {
  color: var(--color-accent);       /* theme-aware gold ink */
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.site-footer .social-links a {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--chrome-muted);
}
.site-footer .social-links a:hover {
  color: var(--color-brand);        /* true gold pops on the black chrome */
  border-color: var(--color-brand);
}

.gallery-follow {
  margin-top: 2.25rem;
  text-align: center;
}
.gallery-follow p {
  color: var(--color-muted);
  max-width: 34rem;
  margin-inline: auto;
}
.footer-fine { color: var(--chrome-muted); font-size: 0.85rem; margin-top: 0.75rem; }

/* 10. MOTION ---------------------------------------------------------------------- */
/* One well-orchestrated entrance: hero pieces rise in sequence on load. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-logo,
.hero-eyebrow,
.hero h1,
.hero-sub,
.hero-actions {
  animation: rise-in 0.6s ease-out both;
}
.hero-eyebrow     { animation-delay: 0.1s; }
.hero h1          { animation-delay: 0.2s; }
.hero-sub         { animation-delay: 0.32s; }
.hero-actions     { animation-delay: 0.44s; }

/* Accessibility: some users get motion-sick — the OS exposes that setting
   and we honor it by turning animations off. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* 11. DESKTOP LAYOUT (mobile-first: these rules ADD columns) --------------------- */
@media (min-width: 700px) {
  /* Real nav bar replaces the hamburger dropdown */
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; background: none; }
  .site-nav ul { display: flex; gap: 1.75rem; padding: 0; }
  .site-nav a { padding: 0.25rem 0; }

  /* DOM order is logo → controls → nav; on desktop put nav in the middle */
  .header-controls { order: 3; }

  .form-row { grid-template-columns: 1fr 1fr; }
  .checks-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  /* 2 testimonials per view on desktop (3 makes the quotes too cramped) */
  .carousel-track .testimonial { flex-basis: calc((100% - 1.25rem) / 2); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding-block: 3.5rem; }
}
