/* Reset (Preflight-inspired) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

ol,
ul {
  list-style: none;
}

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

button {
  font: inherit;
  cursor: pointer;
}

/* Design Tokens */
:root {
  --space: 4px;

  /* Colors */
  --text: #f1f1f1;
  --text-muted: #888;
  --bg: #0a0a0a;
  --bg-elevated: #111;
  --bg-elevated-2: #1a1a1a;
  --border: #333;
  --accent: #e8501e;
  --accent-hover: #d14518;
  --green: #4ade80;
  --red: #f87171;

  /* Typography */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue",
    "Adwaita Sans", Cantarell, Ubuntu, Roboto, Noto, Helvetica, Arial, sans-serif;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 100ms ease-out;
  --transition-normal: 200ms ease-out;

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 6);
}

.main {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 32);
  padding: calc(var(--space) * 32) 0;
}

.text-center {
  text-align: center;
}

/* ==================== */
/* Scroll fade-in       */
/* ==================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 200ms; }

/* ==================== */
/* Hero entrance        */
/* ==================== */
.entrance {
  opacity: 0;
  transform: translateY(24px);
  animation: entrance-fade 0.7s ease-out forwards;
}

.entrance-1 { animation-delay: 0ms; }
.entrance-2 { animation-delay: 150ms; }
.entrance-3 { animation-delay: 300ms; }
.entrance-4 { animation-delay: 450ms; }
.entrance-5 { animation-delay: 600ms; }
.entrance-phone {
  opacity: 0;
  transform: translateX(40px);
  animation: entrance-slide 0.8s ease-out 300ms forwards;
}

@keyframes entrance-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes entrance-slide {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== */
/* Hero                 */
/* ==================== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  position: relative;
  background: var(--bg);
  padding: calc(var(--space) * 12) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: calc(var(--space) * 16);
  align-items: center;
}

.hero-text {
  max-width: 600px;
}

.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: calc(var(--space) * 6);
}

.hero-headline {
  display: block;
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-headline-accent {
  display: block;
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent);
}

.hero-tagline {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: calc(var(--space) * 5);
}

.hero-typewriter {
  font-size: var(--text-xl);
  color: var(--text-muted);
  margin-top: calc(var(--space) * 6);
  min-height: 2em;
}

.hero-typewriter #typewriter {
  color: var(--text);
}

.typewriter-cursor {
  color: var(--accent);
  animation: cursor-blink 530ms steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-ctas {
  display: flex;
  gap: calc(var(--space) * 4);
  margin-top: calc(var(--space) * 8);
}

/* ==================== */
/* Phone mockup         */
/* ==================== */
.hero-phone-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone {
  width: 280px;
  aspect-ratio: 9 / 19.5;
  background: #181818;
  border-radius: 40px;
  border: 3px solid #333;
  padding: 12px;
  position: relative;
  overflow: hidden;
  animation: phone-vibrate 0.15s ease-in-out 1s 3;
}

@keyframes phone-vibrate {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-3px) rotate(-0.5deg); }
  75% { transform: translateX(3px) rotate(0.5deg); }
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  position: relative;
}

.phone-statusbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-bottom: auto;
}

.phone-statusbar-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.phone-statusbar-icons svg {
  width: 14px;
  height: 14px;
}

.phone-caller {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: auto;
}

.phone-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-elevated-2);
  object-fit: cover;
}

.phone-caller-name {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.phone-caller-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.phone-actions {
  display: flex;
  gap: 48px;
  margin-top: auto;
  padding-bottom: 8px;
}

.phone-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: default;
  position: relative;
}

.phone-btn svg {
  position: relative;
  z-index: 1;
}

.phone-btn-decline {
  background: var(--red);
}

.phone-btn-accept {
  background: var(--green);
}

/* Accept button pulse */
.phone-btn-accept::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: call-pulse 2s ease-out infinite;
}

@keyframes call-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ==================== */
/* Hero mobile          */
/* ==================== */
@media (max-width: 768px) {
  .hero {
    padding: calc(var(--space) * 8) 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--space) * 10);
    text-align: center;
  }

  .hero-text {
    max-width: none;
  }

  .hero-logo {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-headline,
  .hero-headline-accent {
    font-size: var(--text-3xl);
  }

  .hero-ctas {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-phone-wrapper {
    order: 1;
  }

  .phone {
    width: 240px;
  }

  .entrance-phone {
    transform: translateY(24px);
    animation-name: entrance-fade;
  }
}

/* ==================== */
/* Buttons              */
/* ==================== */
.btn {
  display: inline-block;
  padding: calc(var(--space) * 3) calc(var(--space) * 8);
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-lg {
  padding: calc(var(--space) * 5) calc(var(--space) * 12);
  font-size: var(--text-xl);
  border-radius: var(--radius-lg);
}

/* ==================== */
/* Use Cases            */
/* ==================== */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--space) * 6);
}

.usecase-card {
  padding: calc(var(--space) * 8);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.usecase-trigger {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: calc(var(--space) * 3);
  line-height: 1.4;
}

.usecase-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .usecase-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== */
/* Section              */
/* ==================== */
.section-heading {
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: calc(var(--space) * 10);
}

/* ==================== */
/* Steps Timeline       */
/* ==================== */
.steps {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 8);
}

.step {
  display: flex;
  gap: calc(var(--space) * 5);
  align-items: flex-start;
  position: relative;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  height: calc(100% - 40px + calc(var(--space) * 8));
  width: 2px;
  background: var(--border);
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.step-content {
  padding-top: calc(var(--space) * 2);
}

.step-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.4;
}

.step-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: calc(var(--space) * 1);
}

/* ==================== */
/* Code block           */
/* ==================== */
.code-block {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    border-color 0.4s ease-out,
    box-shadow 0.4s ease-out;
}

.code-block.glow {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(232, 80, 30, 0.25), 0 0 48px rgba(232, 80, 30, 0.1);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--space) * 3) calc(var(--space) * 4);
  background: var(--bg-elevated-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.code-copy {
  background: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: calc(var(--space) * 1) calc(var(--space) * 3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.code-copy:hover {
  color: var(--text);
}

.code-body {
  padding: calc(var(--space) * 4);
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-muted);
}

/* ==================== */
/* Pricing              */
/* ==================== */
.pricing-card {
  max-width: 400px;
  margin: 0 auto;
  padding: calc(var(--space) * 10);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.pricing-amount {
  font-size: var(--text-4xl);
  font-weight: 700;
}

.pricing-period {
  font-size: var(--text-lg);
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-details {
  margin-top: calc(var(--space) * 6);
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 3);
  text-align: left;
}

.pricing-detail {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 3);
  color: var(--text-muted);
  font-size: var(--text-base);
}

.pricing-detail svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.pricing-fine-print {
  margin-top: calc(var(--space) * 4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pricing-cta {
  margin-top: calc(var(--space) * 8);
}

/* ==================== */
/* Final CTA            */
/* ==================== */
.final-cta {
  padding: calc(var(--space) * 20) 0;
}

.final-cta-heading {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--space) * 10);
}

.final-cta-heading span {
  display: block;
}

.final-cta-accent {
  color: var(--accent);
}

@media (max-width: 768px) {
  .final-cta-heading {
    font-size: var(--text-3xl);
  }
}

/* ==================== */
/* Footer               */
/* ==================== */
.footer {
  padding: calc(var(--space) * 12) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer a {
  color: var(--text);
  transition: color var(--transition-fast);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: calc(var(--space) * 6);
  margin-bottom: calc(var(--space) * 4);
}
