/* ===================================================================
   FlashLight AI — Clap to Torch
   Design tokens: deep space background, duotone glow (cyan = AI/sound,
   amber = the torch beam itself). Sora for display, Inter for body,
   JetBrains Mono for instrumentation labels.
   =================================================================== */

:root{
  --bg:            #050810;
  --bg-elevated:   #0a0f1c;
  --surface:       #0d1526;
  --surface-2:     #101a30;
  --line:          rgba(148,178,224,0.14);
  --line-strong:   rgba(148,178,224,0.28);

  --cyan:          #2be3ff;
  --cyan-soft:     rgba(43,227,255,0.35);
  --cyan-faint:    rgba(43,227,255,0.10);
  --amber:         #ffb648;
  --amber-soft:    rgba(255,182,72,0.35);
  --amber-faint:   rgba(255,182,72,0.10);

  --text:          #eef4fb;
  --text-dim:      #93a1c0;
  --text-faint:    #5c6a8a;

  --radius-lg:     24px;
  --radius-md:     16px;
  --radius-sm:     10px;

  --font-display:  'Sora', 'Segoe UI', sans-serif;
  --font-body:     'Inter', 'Segoe UI', sans-serif;
  --font-mono:     'JetBrains Mono', 'Courier New', monospace;

  --ease:          cubic-bezier(.22,.75,.28,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p{ margin: 0; color: var(--text-dim); }

a{ color: inherit; text-decoration: none; }

img, svg{ display: block; max-width: 100%; }

::selection{ background: var(--cyan-soft); color: #04121a; }

:focus-visible{
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap{
  width: min(1180px, 92%);
  margin-inline: auto;
}

/* ---------- ambient texture ---------- */

.grain{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow-orb{
  position: fixed;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-orb--cyan{ top: -12%; right: -10%; background: radial-gradient(circle, var(--cyan) 0%, transparent 70%); animation: drift 22s ease-in-out infinite; }
.glow-orb--amber{ bottom: -18%; left: -12%; background: radial-gradient(circle, var(--amber) 0%, transparent 70%); animation: drift 26s ease-in-out infinite reverse; }

@keyframes drift{
  0%, 100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(-3%, 4%) scale(1.08); }
}

/* ---------- header ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(5, 8, 16, 0.72);
  border-bottom: 1px solid var(--line);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand em{ font-style: normal; color: var(--cyan); }

.site-nav{
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.site-nav a{ transition: color 0.2s var(--ease); position: relative; }
.site-nav a:hover{ color: var(--text); }

/* ---------- buttons ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0); }

.btn--primary{
  background: linear-gradient(135deg, var(--cyan), #7fd8ff 55%, var(--amber));
  color: #04101a;
  box-shadow: 0 10px 30px -8px var(--cyan-soft);
}
.btn--primary:hover{ box-shadow: 0 14px 38px -6px var(--cyan-soft); }
.btn-icon{ flex-shrink: 0; }
.btn-text{ display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.btn-text small{ font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; opacity: 0.75; }

.btn--outline{
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--outline:hover{ border-color: var(--cyan); background: var(--cyan-faint); }

.btn--ghost{
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover{ border-color: var(--cyan); }

.btn--small{ padding: 9px 18px; font-size: 0.85rem; }

.pulse-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 var(--amber-soft);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 var(--amber-soft); }
  70%{ box-shadow: 0 0 0 10px transparent; }
  100%{ box-shadow: 0 0 0 0 transparent; }
}

/* ---------- eyebrow / section titles ---------- */

.eyebrow{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
  background: var(--cyan-faint);
  border: 1px solid var(--cyan-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.section-title{
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  max-width: 20ch;
}
.section-sub{
  margin-top: 12px;
  max-width: 46ch;
  font-size: 1.02rem;
}

/* ---------- hero ---------- */

.hero{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
  padding: 88px 0 96px;
}

.hero-title{
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin-bottom: 22px;
}

.hero-sub{
  max-width: 46ch;
  font-size: 1.08rem;
  margin-bottom: 36px;
}

.hero-actions{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats{
  display: flex;
  gap: 36px;
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-stats dt{
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero-stats dd{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

/* ---------- 3D phone stage ---------- */

.hero-stage{
  position: relative;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
}

.stage-ring{
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.stage-ring--1{ width: 300px; height: 300px; }
.stage-ring--2{ width: 400px; height: 400px; border-color: rgba(148,178,224,0.08); }
.stage-ring--3{ width: 500px; height: 500px; border-color: rgba(148,178,224,0.05); }

.phone-3d{
  position: relative;
  width: 230px;
  height: 470px;
  transform-style: preserve-3d;
  transform: rotateY(-18deg) rotateX(6deg);
  transition: transform 0.15s var(--ease);
  animation: float 6s ease-in-out infinite;
  cursor: pointer;
}

@keyframes float{
  0%, 100%{ transform: rotateY(-18deg) rotateX(6deg) translateY(0); }
  50%{ transform: rotateY(-18deg) rotateX(6deg) translateY(-14px); }
}

.phone-body{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  background: linear-gradient(160deg, #131c31, #070b14 70%);
  border: 1px solid rgba(148,178,224,0.22);
  box-shadow:
    0 40px 80px -20px rgba(0,0,0,0.7),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
}

.phone-edge{
  position: absolute;
  inset: 0;
  border-radius: 34px;
  box-shadow: inset 0 0 40px rgba(43,227,255,0.06);
  pointer-events: none;
}

.phone-notch{
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
}

.phone-screen{
  position: absolute;
  inset: 30px 14px 14px;
  border-radius: 22px;
  background: radial-gradient(120% 90% at 50% 0%, #0f1a30, #060a13 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  overflow: hidden;
}

.screen-label{
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--text-faint);
}

.waveform{
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}
.waveform i{
  display: block;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--amber));
  height: 20%;
  animation: wave 1.1s ease-in-out infinite;
  opacity: 0.65;
}
.waveform i:nth-child(2n){ animation-delay: 0.1s; }
.waveform i:nth-child(3n){ animation-delay: 0.2s; }
.waveform i:nth-child(4n){ animation-delay: 0.3s; }
.waveform i:nth-child(5n){ animation-delay: 0.15s; }
@keyframes wave{
  0%, 100%{ height: 18%; }
  50%{ height: 85%; }
}

.lens{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a3550, #0a0f1c 70%);
  border: 1px solid rgba(148,178,224,0.3);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
  transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

.beam{
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) translateZ(-40px);
  width: 40px;
  height: 0;
  background: conic-gradient(from 180deg at 50% 0%, transparent, var(--amber-soft) 20%, var(--amber-soft) 80%, transparent);
  filter: blur(6px);
  clip-path: polygon(48% 0%, 52% 0%, 100% 100%, 0% 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease), height 0.4s var(--ease);
  pointer-events: none;
}

/* lit state, toggled via JS */
.phone-3d.is-lit .lens{
  background: radial-gradient(circle at 40% 35%, #fff7e6, var(--amber) 55%, #7a4b12 100%);
  box-shadow: 0 0 22px 6px var(--amber-soft), 0 0 60px 20px var(--amber-faint);
}
.phone-3d.is-lit .beam{
  opacity: 1;
  height: 260px;
}
.phone-3d.is-lit .stage-ring{
  animation: ringPulse 1.2s var(--ease);
}
@keyframes ringPulse{
  0%{ box-shadow: 0 0 0 0 var(--amber-soft); }
  100%{ box-shadow: 0 0 0 24px transparent; }
}

/* ---------- sequence (how it works) ---------- */

.sequence{ padding: 60px 0 40px; position: relative; z-index: 1; }

.sequence-grid{
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 20px;
}

.seq-step{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.seq-step.in-view{ opacity: 1; transform: translateY(0); }

.seq-index{
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.seq-step h3{ font-size: 1.2rem; margin-bottom: 10px; }
.seq-step p{ font-size: 0.95rem; max-width: 32ch; }

.seq-line{
  align-self: center;
  width: 100%;
  height: 1px;
  margin-top: 6px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
}

/* ---------- features ---------- */

.features{ padding: 76px 0 20px; position: relative; z-index: 1; }

.feature-grid{
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card{
  padding: 28px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  opacity: 0;
  transform: translateY(16px);
}
.feature-card.in-view{ opacity: 1; transform: translateY(0); }
.feature-card:hover{
  border-color: var(--cyan-soft);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(43,227,255,0.25);
}

.feature-icon{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-icon--cyan{ color: var(--cyan); background: var(--cyan-faint); border: 1px solid var(--cyan-soft); }
.feature-icon--amber{ color: var(--amber); background: var(--amber-faint); border: 1px solid var(--amber-soft); }

.feature-card h3{ font-size: 1.08rem; margin-bottom: 10px; }
.feature-card p{ font-size: 0.92rem; }

/* ---------- CTA band ---------- */

.cta-band{
  position: relative;
  z-index: 1;
  margin: 100px 0 0;
  padding: 64px 0;
  background: linear-gradient(180deg, transparent, var(--surface) 40%, var(--surface) 60%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-inner h2{ font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 8px; }
.cta-inner p{ font-size: 1rem; }

/* ---------- footer ---------- */

.site-footer{
  position: relative;
  z-index: 1;
  padding: 48px 0 40px;
}
.footer-inner{
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 24px;
}
.footer-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.footer-links{
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.footer-links a:hover{ color: var(--cyan); }
.footer-meta{
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: right;
}
.footer-meta p{ margin: 0 0 6px; color: var(--text-faint); }
.footer-meta a{ color: var(--text-dim); }
.footer-meta a:hover{ color: var(--cyan); }
.footer-copy{ margin-top: 10px !important; opacity: 0.7; }

/* ---------- legal page ---------- */

.legal-wrap{
  padding: 72px 0 100px;
  max-width: 760px;
}
.legal-title{
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin-bottom: 10px;
}
.legal-date{
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 40px;
  display: block;
}
.legal-body h2{
  font-size: 1.15rem;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--cyan);
}
.legal-body p{
  font-size: 1rem;
  margin-bottom: 4px;
}
.legal-body a{ color: var(--amber); border-bottom: 1px solid var(--amber-soft); }
.legal-body a:hover{ border-color: var(--amber); }

/* ---------- responsive ---------- */

@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; padding-top: 56px; }
  .hero-stage{ height: 420px; order: -1; }
  .phone-3d{ width: 180px; height: 370px; }
  .feature-grid{ grid-template-columns: repeat(2, 1fr); }
  .sequence-grid{ grid-template-columns: 1fr; gap: 28px; }
  .seq-line{ width: 1px; height: 28px; margin: 0 0 0 2px; background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 12px); }
  .footer-inner{ grid-template-columns: 1fr; gap: 28px; }
  .footer-meta{ text-align: left; }
}

@media (max-width: 640px){
  .site-nav{ display: none; }
  .header-inner{ justify-content: space-between; }
  .hero-actions{ flex-direction: column; align-items: stretch; }
  .hero-actions .btn{ width: 100%; }
  .hero-stats{ flex-wrap: wrap; row-gap: 16px; }
  .feature-grid{ grid-template-columns: 1fr; }
  .cta-inner{ flex-direction: column; align-items: flex-start; }
  .cta-inner .btn{ width: 100%; }
  .glow-orb{ width: 80vw; height: 80vw; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
