/* -------------------------------------------------------------
 * ATLAS AUTOMOTIVE - DESIGN SYSTEM & GLOBAL STYLES
 * ------------------------------------------------------------- */

/* Reset & Base System */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Material Color Palette */
  --color-bg-graphite: #0b0c0d;      /* Carbon composite dark */
  --color-bg-carbon: #121315;        /* Card surface */
  --color-bg-machined: #1c1d20;      /* Elevated surface / panels */
  --color-titanium: #eaeaea;         /* Primary Accent / Technical Text */
  --color-copper: #c87d55;           /* Secondary Accent / Warm highlight */
  --color-copper-glow: rgba(200, 125, 85, 0.15);
  --color-electric-white: #ffffff;   /* Focus state highlight */
  --color-muted: rgba(234, 234, 234, 0.5); /* Secondary text */
  --color-border: rgba(234, 234, 234, 0.08); /* Hairline borders */
  
  /* Semantic Colors */
  --color-success: #284d37;          /* Forest Green */
  --color-warning: #b38600;          /* Amber */
  --color-error: #8b2626;            /* Muted Crimson */
  
  /* Typography */
  --font-sans: 'Outfit', 'Montserrat', sans-serif;
  --font-serif: 'Cormorant Garamond', 'Playfair Display', serif;
  
  /* Grid & Spacing System (Base 8px) */
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;
  --space-128: 128px;
  --space-160: 160px;
  --space-224: 224px;
  --space-320: 320px;
  
  /* Corner Radius (Automotive Precision) */
  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-dialog: 16px;
  --radius-panel: 20px;
}

html {
  font-family: var(--font-sans);
  background-color: var(--color-bg-graphite);
  color: var(--color-titanium);
  line-height: 1.6;
  scroll-behavior: auto; /* Managed by custom smooth scroller */
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-graphite);
}
::-webkit-scrollbar-thumb {
  background: rgba(234, 234, 234, 0.15);
  border-radius: 3px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-copper);
}

/* Typography scale */
h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

p {
  color: var(--color-muted);
  font-weight: 300;
}

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

.caption {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  font-weight: 300;
}

.metadata {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-copper);
}

.serif-text {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Grids and Layout Container */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-40);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1px);
  column-gap: calc((100% - 12px) / 11);
}

/* Custom Cursor */
.custom-cursor {
  width: 6px;
  height: 6px;
  background-color: var(--color-electric-white);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.15s, height 0.15s, background-color 0.15s;
}

.custom-cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out, width 0.2s, height 0.2s, border-color 0.2s;
}

/* Cursor interactions */
.cursor-hover .custom-cursor {
  width: 12px;
  height: 12px;
  background-color: var(--color-copper);
  mix-blend-mode: normal;
}
.cursor-hover .custom-cursor-ring {
  width: 48px;
  height: 48px;
  border-color: var(--color-copper);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Preloader - Laser Engraving */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-bg-graphite);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.preloader-content {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preloader-emblem {
  margin-bottom: var(--space-24);
  position: relative;
}

.emblem-path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: engrave 3.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.emblem-cross {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: engrave 2s cubic-bezier(0.25, 1, 0.5, 1) forwards 1s;
}

.emblem-dot {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 2.5s;
}

.preloader-wordmark {
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.4em;
  color: var(--color-titanium);
  opacity: 0;
  transform: translateY(10px);
  animation: wordmarkReveal 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards 2s;
}

/* Laser sweep scan line */
.laser-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-copper), transparent);
  box-shadow: 0 0 10px var(--color-copper);
  opacity: 0.8;
  animation: laserScan 2.5s ease-in-out infinite;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 990;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), 
              border-color 0.6s cubic-bezier(0.215, 0.61, 0.355, 1),
              backdrop-filter 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Navbar materialization */
.navbar.scrolled {
  background-color: rgba(18, 19, 21, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-40);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-32);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-32);
}

.nav-item {
  color: var(--color-titanium);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  padding: 8px 0;
  transition: color 0.3s;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-copper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-item:hover {
  color: var(--color-electric-white);
}

.nav-item:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-decoration: none;
}

.brand-logo {
  color: var(--color-titanium);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-brand:hover .brand-logo {
  transform: rotate(360deg);
}

.btn-nav {
  text-decoration: none;
  color: var(--color-bg-graphite);
  background-color: var(--color-titanium);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--color-titanium);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.btn-nav:hover {
  background-color: transparent;
  color: var(--color-titanium);
  box-shadow: 0 0 15px rgba(234, 234, 234, 0.1);
}

/* Ambience Toggle Styles */
.ambience-toggle {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  cursor: none;
  padding: 8px;
}

.audio-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.3s;
}

.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 14px;
}

.wave-bar {
  width: 2px;
  height: 2px;
  background-color: var(--color-muted);
  transition: background-color 0.3s;
}

.ambience-toggle.active .wave-bar {
  background-color: var(--color-copper);
  animation: soundBar 1.2s ease-in-out infinite alternate;
}

.ambience-toggle.active .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.ambience-toggle.active .wave-bar:nth-child(2) { animation-delay: 0.4s; height: 12px; }
.ambience-toggle.active .wave-bar:nth-child(3) { animation-delay: 0.2s; height: 8px; }
.ambience-toggle.active .wave-bar:nth-child(4) { animation-delay: 0.6s; height: 5px; }

/* Mobile nav toggle button */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 24px;
  height: 18px;
  position: relative;
  cursor: none;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--color-titanium);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.mobile-toggle span:first-child { top: 0; }
.mobile-toggle span:last-child { bottom: 0; }

.mobile-toggle.open span:first-child {
  transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.open span:last-child {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Overlay Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-bg-graphite);
  z-index: 980;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(-100%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
  opacity: 0;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu-inner {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 0 var(--space-24);
}

.mobile-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.mobile-nav-item {
  color: var(--color-titanium);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 200;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.3s;
  display: block;
}

.mobile-nav-item:hover {
  color: var(--color-copper);
}

.mobile-menu-footer {
  margin-top: var(--space-80);
}

/* Hardware Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 16px var(--space-32);
  border-radius: var(--radius-btn);
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
}

.btn-primary {
  background-color: var(--color-titanium);
  color: var(--color-bg-graphite);
  border: 1px solid var(--color-titanium);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-titanium);
  border: 1px solid rgba(234, 234, 234, 0.2);
}

/* Metallic hover sheen effect */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: skewX(-25deg);
  transition: none;
}

.btn-primary::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
}

.btn:hover::before {
  left: 150%;
  transition: left 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
  border-color: var(--color-titanium);
  background-color: rgba(234, 234, 234, 0.03);
}

.btn:active {
  transform: scale(0.97); /* Physical feedback */
}

/* Ghost Buttons / Underlined Text links */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-titanium);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: 4px 0;
  position: relative;
  text-decoration: none;
  font-weight: 400;
}

.btn-ghost::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-copper);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-ghost:hover::after {
  transform: scaleX(1);
}

.btn-ghost svg {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-ghost:hover svg {
  transform: translateX(6px);
}

/* Global Footer Styles */
.footer {
  background-color: var(--color-bg-carbon);
  border-top: 1px solid var(--color-border);
  padding: var(--space-96) 0 var(--space-48) 0;
  position: relative;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-40);
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-32);
  margin-bottom: var(--space-80);
}

.footer-brand-col {
  grid-column: span 4;
}

.footer-wordmark {
  font-size: 2rem;
  letter-spacing: 0.25em;
  margin-bottom: var(--space-16);
  color: var(--color-titanium);
}

.footer-brand-col p {
  max-width: 320px;
}

.footer-links-col {
  grid-column: span 2;
}

.footer-links-col h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-24);
  color: var(--color-titanium);
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.footer-links-col a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 300;
  transition: color 0.3s;
}

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

.footer-newsletter-col {
  grid-column: span 2;
}

.footer-newsletter-col h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-24);
  color: var(--color-titanium);
}

.footer-newsletter-col p {
  margin-bottom: var(--space-16);
}

.newsletter-form {
  display: flex;
  border-bottom: 1px solid rgba(234, 234, 234, 0.2);
  padding-bottom: var(--space-8);
  align-items: center;
}

.newsletter-form input {
  background: transparent;
  border: none;
  color: var(--color-titanium);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 4px 0;
  outline: none;
  flex: 1;
}

.newsletter-form input::placeholder {
  color: rgba(234, 234, 234, 0.3);
}

.btn-newsletter {
  background: transparent;
  border: none;
  color: var(--color-muted);
  cursor: none;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.3s, transform 0.3s;
}

.btn-newsletter:hover {
  color: var(--color-copper);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-32);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-legal-links {
  display: flex;
  gap: var(--space-32);
}

.footer-legal-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}

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

/* Animations */
@keyframes engrave {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes wordmarkReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes laserScan {
  0% {
    top: 0%;
    opacity: 0.2;
  }
  50% {
    top: 100%;
    opacity: 1;
  }
  100% {
    top: 0%;
    opacity: 0.2;
  }
}

@keyframes soundBar {
  0% {
    height: 2px;
  }
  100% {
    height: 12px;
  }
}

/* =============================================================
 * TOUCH DEVICE & CURSOR OVERRIDES
 * ============================================================= */
@media (pointer: coarse), (hover: none) {
  /* Hide custom cursor entirely on touch devices */
  .custom-cursor,
  .custom-cursor-ring {
    display: none !important;
  }

  /* Restore native cursor/touch on all interactive elements */
  a, button, input, select, textarea,
  .booking-option-card, .swatch-btn, .eng-hotspot,
  .btn, .btn-ghost, .btn-nav, .btn-newsletter,
  .config-cat-btn, .eng-tab-btn, .mobile-toggle,
  .ambience-toggle, .nav-item, .mobile-nav-item {
    cursor: auto !important;
  }

  /* Ensure minimum 44px tap target for all interactive elements */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }

  .nav-item {
    padding: 12px 4px;
  }

  .swatch-btn {
    width: 36px;
    height: 36px;
  }

  .eng-hotspot {
    width: 36px;
    height: 36px;
  }
}

/* =============================================================
 * RESPONSIVE BREAKPOINTS
 * ============================================================= */

/* Tablet / Medium */
@media (max-width: 1200px) {
  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .ambience-toggle {
    display: none;
  }

  .footer-top-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-brand-col {
    grid-column: span 4;
    margin-bottom: var(--space-40);
  }

  .footer-links-col {
    grid-column: span 2;
  }

  .footer-newsletter-col {
    grid-column: span 4;
    margin-top: var(--space-40);
  }

  .container {
    padding: 0 var(--space-24);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .btn-nav {
    display: none;
  }

  .navbar {
    height: 64px;
  }

  .nav-container {
    padding: 0 var(--space-16);
  }

  .brand-text {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .btn {
    padding: 14px var(--space-24);
    font-size: 0.75rem;
  }

  .footer {
    padding: var(--space-64) 0 var(--space-32) 0;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: var(--space-40);
  }

  .footer-brand-col, .footer-links-col, .footer-newsletter-col {
    grid-column: span 1;
    margin: 0;
  }

  .footer-wordmark {
    font-size: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-24);
  }

  .footer-legal-links {
    flex-wrap: wrap;
    gap: var(--space-16) var(--space-24);
  }

  .container {
    padding: 0 var(--space-16);
  }

  .preloader-emblem {
    width: 60px;
    height: 60px;
  }

  .preloader-wordmark {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .navbar {
    height: 56px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .footer-links-col h4 {
    font-size: 0.75rem;
  }

  .footer-links-col a {
    font-size: 0.8rem;
  }
}

/* ============================================================
   MOBILE OPTIMIZATION — TOUCH & OVERFLOW
   ============================================================ */
@media (pointer: coarse) {
  .btn, .nav-link, a, button {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn { padding: 14px 20px; }
  body { cursor: auto; -webkit-text-size-adjust: 100%; }
  html, body { overflow-x: hidden; overscroll-behavior-x: none; }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 1.8rem; line-height: 1.15; }
  .hero-body { font-size: 0.95rem; }
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .grid-12 { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal-dialog { width: 95vw; max-width: 95vw; margin: 16px auto; }
}
