/* 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; /* Force dark mode - ignore browser preference */
  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;
}

/* Brand font */
@font-face {
  font-family: "MagicMedieval";
  src: url("/static/MagicMedieval.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Design Tokens */
:root {
  /* Spacing (4px base) */
  --space: 4px;

  /* Colors (dark mode default) */
  --text: #f1f1f1;
  --text-muted: #888;
  --bg: #000;
  --bg-elevated: #111;
  --bg-elevated-2: #1a1a1a;
  --border: #333;
  /* Contrast colors - inverted for emphasis */
  --contrast: #fff;
  --contrast-bg: #fff;
  --contrast-bg-hover: #e5e5e5;

  /* 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: 3rem;

  --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 - match app theme.ts timing */
  --transition-fast: 100ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 400ms 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 content area with consistent section spacing */
.main {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) * 32);
  padding: calc(var(--space) * 32) 0;
}

/* Utilities */
.text-center {
  text-align: center;
}

/* Scroll animations */
.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);
}

/* Hero specific */
.hero {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height - accounts for mobile browser chrome */
  display: flex;
  align-items: center;
  text-align: center;
  position: relative;
  background: url("/static/hero-bg.jpg") center/cover no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);
  backdrop-filter: blur(4px);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero .eyebrow {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: calc(var(--space) * 4);
}

.hero .logo {
  font-family: "MagicMedieval", Georgia, serif;
  font-size: 5rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  margin-bottom: calc(var(--space) * 6);
  line-height: 1;
}

.hero .tagline {
  font-size: var(--text-xl);
  color: var(--text);
  line-height: 1.6;
  margin-bottom: calc(var(--space) * 8);
}

.hook-text::after {
  content: "|";
  animation: blink 1s step-end infinite;
}

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

.scroll-hint {
  position: absolute;
  bottom: calc(var(--space) * 8);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  opacity: 0.5;
  animation: bounce 2s infinite;
}

.scroll-hint svg {
  width: 24px;
  height: 24px;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

@media (max-width: 768px) {
  .hero .logo {
    font-size: 3rem;
  }
  .hero .tagline {
    font-size: var(--text-lg);
  }
}

/* Features */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--space) * 8);
}

.feature {
  flex: 1 1 280px;
  max-width: 340px;
  text-align: center;
  padding: calc(var(--space) * 8);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.feature-icon {
  display: inline-flex;
  padding: calc(var(--space) * 4);
  margin-bottom: calc(var(--space) * 4);
  background: var(--bg-elevated-2);
  border-radius: 50%;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text);
}

.feature-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: calc(var(--space) * 3);
}

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

/* Big Statement */
.big-statement {
  font-size: var(--text-4xl);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .big-statement {
    font-size: var(--text-2xl);
  }
}

/* CTA */
.cta-text {
  font-size: var(--text-xl);
  color: var(--text-muted);
}

/* Section Heading */
.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;
}

/* Line from this circle to next circle */
.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(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-lg);
  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);
}

/* Split Section */
.split-section {
  max-width: var(--content-width);
  text-align: center;
}

.split-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  margin-bottom: calc(var(--space) * 4);
}

.split-text {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.7;
}

/* Big Statement Sub */
.big-statement-sub {
  font-size: var(--text-xl);
  color: var(--text-muted);
  text-align: center;
  margin-top: calc(var(--space) * 4);
}

/* Section styles */
.section-dark {
  background: var(--bg-elevated);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: calc(var(--space) * 12);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-top: calc(var(--space) * 4);
}

/* Coming Soon */
.coming-soon {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-top: calc(var(--space) * 4);
}

/* Scroll CTA (link styled as button) */
.scroll-cta {
  display: inline-block;
  margin-top: calc(var(--space) * 6);
  padding: calc(var(--space) * 3) calc(var(--space) * 6);
  background: #000;
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  transition: background var(--transition-fast);
}

.scroll-cta:hover {
  background: #222;
}

/* Waitlist Form */
.waitlist-form {
  display: flex;
  justify-content: center;
  gap: calc(var(--space) * 3);
  margin-top: calc(var(--space) * 10);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.waitlist-input {
  flex: 1;
  padding: calc(var(--space) * 3) calc(var(--space) * 4);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

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

.waitlist-input:focus {
  outline: none;
  border-color: var(--text-muted);
}

.waitlist-button {
  padding: calc(var(--space) * 3) calc(var(--space) * 6);
  background: #000;
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  transition: background var(--transition-fast);
}

.waitlist-button:hover {
  background: #222;
}

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

.waitlist-message {
  margin-top: calc(var(--space) * 2);
  font-size: var(--text-sm);
  min-height: 1.5em;
}

.waitlist-message.success {
  color: #4ade80;
}

.waitlist-message.error {
  color: #f87171;
}

/* App Store badge (for when app launches) */
.app-store-badge {
  display: inline-block;
  transition: opacity var(--transition-fast);
}

.app-store-badge:hover {
  opacity: 0.8;
}

.app-store-badge img {
  display: block;
  height: 64px;
  width: auto;
}

/* 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(--contrast);
}

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

/* Legal pages */
.legal {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: calc(var(--space) * 12) calc(var(--space) * 6);
}

.legal h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: calc(var(--space) * 2);
}

.legal h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: calc(var(--space) * 8);
  margin-bottom: calc(var(--space) * 4);
}

.legal p {
  margin-bottom: calc(var(--space) * 4);
  color: var(--text-muted);
}

.legal ul {
  margin-bottom: calc(var(--space) * 4);
  padding-left: calc(var(--space) * 6);
  list-style: disc;
}

.legal li {
  margin-bottom: calc(var(--space) * 2);
  color: var(--text-muted);
}

.legal a {
  color: var(--text);
  text-decoration: underline;
}

.legal a:hover {
  text-decoration: underline;
}
