/* ─── FONTS ─────────────────────────────────────────────────────────────────
   Update the src paths below to match your actual filenames.
─────────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Affix';
  src: url('fonts/affix.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
   font-feature-settings: "ss03" 1;  /* Stylistic Set 3 */
}

/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --red:        #FF0000;
  --cream:      #F6F2EF;
  --black:      #111111;
  --dark:       #1a1a1a;
  --white:      #ffffff;
  --mid:        #888880;

  /* Typography */
  --font-display: 'Affix', sans-serif;
  --font-body:    'Affix', sans-serif;

  /* Spacing */
  --page-px: clamp(20px, 4vw, 60px);
  --section-gap: clamp(60px, 10vw, 140px);
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  -webkit-font-smoothing: antialiased; 
  background-color: var(--cream); /* Locks the safe-area bounce to cream */
}

body {
  background-color: var(--cream);
  color: var(--red);
  font-family: var(--font-body);
  min-height: 100vh;
  overscroll-behavior: none; 
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

/* ─── TYPOGRAPHY SCALE ───────────────────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
}

.t-headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--red);
}

.t-subheadline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--red);
}

.t-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--red);
}

.t-body, .t-body-red {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.55;
}

.t-body { color: var(--black); }
.t-body-red { color: var(--red); }

/* ─── DESKTOP NAV ────────────────────────────────────────────────────────── */
#nav {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 500;
  white-space: nowrap;
}

#nav-logo {
  position: fixed;
  bottom: 22px;
  left: 20px;
  z-index: 501; /* Higher z-index to stay above mobile overlay */
  width: 55px;
  height: 55px;
  cursor: pointer;
  display: block;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 55px;
  padding: 0 26px;
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.nav-pill--light { background: var(--white); color: var(--black); }
.nav-pill--light.active { background: var(--red); color: var(--white); }

.nav-pill--dark { background: var(--white); color: var(--black); }
.nav-pill--dark.active { background: var(--red); color: var(--white); }

.nav-pill:hover { transform: scale(1.03); }

/* ─── SHARED UI COMPONENTS ───────────────────────────────────────────────── */
.red-ball {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #ff5a50, var(--red) 55%, #8b0e09);
  flex-shrink: 0;
  display: inline-block;
}

/* ─── MOBILE NAV (FIGMA DESIGN) ─────────────────────────────────────────── */

#mobile-nav-controls {
  position: fixed;
  bottom: 25px;
  right: 20px;
  z-index: 501; /* Sits above the red overlay */
}

#mobile-menu-toggle {
  background: var(--white);
  color: var(--black);
  border: none;
  border-radius: 99px;
  height: 48px;
  padding: 0 40px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;

  transition: transform 0.2s ease;
}

#mobile-menu-toggle:active { transform: scale(0.96); }

/* Text Swapping for Toggle */
.text-close { display: none; }
body.menu-open .text-menu { display: none; }
body.menu-open .text-close { display: block; }

#mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 500;
  display: flex;
  flex-direction: column;
  justify-content: start;
  padding: 20px;
  
  /* Start hidden & slid down */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.menu-open #mobile-menu-overlay {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.mobile-nav-links a {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--black);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mobile-nav-links a:active { opacity: 0.5; }

/* ─── CONTEXTUAL CURSOR ─────────────────────────────────────────────────── */

.cursor { 
  display: none; 
}

@media (min-width: 768px) {
  .cursor { 
    display: block; 
    pointer-events: none; 
    position: fixed;
    inset: 0;
    z-index: 100000;
  }
  
  .cursor__ball {
    position: absolute; 
    top: 60px; left: 60px;
    width: 70px; height: 70px;
    background-color: #FF0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    pointer-events: none;
    will-change: transform;
  }

  .cursor__text {
    color: #111; 
    font-family: 'Affix', serif; 
    font-size: 11px;
  }
}

/* ─── GLOBAL FOOTER ──────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  z-index: 9;
}

/* ── FOOTER SVG SCALING FIX ────────────────────────────────────────────── */
.footer-bg-svg {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  pointer-events: none; 
  z-index: 0; 
  /* De bulletproof SVG background methode: */
  background-image: url('img/footer-typography.svg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}


.footer-top {
  display: flex; align-items: flex-start; gap: 15vw; position: relative; z-index: 2; 
}

.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a { font-size: 13px; color: var(--black); line-height: 1.4; }

.footer-email label { font-size: 13px; color: var(--black); display: block; margin-bottom: 6px; }
.footer-email-wrap { display: flex; align-items: center; gap: 8px; }
.footer-email input { background: transparent; border: none; border-bottom: 1px solid var(--black); font-size: 13px; color: var(--black); padding: 4px 0; outline: none; width: 220px; }
.footer-email button { background: transparent; border: none; font-size: 13px; color: var(--black); cursor: pointer; }

.footer-3d-car { 
  position: absolute; bottom: -80px; left: 0; width: 250px; height: 250px; z-index: 1; pointer-events: none; overflow: hidden; 
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

.footer-3d-car::-webkit-scrollbar {
  display: none;
}
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }

.footer-bottom-bar {
  display: flex; justify-content: space-between;
  position: absolute; bottom: 20px; left: 20px; right: 20px;
  z-index: 2; font-size: 11px; color: var(--black); font-family: var(--font-body);
}
.footer-bottom-bar a { text-decoration: underline; text-underline-offset: 2px; }

/* Hide the default 3D loading progress bar that looks like a scrollbar (useful globally for model-viewers) */
model-viewer::part(default-progress-bar) { display: none; }
model-viewer::part(default-progress-mask) { display: none; }


/* ─── VISIBILITY LOGIC & RESPONSIVE STATES ───────────────────────────────── */

/* Desktop State */
@media (min-width: 769px) {
  #mobile-nav-controls, #mobile-menu-overlay {
    display: none !important;
  }
}

/* Mobile State */
@media (max-width: 900px) { /* Adjusted breakpoint slightly to catch iPad layouts */
  /* Hide the desktop pill nav, but KEEP #nav-logo visible on the left */
  #nav {
    display: none !important;
  }
  
  /* Adjusted responsive values for small screens */
  .t-headline { font-size: 36px; line-height: 1.2;}
  .nav-pill { padding: 0 18px; font-size: 13px; }

  /* Mobile Footer Adjustments */
  .footer-top { flex-direction: column; gap: 40px; }
  .footer-3d-car { display: none !important; }
}

/* ─── UTILITY ────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}