/* Broberg Racing — static site styles */
:root {
  --yellow: #ffcd00;
  --yellow-deep: #e6b800;
  --red: #e3121b;
  --ink: #0d0d0f;
  --ink-2: #16161a;
  --ink-3: #222228;
  --paper: #f4f2ec;
  --paper-2: #e9e6dc;
  --text-dark: #141416;
  --muted-dark: #55555c;
  --text-light: #f5f5f2;
  --muted-light: #a9a9b0;
  --radius: 4px;
  --wrap: 1180px;
  --head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text-dark);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1; margin: 0 0 .5em; letter-spacing: .01em; text-transform: uppercase; }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

/* Language switching */
html[data-lang="es"] [lang="en"],
html[data-lang="en"] [lang="es"] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .25s, box-shadow .25s;
  color: var(--text-light);
}
.site-header.scrolled, .site-header.open { background: rgba(10,10,12,.94); backdrop-filter: blur(8px); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-name { font-family: var(--head); font-weight: 800; font-size: 1.25rem; letter-spacing: .06em; }
.brand-name b { color: var(--yellow); margin-left: .25em; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  text-decoration: none; font-family: var(--head); font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; font-size: 1rem; padding: 8px 10px; border-radius: var(--radius);
  transition: color .2s;
}
.nav a:hover { color: var(--yellow); }
.nav a.nav-cta { background: var(--yellow); color: #000; margin-left: 6px; }
.nav a.nav-cta:hover { background: #fff; color: #000; }

.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.35); color: var(--muted-light);
  font-family: var(--head); font-weight: 600; letter-spacing: .08em; font-size: .95rem;
  padding: 5px 10px; border-radius: 99px; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--yellow); }
.lt-sep { margin: 0 4px; opacity: .5; }
html[data-lang="es"] .lt-es, html[data-lang="en"] .lt-en { color: var(--yellow); }

.menu-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: #fff; margin: 5px 0; transition: transform .25s, opacity .25s; }
.site-header.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.open .menu-toggle span:nth-child(2) { opacity: 0; }
.site-header.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 980px) {
  .brand-name { display: none; }
  .menu-toggle { display: block; }
  .nav {
    /* header's backdrop-filter makes it the containing block, so size explicitly */
    position: absolute; top: 68px; left: 0; right: 0;
    height: calc(100vh - 68px); height: calc(100dvh - 68px);
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,10,12,.98); padding: 12px 16px 32px;
    transform: translateX(100%); transition: transform .3s ease; overflow-y: auto;
  }
  .site-header.open .nav { transform: none; }
  .nav a { font-size: 1.6rem; padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 0; }
  .nav a.nav-cta { margin: 20px 0 0; text-align: center; border-radius: var(--radius); border: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 600; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em;
  text-decoration: none; padding: 12px 26px; border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: #000; }
.btn-primary:hover { background: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-ghost-dark { border-color: var(--text-dark); color: var(--text-dark); }
.btn-ghost-dark:hover { background: var(--text-dark); color: var(--yellow); }
.btn-sm { padding: 9px 18px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end;
  background: var(--ink); color: var(--text-light); overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; animation: heroZoom 14s ease-out both; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,8,10,.85) 0%, rgba(8,8,10,.45) 55%, rgba(8,8,10,.15) 100%),
    linear-gradient(0deg, rgba(8,8,10,.9) 0%, rgba(8,8,10,0) 45%);
}
.hero-content { position: relative; padding-top: 120px; padding-bottom: 96px; }
.eyebrow { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--yellow); margin-bottom: 14px; }
.hero h1 { font-size: clamp(4rem, 13vw, 9.5rem); line-height: .86; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--yellow); }
.hero-tag { font-family: var(--head); font-style: italic; font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem); text-transform: uppercase; margin-bottom: 10px; }
.hero-sub { max-width: 540px; color: #d9d9dc; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.scroll-cue { position: absolute; left: 50%; bottom: 24px; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.5); border-radius: 14px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--yellow); border-radius: 2px; animation: cue 1.6s infinite; }
@keyframes cue { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }
@media (max-width: 719px) { .scroll-cue { display: none; } .hero-content { padding-bottom: 56px; } }

/* ---------- Titles strip ---------- */
.titles { background: var(--yellow); color: #000; }
.titles-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.title-item { padding: 26px 12px; text-align: center; border-left: 1px solid rgba(0,0,0,.15); font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
.title-item:first-child { border-left: 0; }
.title-item strong { display: block; font-size: 2.6rem; font-weight: 800; line-height: 1; }
@media (max-width: 719px) {
  .titles-grid { grid-template-columns: 1fr 1fr; }
  .title-item:nth-child(3) { border-left: 0; }
  .title-item:nth-child(n+3) { border-top: 1px solid rgba(0,0,0,.15); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-dark { background: var(--ink); color: var(--text-light); }
.kicker { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--red); margin-bottom: 8px; }
.section-dark .kicker { color: var(--yellow); }
.lead { font-size: 1.1rem; max-width: 720px; color: var(--muted-dark); margin-bottom: 40px; }
.section-dark .lead { color: var(--muted-light); }
.note { margin-top: 36px; color: var(--muted-light); max-width: 820px; }
.center { text-align: center; margin-top: 40px; }

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .split-rev .split-text { order: 2; }
}
.split-text p { color: var(--muted-dark); }
.section-dark .split-text p { color: var(--muted-light); }
.split-media { margin: 0; }
.stack { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); }
.stack img:last-child { margin-top: 48px; }
.trio { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.trio img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.trio img:nth-child(1) { grid-row: span 2; aspect-ratio: 3/4.6; }
.trio img:nth-child(2), .trio img:nth-child(3) { aspect-ratio: 4/3; }

/* Timeline */
.timeline { list-style: none; margin: 72px 0 0; padding: 0; display: grid; gap: 0; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--text-dark); }
.timeline li { padding: 20px 18px 0 0; position: relative; }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; background: var(--yellow); border: 2px solid var(--text-dark); border-radius: 50%; }
.tl-year { display: block; font-family: var(--head); font-weight: 800; font-size: 2rem; line-height: 1.1; margin-bottom: 6px; }
.tl-year small { font-size: 1rem; margin-left: 4px; }
.timeline p { font-size: .95rem; color: var(--muted-dark); }
@media (max-width: 899px) {
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--text-dark); margin-left: 6px; }
  .timeline li { padding: 0 0 24px 24px; }
  .timeline li::before { top: 8px; left: -7px; }
}

/* Results */
.results { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 24px; }
@media (min-width: 560px) { .results { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .results { grid-template-columns: repeat(4, 1fr); } }
.result { background: var(--ink-2); border: 1px solid var(--ink-3); border-top: 4px solid var(--yellow); padding: 26px 24px 18px; border-radius: var(--radius); }
.result .pos { font-family: var(--head); font-weight: 800; font-style: italic; font-size: 3.6rem; line-height: 1; color: var(--yellow); display: block; margin-bottom: 12px; }
.result .pos-time { font-size: 3rem; }
.result h3 { font-size: 1.45rem; }
.result h3 small { color: var(--muted-light); font-weight: 600; margin-left: 4px; }
.result p { color: var(--muted-light); font-size: .95rem; }

/* Cars */
.car { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.car img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.car-body { padding: 20px 22px 8px; }
.car-feature { display: grid; margin: 32px 0 24px; background: var(--ink); color: var(--text-light); }
.car-feature img { aspect-ratio: 16/10; height: 100%; }
.car-feature .car-body { padding: 28px 28px 20px; align-self: center; }
.car-feature h3 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.car-feature p { color: var(--muted-light); }
@media (min-width: 900px) { .car-feature { grid-template-columns: 1.6fr 1fr; } .car-feature .car-body { padding: 40px; } }
.car-tag { display: inline-block; background: var(--yellow); color: #000; font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; padding: 2px 10px; border-radius: 2px; }
.cars { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 6px 0 16px; }
.specs div { border-top: 1px solid var(--paper-2); padding-top: 8px; }
.specs dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-dark); }
.specs dd { margin: 0; font-weight: 600; }

/* Services */
.services { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); background: var(--ink-3); border: 1px solid var(--ink-3); }
.service { background: var(--ink); padding: 30px 26px 18px; transition: background .2s; position: relative; }
.service::before { content: ""; position: absolute; left: 26px; top: 0; width: 36px; height: 3px; background: var(--yellow); }
.service:hover { background: var(--ink-2); }
.service p { color: var(--muted-light); font-size: .97rem; }

/* Sale */
.sale { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 24px; }
.sale-card { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sale-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.sale-card img.pos-bottom { object-position: 50% 80%; }
.sale-card img.pos-top { object-position: 50% 0%; }
.sale-body { padding: 22px 24px 26px; }
.sale-body p { color: var(--muted-light); }
.sale .specs div { border-top-color: var(--ink-3); }
.sale .specs dt { color: var(--muted-light); }
.sale .specs dd { color: var(--text-light); font-size: .95rem; }
.models { list-style: none; padding: 0; margin: 4px 0 16px; }
.models li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--ink-3); }
.models strong { font-family: var(--head); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-light); }
.models span { color: var(--muted-light); font-size: .92rem; }
.sale-price { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--yellow) !important; }
.sale-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Drivers */
.drivers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.driver { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.driver img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 20%; transition: transform .5s; }
.driver:hover img { transform: scale(1.04); }
.driver figcaption { position: absolute; inset: auto 0 0 0; padding: 60px 20px 18px; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,0)); }
.driver strong { display: block; font-family: var(--head); font-size: 1.6rem; text-transform: uppercase; line-height: 1.1; }
.driver q { font-size: .9rem; color: #ddd; font-style: italic; }

/* Gallery */
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; grid-auto-flow: dense; margin-top: 24px; }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; } }
.gallery a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--ink-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; }
.gallery a:hover img { transform: scale(1.05); }
.g-wide { grid-column: span 2; }
.g-tall { grid-row: span 2; }

/* Social band */
.social { position: relative; padding: clamp(80px, 12vw, 140px) 0; color: #fff; text-align: center; overflow: hidden; background: var(--ink); }
.social-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.social-inner { position: relative; }
.social p { color: #ddd; font-size: 1.1rem; }
.social .hero-actions { justify-content: center; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; }
.contact-list li { padding: 16px 0; border-top: 1px solid var(--paper-2); }
.contact-list a { font-weight: 600; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.cl-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-dark); margin-bottom: 2px; }
.contact-form { background: #fff; padding: 28px; border-radius: var(--radius); display: grid; gap: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.contact-form label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 1rem;
  padding: 12px 14px; border: 1px solid #d6d3c9; border-radius: var(--radius); background: var(--paper); color: var(--text-dark); width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--yellow); outline-offset: 1px; border-color: var(--text-dark); }
.form-hint { font-size: .85rem; color: var(--muted-dark); margin: 0; }

/* Footer */
.site-footer { background: #060607; color: var(--muted-light); padding: 48px 0 36px; text-align: center; font-size: .92rem; }
.footer-inner img { height: 46px; width: auto; margin: 0 auto 16px; }
.footer-links { display: flex; gap: 20px; justify-content: center; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }
.copy { opacity: .6; margin: 0; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 3rem; line-height: 1; cursor: pointer; padding: 12px 16px; }
.lightbox button:hover { color: var(--yellow); }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg, .scroll-cue span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* The brand is dark-and-yellow in both colour schemes; dark-mode visitors get a darker paper. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #e9e6dd;
  }
}
