/* =====================================================================
   Mira — Marketing site stylesheet.
   Dark-first. Tokens mirror docs-internal/DESIGN_SYSTEM.md (sourced from the
   canonical iOS AppTheme in ios/.../Design/Theme.swift).
   ===================================================================== */

:root {
  /* Core surfaces */
  --background: #091314;
  --background-alt: #0F1D1F;
  --surface: #102022;
  --surface-elevated: #172C2E;

  /* Brand + accents (dark renderings) */
  --brand: #128C8C;           /* brand identity teal (logo on light) */
  --accent: #5FCFCF;          /* brand teal rendered on dark */
  --accent-blue: #8BE7E7;
  --accent-green: #8CB1B1;
  --accent-purple: #90A3AD;
  --accent-orange: #E2A07B;

  /* Text + dividers */
  --text-primary: #E8F3F1;
  --text-secondary: #8FAEAC;
  --divider: #2C4747;

  /* Semantic status */
  --error: #BA1A1A;

  /* Radii */
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Layout */
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--background);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(170deg, var(--background) 0%, var(--background-alt) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-blue);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.25rem; }

/* Pacifico is reserved for the "mira" wordmark ONLY. Never used for
   headings, body, or decorative text elsewhere. */
.wordmark {
  font-family: 'Pacifico', 'Plus Jakarta Sans', cursive;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.section-label {
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ===== Layout ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(9, 19, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(95, 207, 207, 0.08);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-logo span {
  font-family: 'Pacifico', 'Plus Jakarta Sans', cursive;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  color: var(--background) !important;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(95, 207, 207, 0.28);
  color: var(--background) !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 6px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

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

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(95, 207, 207, 0.07) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5%, 5%); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-icon {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px rgba(95, 207, 207, 0.18);
}

/* The hero wordmark — Pacifico, accent color. */
.hero-brand {
  font-family: 'Pacifico', 'Plus Jakarta Sans', cursive;
  font-size: 5rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.hero-meaning {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  max-width: 700px;
  margin: 0 auto 1rem;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  color: var(--background);
  padding: 16px 36px;
  border-radius: var(--radius-full);
  font-size: 1.05rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(95, 207, 207, 0.3);
  color: var(--background);
}

/* ===== What Is Mira ===== */
.about-text {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: 32px 24px;
  background: rgba(16, 32, 34, 0.6);
  border: 1px solid rgba(95, 207, 207, 0.12);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(95, 207, 207, 0.18), rgba(139, 231, 231, 0.15));
  border-radius: 12px;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== How It Works ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(16.67% + 20px);
  right: calc(16.67% + 20px);
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue), var(--accent-purple));
  opacity: 0.3;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.step:nth-child(1) .step-number {
  background: linear-gradient(135deg, rgba(95, 207, 207, 0.22), rgba(95, 207, 207, 0.06));
  border: 2px solid rgba(95, 207, 207, 0.4);
  color: var(--accent);
}

.step:nth-child(2) .step-number {
  background: linear-gradient(135deg, rgba(139, 231, 231, 0.22), rgba(139, 231, 231, 0.06));
  border: 2px solid rgba(139, 231, 231, 0.4);
  color: var(--accent-blue);
}

.step:nth-child(3) .step-number {
  background: linear-gradient(135deg, rgba(144, 163, 173, 0.22), rgba(144, 163, 173, 0.06));
  border: 2px solid rgba(144, 163, 173, 0.4);
  color: var(--accent-purple);
}

.step-icon {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step h3 {
  margin-bottom: 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== Feature Cards (shared) ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: rgba(16, 32, 34, 0.5);
  border: 1px solid rgba(95, 207, 207, 0.1);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(95, 207, 207, 0.24);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-icon.cyan  { background: rgba(95, 207, 207, 0.18); }
.feature-icon.cyan svg  { stroke: var(--accent); }
.feature-icon.blue  { background: rgba(139, 231, 231, 0.18); }
.feature-icon.blue svg  { stroke: var(--accent-blue); }
.feature-icon.green { background: rgba(140, 177, 177, 0.18); }
.feature-icon.green svg { stroke: var(--accent-green); }
.feature-icon.purple { background: rgba(144, 163, 173, 0.18); }
.feature-icon.purple svg { stroke: var(--accent-purple); }

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Safety Section ===== */
.safety-layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.safety-layer {
  text-align: center;
  padding: 32px 20px;
  background: rgba(16, 32, 34, 0.5);
  border: 1px solid rgba(95, 207, 207, 0.1);
  border-radius: var(--radius);
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.safety-layer-number {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--background);
}

.safety-layer-icon {
  width: 48px;
  height: 48px;
  margin: 8px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.safety-layer-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safety-layer h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.safety-layer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.safety-callouts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.safety-callout {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: rgba(16, 32, 34, 0.6);
  border: 1px solid rgba(95, 207, 207, 0.12);
  border-radius: var(--radius);
}

.callout-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(95, 207, 207, 0.18), rgba(139, 231, 231, 0.15));
  border-radius: 12px;
}

.callout-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.callout-text h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.callout-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
  padding: 48px 0;
  border-top: 1px solid rgba(95, 207, 207, 0.1);
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-logo span {
  font-family: 'Pacifico', 'Plus Jakarta Sans', cursive;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.footer-contact {
  margin-bottom: 16px;
}

.footer-contact a {
  font-size: 0.9rem;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Above-the-fold items get flipped visible synchronously on load — skip
   the 600ms transition so there's no flash of invisible content. */
.fade-in.instant-reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* Honor the user's motion preference. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ===== Responsive: Tablet (768px) ===== */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  section { padding: 72px 0; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 19, 20, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: block;
  }

  .hero-brand { font-size: 4rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero-icon { width: 110px; height: 110px; border-radius: var(--radius-lg); }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps::before { display: none; }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .safety-layers {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .safety-callouts {
    grid-template-columns: 1fr;
  }
}

/* ===== Responsive: Desktop (1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .safety-layers {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Utility ===== */
.text-center { text-align: center; }
