/* ================================================================
   styles.css — Meiber Automotive Landing Page
   ================================================================

   TABLE OF CONTENTS
   1. Design Tokens (CSS Variables)
   2. Reset & Base
   3. Reveal Animation (scroll-triggered fade-up)
   4. Navbar
   5. Mobile Menu
   6. Hero Section
   7. Stats Bar
   8. Vehicles Section
   9. About & Updates
  10. Contact Section
  11. Footer
  12. Responsive Breakpoints

================================================================ */


/* ----------------------------------------------------------------
   1. DESIGN TOKENS
   All colours, fonts, and spacing live here as CSS variables.
   Changing --accent changes every accent in the site instantly.
---------------------------------------------------------------- */
:root {
  --bg:          #080808;       /* Almost pure black — main background    */
  --bg-mid:      #0f0f0f;       /* Slightly lighter black — section alt   */
  --bg-card:     #141414;       /* Card/panel background                  */
  --border:      rgba(255,255,255,0.08); /* Hairline dividers              */
  --text:        #e8e0d4;       /* Warm off-white — body text             */
  --text-muted:  rgba(232,224,212,0.45); /* Dimmed text                   */
  --accent:      #c8a96e;       /* Brushed gold — buttons, highlights     */
  --accent-pale: rgba(200,169,110,0.12); /* Ghost-button background        */

  --font-display: 'Cormorant Garamond', Georgia, serif;  /* Headlines      */
  --font-body:    'DM Sans', sans-serif;                 /* Body / UI      */

  --max-w:  1280px;    /* Maximum content width                           */
  --radius: 4px;       /* Subtle border radius for inputs/buttons         */
  --gap:    clamp(1.5rem, 4vw, 4rem); /* Responsive section padding      */
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


/* ----------------------------------------------------------------
   2. RESET & BASE
   Browser normalisation + global typography defaults.
---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;       /* Smooth-scroll when nav links are clicked */
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;            /* Prevent horizontal scroll on animations */
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;             /* Images fill their containers without distortion */
}

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

ul { list-style: none; }


/* ----------------------------------------------------------------
   3. REVEAL ANIMATION
   Every element with class .reveal starts invisible and slightly
   below its final position. JavaScript adds .visible when the
   element enters the viewport, triggering the CSS transition.
---------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--transition),
              transform 0.7s var(--transition);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger sibling reveals using nth-child delays */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }


/* ----------------------------------------------------------------
   4. NAVBAR
   Fixed at top. Transparent by default → dark on scroll (JS adds
   .scrolled class). Uses flexbox to spread brand + links.
---------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

/* JS adds this class once the user scrolls > 80px */
.navbar.scrolled {
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

/* Hamburger hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}


/* ----------------------------------------------------------------
   5. MOBILE MENU DRAWER
   Hidden off-screen. JS toggles .open to slide it into view.
---------------------------------------------------------------- */
.mobile-menu {
  display: none;              /* Only shown on mobile (see breakpoints) */
  position: fixed;
  top: 0; right: -100%;
  width: 70vw;
  max-width: 320px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 99;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 2rem;
  gap: 2rem;
  transition: right var(--transition);
}

.mobile-menu.open { right: 0; }

.mobile-link {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text);
}


/* ----------------------------------------------------------------
   6. HERO SECTION
   Two stacked subsections: the text block then the image block.
   A decorative grain overlay adds texture to the black background.
---------------------------------------------------------------- */
.hero {
  padding-top: 140px;          /* Clear the fixed navbar */
  overflow: hidden;
  position: relative;
}

/* Noise texture overlay using an SVG data URI */
.hero::before {
  content: '';
  position: fixed;             /* Fixed so it covers the entire viewport */
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 6rem);
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 8rem);  /* Fluid — scales with viewport */
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.06em;
}

/* Primary CTA button — pill shape, accent-coloured */
.btn {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.2s;
}

.btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

/* Full-bleed hero image block */
.hero-image-wrap {
  position: relative;
  margin-top: 4rem;
  height: clamp(400px, 60vw, 780px);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

/* Fade the top edge of the image so it blends into the black background */
.hero-image-fade {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
}


/* ----------------------------------------------------------------
   7. STATS BAR
   A horizontal strip of three numbers separated by vertical lines.
---------------------------------------------------------------- */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 8rem);
  padding: 5rem clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
}

/* The animated number */
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  color: var(--accent);
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Thin vertical rule between stats */
.stat-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
}


/* ----------------------------------------------------------------
   8. VEHICLES SECTION
   Each vehicle-row is a CSS grid: image + copy side-by-side.
   .reverse flips the column order so the image appears on the right.
---------------------------------------------------------------- */
.vehicles {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8rem clamp(1.5rem, 5vw, 4rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--text);
  margin-bottom: 5rem;
}

.vehicle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* Two equal columns */
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  margin-bottom: 7rem;
}

/* Reverse layout: swap column order so image appears on the right */
.vehicle-row.reverse {
  direction: rtl;               /* Quick RTL trick to flip column order */
}

.vehicle-row.reverse > * {
  direction: ltr;               /* Reset text direction inside children  */
}

.vehicle-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
}

.vehicle-img-wrap img {
  transition: transform 0.8s var(--transition);
}

.vehicle-img-wrap:hover img {
  transform: scale(1.04);       /* Subtle zoom on hover */
}

/* Thin gold rule above the vehicle heading */
.copy-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 1.5rem;
  width: 80px;
}

.vehicle-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 300;
  margin-bottom: 0.4rem;
}

.vehicle-sub {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.vehicle-copy p:last-of-type {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Ghost / outline button */
.btn-ghost {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
  transition: opacity var(--transition);
}

.btn-ghost:hover { opacity: 0.6; }


/* ----------------------------------------------------------------
   9. ABOUT & UPDATES
---------------------------------------------------------------- */
.about {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
}

/* 50/50 split layout */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: var(--max-w);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.about-copy {
  padding: clamp(4rem, 8vw, 8rem) clamp(1.5rem, 5vw, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.about-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 300;
  line-height: 1.1;
}

.about-copy p {
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 0.95rem;
  max-width: 44ch;
}

.about-img {
  border-left: 1px solid var(--border);
  overflow: hidden;
  min-height: 420px;
}

/* --- Updates grid --- */
.updates {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 7rem clamp(1.5rem, 5vw, 4rem);
}

.updates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;                        /* 1px gap creates thin divider lines */
  background: var(--border);       /* Border shows through the 1px gaps  */
  border: 1px solid var(--border);
}

.update-card {
  background: var(--bg-mid);       /* Card fills over the border-colour bg */
  padding: 0;
  overflow: hidden;
  transition: background var(--transition);
}

.update-card:hover {
  background: var(--bg-card);
}

.update-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.update-img-wrap img {
  transition: transform 0.8s var(--transition);
}

.update-card:hover .update-img-wrap img {
  transform: scale(1.05);
}

.update-tag {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1.5rem 1.5rem 0.25rem;
}

.update-card h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  padding: 0 1.5rem 0.5rem;
  line-height: 1.2;
}

.update-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 1.5rem 1.75rem;
  line-height: 1.7;
}


/* ----------------------------------------------------------------
  10. CONTACT SECTION
---------------------------------------------------------------- */
.contact {
  border-top: 1px solid var(--border);
  padding: clamp(5rem, 10vw, 10rem) clamp(1.5rem, 5vw, 4rem);
}

.contact-header {
  margin-bottom: 4rem;
}

.contact-header h2 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 300;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.contact-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* The form itself is centred and constrained in width */
.contact-form {
  max-width: 680px;
  margin: 0 auto;
}

/* A row that holds two fields side by side */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.form-field.full {
  margin-bottom: 1.5rem;
}

label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.req { color: var(--accent); }

/* Underline-only inputs — no box, just a bottom border */
input, textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}

input:focus, textarea:focus {
  border-bottom-color: var(--accent);  /* Gold underline on focus */
}

/* Full-width send button */
.btn-send {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  margin-top: 2rem;
  transition: background var(--transition), transform 0.2s;
}

.btn-send:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

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

/* Success message — hidden by default, shown via JS */
.form-success {
  text-align: center;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 0.5s;
}

.form-success.visible { opacity: 1; }


/* ----------------------------------------------------------------
  11. FOOTER
---------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 2rem;
  background: var(--bg);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-bottom: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-col p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}


/* ----------------------------------------------------------------
  12. RESPONSIVE BREAKPOINTS

  Tablet  ≤ 900px: vehicle rows stack vertically
  Mobile  ≤ 600px: single column everywhere, smaller text
---------------------------------------------------------------- */

/* --- Tablet --- */
@media (max-width: 900px) {

  .nav-links { display: none; }   /* Hide desktop nav links */
  .hamburger { display: flex; }   /* Show hamburger button */
  .mobile-menu { display: flex; } /* Enable mobile drawer */

  .vehicle-row,
  .vehicle-row.reverse {
    grid-template-columns: 1fr;   /* Stack image above text */
    direction: ltr;
  }

  .about-split {
    grid-template-columns: 1fr;   /* Stack about columns */
  }

  .about-img {
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 280px;
  }

  .updates-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-bar {
    gap: clamp(1.5rem, 4vw, 4rem);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Mobile --- */
@media (max-width: 600px) {

  .hero-headline { font-size: clamp(2.5rem, 12vw, 4rem); }

  .stats-bar {
    flex-direction: column;
    gap: 2.5rem;
  }

  .stat-divider {
    width: 60px;
    height: 1px;   /* Horizontal divider on mobile */
  }

  .updates-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;   /* Stack name fields */
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .vehicles { padding: 5rem 1.5rem; }
  .vehicle-row { margin-bottom: 4rem; }
}