/* ============================================================
   1 DREAM — Promotional Website
   Design tokens matched to DesignTokens.swift
   ============================================================ */

:root {
  /* Colors — app palette */
  --bg:               #080808;
  --surface:          #0A0A0A;
  --surface-raised:   #101010;

  --text-primary:     #FFFFFF;
  --text-secondary:   #BBBBBB;
  --text-tertiary:    #A8A8A8;
  --text-subtle:      #5D5D5D;
  --text-disabled:    #4B4B4B;
  --text-faint:       #383838;

  --border-subtle:    rgba(255,255,255,0.06);
  --border-default:   rgba(255,255,255,0.12);
  --border-strong:    rgba(255,255,255,0.18);
  --border-active:    rgba(255,255,255,0.30);

  --resonance:        rgba(160,200,255,0.85);
  --resonance-dim:    rgba(160,200,255,0.30);
  --feeling:          rgba(214,140,117,0.90);
  --feeling-dim:      rgba(214,140,117,0.30);

  /* Layout */
  --page-x:     clamp(24px, 6vw, 88px);
  --max-w:      1100px;
  --section-y:  clamp(80px, 12vw, 160px);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; }
button { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-x);
}

/* ── Typography ─────────────────────────────────────────────── */
h1 {
  font-size: clamp(38px, 6.5vw, 76px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
h2 {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}
p {
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--text-secondary);
  line-height: 1.75;
}
.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 14px;
}
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-subtle);
  margin-bottom: 48px;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 18px 0;
  background: rgba(8,8,8,0.80);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 0.5px solid var(--border-subtle);
  transition: border-color 0.3s;
}
.nav--scrolled { border-bottom-color: var(--border-default); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  user-select: none;
}
.nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 16px;
  border: 0.5px solid var(--border-default);
  border-radius: 100px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-cta:hover { color: var(--text-primary); border-color: var(--border-active); }

/* ── App Store Button ─────────────────────────────────────────── */
.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text-primary);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.app-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.app-btn--lg { font-size: 16px; padding: 14px 32px; }
.apple-icon {
  width: 14px;
  height: 17px;
  flex-shrink: 0;
  position: relative;
  top: -0.5px;
}
.app-btn--lg .apple-icon { width: 16px; height: 20px; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--section-y) + 56px) var(--page-x) var(--section-y);
}
.hero-content { max-width: 540px; }
.hero-content .eyebrow { margin-bottom: 20px; }
.hero-content h1 { margin-bottom: 28px; }

.hero-sub {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 44px;
}
/* Rotating word —
   Active word is in normal flow (position:relative) so the container
   baseline always matches surrounding text — no vertical-align tricks,
   consistent across Safari / Chrome / Firefox. */
.rotating {
  display: inline-block;
  position: relative;
}
.rotate-word {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
}
.rotate-word--active {
  position: relative; /* in flow — defines container height & baseline */
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-subtle);
}
.hero-phone-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  perspective: 1000px;
}

/* ── Phone shell ─────────────────────────────────────────────── */
.phone {
  width: 264px;
  height: 534px;
  background: #0C0C0C;
  border-radius: 46px;
  border: 0.5px solid rgba(255,255,255,0.14);
  box-shadow:
    0 0 0 10px #111,
    0 0 0 10.5px rgba(255,255,255,0.055),
    0 48px 120px rgba(0,0,0,0.85),
    0 24px 48px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transform-style: preserve-3d;
}
.phone--sm {
  width: 240px;
  height: 486px;
  border-radius: 42px;
}

/* Dynamic island */
.phone-island {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
}
.phone--sm .phone-island {
  width: 80px;
  height: 24px;
  top: 11px;
}

/* Screen */
.phone-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  border-radius: 46px;
  overflow: hidden;
}
.phone--sm .phone-screen { border-radius: 42px; }

/* Home indicator */
.phone-chin {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 4px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  z-index: 10;
}

/* ── Screen: Home ────────────────────────────────────────────── */
.ps-home {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 54px 18px 28px;
}
.ps-top-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.ps-top-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.ps-orb-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ps-orb {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ps-orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 0.5px solid rgba(255,255,255,0.10);
  animation: orb-pulse 3.2s ease-in-out infinite;
}
.ps-orb-ring--1 { width: 80px;  height: 80px;  animation-delay: 0s; }
.ps-orb-ring--2 { width: 102px; height: 102px; animation-delay: 0.6s; opacity: 0.55; }
.ps-orb-ring--3 { width: 124px; height: 124px; animation-delay: 1.2s; opacity: 0.28; }
.ps-orb-core {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.025);
  border: 0.5px solid rgba(255,255,255,0.16);
  animation: orb-core 3.2s ease-in-out infinite;
}
@keyframes orb-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.06); opacity: 1;   }
}
@keyframes orb-core {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.09); }
}

.ps-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}
.ps-dream-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}
.ps-quote-block { text-align: center; }
.ps-quote-text {
  font-size: 8.5px;
  color: var(--text-disabled);
  font-style: italic;
  line-height: 1.45;
}
.ps-quote-author {
  font-size: 8px;
  color: var(--text-faint);
  margin-top: 2px;
}
.ps-begin-btn {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  padding: 7px 22px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.ps-tab-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px 0 0;
  border-top: 0.5px solid var(--border-subtle);
  margin-top: 8px;
}
.ps-tab {
  font-size: 7.5px;
  font-weight: 500;
  color: var(--text-disabled);
}
.ps-tab--active { color: var(--text-primary); }

/* ── Screen: Session ────────────────────────────────────────── */
.ps-session {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 18px 40px;
  gap: 18px;
}
.ps-session-dream {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-align: center;
}
.ps-timer-area {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ps-ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 0.5px solid rgba(255,255,255,0.10);
  animation: ripple 3s linear infinite;
}
.ps-ripple-ring--a { width: 50px;  height: 50px;  animation-delay: 0s; }
.ps-ripple-ring--b { width: 76px;  height: 76px;  animation-delay: 1s; }
.ps-ripple-ring--c { width: 102px; height: 102px; animation-delay: 2s; }
@keyframes ripple {
  0%   { transform: scale(0.75); opacity: 0; }
  15%  { opacity: 1; }
  75%  { opacity: 0.25; }
  100% { transform: scale(1.55); opacity: 0; }
}
.ps-timer {
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.ps-prompt {
  font-size: 9px;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.55;
  font-style: italic;
  padding: 0 6px;
}
.ps-ctrl-btn {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.10);
  border-radius: 100px;
  padding: 5px 18px;
  cursor: pointer;
}

/* ── Screen: Dreams ────────────────────────────────────────── */
.ps-dreams {
  height: 100%;
  padding: 54px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ps-screen-eyebrow {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 18px;
}
.ps-dream-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.ps-dream-row { display: flex; flex-direction: column; gap: 5px; }
.ps-dream-row-name {
  font-size: 8.5px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.ps-bar-wrap {
  height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 1px;
  overflow: hidden;
}
.ps-bar {
  height: 100%;
  width: var(--w);
  background: var(--resonance-dim);
  border-radius: 1px;
  position: relative;
}
.ps-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--feeling-dim);
  width: 60%;
  border-radius: 1px;
  opacity: 0.7;
}
.ps-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border-subtle);
}
.ps-leg-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ps-leg-dot--r { background: var(--resonance); }
.ps-leg-dot--f { background: var(--feeling); }
.ps-leg-txt {
  font-size: 7px;
  color: var(--text-disabled);
}

/* ── Philosophy ──────────────────────────────────────────────── */
.philosophy {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.philosophy-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.philosophy-body { display: flex; flex-direction: column; gap: 18px; }
.philosophy-body p { font-size: clamp(15px, 1.5vw, 17px); }

/* ── How it works ────────────────────────────────────────────── */
.how {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ── Feature sections ─────────────────────────────────────────── */
.feature {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.feature-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
}
.feature--flip .feature-inner {
  grid-template-columns: auto 1fr;
}
.feature-text { max-width: 480px; }
.feature-text h2 { margin: 12px 0 24px; }
.feature-text p + p { margin-top: 16px; }

/* Chip preview (post-session word chips) */
.chip-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
  padding: 5px 12px;
  border: 0.5px solid var(--border-default);
  border-radius: 100px;
  background: var(--surface);
}
/* Standalone punch line */
.feature-punch {
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 500;
  color: var(--text-primary) !important;
  margin-top: 20px;
  line-height: 1.4;
}

/* ── Exercises ─────────────────────────────────────────────────── */
.exercises-sec {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.exercises-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 8vw, 100px);
  align-items: center;
}
.exercises-text h2 { margin: 12px 0 24px; }
.level-grid { display: flex; flex-direction: column; gap: 14px; }
.level-row { display: flex; align-items: center; gap: 16px; }
.level-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  width: 52px;
  flex-shrink: 0;
}
.level-dots { display: flex; gap: 7px; }
.ldot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid var(--border-default);
}
.ldot--on  { background: rgba(255,255,255,0.28); border-color: transparent; }
.ldot--dim { background: rgba(255,255,255,0.10); border-color: var(--border-default); }

/* ── Four Lenses ─────────────────────────────────────────────── */
.lenses {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.lenses-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
}
.lenses-text h2 { margin: 12px 0 24px; }
.lenses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lens-card {
  padding: 16px;
  background: var(--surface);
  border: 0.5px solid var(--border-default);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lens-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.lens-q {
  font-size: 12px;
  color: var(--text-disabled);
  line-height: 1.55;
}

/* ── Trust ─────────────────────────────────────────────────────── */
.trust {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
  text-align: center;
}
.trust-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(28px, 5vw, 64px);
}
.trust-line {
  width: 0.5px;
  height: 56px;
  background: var(--border-default);
  flex-shrink: 0;
}
.trust-val {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}
.trust-desc {
  font-size: 13px;
  color: var(--text-subtle);
}
.trust-sub {
  font-size: 14px;
  color: var(--text-disabled);
  text-align: center;
}

/* ── Science ─────────────────────────────────────────────────── */
.science {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.science-inner {
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
}
.science-quote {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
}
.science-cite {
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 28px;
  font-style: normal;
}
.science-body {
  font-size: 15px;
  color: var(--text-tertiary);
  line-height: 1.75;
}

/* ── Download ─────────────────────────────────────────────────── */
.download {
  padding: var(--section-y) 0;
  border-top: 0.5px solid var(--border-subtle);
}
.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.dl-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin-bottom: 8px;
  border: 0.5px solid var(--border-default);
}
.dl-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.dl-sub {
  font-size: 16px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.dl-langs {
  font-size: 12px;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  padding: 28px 0;
  border-top: 0.5px solid var(--border-subtle);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-disabled);
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-link {
  font-size: 12px;
  color: var(--text-disabled);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--text-tertiary); }
.footer-copy {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(56px + 60px);
    padding-bottom: 60px;
  }
  .hero-content { max-width: 100%; }
  .hero-content .eyebrow { text-align: center; }
  .hero-sub {
    justify-content: center;
  }
  .hero-meta { text-align: center; }
  .hero-phone-wrap { order: -1; }

  .philosophy-inner { grid-template-columns: 1fr; gap: 28px; }
  .steps { grid-template-columns: 1fr 1fr; }

  .feature-inner,
  .feature--flip .feature-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .feature--flip .feature-inner { display: flex; flex-direction: column-reverse; }
  .feature-phone-wrap { display: flex; justify-content: center; }
  .feature-text { max-width: 100%; }

  .exercises-inner { grid-template-columns: 1fr; gap: 48px; }

  .lenses-inner { grid-template-columns: 1fr; gap: 36px; }

  .trust-grid { flex-direction: column; gap: 28px; }
  .trust-item { padding: 0; }
  .trust-line { width: 48px; height: 0.5px; }
}

@media (max-width: 580px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .lenses-grid { grid-template-columns: 1fr; }
  .phone { width: 224px; height: 452px; border-radius: 40px; }
  .phone .phone-screen { border-radius: 40px; }
  .phone-island { width: 76px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .rotate-word { transition: none; }
  .ps-orb-ring, .ps-orb-core,
  .ps-ripple-ring { animation: none; }
}
