/* ═══════════════════════════════════════════════════════════════
   QUANTUMINDSSI - SHARED TECHNICAL THEME
   Applied across all pages for consistency
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ────────────────────────────────────────────── */
:root {
  --black: #05424e;
  --black-rgb: 5, 66, 78;
  --white: #fdfefd;
  --off-white: #f0ede8;
  --grey: #888;
  --grey-dim: #444;
  --border: rgba(255,255,255,0.12);
  --accent: #fdfefd;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  
  /* Legacy compatibility mappings */
  --bg-primary: #0a0a0a;
  --text-primary: var(--white);
  --text-secondary: var(--grey);
}

/* ── BASE RESET ───────────────────────────────────────────────── */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  font-family: var(--sans);
  background: #0a0a0a;
  color: var(--white);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── TICKER ───────────────────────────────────────────────────── */
.ticker {
  background: #111;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  gap: 48px;
  animation: ticker 18s linear infinite;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--grey);
}
.ticker-inner span { flex-shrink: 0; }
.ticker-dot { color: #555; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── NAVIGATION ───────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  isolation: auto;
}
.nav-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  mix-blend-mode: screen !important;
  display: block;
}
.nav-logo span { color: var(--grey); font-weight: 400; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #4caf50;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-status::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  color: var(--grey);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.active { color: var(--white); border-bottom: 1px solid var(--white); }
.btn-preorder {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--white);
  padding: 8px 18px;
  transition: background 0.2s, color 0.2s;
}
.btn-preorder:hover { background: var(--white); color: var(--black); }

/* Hamburger button - hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 6px;
  z-index: 101;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation to X */
.nav-hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Show hamburger on mobile */
@media (max-width: 767px) {
  .nav-hamburger {
    display: flex;
  }
}

/* ── CLOCK BAR ────────────────────────────────────────────────── */
.clock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
  letter-spacing: 0.08em;
}
.clock-bar .date { color: #666; }
.clock-bar .time { color: var(--white); }

/* ── TECH GRID BACKGROUND ─────────────────────────────────────── */
.tech-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(45, 184, 182, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 184, 182, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridPulse 4s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── SCAN LINE EFFECT ────────────────────────────────────────── */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(45, 184, 182, 0.5), transparent);
  animation: scanMove 6s linear infinite;
  pointer-events: none;
  z-index: 9999;
}
@keyframes scanMove {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

/* ── GLOW ORBS ────────────────────────────────────────────────── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}
.glow-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: 10%;
  left: -10%;
  animation-delay: 0s;
}
.glow-orb-2 {
  width: 300px;
  height: 300px;
  background: var(--grey);
  bottom: 20%;
  right: -5%;
  animation-delay: -10s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.9); }
  75% { transform: translate(-50px, -20px) scale(1.05); }
}

/* ── HERO SECTION ─────────────────────────────────────────────── */
.hero {
  padding: 96px 32px 72px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero p {
  font-size: 16px;
  color: var(--grey);
  max-width: 560px;
  line-height: 1.7;
}

/* ── CONTAINER ────────────────────────────────────────────────── */
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 32px; 
}

/* ── FOOTER ───────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 32px 32px;
  text-align: center;
}
footer p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ── PAGE LAYOUT ────────────────────────────────────────────── */
main {
  min-height: calc(100vh - 200px);
}

/* ── HAMBURGER BUTTON ────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--white);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Large Desktop (1200px+) - Default styles apply */

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) {
  .container { max-width: 960px; }
  .hero { padding: 80px 24px 64px; }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
  .container { max-width: 720px; padding: 0 20px; }
  .hero { padding: 72px 20px 56px; }
  .hero h1 { font-size: 2.25rem; }
  .hero h2 { font-size: 2rem; }
  
  /* 3-col grid → 2-col */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* 4-col grid → 2-col */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 767px) {
  body { font-size: 14px; }
  .container { padding: 0 16px; }
  .hero { padding: 64px 16px 48px; }
  .hero h1 { font-size: 1.875rem; line-height: 1.2; }
  .hero h2 { font-size: 1.5rem; }
  .hero p { font-size: 15px; }
  
  /* All multi-column grids → 1 column */
  [style*="grid-template-columns: repeat(2, 1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Reduce large watermark logo */
  [style*="width:320px"][style*="height:320px"] {
    width: 200px !important;
    height: 200px !important;
  }
  
  /* Responsive spec panels */
  .spec-grid { grid-template-columns: 1fr !important; }
  
  /* Smaller logo in hero */
  .hero img[style*="width:96px"] {
    width: 72px !important;
    height: 72px !important;
  }
  
  /* Nav mobile */
  nav {
    padding: 0 16px;
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
  }
  .nav-logo {
    font-size: 12px;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .nav-logo img { width: 36px; height: 36px; }
  .nav-right { gap: 12px; }
  .nav-status { display: none; }
  .btn-preorder { display: none; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 12px 0 16px;
    gap: 0;
    order: 3;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-hamburger { display: flex; }
  .clock-bar { padding: 10px 16px; }
}

/* Mobile Small (575px and below) */
@media (max-width: 575px) {
  body { font-size: 13px; }
  .container { padding: 0 12px; }
  .hero { padding: 56px 12px 40px; }
  .hero h1 { font-size: 1.5rem; }
  .hero h2 { font-size: 1.25rem; }
  
  /* Nav adjustments */
  nav { padding: 0 12px; }
  .nav-logo { font-size: 11px; gap: 6px; }
  .nav-logo img { width: 32px; height: 32px; }
  
  /* Further reduce watermark */
  [style*="width:320px"][style*="height:320px"] {
    width: 150px !important;
    height: 150px !important;
  }
  
  /* Smaller hero logo */
  .hero img[style*="width:96px"] {
    width: 64px !important;
    height: 64px !important;
  }
  
  /* Ticker smaller */
  .ticker { font-size: 10px; }
  
  /* Cockpit panels padding reduction */
  .cockpit-panel { padding: 20px !important; }
  
  /* Hero stats stack */
  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
  
  /* Blockquote smaller */
  blockquote[style*="font-size: 1.5rem"] {
    font-size: 1.125rem !important;
  }
}

/* Prevent horizontal overflow */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* Flexible typography */
h1 { font-size: clamp(1.5rem, 5vw, 3rem); }
h2 { font-size: clamp(1.25rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }

/* ═══════════════════════════════════════════════════════════════
   CROSS-BROWSER ENGINEERING
   Safari, Chrome, Brave, Firefox, Edge
   ═══════════════════════════════════════════════════════════════ */

/* ── VENDOR PREFIXES ───────────────────────────────────────────── */
/* Backdrop filter with fallbacks */
nav, .cockpit-panel, .spec-module, .product-card {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Safari backdrop-filter fix for older versions */
@supports not (backdrop-filter: blur(12px)) {
  nav, .cockpit-panel, .spec-module, .product-card {
    background: rgba(10, 10, 10, 0.98);
  }
}

/* Webkit appearance normalization */
button, input, select, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Safari input styling fix */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea {
  -webkit-border-radius: 8px;
  border-radius: 8px;
}

/* Webkit tap highlight color */
a, button, .btn, input, select, textarea {
  -webkit-tap-highlight-color: rgba(45, 184, 182, 0.2);
}

/* Touch action for all interactive elements */
a, button, .btn, input, select, textarea, .nav-links a {
  touch-action: manipulation;
}

/* ── SAFARI SPECIFIC ───────────────────────────────────────────── */
/* Fix for Safari flexbox gaps */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific fixes */
  .hero-stats {
    gap: 24px;
  }
  
  /* Safari momentum scrolling */
  .nav-links, .container, section {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix for Safari 100vh issue */
  .hero {
    min-height: -webkit-fill-available;
    min-height: 100vh;
  }
  
  /* Safari font smoothing */
  body {
    -webkit-font-smoothing: antialiased;
  }
}

/* Safari clip-path fix */
.clip-path-fix {
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
}

/* ── CHROME / BRAVE / EDGE ─────────────────────────────────────── */
/* Chromium-based optimizations */
@supports (container-type: inline-size) {
  /* Container queries support */
  .container-query-support {
    container-type: inline-size;
  }
}

/* Chrome scrollbar styling */
@supports (scrollbar-width: thin) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.05);
  }
}

/* Brave Shield compatibility - ensure content shows */
.brave-shield-fix {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ── FIREFOX ───────────────────────────────────────────────────── */
/* Firefox-specific fixes */
@-moz-document url-prefix() {
  /* Firefox flexbox gap fix */
  .hero-stats > * + * {
    margin-left: 32px;
  }
  
  /* Firefox scrollbar */
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.05);
  }
  
  /* Firefox focus outline */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

/* ── FORM ELEMENT NORMALIZATION ────────────────────────────────── */
/* Cross-browser form consistency */
input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Focus styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ── CSS GRID / FLEXBOX FALLBACKS ──────────────────────────────── */
/* Flexbox fallbacks for older browsers */
@supports not (display: grid) {
  .cockpit-panel,
  .product-card,
  .spec-module {
    display: block;
    width: 100%;
    margin-bottom: 24px;
  }
}

/* Gap fallback for older Safari */
@supports not (gap: 24px) {
  .hero-stats > * + * {
    margin-left: 32px;
  }
  
  .nav-links > * + * {
    margin-top: 8px;
  }
}

/* ── ANIMATION / TRANSITION FALLBACKS ──────────────────────────── */
/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  
  .ticker-inner {
    -webkit-animation: none !important;
    animation: none !important;
  }
}

/* ── HIGH CONTRAST MODE ─────────────────────────────────────────── */
@media (prefers-contrast: more) {
  .cockpit-panel,
  .spec-module,
  .product-card {
    border-width: 2px;
    border-color: var(--white);
  }
  
  a, button, .btn {
    text-decoration: underline;
  }
}

/* ── PRINT STYLES ──────────────────────────────────────────────── */
@media print {
  /* Hide interactive elements */
  nav, .ticker, .clock-bar, .btn, button, .nav-hamburger,
  .scanline, .tech-grid, .bg-carousel {
    display: none !important;
  }
  
  /* Ensure readable text */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* Expand all sections for print */
  section, .cockpit-panel, .spec-module {
    page-break-inside: avoid;
    break-inside: avoid;
    background: white !important;
    border: 1px solid #ccc !important;
  }
}

/* ── SELECTION STYLING ─────────────────────────────────────────── */
::-moz-selection {
  background: rgba(45, 184, 182, 0.3);
  color: var(--white);
}

::selection {
  background: rgba(45, 184, 182, 0.3);
  color: var(--white);
}

/* ── PLACEHOLDER STYLING ───────────────────────────────────────── */
::-webkit-input-placeholder {
  color: var(--grey);
  opacity: 0.6;
}

::-moz-placeholder {
  color: var(--grey);
  opacity: 0.6;
}

:-ms-input-placeholder {
  color: var(--grey);
  opacity: 0.6;
}

::placeholder {
  color: var(--grey);
  opacity: 0.6;
}

/* ── IMAGE RENDERING ───────────────────────────────────────────── */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* ── SMOOTH SCROLLING ─────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* Disable smooth scroll for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
