@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400&display=swap');

:root {
  /* Primus Racing Brand Colors */
  --primus-orange: #F47920;
  --primus-black: #0D0D0D;
  --primus-white: #FFFFFF;
  --primus-grey: #E0DFDF;

  /* Functional Neutrals */
  --surface-dark: #1A1A1A;
  --surface-mid: #3A3A3A;
  --surface-light: #F5F5F5;

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --container-max: 1280px;
  --section-padding: 120px;
}

/* Reset & Scaffolding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--primus-white);
  color: var(--primus-black);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* Typography Classes */
h1,
h2,
h3,
h4 {
  line-height: 1.1;
  margin-bottom: 24px;
}

.display-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 6.5vw, 6rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 5rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overline {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primus-orange);
  margin-bottom: 16px;
  display: block;
}

em {
  font-style: italic;
  color: var(--surface-mid);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--surface-mid);
}

/* Layout Utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
  scroll-margin-top: 100px;
}

/* Components */
.btn-primary {
  display: inline-block;
  background: var(--primus-orange);
  color: var(--primus-white);
  border-radius: 999px;
  padding: 16px 32px;
  font: 600 15px/1 var(--font-body);
  letter-spacing: 0.02em;
  transition: transform 200ms ease, box-shadow 200ms ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 24px rgba(244, 121, 32, 0.35);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--primus-black);
  border-radius: 999px;
  padding: 14px 30px;
  font: 600 15px/1 var(--font-body);
  letter-spacing: 0.02em;
  border: 2px solid var(--surface-mid);
  transition: border-color 200ms ease, color 200ms ease;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--primus-orange);
  color: var(--primus-orange);
}

.card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  transition: transform 300ms ease, border-color 300ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 121, 32, 0.5);
  /* Orange hover hint */
}

.technical-wrap {
  float: right;
  width: 440px;
  /* Precise technical width */
  margin: 12px 0 60px 80px;
  position: relative;
  z-index: 2;
  /* Prevent overlapping floats from different sides */
  clear: both;
  shape-outside: inset(0);
}

.technical-wrap.left {
  float: left;
  margin: 12px 80px 60px 0;
}

.wrap-label {
  display: block;
  margin-top: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primus-orange);
  font-family: var(--font-mono);
}

@media (max-width: 1024px) {
  .technical-wrap {
    float: none;
    width: 100%;
    margin: 0 0 40px 0;
  }
}

/* Graphic Decorators */
.accent-circle {
  border-radius: 50%;
  background: var(--primus-orange);
  opacity: 0.12;
  /* Lowered for subtle, premium depth */
  position: absolute;
  pointer-events: none;
  filter: blur(140px);
  /* Increased blur for smoother fades */
  transition: opacity 1200ms ease;
  z-index: 0;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  /* Reduced for subtler movement */
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Duochrome Treatment Setup */
.duochrome-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.duochrome-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.2);
  display: block;
}

.duochrome-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primus-orange) 0%, var(--primus-black) 100%);
  mix-blend-mode: color;
  opacity: 0.9;
  pointer-events: none;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 300ms ease, background 300ms ease, box-shadow 300ms ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.site-header.scrolled {
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--primus-black);
  transition: color 200ms ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background-color: var(--primus-orange);
  transition: width 300ms ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Navigation Drawer Mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 12px;
  cursor: pointer;
  z-index: 1000;
  position: relative;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primus-black);
  position: relative;
  transition: transform 0.3s ease;
}

.hamburger::before {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--primus-black);
  top: -8px;
  transition: transform 0.3s ease;
}

/* Hamburger Open State (Minimal 2-line animation) */
.nav-open .hamburger {
  transform: rotate(45deg);
}

.nav-open .hamburger::before {
  transform: translateY(8px) rotate(-90deg);
}

.nav-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: white;
  padding: 140px 40px 60px;
  z-index: 900;
  transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-open .nav-mobile-drawer {
  right: 0;
}

.nav-links-mobile {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.nav-links-mobile a {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 1.25rem;
  /* Reduced for a more elegant mobile look */
  font-weight: 500;
  color: var(--primus-black);
  text-transform: uppercase;
}

.nav-drawer-footer {
  padding-top: 40px;
  border-top: 1px solid var(--surface-light);
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  /* Very subtle overlay */
  backdrop-filter: blur(8px);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
}

.language-toggle {
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--surface-mid);
}

.nav-drawer-footer .language-toggle {
  display: flex;
  /* Ensure visible in mobile drawer */
  margin-top: 20px;
}

.language-toggle span {
  cursor: pointer;
  transition: color 200ms ease;
}

.language-toggle span:hover,
.language-toggle span.active {
  color: var(--primus-orange);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 160px;
  /* Increased offset for header */
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
  margin-bottom: 80px;
}

.hero-body {
  font-size: 1.25rem;
  color: var(--surface-mid);
  margin-bottom: 48px;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

/* Base Sponsor Marquee */
.sponsor-marquee-wrap {
  width: 100%;
  overflow: hidden;
  background-color: var(--primus-white);
  /* As specified in guidelines: white or Mist background for sponsor strip */
  padding: 32px 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sponsor-marquee {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
  align-items: center;
  white-space: nowrap;
  gap: 60px;
}

.sponsor-link {
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
}

.sponsor-marquee:hover {
  animation-play-state: paused;
}

.sponsor-logo {
  height: 40px;
  margin: 0 24px;
  opacity: 0.6;
  filter: grayscale(100%);
  transition: opacity 300ms ease, filter 300ms ease, transform 300ms ease;
}

.sponsor-logo:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.05);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* About Car layout */
.split-section {
  display: flex;
  align-items: center;
  gap: 160px;
}

.split-content {
  flex: 1;
}

.split-visual {
  flex: 1;
  position: relative;
}

.cad-img {
  width: 100%;
  border-radius: 16px;
  /* Give it a slight perspective pop */
  transform: perspective(1000px) rotateY(-5deg) translateY(0);
  transition: transform 0.5s ease-out;
}

.cad-img:hover {
  transform: perspective(1000px) rotateY(0deg) translateY(-10px);
}

/* Our Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 64px;
}

.team-card {
  display: block;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.team-card:hover {
  transform: translateY(-8px);
}

.team-card:hover .duochrome-wrap::after {
  opacity: 0.7;
}

.team-card:hover .member-name {
  color: var(--primus-orange);
}

.member-info {
  margin-top: 16px;
}

.member-name {
  font-weight: 600;
  font-size: 1.125rem;
  transition: color 300ms ease;
}

.member-role {
  color: var(--primus-orange);
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.member-desc {
  color: var(--surface-mid);
  font-size: 0.875rem;
}

/* Forms */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--surface-mid);
}

.input-group input,
.input-group textarea {
  background: var(--surface-light);
  border: 1px solid var(--surface-mid);
  border-radius: 8px;
  padding: 16px;
  color: var(--primus-black);
  font-family: var(--font-body);
  transition: border-color 200ms ease;
  outline: none;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--primus-orange);
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 80px 0 40px;
  margin-top: 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 64px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
  color: var(--surface-mid);
}

/* Scroll Reveal Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1000ms cubic-bezier(0.16, 1, 0.3, 1), transform 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
/* Profile Detail Page (team.html) */
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 120px;
  margin-top: 80px;
}

.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 80px;
  scroll-margin-top: 200px;
}

.profile-visual {
  flex: 0 0 400px;
}

.profile-content {
  flex: 1;
  padding-top: 20px;
}

.profile-long-desc {
  font-size: 1.125rem;
  color: var(--surface-mid);
  line-height: 1.8;
  max-width: 700px;
}

@media (max-width: 1024px) {

  .split-section {
    flex-direction: column-reverse;
    gap: 60px;
  }

  /* Remove '3D' parallax for better mobile performance */
  .split-visual.parallax {
    transform: none !important;
  }

  /* Simple 2D 'Hover' entry for mobile CAD image */
  .cad-img {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .visible .cad-img {
    opacity: 1;
    transform: scale(1);
  }

  .profile-row {
    flex-direction: column;
    gap: 60px;
  }

  .profile-visual {
    flex: none;
    width: 100%;
    max-width: 500px;
  }
}

@media (max-width: 900px) {

  .nav-links,
  .language-toggle {
    display: none;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .display-text {
    font-size: 3.5rem;
  }

  .section-title {
    font-size: 2.8rem;
  }

  /* Optimized for touch: less travel, tighter feel */
  .fade-in-up {
    transform: translateY(15px);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-top {
    flex-direction: column;
    gap: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
}

/* Specific fix: Hide large CAD preview when it becomes too dominantly large on mid-sized viewports */
@media (min-width: 700px) and (max-width: 1024px) {
  #car .split-visual {
    display: none;
  }

  #car .split-section {
    gap: 0;
    text-align: center;
    /* Center text for better balance without image */
  }

  #car .split-content {
    max-width: 600px;
    margin: 0 auto;
  }
}