/* =========================================================
   Roadcraft Save Editor — Landing Page Stylesheet
   Design System: "The Precision Console"
   ========================================================= */

:root {
  /* Surface hierarchy (tonal depth, no flat borders) */
  --background:              #0e0e0e;
  --surface:                 #111111;
  --surface-low:             #131313;
  --surface-high:            #1a1a1a;
  --surface-highest:         #262626;
  --surface-dim:             rgba(19, 19, 19, 0.80);

  /* Primary (amber) */
  --primary:                 #f4aa21;
  --primary-dim:             #d4940f;
  --primary-glow:            rgba(244, 170, 33, 0.15);
  --primary-glow-strong:     rgba(244, 170, 33, 0.25);
  --on-primary:              #000000;

  /* Text */
  --on-surface:              #ffffff;
  --on-surface-variant:      #adaaaa;
  --text-muted:              #666666;

  /* Misc */
  --outline-variant:         rgba(72, 72, 71, 0.20);
  --roundness-sm:            0.5rem;
  --roundness-md:            0.75rem;
  --roundness-lg:            1rem;
  --roundness-xl:            1.5rem;

  --max-width:               1600px;
  --nav-height:              72px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--on-surface-variant);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--on-surface); }

ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  margin-top: 12px;
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dim));
  color: var(--on-primary);
  border-radius: var(--roundness-md);
  box-shadow: 0 0 20px var(--primary-glow), 0 4px 16px rgba(0,0,0,0.3);
}
.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px var(--primary-glow-strong), 0 6px 24px rgba(0,0,0,0.4);
  color: var(--on-primary);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.875rem;
}

/* =========================================================
   NAVIGATION — Glassmorphism
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: var(--surface-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--outline-variant);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface);
  font-weight: 600;
  font-size: 1rem;
}
.nav-brand:hover { color: var(--on-surface); }

.nav-icon {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--on-surface); }
.nav-links .btn { color: var(--on-primary); }
.nav-links .btn:hover { color: var(--on-primary); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--on-surface);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* =========================================================
   HERO — Techy / Editorial
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 48px 0;
  overflow: hidden;
}

/* ── Background layers ── */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 170, 33, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 170, 33, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-glow--center {
  width: 900px;
  height: 900px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, rgba(244, 170, 33, 0.07) 0%, transparent 65%);
}
.hero-glow--top {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(244, 170, 33, 0.05) 0%, transparent 70%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(244, 170, 33, 0.06);
  animation: orbPulse 6s ease-in-out infinite;
}
.hero-orb--1 {
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
}
.hero-orb--2 {
  width: 900px;
  height: 900px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  animation-delay: -3s;
  border-color: rgba(244, 170, 33, 0.03);
}

@keyframes orbPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -55%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -55%) scale(1.05); }
}

/* ── Content ── */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(244, 170, 33, 0.08);
  padding: 6px 18px;
  border-radius: 100px;
}

.hero-icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 24px rgba(244, 170, 33, 0.2));
}

.hero-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.hero-headline-top {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  text-shadow: 0 0 60px rgba(244, 170, 33, 0.1);
}

.hero-headline-bottom {
  font-size: clamp(1.5rem, 3.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 4px;
}

.hero-tagline {
  max-width: 580px;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: var(--on-surface-variant);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(244, 170, 33, 0.35);
  border-radius: var(--roundness-md);
  transition: all 0.25s ease;
}
.btn-outline:hover {
  background: rgba(244, 170, 33, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.03);
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Hero feature cards ── */
.hero-cards {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  max-width: var(--max-width);
  margin-top: 56px;
  padding: 0 48px 80px;
}

.hero-card {
  background: var(--surface-low);
  padding: 32px 28px;
  border-radius: var(--roundness-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(32px);
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-card:nth-child(1) { animation-delay: 0.95s; }
.hero-card:nth-child(2) { animation-delay: 1.1s; }
.hero-card:nth-child(3) { animation-delay: 1.25s; }

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(244, 170, 33, 0.04);
}

.hero-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(244, 170, 33, 0.08);
  color: var(--primary);
  margin-bottom: 16px;
}

.hero-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.hero-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--on-surface-variant);
}

/* =========================================================
   FEATURES — Alternating rows
   ========================================================= */
.features {
  background: var(--surface-low);
  padding: 120px 0;
}

.feature-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 72px;
  align-items: center;
  margin-bottom: 120px;
}
.feature-row:last-child { margin-bottom: 0; }

.feature-row--reverse { direction: rtl; }
.feature-row--reverse > * { direction: ltr; }

.feature-image img {
  border-radius: var(--roundness-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-image img:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 40px rgba(235, 162, 22, 0.04);
}

.feature-text h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}
.feature-text h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

.feature-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--on-surface-variant);
}

/* =========================================================
   HOW IT WORKS
   ========================================================= */
.how-it-works {
  background: var(--background);
  padding: 120px 0;
}

.how-it-works .section-title {
  text-align: center;
  margin-bottom: 64px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  position: relative;
}

.step {
  background: var(--surface-low);
  padding: 32px 24px;
  border-radius: var(--roundness-lg);
  text-align: center;
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--on-primary);
  background: linear-gradient(180deg, var(--primary), var(--primary-dim));
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 0 0 20px var(--primary-glow);
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.step p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--on-surface-variant);
}

/* =========================================================
   DOWNLOAD CTA
   ========================================================= */
.download {
  position: relative;
  padding: 120px 0;
  text-align: center;
  overflow: hidden;
}

.download-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(244, 170, 33, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.download-inner {
  position: relative;
  z-index: 1;
}

.download .section-title {
  margin-bottom: 32px;
}

.download .btn {
  margin-bottom: 32px;
}

.download-specs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.download-specs li {
  position: relative;
  padding-left: 14px;
}
.download-specs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
}

/* =========================================================
   BACKUP SECTION
   ========================================================= */
.backup-section {
  background: var(--surface-low);
  padding: 120px 0;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}

.backup-feature {
  background: var(--surface-high);
  padding: 32px 28px;
  border-radius: var(--roundness-lg);
  transition: transform 0.3s ease;
}
.backup-feature:hover {
  transform: translateY(-3px);
}

.backup-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(244, 170, 33, 0.08);
  color: var(--primary);
  margin-bottom: 16px;
}

.backup-feature h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.backup-feature p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--on-surface-variant);
}

.backup-screenshot {
  max-width: 960px;
  margin: 0 auto;
}
.backup-screenshot img {
  border-radius: var(--roundness-xl);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(244, 170, 33, 0.03);
}

/* =========================================================
   DOWNLOAD sub-text
   ========================================================= */
.download-sub {
  font-size: 1.1rem;
  color: var(--on-surface-variant);
  margin-bottom: 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: #0a0a0a;
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  font-weight: 500;
}
.footer-brand img { border-radius: 4px; }

.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links a:hover { color: var(--on-surface); }

.footer-legal {
  width: 100%;
  text-align: center;
  padding-top: 24px;
}
.footer-legal p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =========================================================
   SCROLL ANIMATIONS
   ========================================================= */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.animate-on-scroll[data-direction="left"] { transform: translateX(-70px); }
.animate-on-scroll[data-direction="right"] { transform: translateX(70px); }
.animate-on-scroll[data-direction="up"] { transform: translateY(60px); }

.animate-on-scroll.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Hero staggered fade-in */
.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: heroFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }
.hero-content > *:nth-child(5) { animation-delay: 0.65s; }
.hero-content > *:nth-child(6) { animation-delay: 0.75s; }

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   RESPONSIVE — Tablet
   ========================================================= */
@media (max-width: 1024px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-row--reverse { direction: ltr; }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-cards {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px 60px;
  }

  .backup-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   RESPONSIVE — Mobile
   ========================================================= */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface-low);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    z-index: 999;
  }
  .nav-links.open {
    transform: translateY(0);
  }

  .nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    min-height: auto;
    padding: calc(var(--nav-height) + 24px) 20px 0;
  }

  .hero-headline-top {
    font-size: 2.5rem;
  }
  .hero-headline-bottom {
    font-size: 1.25rem;
  }

  .hero-cards {
    margin-top: 36px;
    padding: 0 16px 48px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  .hero-actions .btn { text-align: center; }

  .backup-section {
    padding: 80px 0;
  }

  .features,
  .how-it-works,
  .download {
    padding: 80px 0;
  }

  .section-header { margin-bottom: 48px; }
  .feature-row { margin-bottom: 64px; }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .download-specs {
    flex-direction: column;
    align-items: center;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
