/* ─────────────────────────────────────────────────────────────────────
   AllergyKeeper — Corporate web styles
   Brand colors aligned with src/theme/colors.ts
   ───────────────────────────────────────────────────────────────────── */

:root {
  --brand: #00A676;
  --brand-600: #00A676;
  --brand-700: #047857;
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --background: #F7F7F7;
  --surface: #ffffff;
  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-muted: #9ca3af;
  --border-light: #e5e7eb;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 166, 118, 0.12);
  --shadow-xl: 0 30px 80px rgba(0, 166, 118, 0.18);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --container: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Reveal animations ───────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Nav ─────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(247, 247, 247, 0.96);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
}

.nav-brand img {
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--brand);
}

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 120px 48px 80px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 166, 118, 0.06), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--brand-100);
}

.hero-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}

.hero-accent {
  background: linear-gradient(135deg, var(--brand) 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
  white-space: nowrap;
}

.cta-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 166, 118, 0.3);
}

.cta-primary:hover {
  background: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 166, 118, 0.4);
}

.cta-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.cta-secondary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.hero-phone {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Phone frame (reusable) ─────────────────────────────────────────── */

.phone-frame {
  position: relative;
  width: 280px;
  aspect-ratio: 9 / 19;
  border-radius: 42px;
  background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
  padding: 12px;
  box-shadow: var(--shadow-xl), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.phone-frame-large {
  width: 320px;
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 28px;
  background: #000;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--background);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-screen-placeholder {
  flex-direction: column;
  gap: 12px;
  font-size: 64px;
}

.phone-screen-placeholder small {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.phone-screen-splash {
  background: #059669;
  padding: 0;
}

.splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Problem section ─────────────────────────────────────────────────── */

.problem {
  padding: 80px 0;
  text-align: center;
}

.section-title {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text-primary);
  max-width: 880px;
  margin: 0 auto 24px;
}

.section-lead {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Features section (Apple-style sticky) ──────────────────────────── */

.features {
  padding: 80px 0 120px;
}

.features .section-title,
.features .section-lead {
  text-align: center;
}

.features-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-top: 64px;
  align-items: start;
}

.features-sticky {
  position: sticky;
  top: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 540px;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 80px;
  padding: 40px 0;
}

.feature-block {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.3s ease-out;
}

.feature-block.is-active {
  opacity: 1;
}

.feature-badge {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.feature-block h3 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.feature-block p {
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

/* Phone screen slots (one visible at a time) */

#feature-screen {
  flex-direction: column;
  align-items: stretch;
  padding: 24px 20px;
  gap: 0;
}

.feature-screen-slot {
  position: absolute;
  inset: 0;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}

.feature-screen-slot.is-active {
  opacity: 1;
  pointer-events: auto;
}

.feature-mock {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.feature-mock-header {
  font-size: 56px;
  line-height: 1;
}

.feature-mock-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.feature-mock-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mock-pill {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.mock-pill-red    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.mock-pill-orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.mock-pill-yellow { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.mock-pill-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.mock-pill-green  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.feature-mock-card .feature-mock-card-body {
  background: #fee2e2;
  border: 2px solid #dc2626;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: #7f1d1d;
  font-size: 12px;
  line-height: 1.5;
  width: 100%;
}

.feature-mock-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Mobile: remove sticky, stack */
@media (max-width: 960px) {
  .features-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .features-sticky {
    position: relative;
    top: auto;
    order: -1;
    min-height: 540px;
  }
  .features-list {
    gap: 60px;
    padding: 20px 0;
  }
  .feature-block {
    min-height: auto;
    opacity: 1;
    transform: none;
  }
  .feature-block:not(:first-child) .feature-badge::after {
    content: "";
  }
}

/* ── Languages (marquee) ─────────────────────────────────────────────── */

.languages {
  padding: 80px 0 60px;
}

.languages .section-title,
.languages .section-lead {
  text-align: center;
}

.marquee {
  margin-top: 64px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: marquee 60s linear infinite;
  will-change: transform;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--border-light);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Use cases ───────────────────────────────────────────────────────── */

.use-cases {
  padding: 80px 0;
}

.use-cases .section-title {
  text-align: center;
  margin-bottom: 64px;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.case {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.case:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.case-icon {
  font-size: 56px;
  margin-bottom: 20px;
  line-height: 1;
}

.case h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.case p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── How it works ────────────────────────────────────────────────────── */

.how {
  padding: 120px 0;
  background: var(--brand-50);
}

.how .section-title {
  text-align: center;
  margin-bottom: 80px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
}

.step {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid var(--border-light);
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.step-num {
  width: 52px;
  height: 52px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0, 166, 118, 0.3);
}

.step h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── FAQ ─────────────────────────────────────────────────────────────── */

.faq {
  padding: 80px 0;
}

.faq .section-title {
  text-align: center;
  margin-bottom: 48px;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-list details {
  background: #fff;
  border-radius: var(--radius);
  padding: 0;
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.faq-list details[open] {
  box-shadow: var(--shadow);
}

.faq-list summary {
  padding: 24px 28px;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 56px;
  color: var(--text-primary);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 300;
  color: var(--brand);
  transition: transform 0.3s;
}

.faq-list details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-list details p {
  padding: 0 28px 24px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 15px;
}

/* ── Contact ─────────────────────────────────────────────────────────── */

.contact {
  padding: 80px 0;
  text-align: center;
  background: var(--brand-50);
}

.contact .section-title {
  margin-bottom: 20px;
}

.contact .section-lead {
  margin-bottom: 40px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 40px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  color: var(--text-primary);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
}

.contact-email:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: var(--brand);
}

.contact-email-icon {
  font-size: 28px;
  line-height: 1;
}

@media (max-width: 560px) {
  .contact-email {
    padding: 16px 24px;
    gap: 12px;
  }
  .contact-email-text {
    font-size: 16px;
  }
}

/* ── Download CTA ────────────────────────────────────────────────────── */

.download {
  padding: 80px 0;
  text-align: center;
  background: var(--brand);
  color: #fff;
}

.download h2 {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.download p {
  font-size: clamp(16px, 1.4vw, 20px);
  opacity: 0.95;
  max-width: 560px;
  margin: 0 auto 48px;
}

.store-badges {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #000;
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-family: inherit;
  transition: transform 0.25s var(--ease);
  min-width: 200px;
}

.store-badge:hover {
  transform: translateY(-3px);
}

.store-badge-icon {
  font-size: 28px;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.store-badge-text small {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

.store-badge-text strong {
  font-size: 18px;
  font-weight: 700;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer {
  background: #0b0f14;
  color: rgba(255, 255, 255, 0.7);
  padding: 80px 0 32px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 300px;
}

.footer-brand img {
  border-radius: 8px;
}

.footer-brand strong {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ── Hero responsive ─────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 100px 24px 60px;
    gap: 48px;
    text-align: center;
    min-height: auto;
  }
  .hero-content {
    align-items: center;
  }
  .hero-subtitle {
    text-align: center;
  }
  .hero-ctas {
    justify-content: center;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .marquee-track {
    animation: none;
  }
  .feature-block {
    opacity: 1;
    transform: none;
  }
}
