/* =========================================================
   Circuitcam — base styles
   The per-page <style> blocks carry the nav + responsive rules.
   This file holds the global reset plus the homepage's structural
   classes (these lived in the old WordPress theme and were missing
   from the exported markup).
   ========================================================= */

:root { --red:#D42B0F; --red-dark:#b8240d; --ink:#f2f2f2; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #080808;
  color: var(--ink);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }
a { color: inherit; }

/* Dark backing behind every embedded player so no white shows while a
   Vimeo iframe is still initialising. */
iframe { background: #000; }

/* Accessible focus ring (keyboard users) */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100000;
  background: var(--red); color: #fff; padding: 12px 18px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Homepage layout primitives ---- */
.cc-container { max-width: 1280px; margin: 0 auto; }
.cc-section { padding: 96px clamp(20px, 5vw, 40px); }

.cc-section-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 3.5px; text-transform: uppercase; color: var(--red);
  margin-bottom: 20px;
}
.cc-section-eyebrow::before {
  content: ''; display: block; width: 24px; height: 2px; background: var(--red);
}

.cc-section h2, .cc-final-cta h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(34px, 4.5vw, 58px); font-weight: 900; line-height: 1;
  letter-spacing: -1px; text-transform: uppercase; color: var(--ink);
  margin: 0 0 24px;
}

.cc-divider { width: 48px; height: 3px; background: var(--red); margin: 0 0 28px; }

.cc-lead {
  font-size: clamp(18px, 2.2vw, 22px); color: var(--ink);
  line-height: 1.5; margin: 0 0 16px;
}

/* ---- Buttons ---- */
.cc-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 32px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  border-radius: 2px; transition: background .2s ease, border-color .2s ease, color .2s ease;
  margin-top: 8px;
}
.cc-btn-primary { background: var(--red); color: #fff; }
.cc-btn-primary:hover { background: var(--red-dark); }
.cc-btn-outline { background: transparent; color: var(--ink); border: 1px solid rgba(255,255,255,.3); }
.cc-btn-outline:hover { border-color: var(--red); color: var(--red); }

/* ---- What we do ---- */
.cc-what-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.cc-what-image-wrap { position: relative; }
.cc-what-image { width: 100%; display: block; border-radius: 2px; }
.cc-what-image-badge {
  position: absolute; left: 0; bottom: 24px; background: var(--red); color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.3; padding: 14px 20px;
}
.cc-what-text h2 { margin-bottom: 8px; }

/* ---- Final CTA ---- */
.cc-final-cta {
  background: #080808; text-align: center;
  padding: clamp(80px, 10vw, 120px) clamp(20px, 5vw, 40px);
  border-top: 1px solid rgba(255,255,255,.06);
}
.cc-final-cta .cc-section-eyebrow { justify-content: center; }
.cc-final-cta p { color: #aaa; max-width: 480px; margin: 0 auto 40px; line-height: 1.6; }

/* ---- Footer (homepage) ---- */
.cc-footer { background: #0a0a0a; border-top: 1px solid rgba(255,255,255,.07); padding: 48px clamp(20px,5vw,40px) 32px; }
.cc-footer-inner { max-width: 1280px; margin: 0 auto; }
.cc-footer-top {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 32px;
}
.cc-footer-brand p { color: #888; font-size: 13px; line-height: 1.7; max-width: 240px; margin: 0; }
.cc-footer-col h4 {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: #555; margin: 0 0 20px;
}
.cc-footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cc-footer-col a { color: rgba(255,255,255,.5); text-decoration: none; font-size: 14px; }
.cc-footer-col a:hover { color: var(--ink); }
.cc-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #555; gap: 12px; flex-wrap: wrap;
}

/* =========================================================
   Scroll flow — reveal-on-scroll, progress bar, sticky-nav state
   (matches the louisbates.dev feel; all motion is opt-out)
   ========================================================= */

/* Reveal targets. Hidden from first paint only when JS is present
   (the `.cc-anim` class is static on <html>); shown via `.is-visible`
   once they scroll into view. */
.cc-anim .cc-section > .cc-container > *,
.cc-anim .cc-final-cta .cc-container > *,
.cc-anim .cc-fd-benefit-row,
.cc-anim .cc-fd-featured,
.cc-anim .cc-fd-two-laps > div,
.cc-anim .cc-reviews-grid > div,
.cc-anim .cc-fd-expect-text,
.cc-anim .cc-fd-expect-img-wrap,
.cc-anim .cc-org-fact-item,
.cc-anim .cc-org-trusted-grid > div,
.cc-anim .cc-org-install > div,
.cc-anim .cc-org-provides-grid > div,
.cc-anim .cc-org-fits-grid > div,
.cc-anim .cc-org-who-grid > div,
.cc-anim .cc-org-enquiry-grid > div,
.cc-anim .cc-contact-grid > div,
.cc-anim .cc-booking-cards > div,
.cc-anim .ev-card,
.cc-anim .ev-more-cta {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.cc-anim .is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Video / iframe blocks fade only (no slide). A transform on an <iframe>
   or <video> ancestor leaves a white compositing seam around the player,
   so these reveal with opacity alone. */
.cc-anim .cc-fd-featured,
.cc-anim .cc-fd-two-laps > div,
.cc-anim .cc-sample-laps-grid,
.cc-anim .cc-org-install > div {
  transform: none !important;
}

/* No-JS (and reduced-motion) safety net: never leave content hidden. */
@media (scripting: none) {
  .cc-anim .cc-section > .cc-container > *,
  .cc-anim .cc-final-cta .cc-container > *,
  .cc-anim .cc-fd-benefit-row, .cc-anim .cc-fd-featured,
  .cc-anim .cc-fd-two-laps > div, .cc-anim .cc-reviews-grid > div,
  .cc-anim .cc-fd-expect-text, .cc-anim .cc-fd-expect-img-wrap,
  .cc-anim .cc-org-fact-item, .cc-anim .cc-org-trusted-grid > div,
  .cc-anim .cc-org-install > div, .cc-anim .cc-org-provides-grid > div,
  .cc-anim .cc-org-fits-grid > div, .cc-anim .cc-org-who-grid > div,
  .cc-anim .cc-org-enquiry-grid > div, .cc-anim .cc-contact-grid > div,
  .cc-anim .cc-booking-cards > div, .cc-anim .ev-card, .cc-anim .ev-more-cta {
    opacity: 1; transform: none;
  }
}

/* Scroll-progress bar (injected by script.js) */
#cc-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10001;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--red), #ff6a4d);
  pointer-events: none;
}

/* Sticky-nav scroll state (class toggled by script.js) */
nav.cc-nav-scrolled {
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  background: rgba(8,8,8,0.98) !important;
}

/* Gentle hover lift on the main content cards */
.cc-org-fact-item, .cc-org-provides-grid > div, .cc-org-fits-grid > div,
.cc-org-who-grid > div, .cc-fd-two-laps > div, .cc-booking-cards > div {
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease;
}
@media (hover: hover) {
  .cc-org-who-grid > div:hover, .cc-booking-cards > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  #cc-progress { display: none; }
  /* Reveal targets are un-hidden by script.js immediately under reduced
     motion; this is the no-JS belt-and-braces for reduced-motion users. */
}
@media (prefers-reduced-motion: reduce) and (scripting: none) {
  .cc-anim .cc-section > .cc-container > *,
  .cc-anim .cc-final-cta .cc-container > *,
  .cc-anim .cc-fd-benefit-row, .cc-anim .cc-fd-featured,
  .cc-anim .cc-fd-two-laps > div, .cc-anim .cc-reviews-grid > div,
  .cc-anim .cc-fd-expect-text, .cc-anim .cc-fd-expect-img-wrap,
  .cc-anim .cc-org-fact-item, .cc-anim .cc-org-trusted-grid > div,
  .cc-anim .cc-org-install > div, .cc-anim .cc-org-provides-grid > div,
  .cc-anim .cc-org-fits-grid > div, .cc-anim .cc-org-who-grid > div,
  .cc-anim .cc-org-enquiry-grid > div, .cc-anim .cc-contact-grid > div,
  .cc-anim .cc-booking-cards > div, .cc-anim .ev-card, .cc-anim .ev-more-cta {
    opacity: 1; transform: none;
  }
}
