/* ============================================================
   Ohmie — Learn Real Electronics
   Brand tokens sourced from OhmicDuolingoApp/ContentView.swift
   Structure mirrors calai.app landing page
   ============================================================ */

:root {
  /* palette */
  --cream: #FBF8EE;
  --electric: #2EA8E6;
  --electric-dk: #1B86BD;
  --amber: #FFB020;
  --amber-dk: #D68F0A;
  --heart: #FF4B4B;
  --flame: #FF9600;
  --leaf: #58CC02;
  --leaf-dk: #46A302;
  --ink: #3C3C3C;
  --ink-mid: #777777;
  --lock: #C9C4B8;
  --stroke: #E8E2D2;
  --gold: #FFD84D;
  --gold-outline: #CB9A06;
  --purple: #7E3FF2;
  --purple-dk: #5A2DB5;

  /* spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-24: 6rem;
  --s-32: 8rem;

  /* radii */
  --r-card: 16px;
  --r-big: 30px;

  --shadow-card: 0 1px 20px rgba(220, 214, 194, 0.5);
  --content-w: 72rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(to bottom, #FFFFFF, #FBF8EE 30%, #F0F8FF 65%, #FBF8EE);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 800; }

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
}

.section-sub {
  text-align: center;
  color: var(--ink-mid);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.185rem);
  max-width: 38rem;
  margin: var(--s-3) auto 0;
}

section { padding: var(--s-16) var(--s-6); }

/* ============ store badge (official Apple badge SVG) ============ */
.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.store-badge img { width: 128px; height: auto; display: block; }
.store-badge-lg img { width: 168px; }
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60, 60, 60, 0.25); }

/* ============ chunky brand button ============ */
.btn-chunky {
  display: block;
  width: 100%;
  padding: var(--s-4) var(--s-6);
  background: var(--leaf);
  color: #fff;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--leaf-dk);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}
.btn-chunky:hover { filter: brightness(1.05); }
.btn-chunky:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-dk); }

/* ============ 1. sticky header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 238, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(232, 226, 210, 0.6);
}
.header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: var(--s-3) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 36px; height: auto; }
.brand-word { font-size: 1.375rem; font-weight: 900; letter-spacing: -0.01em; }
.site-nav { display: none; gap: var(--s-8); }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.75;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { opacity: 1; color: var(--electric); }
.header-cta .store-badge img { width: 108px; }

@media (min-width: 48rem) {
  .site-nav { display: flex; }
  .header-cta .store-badge img { width: 120px; }
}

/* ============ 2. hero ============ */
.hero { padding-top: var(--s-12); padding-bottom: var(--s-16); overflow: hidden; /* clip the rotated back phone's corner bleed */ }
.hero-grid {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  align-items: center;
}
.proof-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: #fff;
  border: 2px solid var(--stroke);
  border-radius: 999px;
  padding: var(--s-2) var(--s-4);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--s-6);
}
.pill-avatar { width: 26px; height: auto; }
.hero-copy h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.25rem);
  letter-spacing: -0.02em;
}
.h1-bold { display: block; font-weight: 900; }
.h1-light { display: block; font-weight: 700; color: var(--ink); opacity: 0.9; margin-top: var(--s-1); }
.hero-sub {
  color: var(--ink);
  opacity: 0.6;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.185rem);
  max-width: 34rem;
  margin: var(--s-6) 0 var(--s-8);
}
.hero-cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); }
.fine-print { margin: 0; font-size: 0.815rem; color: var(--ink-mid); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.phone {
  background: #26221a;
  border-radius: 44px;
  padding: 10px;
  box-shadow: 0 24px 48px rgba(60, 60, 60, 0.22);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 34px; }
.phone-hero { position: relative; z-index: 1; width: min(310px, 76vw); }
/* second, smaller phone tucked behind the hero phone (calai-style composite) */
.phone-hero-back {
  position: absolute;
  top: 6%;
  right: max(calc(50% - 290px), -16px);
  z-index: 0;
  width: min(236px, 56vw);
  padding: 8px;
  border-radius: 38px;
  transform: rotate(8deg);
  box-shadow: 0 18px 36px rgba(60, 60, 60, 0.16);
}
.phone-hero-back img { border-radius: 30px; }
.hero-mascot {
  z-index: 2;
  position: absolute;
  width: clamp(84px, 18vw, 132px);
  bottom: -18px;
  right: max(calc(50% - 260px), -8px);
  filter: drop-shadow(0 10px 16px rgba(203, 154, 6, 0.35));
  animation: bob 3.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot { animation: none; }
}

@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; }
  .hero-mascot { right: -12px; }
}

/* ============ 3. product proof "reels" ============ */
.reels { padding-top: var(--s-24); }
.reel-grid {
  max-width: 80rem;
  margin: var(--s-12) auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}
.reel-card {
  position: relative;
  display: block;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(60, 60, 60, 0.14);
  text-decoration: none;
  color: #fff;
  background: var(--cream);
  border: 2px solid var(--stroke);
}
.reel-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}
.reel-card:hover > img { transform: scale(1.05); }
.reel-caption {
  position: absolute;
  left: var(--s-3);
  right: var(--s-3);
  bottom: var(--s-3);
  padding: var(--s-4);
  border-radius: 18px;
  background: rgba(30, 26, 20, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(207, 207, 207, 0.45);
}
.reel-quote {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 0.5;
  color: var(--gold);
}
.reel-caption h3 { font-size: 1.125rem; margin: var(--s-2) 0 var(--s-1); }
.reel-caption p { margin: 0; font-size: 0.875rem; font-weight: 600; opacity: 0.92; }

/* mobile: shorter cards so the grid doesn't scroll forever */
@media (max-width: 47.9375rem) {
  .reel-card > img { aspect-ratio: 3 / 4; object-position: top; }
}

@media (min-width: 48rem) {
  .reel-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-8);
    align-items: start;
  }
  /* staggered offsets + varied heights for a masonry feel */
  .reel-card:nth-child(3n + 2) { margin-top: var(--s-12); }
  .reel-card:nth-child(3n) { margin-top: var(--s-6); }
  .reel-card:nth-child(n + 4) > img { aspect-ratio: 3 / 4; }
}

/* ============ 4. feature slider ============ */
.features { padding-top: var(--s-24); }
.feature-grid {
  max-width: var(--content-w);
  margin: var(--s-12) auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  align-items: center;
}
.feature-phone-col { display: flex; flex-direction: column; align-items: center; gap: var(--s-6); }
/* staged frames 2026-07-04: bezel, shadow, and backdrop are baked into the
   images, so no CSS chrome — just a rounded card that crossfades */
.phone-slider {
  position: relative;
  width: min(420px, 86vw);
  aspect-ratio: 620 / 806;
}
.phone-slider .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.phone-slider .slide.is-active { opacity: 1; }
.slider-dots { display: flex; gap: 0; }
/* 44px hit area, 10px visible dot (background clipped to content box) */
.dot {
  width: 44px;
  height: 44px;
  padding: 17px;
  border: none;
  border-radius: 50%;
  background-color: var(--lock);
  background-clip: content-box; /* shorthand `background:` would reset this */
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.dot.is-active { background-color: var(--electric); transform: scale(1.25); }

.feature-cards { display: flex; flex-direction: column; gap: var(--s-4); }
.feature-card {
  text-align: left;
  font-family: inherit;
  background: #fff;
  border: 2px solid var(--stroke);
  border-radius: var(--r-card);
  padding: var(--s-4) var(--s-6);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.feature-card h3 { font-size: 1.125rem; color: var(--ink); }
.feature-card p { margin: var(--s-2) 0 0; font-size: 0.9rem; color: var(--ink-mid); }
.feature-card.is-active {
  transform: scale(1.03);
  border-color: var(--electric);
  background: #F2FAFF;
}
.feature-card:hover { border-color: var(--electric); }

@media (min-width: 60rem) {
  .feature-grid { grid-template-columns: 1fr 1.2fr; }
}

/* ============ 5. benefits ============ */
.benefits { padding-top: var(--s-24); }
.benefit-grid {
  max-width: var(--content-w);
  margin: var(--s-12) auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}
.benefit-card {
  background: #fff;
  border: 2px solid var(--stroke);
  border-radius: var(--r-big);
  padding: var(--s-8);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.benefit-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(220, 214, 194, 0.8); }
.benefit-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--cream);
  border: 2px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-6);
}
.benefit-icon svg { width: 34px; height: 34px; }
.benefit-card h3 { font-size: 1.25rem; }
.benefit-card p { font-size: 0.9rem; color: var(--ink-mid); margin: var(--s-3) 0 0; }

@media (min-width: 48rem) {
  .benefit-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ 6. spotlight ============ */
.spotlight { padding-top: var(--s-32); padding-bottom: var(--s-32); }
.spotlight-grid {
  max-width: var(--content-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  align-items: center;
}
.eyebrow {
  color: var(--heart);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.815rem;
  margin: 0 0 var(--s-3);
}
.spotlight-copy h2 { text-align: left; }
.spotlight-line { color: var(--ink-mid); font-size: 1.06rem; margin: var(--s-4) 0 0; }
.spotlight-visual { display: flex; justify-content: center; }
.phone-tilt {
  width: min(280px, 70vw);
  transform: rotate(-3deg);
  box-shadow: 0 32px 64px rgba(60, 60, 60, 0.28);
  transition: transform 0.3s ease;
}
.phone-tilt:hover { transform: rotate(-1deg) scale(1.02); }

@media (min-width: 60rem) {
  .spotlight { padding-block: 14rem; } /* calai-style luxury whitespace */
  .spotlight-grid { grid-template-columns: 1.1fr 1fr; }
  .phone-tilt { transform: rotate(-3deg) scale(1.1); }
  .phone-tilt:hover { transform: rotate(-1deg) scale(1.12); }
}

/* ============ 7. dark section ============ */
.dark-section {
  background: linear-gradient(160deg, var(--purple), var(--purple-dk));
  color: #fff;
  padding-top: var(--s-24);
  padding-bottom: var(--s-24);
}
.dark-section h2 { color: #fff; }
.dark-grid {
  max-width: 80rem;
  margin: var(--s-12) auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-6);
}
.dark-card {
  width: 20rem;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: var(--s-6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease;
}
.dark-card:hover { transform: scale(1.05); }
.dark-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--s-4);
}
.dark-avatar-img img { width: 34px; height: auto; }
.dark-card h3 { font-size: 1.185rem; }
.dark-card p { margin: var(--s-2) 0 0; font-size: 0.9rem; opacity: 0.8; }
.dark-card-flip {
  background: rgba(255, 216, 77, 0.12);
  border: 2px solid var(--gold);
}

/* ============ 8. final CTA ============ */
.final-cta {
  text-align: center;
  padding-top: var(--s-24);
  padding-bottom: var(--s-24);
  /* full-bleed crescendo band: cream fading into a soft electric tint */
  background: linear-gradient(
    180deg,
    rgba(46, 168, 230, 0) 0%,
    rgba(46, 168, 230, 0.08) 55%,
    rgba(46, 168, 230, 0.03) 100%
  );
}
.final-mascot { width: 110px; margin-bottom: var(--s-6); }
.final-cta-buttons {
  align-items: center;
  margin-top: var(--s-8);
}
.stars { color: var(--amber); font-size: 1.5rem; letter-spacing: 0.2em; margin-bottom: var(--s-4); }
.rating-row { display: flex; justify-content: center; gap: var(--s-8); font-weight: 800; margin-top: var(--s-4); }

/* ============ 9. trial modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  background: rgba(30, 26, 20, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.is-open { opacity: 1; }
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  background: var(--cream);
  border: 2px solid var(--stroke);
  border-radius: var(--r-big);
  padding: var(--s-8);
  text-align: center;
  transform: scale(0.8) translateY(24px);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.is-open .modal-card { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-4);
  background: none;
  border: none;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-mid);
  cursor: pointer;
  padding: var(--s-1);
}
.modal-close:hover { color: var(--ink); }
.modal-mascot { width: 92px; margin-bottom: var(--s-3); }
.modal-card h2 { font-size: 1.375rem; font-weight: 900; letter-spacing: 0.01em; }
.modal-sub { color: var(--ink-mid); font-size: 0.9rem; margin: var(--s-4) 0 var(--s-6); }
.modal-fine { font-size: 0.75rem; color: var(--ink-mid); margin: var(--s-4) 0 0; }

/* ============ 10. footer ============ */
.site-footer {
  background: #fff;
  border-top: 2px solid var(--stroke);
  padding: var(--s-16) var(--s-6) var(--s-8);
}
.footer-grid {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
}
.footer-brand .brand { margin-bottom: var(--s-4); }
.footer-label { font-size: 0.815rem; color: var(--ink-mid); margin: var(--s-4) 0 var(--s-2); }
.footer-col h3 { font-size: 1rem; margin-bottom: var(--s-4); }
.footer-col a {
  display: block;
  color: var(--ink-mid);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: var(--s-3);
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--electric); }
.footer-copyright {
  max-width: 80rem;
  margin: var(--s-12) auto 0;
  font-size: 0.815rem;
  color: var(--ink-mid);
}

@media (min-width: 48rem) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ============ privacy page ============ */
.legal-page {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--s-12) var(--s-6) var(--s-24);
}
.legal-page h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); margin-bottom: var(--s-2); }
.legal-page h2 { text-align: left; font-size: 1.375rem; margin-top: var(--s-12); }
.legal-page p, .legal-page li { color: var(--ink); opacity: 0.85; font-size: 1rem; }
.legal-page ul { padding-left: 1.25rem; }
.legal-page a { color: var(--electric); font-weight: 700; }
.legal-updated { color: var(--ink-mid); font-size: 0.9rem; }

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- screenshots paused (2026-07-04): mascot-led layout until staged renders / sim-loop videos exist ---- */
[hidden] { display: none !important; }
.hero-mascot-solo {
  width: min(340px, 68vw);
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(46, 168, 230, 0.28)) drop-shadow(0 10px 16px rgba(203, 154, 6, 0.3));
  animation: bob 3.6s ease-in-out infinite;
}
.spotlight-mascot {
  width: min(220px, 50vw);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 12px 24px rgba(203, 154, 6, 0.3));
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot-solo { animation: none; }
}
@media (min-width: 60rem) {
  /* feature-grid two-col restored 2026-07-04 — phone slider back in "What does Ohmie include?" */
  .spotlight-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .spotlight-copy { max-width: 40rem; }
}

/* ---- live Lottie hero mascot (2026-07-05): the app's real idle animation on the web ---- */
.hero-mascot-lottie {
  width: min(340px, 68vw);
  aspect-ratio: 220 / 266; /* lottie canvas ratio */
  cursor: pointer;
  filter: drop-shadow(0 24px 48px rgba(46, 168, 230, 0.28)) drop-shadow(0 10px 16px rgba(203, 154, 6, 0.3));
}
.hero-mascot-lottie svg { display: block; }
