/* My Racer's Edge - Landing Page Styles
   Theme matched to the mobile app (dark navy + cyan) */

:root {
  /* App-matched palette */
  --bg:        #0B0D10;
  --bg-alt:    #141820;
  --panel:     #1A1F2B;
  --line:      rgba(255,255,255,.08);
  --text:      #E2E8F0;
  --muted:     #94A3B8;

  /* Accent colors — exactly from the app */
  --accent:    #00E5CC;  /* cyan/teal used on buttons, borders, active items */
  --accent-soft: rgba(0,229,204,.12);
  --accent-glow: rgba(0,229,204,.25);
  --red:       #EF4444;  /* secondary accent used on icons */
  --red-soft:  rgba(239,68,68,.12);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 32px;
  --space-5: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --glow:   0 0 20px var(--accent-glow);
}

* { box-sizing: border-box }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 700px at 18% 12%, rgba(0,229,204,.04), transparent 55%),
    radial-gradient(900px 600px at 82% 8%, rgba(239,68,68,.06), transparent 45%),
    radial-gradient(900px 500px at 80% 60%, rgba(0,229,204,.03), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none }
p { margin: 0 0 var(--space-3) }
h1,h2,h3 { margin: 0 0 var(--space-2); line-height: 1.15 }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px }
section { scroll-margin-top: 96px }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 10px;
  background: var(--panel); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius-sm);
  z-index: 50;
}
.skip-link:focus { left: 10px; outline: 2px solid var(--accent) }

/* ── Navigation ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11,13,16,.75);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; gap: 16px;
}
.brand {
  font-weight: 900; letter-spacing: .12em;
  text-transform: uppercase; font-size: .95rem;
}
.nav-links {
  list-style: none; display: flex; gap: 18px;
  margin: 0; padding: 0; font-weight: 600; font-size: .95rem;
}
.nav-links a {
  padding: 8px 10px; border-radius: var(--radius-sm); color: var(--muted);
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text); background: rgba(255,255,255,.04);
}
.nav-row .btn { white-space: nowrap }

@media (max-width: 720px) {
  .nav-links { display: none }
}

/* ── Layout ── */
main { flex: 1; }

.section { padding: 70px 0 }
@media (max-width: 720px) { .section { padding: 54px 0 } }

/* ── Hero ── */
.hero { padding-top: 84px }
.grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 28px; align-items: center;
}
@media (max-width: 960px) { .grid { grid-template-columns: 1fr } }
.hero-grid { align-items: start }

/* ── Typography ── */
.kicker {
  margin: 0 0 10px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .12em;
  font-weight: 800; font-size: .8rem;
}
h1 { font-size: 3rem; letter-spacing: -.02em }
@media (max-width: 540px) { h1 { font-size: 2.25rem } }
.lead { margin: 0 0 var(--space-3); color: var(--muted); font-size: 1.05rem }
.bullets { margin: 0 0 var(--space-3); padding-left: 18px; color: var(--text) }
.bullets li { margin: 6px 0 }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start }
.form-actions { display: flex; gap: var(--space-2); flex-wrap: wrap }
.input-group { width: 100% }
.form input {
  width: 100%; padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  color: var(--text); outline: none;
  font-family: inherit; font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.form input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.input-error { min-height: 18px; color: var(--red); margin: 4px 0 0; font-size: .9rem }
.status { margin: 6px 0 0; font-size: .95rem; color: var(--text) }
.fineprint { margin: 10px 0 0; color: var(--muted); font-size: .92rem }
.recaptcha-row { display: flex; flex-direction: column; gap: 6px }
.recaptcha { max-width: 304px }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 12px 14px;
  border-radius: var(--radius-md); font-weight: 800;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  font-size: .95rem; cursor: pointer;
}
.btn.solid {
  background: var(--accent); color: #0b0d10;
  border-color: var(--accent); box-shadow: var(--glow);
}
.btn.solid:hover { transform: translateY(-1px) }
.btn.ghost {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent) }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none }

/* ── Phone Mockup ── */
.phone-wrap { display: flex; justify-content: flex-end }
.phone {
  position: relative;
  width: 100%; max-width: 320px;
  margin: 0 auto;
  border-radius: 32px;
  background: linear-gradient(160deg, var(--panel), var(--bg) 50%, var(--panel) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 0 8px rgba(255,255,255,.02);
  padding: 14px;
  overflow: hidden;
}
.phone-notch {
  display: none;
}
.phone-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 22px; overflow: hidden;
}
.app-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

/* ── App Showcase ── */
.showcase { background: var(--bg-alt) }

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .showcase-grid { grid-template-columns: 1fr }
}

.showcase-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.showcase-img-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 24px 24px 0;
  background: var(--bg);
}

.showcase-img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}

.showcase-caption {
  padding: 20px 24px 24px;
}
.showcase-caption h3 { font-size: 1.1rem; margin-bottom: 6px }
.showcase-caption p { color: var(--muted); margin: 0 }

/* ── Section Header ── */
.section-header { text-align: left; margin-bottom: var(--space-4) }
.section-header h2 { font-size: 1.9rem }

/* ── Feature Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.card:hover { border-color: rgba(0,229,204,.2) }
.card h3 { margin: 0 0 6px; font-size: 1.05rem }
.card p { margin: 0; color: var(--muted) }

/* ── How It Works Steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.02);
  transition: border-color .2s;
}
.step:hover { border-color: rgba(0,229,204,.2) }
.step-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.step svg { width: 24px; height: 24px }
.step p { color: var(--muted); margin: 0 }

/* ── FAQ Accordion ── */
.accordion { display: grid; gap: 10px }
.accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.02);
  overflow: hidden;
}
.accordion-button {
  width: 100%; text-align: left;
  background: none; border: none;
  color: var(--text); font-size: 1rem;
  font-family: inherit;
  padding: 16px; display: flex;
  justify-content: space-between;
  align-items: center; gap: 10px; cursor: pointer;
}
.accordion-button::after {
  content: "+"; color: var(--accent); font-weight: 800;
}
.accordion-button[aria-expanded="true"]::after { content: "−" }
.accordion-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.accordion-panel { padding: 0 16px 16px; color: var(--muted) }

/* ── CTA Section ── */
.cta { background: var(--bg-alt); border-top: 1px solid var(--line) }
.cta-box {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  padding: 22px;
  box-shadow: var(--shadow);
}
.cta-box .form { width: 320px; max-width: 100% }

/* ── Footer ── */
.footer { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted) }
.footer-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.muted { opacity: .6 }

/* ── Utils ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Reveal Animations ── */
.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important }
  .reveal { opacity: 1; transform: none }
}

/* ── Legal Pages (Privacy, Terms) ── */
.legal-content { max-width: 780px }
.legal-content h3 {
  color: var(--accent); font-size: 1.1rem;
  margin: var(--space-4) 0 var(--space-2);
}
.legal-content h3:first-child { margin-top: 0 }
.legal-content p { color: var(--muted); line-height: 1.7 }
.legal-content strong { color: var(--text) }

.warning-box {
  border: 1px solid var(--red);
  border-radius: var(--radius-lg);
  background: var(--red-soft);
  padding: 20px;
  margin-bottom: var(--space-4);
}
.warning-box h2 {
  color: var(--red); font-size: 1.15rem; margin-bottom: var(--space-2);
}
.warning-box p { color: var(--text); margin-bottom: var(--space-2) }
.warning-box p:last-child { margin-bottom: 0 }

/* ── Ambient Glow Background ── */
.ambient-glow {
  position: absolute; top: 0; left: 0; right: 0; height: 100vh;
  overflow: hidden; z-index: -1; opacity: 0.6; pointer-events: none;
  background: radial-gradient(circle at 70% 30%, var(--accent-glow) 0%, transparent 50%),
              radial-gradient(circle at 30% 60%, rgba(239,68,68,.1) 0%, transparent 40%);
  animation: breathe 10s ease-in-out infinite alternate;
}
@keyframes breathe {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.1); opacity: 0.7; }
}

/* ── Typography Enhancements ── */
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
}

/* ── App Download Page ── */
.download-page .store-buttons {
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-start;
  margin-top: 24px; position: relative;
}
.store-btn-img {
  position: relative; display: inline-flex; flex-direction: column; align-items: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, filter 0.3s ease;
  opacity: 0.4; filter: grayscale(100%);
}
.store-btn-img.highlight {
  opacity: 1; filter: grayscale(0%);
}
.store-btn-img:hover { transform: translateY(-4px); }
.store-btn-img img { height: 56px; width: auto; }

/* Glassmorphism Badge */
.glass-badge {
  position: absolute; top: -12px; right: -12px;
  background: rgba(11, 13, 16, 0.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent); font-size: 0.65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,229,204,0.1);
  opacity: 1 !important; transform: rotate(4deg);
}

/* ── Feature Cards Grid ── */
.feature-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: linear-gradient(160deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-2px); border-color: rgba(0,229,204,.3);
  box-shadow: 0 8px 24px rgba(0,0,0,.3), 0 0 12px rgba(0,229,204,.1);
}
.feature-card h4 {
  color: var(--text); font-size: 1rem; margin-bottom: 6px; font-weight: 600;
}
.feature-card p {
  color: var(--muted); font-size: 0.85rem; margin: 0; line-height: 1.5;
}

/* ── Download Phone Mockup Extras ── */
.download-phone-mockup {
  max-width: 300px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 0 8px rgba(255,255,255,.02), 0 0 40px rgba(0,229,204,0.15);
  transform: perspective(1000px) rotateY(-8deg) rotateX(4deg) translateZ(0);
  transition: transform 0.5s ease;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}
.download-phone-mockup .app-screenshot {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  transform: translateZ(0);
}
.download-phone-mockup:hover {
  transform: perspective(1000px) rotateY(-4deg) rotateX(2deg) translateY(-8px) translateZ(0);
}
@media (max-width: 960px) {
  .download-phone-mockup { transform: none; margin: 40px auto 0; }
  .download-phone-mockup:hover { transform: translateY(-4px); }
  .download-page .store-buttons { justify-content: center; }
  .download-page .hero-grid { text-align: center; }
  .download-page .hero-grid .copy { margin: 0 auto; }
}

/* ── Interstitial ── */
.interstitial {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 24px 0; background: var(--panel); padding: 16px 24px;
  border: 1px solid var(--line); border-radius: var(--radius-md); max-width: 400px;
}
@media (max-width: 960px) { .interstitial { margin: 24px auto; } }

.spinner {
  width: 20px; height: 20px; border: 3px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── Toast Notification ── */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translate(-50%, 100px);
  background: var(--bg-alt); border: 1px solid var(--accent);
  border-radius: var(--radius-lg); padding: 16px 24px;
  box-shadow: var(--shadow), 0 0 20px var(--accent-glow);
  z-index: 100; opacity: 0; visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  pointer-events: none;
}
.toast.show {
  transform: translate(-50%, 0); opacity: 1; visibility: visible;
}
.toast-content {
  display: flex; align-items: center; gap: 16px;
}
.toast-icon { font-size: 1.5rem; }
