/* Base reset and tokens */
:root {
  --bg: #fafafa;
  --text: #0a0a0a;
  --text-muted: #666;
  --border: rgba(0,0,0,.08);
  --surface: #ffffff;
  --gradient-purple: #9333ea;
  --gradient-blue: #3b82f6;
  --gradient-cyan: #06b6d4;
  --gradient-pink: #ec4899;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12);
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body { 
  height: 100%; 
  overflow-x: hidden;
}

body {
  margin: 0;
  background: 
    radial-gradient(1400px 900px at 15% -5%, rgba(147,51,234,.15), transparent 65%),
    radial-gradient(1200px 800px at 85% -10%, rgba(6,182,212,.12), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(236,72,153,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain overlay */
#grain {
  position: fixed; 
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.04"/></svg>');
  mix-blend-mode: overlay;
  animation: grain 8s steps(10) infinite;
  z-index: 100;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-10%, 5%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 10%); }
  80% { transform: translate(-15%, 0); }
  90% { transform: translate(10%, 5%); }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero Section */
.hero { 
  position: relative; 
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.radial { 
  position: absolute; 
  filter: blur(120px); 
  opacity: .8; 
  z-index: 0; 
  pointer-events: none;
}
.radial--1 { 
  width: 700px; 
  height: 700px; 
  left: -200px; 
  top: -200px; 
  background: radial-gradient(circle at 30% 30%, rgba(147,51,234,.4), transparent 65%); 
}
.radial--2 { 
  width: 900px; 
  height: 900px; 
  right: -250px; 
  top: -300px; 
  background: radial-gradient(circle at 70% 30%, rgba(6,182,212,.35), transparent 65%); 
}

.hero__content { 
  position: relative;
  z-index: 2; 
  text-align: center; 
  max-width: 880px;
  margin: 0 auto 60px;
}

h1 {
  font-size: clamp(42px, 8vw, 96px); 
  line-height: 1.05; 
  margin: 0 0 24px; 
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: linear-gradient(135deg, var(--gradient-purple), var(--gradient-blue), var(--gradient-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle { 
  color: var(--text); 
  margin: 0 0 40px; 
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 500;
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Waitlist Form */
.waitlist { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 12px; 
  max-width: 520px; 
  margin: 0 auto;
}

@media (min-width: 640px) {
  .waitlist { 
    grid-template-columns: 1fr auto; 
  }
}

.waitlist input[type="email"] {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 16px 20px; 
  border-radius: 14px; 
  outline: none;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}

.waitlist input:focus {
  border-color: var(--gradient-purple);
  box-shadow: 0 0 0 3px rgba(147,51,234,.1), var(--shadow-sm);
}

.waitlist input::placeholder { 
  color: #aaa; 
}

.cta {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  padding: 16px 28px; 
  border-radius: 14px; 
  border: none;
  background: linear-gradient(135deg, var(--gradient-purple), var(--gradient-blue), var(--gradient-cyan));
  color: #ffffff; 
  text-decoration: none; 
  font-weight: 700; 
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  box-shadow: 0 8px 24px rgba(147,51,234,.25), 0 2px 8px rgba(59,130,246,.15);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}

.cta:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 12px 32px rgba(147,51,234,.35), 0 4px 12px rgba(59,130,246,.25);
}

.cta:active {
  transform: translateY(0);
}

.cta--large {
  padding: 20px 40px;
  font-size: 18px;
}

/* Device Mockups */
.mockup-devices {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 auto 80px;
  max-width: 1100px;
  padding: 0 12px;
}

.device {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* iPhone */
.device--iphone {
  width: 280px;
  flex-shrink: 0;
}

.device--iphone .device__frame {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
  border-radius: 42px;
  padding: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.1) inset;
  position: relative;
}

.device__notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #0a0a0a;
  border-radius: 0 0 18px 18px;
  z-index: 10;
}

.device__screen {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
}

.device__statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 8px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.time {
  margin-left: 24px;
}

.device__icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.signal, .battery {
  width: 14px;
  height: 10px;
  background: var(--text);
  border-radius: 2px;
}

.device__content {
  padding: 12px 16px;
  height: calc(100% - 40px);
  overflow: hidden;
}

.app-header {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.app-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

.pdf-preview {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.analysis-mini {
  display: grid;
  gap: 8px;
}

.risk-item {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
}

.risk--warn {
  border-color: rgba(245,158,11,.3);
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(255,255,255,1));
}

.risk--danger {
  border-color: rgba(239,68,68,.35);
  background: linear-gradient(135deg, rgba(239,68,68,.08), rgba(255,255,255,1));
}

/* iPad */
.device--ipad {
  width: 420px;
  flex-shrink: 0;
}

.device--ipad .device__frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
  border-radius: 28px;
  padding: 10px;
  box-shadow: 0 40px 100px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.1) inset;
}

.device--ipad .device__screen {
  border-radius: 20px;
}

.device__content--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100% - 40px);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pdf-section, .analysis-section {
  display: grid;
  gap: 8px;
  align-content: start;
}

.pdf-line {
  height: 8px;
  background: linear-gradient(90deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.05) 100%);
  border-radius: 4px;
  transition: all .3s;
}

.pdf-line:nth-child(1) { width: 100%; }
.pdf-line:nth-child(2) { width: 95%; }
.pdf-line:nth-child(3) { width: 100%; }
.pdf-line:nth-child(4) { width: 88%; }
.pdf-line:nth-child(5) { width: 100%; }
.pdf-line:nth-child(6) { width: 92%; }
.pdf-line:nth-child(7) { width: 100%; }
.pdf-line:nth-child(8) { width: 85%; }
.pdf-line:nth-child(9) { width: 100%; }

.pdf-line--highlight {
  height: 10px;
  animation: pulse 2s ease-in-out infinite;
}

.pdf-line--warn {
  background: linear-gradient(90deg, rgba(245,158,11,.3), rgba(245,158,11,.15));
  box-shadow: 0 0 0 1px rgba(245,158,11,.4);
}

.pdf-line--danger {
  background: linear-gradient(90deg, rgba(239,68,68,.35), rgba(239,68,68,.2));
  box-shadow: 0 0 0 1px rgba(239,68,68,.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

.analysis-badge {
  display: inline-flex;
  align-self: start;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(147,51,234,.1), rgba(59,130,246,.08));
  border: 1px solid rgba(147,51,234,.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gradient-purple);
  margin-bottom: 4px;
}

/* Features */
.features {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto 80px;
  padding: 0 12px;
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 24px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature__icon {
  font-size: 28px;
  line-height: 1;
}

.feature__text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.feature__text p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* CTA Section */
.cta-section {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 12px 40px;
}

/* Footer */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1.5px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.footer__support a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}

.footer__support a:hover {
  color: var(--text);
}

.footer__right a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}

.footer__right a:hover {
  color: var(--text);
}

/* Selection */
::selection { 
  background: rgba(147,51,234,.25); 
  color: var(--text); 
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mockup-devices {
    flex-direction: column;
    gap: 40px;
  }
  
  .device--iphone {
    width: 260px;
  }
  
  .device--ipad {
    width: 340px;
  }
  
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
