/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-muted: rgba(79, 70, 229, 0.12);

  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-hero: #f0f0ff;
  --bg-alt: #f3f4f6;

  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.06);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1100px;
}

[data-theme="dark"] {
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: #1e1b4b;
  --accent-muted: rgba(129, 140, 248, 0.12);

  --bg: #0f0f17;
  --bg-card: #18182a;
  --bg-hero: #14142a;
  --bg-alt: #1a1a2e;

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --border: #2a2a40;
  --border-strong: #3a3a58;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition-slow), color var(--transition-slow);
  line-height: 1.65;
  font-size: 16px;
}

.logo-image {
  height: 32px;
  width: auto;
  display: block;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

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

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

code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
  background: var(--accent-muted);
  color: var(--accent);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

strong { font-weight: 600; }

/* ===========================
   LAYOUT
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* ===========================
   NAVIGATION
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-slow), border-color var(--transition-slow);
  backdrop-filter: blur(8px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 400;
  white-space: nowrap;
}

.nav-logo:hover { color: var(--accent); }

.logo-icon { font-size: 1.1em; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.theme-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { transform: rotate(20deg); background: var(--accent-muted); }

.theme-icon { display: none; }

[data-theme="light"] .theme-icon--light,
[data-theme="dark"] .theme-icon--dark {
  display: inline;
}

/* ===========================
   HERO
   =========================== */
.hero {
  background: var(--bg-hero);
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  transition: background var(--transition-slow);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 20%, rgba(79,70,229,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(129,140,248,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(79,70,229,0.15);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.hero-statement {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--accent);
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  transition: background var(--transition-slow);
}

.hero-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-github {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.github-link:hover { color: var(--text); }

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  overflow: hidden;
}

.hero-wave svg {
  width: 100%;
  height: 100%;
  fill: var(--bg);
  transition: fill var(--transition-slow);
}

.desktop-break { display: none; }
@media (min-width: 640px) { .desktop-break { display: inline; } }

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(79,70,229,0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--bg-alt);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
}

/* ===========================
   SECTION LABELS & TITLES
   =========================== */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--text);
  margin-bottom: 2.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ===========================
   WHY SECTION
   =========================== */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .why-grid { grid-template-columns: repeat(3, 1fr); }
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.why-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.why-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.why-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.why-card p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===========================
   HOW IT WORKS
   =========================== */
.how-section {
  background: var(--bg-alt);
  transition: background var(--transition-slow);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}

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

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent-muted);
  line-height: 1;
  margin-bottom: 0.75rem;
  font-weight: 400;
  color: var(--accent);
  opacity: 0.4;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-connector {
  font-size: 1.5rem;
  color: var(--text-faint);
  text-align: center;
  display: none;
}

@media (min-width: 700px) {
  .step-connector { display: block; }
}

/* ===========================
   EXAMPLE SECTION
   =========================== */
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  max-width: 700px;
}

.example-scenario p {
  font-size: 0.97rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.65;
}

.example-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.example-steps {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.example-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.example-step-num {
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.example-result {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.result-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 0.85rem;
}

.result-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.93rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.result-item--highlight {
  background: var(--accent-muted);
  border: 1px solid rgba(79,70,229,0.2);
}

.result-key {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.result-val {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.timestamp {
  font-family: 'Fira Code', monospace;
  font-size: 1.1em;
  color: var(--accent);
  font-weight: 700;
}

.example-footer {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

/* ===========================
   EXAMPLE LAYOUT (side-by-side on desktop)
   =========================== */
.example-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .example-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 3rem;
  }

  .example-layout .example-card {
    flex: 1;
    max-width: none;
    margin-bottom: 0;
  }

  .example-layout .recording-container {
    flex-shrink: 0;
  }
}

/* ===========================
   PHONE / RECORDING
   =========================== */
.recording-container {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(260px, 70vw);
  background: var(--text);
  border-radius: 36px;
  padding: 8px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  transition: background var(--transition-slow);
}

.phone-screen {
  width: 100%;
  aspect-ratio: 1080 / 2340;
  border-radius: 30px;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}

.phone-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
}

.recording-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-alt);
}

.recording-placeholder-icon { font-size: 2.5rem; opacity: 0.3; }
.recording-placeholder-text { font-size: 0.75rem; color: var(--text-faint); text-align: center; font-weight: 500; }
.recording-placeholder-dim { font-size: 0.7rem; color: var(--text-faint); opacity: 0.6; font-family: monospace; }

/* ===========================
   FEATURES
   =========================== */
.features-section {
  background: var(--bg-alt);
  transition: background var(--transition-slow);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .features-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.feature-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.feature-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.feature-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ===========================
   GETTING STARTED
   =========================== */
.gs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .gs-grid { grid-template-columns: 1fr 1fr; }
}

.gs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gs-icon { font-size: 1.5rem; }

.gs-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.gs-steps {
  list-style: none;
  counter-reset: gs-counter;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.gs-steps li {
  counter-increment: gs-counter;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.gs-steps li::before {
  content: counter(gs-counter);
  background: var(--accent-muted);
  color: var(--accent);
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover { color: var(--accent-hover); }

/* ===========================
   FOOTER
   =========================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: var(--bg);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.footer-license {
  font-size: 0.8rem;
  color: var(--text-faint);
  padding: 0.2rem 0.6rem;
  background: var(--bg-alt);
  border-radius: 100px;
  border: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-link:hover { color: var(--accent); }

.footer-copy {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3.5rem 0; }
  .nav-link { display: none; }
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
  .example-card { padding: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ===========================
   ANIMATIONS
   =========================== */
@media (prefers-reduced-motion: no-preference) {
  .hero-badge,
  .hero-title,
  .hero-subtitle,
  .hero-statement,
  .hero-body,
  .hero-cta,
  .hero-github {
    animation: fadeUp 0.6s both;
  }
  .hero-title { animation-delay: 0.05s; }
  .hero-subtitle { animation-delay: 0.1s; }
  .hero-statement { animation-delay: 0.15s; }
  .hero-body { animation-delay: 0.2s; }
  .hero-cta { animation-delay: 0.25s; }
  .hero-github { animation-delay: 0.3s; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}