/* ==========================================================
   Primer Landing Page — Copper & Sand Design System
   ========================================================== */

/* --- Custom Properties (from DesignSystem.swift) --- */
:root {
  /* Backgrounds */
  --bg:              #0A0908;
  --surface:         #141210;
  --surface-elevated:#1E1B18;

  /* Text */
  --text-primary:    #F5F2EF;
  --text-secondary:  #A89F94;
  --text-tertiary:   #6B6560;

  /* Copper accents */
  --accent:          #C9956C;
  --accent-light:    #DEB08A;
  --accent-dark:     #8B6B4F;
  --accent-muted:    rgba(201,149,108,0.12);

  /* States */
  --success:         #7DAF7D;
  --warning:         #D4A56A;
  --error:           #C97B6C;

  /* Borders */
  --border:          rgba(255,255,255,0.08);
  --border-subtle:   rgba(255,255,255,0.04);
  --glass-border:    rgba(255,255,255,0.12);

  /* Gradient anchors */
  --grad-top:        #1A1614;
  --grad-mid:        #2D2520;
  --grad-bottom:     #1F1A16;
  --grad-accent:     #3D2E24;

  /* Spacing (from PrimerSpacing) */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 72px;
  --sp-huge:120px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

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

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

img, canvas { display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* --- Sections --- */
.section {
  padding: var(--sp-huge) 0;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ambient-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.ambient-orb--1 {
  width: 60vw;
  height: 60vw;
  top: -20%;
  left: -15%;
  background: radial-gradient(circle, rgba(139,107,79,0.18) 0%, transparent 70%);
  animation: drift1 14s ease-in-out infinite alternate;
}

.ambient-orb--2 {
  width: 45vw;
  height: 45vw;
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(201,149,108,0.10) 0%, transparent 70%);
  animation: drift2 12s ease-in-out infinite alternate;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(30px, 20px); }
}

@keyframes drift2 {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-20px, -25px); }
}

.hero-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* sized by JS */
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-lg);
}

.wordmark-sm {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

.hero-headline {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
}

.hero-subhead {
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.7;
}

/* CTA Button (CopperButtonStyle port) */
.cta-button {
  display: inline-block;
  padding: 14px var(--sp-xl);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, box-shadow 0.3s ease;
  /* Inner highlight gradient matching CopperButtonStyle */
  background-image: linear-gradient(to bottom, rgba(255,255,255,0.10) 0%, transparent 50%);
  background-color: var(--accent);
}

.cta-button:hover {
  box-shadow: 0 0 32px rgba(201,149,108,0.35);
  transform: scale(1.02);
}

.cta-button:active {
  opacity: 0.9;
  transform: scale(0.98);
}

/* --- System Requirement --- */
.system-req {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: var(--sp-sm);
  letter-spacing: 0.02em;
}

/* --- Scroll Hint --- */
.scroll-hint {
  position: absolute;
  bottom: var(--sp-xl);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  opacity: 0.5;
  animation: scrollBounce 2s ease-in-out infinite;
}

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

/* --- App Preview --- */
.app-preview {
  text-align: center;
}

.preview-window {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
}

.preview-titlebar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.3;
}

.preview-body {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- PROBLEM / SOLUTION / SCIENCE / DEFOCUS / COMPOUND --- */
.problem,
.solution,
.science,
.defocus,
.compound {
  text-align: center;
}

.section-heading {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--sp-xl);
  color: var(--text-primary);
}

.section-body {
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--sp-lg);
  line-height: 1.7;
}

.section-subheading {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2xl);
  text-align: center;
}

.section-body--emphasis {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- SCIENCE LIST --- */
.science-list {
  list-style: none;
  counter-reset: science;
  max-width: 480px;
  margin: 0 auto var(--sp-xl);
  text-align: left;
}

.science-list li {
  counter-increment: science;
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-secondary);
  line-height: 1.7;
  padding: var(--sp-sm) 0;
  padding-left: var(--sp-xl);
  position: relative;
}

.science-list li::before {
  content: counter(science) ".";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}

/* --- BENEFITS GRID --- */
.benefits {
  text-align: center;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
  text-align: left;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  transition: border-color 0.3s ease;
}

.benefit-card:hover {
  border-color: rgba(201,149,108,0.2);
}

.benefit-title {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: var(--sp-sm);
  color: var(--text-primary);
}

.benefit-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- STEPS NOTE --- */
.steps-note {
  margin-top: var(--sp-2xl);
  font-style: italic;
  color: var(--text-tertiary);
}

/* --- EXERCISE DEMOS --- */
.exercises {
  text-align: center;
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
}

.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.exercise-card:hover {
  border-color: rgba(201,149,108,0.25);
  box-shadow: 0 4px 32px rgba(201,149,108,0.08);
}

.exercise-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}

.exercise-canvas {
  width: 100%;
  height: 100%;
}

.exercise-title {
  font-size: 18px;
  font-weight: 500;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-sm);
  color: var(--text-primary);
}

.exercise-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 0 var(--sp-lg) var(--sp-lg);
  line-height: 1.6;
}

/* --- FEATURE GRID --- */
.features {
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
  text-align: left;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  transition: border-color 0.3s ease;
}

.feature-card:hover {
  border-color: rgba(201,149,108,0.2);
}

.feature-icon {
  color: var(--accent);
  margin-bottom: var(--sp-md);
}

.feature-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: var(--sp-sm);
  color: var(--text-primary);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- HOW IT WORKS --- */
.how-it-works {
  text-align: center;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: var(--sp-xl);
}

.step {
  flex: 1;
  max-width: 220px;
  text-align: center;
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 300;
  color: var(--accent);
  margin: 0 auto var(--sp-md);
}

.step-title {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: var(--sp-sm);
  color: var(--text-primary);
}

.step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-connector {
  width: 48px;
  height: 1px;
  background: var(--border);
  margin-top: 22px;
  flex-shrink: 0;
}

/* --- QUOTE --- */
.quote-section {
  text-align: center;
  padding: var(--sp-huge) 0;
}

.pull-quote p {
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- FOOTER CTA --- */
.footer-cta {
  text-align: center;
  padding-bottom: var(--sp-3xl);
}

.footer-cta .cta-button {
  margin-top: var(--sp-md);
}

.footer-subtext {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: var(--sp-lg);
}

/* --- FOOTER --- */
.footer {
  text-align: center;
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border-subtle);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ==========================================================
   Scroll Reveal
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   Reduced Motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .ambient-orb { animation: none !important; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-canvas,
  .exercise-canvas {
    /* JS also checks this; CSS hides as fallback */
  }
  html { scroll-behavior: auto; }
}

/* ==========================================================
   Responsive — Tablet (640–1023px)
   ========================================================== */
@media (max-width: 1023px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .exercise-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .steps {
    flex-wrap: wrap;
    gap: var(--sp-lg);
  }

  .step-connector {
    display: none;
  }

  .step {
    flex: 0 0 calc(50% - var(--sp-md));
  }
}

/* ==========================================================
   Responsive — Mobile (<640px)
   ========================================================== */
@media (max-width: 639px) {
  .section {
    padding: var(--sp-3xl) 0;
  }

  .hero {
    min-height: 90vh;
  }

  .hero-headline {
    font-size: 32px;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }

  .step {
    flex: none;
    width: 100%;
    max-width: 280px;
  }

  .step-connector {
    display: none;
  }
}
