/* ============================================
   UGLIFY LANDING PAGE
   Design tokens from UGLIFY_Design_Spec.md
   ============================================ */

:root {
  /* Colors */
  --void: #0F0F0E;
  --charcoal: #1C1C1A;
  --ember: #E8963F;
  --ember-soft: #C47A30;
  --text-primary: #F5F0EB;
  --text-secondary: #A8A29E;
  --text-muted: #6B6560;
  --divider: #1C1C1A;

  /* Typography */
  --font-headline: 'JetBrains Mono', monospace;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* ============================================
   UTILITIES
   ============================================ */

.link--ember {
  color: var(--ember);
  transition: opacity 0.2s;
}
.link--ember:hover {
  opacity: 0.8;
}

.section-title {
  font-family: var(--font-headline);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.section-title--sm {
  font-size: clamp(1.1rem, 3.5vw, 1.25rem);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
  background: var(--ember);
  color: #fff;
  padding: 14px var(--space-lg);
  border-radius: var(--radius-md);
  width: 100%;
  text-align: center;
}

.btn--primary:hover {
  background: var(--ember-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(232, 150, 63, 0.25);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--lg {
  padding: 16px var(--space-xl);
  font-size: 1.05rem;
}

/* ============================================
   HEADER
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 20px;
  background: rgba(15, 15, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--charcoal);
}

.header__logo {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.header__cta {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
  background: var(--ember);
  padding: 6px 16px;
  border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}

.header__cta:hover {
  background: var(--ember-soft);
  transform: translateY(-1px);
}

/* ============================================
   S1: HERO
   ============================================ */

.hero {
  padding: var(--space-2xl) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  min-height: 100svh;
  min-height: 100vh;
  justify-content: center;
  position: relative;
}

/* Subtle radial glow behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232, 150, 63, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  max-width: 480px;
  width: 100%;
  text-align: left;
  position: relative;
  z-index: 1;
}

.hero__headline {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}

.hero__line1 {
  display: block;
  color: var(--text-primary);
}

.hero__line2 {
  display: block;
  color: var(--ember);
}

.hero__sub {
  font-size: clamp(0.95rem, 3vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-xl);
  max-width: 400px;
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__fallback {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero__device {
  position: relative;
  z-index: 1;
}

/* ============================================
   DEVICE FRAME (CSS-only iPhone mockup)
   ============================================ */

.device-frame {
  width: 220px;
  height: 440px;
  background: var(--charcoal);
  border-radius: 32px;
  border: 2px solid #2A2A28;
  padding: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0,0,0,0.5);
}

.device-frame__notch {
  width: 80px;
  height: 24px;
  background: var(--void);
  border-radius: 0 0 14px 14px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.device-frame__screen {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #0A0A09;
}

.device-frame__bar {
  width: 40%;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

/* Fake feed inside device */
.fake-feed {
  padding: 32px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fake-feed--gray {
  filter: grayscale(1);
}

.fake-feed__header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fake-feed__avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3a3a38;
}

.fake-feed__name {
  width: 50px;
  height: 8px;
  border-radius: 4px;
  background: #3a3a38;
}

.fake-feed__image {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 6px;
}

.fake-feed__image--1 {
  background: linear-gradient(135deg, #E84393, #FD79A8);
}
.fake-feed__image--2 {
  background: linear-gradient(135deg, #0984E3, #74B9FF);
}
.fake-feed__image--3 {
  background: linear-gradient(135deg, #00B894, #55EFC4);
}

.fake-feed__actions {
  display: flex;
  gap: 6px;
  padding: 2px 0;
}

.fake-feed__dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #2a2a28;
}

/* ============================================
   S2: MECHANISM
   ============================================ */

.mechanism {
  padding: var(--space-2xl) 20px;
  max-width: 480px;
  margin: 0 auto;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--charcoal);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform 0.3s ease, opacity 0.5s ease;
}

.step__screen {
  width: 72px;
  min-width: 72px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: #111110;
  border: 1px solid #2a2a28;
}

.step__screen-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__screen--dim {
  opacity: 0.25;
}

.step__screen--invert .step__screen-inner {
  filter: invert(1) hue-rotate(180deg);
}

.step__mute-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(15, 15, 14, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.mini-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px;
  width: 100%;
}

.mini-feed__bar {
  width: 100%;
  border-radius: 3px;
}

.step__text {
  flex: 1;
}

.step__label {
  font-family: var(--font-headline);
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.step__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   S3: DIFFERENTIATORS
   ============================================ */

.differentiators {
  padding: var(--space-2xl) 20px;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.diff-card {
  background: var(--charcoal);
  border-radius: var(--radius-md);
  padding: var(--space-lg) 20px;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.diff-card:hover {
  border-color: #2a2a28;
}

.diff-card--ember {
  border-color: rgba(232, 150, 63, 0.15);
}

.diff-card--ember:hover {
  border-color: rgba(232, 150, 63, 0.3);
}

.diff-card__title {
  font-family: var(--font-headline);
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.diff-card__title--ember {
  color: var(--ember);
}

.diff-card__body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================
   S4: HOW IT WORKS
   ============================================ */

.how {
  padding: var(--space-2xl) 20px;
  max-width: 480px;
  margin: 0 auto;
}

.how__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.how__step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.how__circle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--ember);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.how__text {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.how__divider {
  width: 100%;
  height: 1px;
  background: var(--charcoal);
  margin-bottom: var(--space-lg);
}

.how__note {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ============================================
   S5: SOCIAL PROOF
   ============================================ */

.proof {
  padding: var(--space-2xl) 20px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--charcoal);
  border-radius: 0;
  /* full-bleed charcoal background */
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}

.proof .section-title {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.proof__stats {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.proof__stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.proof__number {
  font-family: var(--font-headline);
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  font-weight: 700;
  color: var(--ember);
  white-space: nowrap;
}

.proof__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.proof__note {
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   S6: FINAL CTA
   ============================================ */

.final-cta {
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.final-cta__h1 {
  font-family: var(--font-headline);
  font-size: clamp(1.3rem, 5vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.final-cta__h2 {
  font-family: var(--font-headline);
  font-size: clamp(1.3rem, 5vw, 1.65rem);
  font-weight: 700;
  color: var(--ember);
  margin-bottom: var(--space-sm);
}

.final-cta .btn {
  max-width: 340px;
}

.final-cta__trust {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.final-cta__fallback {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================
   WAITLIST FORM
   ============================================ */

.waitlist {
  max-width: 380px;
  margin: 0 auto;
  padding: 0 20px var(--space-2xl);
  text-align: center;
}

.waitlist__form {
  display: flex;
  gap: var(--space-sm);
}

.waitlist__input {
  flex: 1;
  padding: 12px var(--space-md);
  background: var(--charcoal);
  border: 1px solid #2a2a28;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.waitlist__input:focus {
  border-color: var(--ember);
}

.waitlist__input::placeholder {
  color: var(--text-muted);
}

.waitlist__btn {
  padding: 12px 20px;
  background: var(--ember);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}

.waitlist__btn:hover {
  background: var(--ember-soft);
  transform: translateY(-1px);
}

.waitlist__status {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.waitlist__status--success {
  color: #7DC88E;
}

.waitlist__status--error {
  color: var(--ember);
}

/* ============================================
   S7: FOOTER
   ============================================ */

.footer {
  padding: var(--space-xl) 20px var(--space-2xl);
  max-width: 480px;
  margin: 0 auto;
}

.footer__divider {
  width: 100%;
  height: 1px;
  background: var(--charcoal);
  margin-bottom: var(--space-lg);
}

.footer__logo {
  display: block;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer__links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer__tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.steps [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.steps [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
.steps [data-reveal]:nth-child(4) { transition-delay: 0.3s; }

.differentiators [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.differentiators [data-reveal]:nth-child(3) { transition-delay: 0.2s; }

.how__steps [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.how__steps [data-reveal]:nth-child(3) { transition-delay: 0.2s; }

/* Hero entrance animation */
.hero__content {
  animation: heroFadeIn 0.8s ease both;
}

.hero__device {
  animation: heroFadeIn 1s ease 0.3s both;
}

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

/* ============================================
   DESKTOP ENHANCEMENTS (768px+)
   ============================================ */

@media (min-width: 768px) {
  .hero {
    flex-direction: row;
    padding: 80px 40px;
    gap: 60px;
    max-width: 960px;
    margin: 0 auto;
  }

  .hero__content {
    flex: 1;
  }

  .hero__headline {
    font-size: 2.5rem;
  }

  .hero__device {
    flex-shrink: 0;
  }

  .device-frame {
    width: 260px;
    height: 520px;
  }

  .mechanism,
  .differentiators,
  .how,
  .final-cta,
  .footer {
    max-width: 600px;
  }

  .proof__stats {
    max-width: 600px;
  }

  .proof .section-title,
  .proof__note {
    max-width: 600px;
  }

  .btn--primary {
    width: auto;
    min-width: 280px;
  }

  .final-cta .btn {
    max-width: none;
    width: auto;
    min-width: 320px;
  }
}

/* Large desktop */
@media (min-width: 1024px) {
  .hero {
    max-width: 1100px;
    padding: 100px 60px;
  }

  .hero__headline {
    font-size: 2.8rem;
  }

  .device-frame {
    width: 280px;
    height: 560px;
  }

  .mechanism,
  .differentiators,
  .how,
  .final-cta,
  .footer {
    max-width: 680px;
  }

  .proof__stats,
  .proof .section-title,
  .proof__note {
    max-width: 680px;
  }

  .step {
    padding: var(--space-lg);
    gap: var(--space-lg);
  }

  .step__screen {
    width: 88px;
    min-width: 88px;
    height: 148px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
