/* ============================================
   Solvaya Concept C — The Enemy Portrait
   Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Dark Mode (default) */
  --bg-primary: #0A0E17;
  --bg-surface: #141A26;
  --bg-surface-raised: #1C2333;
  --bg-card: #1A2235;
  --bg-elevated: #1E293B;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #3B82F6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --danger: #EF4444;
  --danger-dim: rgba(239, 68, 68, 0.1);
  --danger-bg: rgba(239, 68, 68, 0.08);
  --success: #10B981;
  --success-dim: rgba(16, 185, 129, 0.1);
  --border: rgba(148, 163, 184, 0.12);
  --border-light: rgba(148, 163, 184, 0.2);

  /* Typography */
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-gap: 6rem;
  --section-gap-sm: 3rem;
}

/* Light Mode overrides */
html.light {
  --bg-primary: #FFFFFF;
  --bg-surface: #F8FAFC;
  --bg-surface-raised: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --accent: #2563EB;
  --accent-glow: rgba(37, 99, 235, 0.08);
  --border: rgba(15, 23, 42, 0.08);
  --border-light: rgba(15, 23, 42, 0.15);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: white;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.display-xl {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.display-lg {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.display-md {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.display-sm {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.7;
}

.numbers {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* --- SVG Icon Base --- */
.icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2em; height: 2em; }

/* --- OTA Logo Styling --- */
.ota-logo {
  filter: grayscale(1);
  opacity: 0.5;
  transition: all 0.3s ease;
}

.ota-logo:hover {
  filter: grayscale(0.3);
  opacity: 0.8;
}

.ota-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ota-badge-warning {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

/* --- Comparison Table --- */
.compare-row {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

.compare-row:hover {
  background: var(--bg-surface-raised);
}

.compare-ota {
  color: var(--danger);
}

.compare-solvaya {
  color: var(--success);
}

/* Receipt Statement */
.receipt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0;
  position: relative;
  color: var(--text-primary);
}

.receipt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 4px,
    var(--border) 4px,
    var(--border) 8px
  );
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0.5rem 0;
}

.receipt-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

/* --- Calculator --- */
.calc-value {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.calc-value-sm {
  font-size: 1.25rem;
}

/* --- Section Dividers --- */
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

/* --- Glow Effects --- */
.glow-red {
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.08);
}

.glow-green {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.08);
}

.glow-blue {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.12);
}

/* --- Scroll Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* --- OTA Commission Sticker --- */
.commission-sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  transform: rotate(-3deg);
  line-height: 1;
  white-space: nowrap;
}

/* --- Warning Pulse (scroll) --- */
@keyframes warningPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.warning-pulse {
  animation: warningPulse 1.5s ease-out;
}

@keyframes greenGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.green-glow {
  animation: greenGlow 1.5s ease-out;
}

/* --- Timeline --- */
.timeline-bar {
  height: 0.75rem;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.timeline-bar-ota {
  background: var(--danger);
  opacity: 0.7;
}

.timeline-bar-solvaya {
  background: var(--success);
  opacity: 0.7;
}

/* --- Custom Range Slider --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

/* --- Navigation --- */
.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, white);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2rem;
}

.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* --- Dark mode toggle (custom) --- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* --- FAQ --- */
.faq-question {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer.open {
  grid-template-rows: 1fr;
}

.faq-answer > div {
  overflow: hidden;
}

/* --- Mobile Hamburger --- */
.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

.hamburger.open span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --section-gap: 3rem;
  }
}

/* --- Utility: Redacted/danger text --- */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.bg-danger-subtle { background: var(--danger-bg); }
.bg-success-subtle { background: var(--success-dim); }

/* --- Mobile nav overlay --- */
.mobile-nav-open {
  overflow: hidden;
}

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

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}
