/* ═══════════════════════════════════════════════════
   MODE3 RHYTHM QUIZ — Styles
   Matches the MODE3 tracker app design language.
═══════════════════════════════════════════════════ */

:root {
  --bg:      #0b0d10;
  --s1:      #131619;
  --s2:      #1b1e24;
  --bd:      rgba(255,255,255,0.07);
  --bd2:     rgba(255,255,255,0.14);
  --txt:     #ede9e3;
  --txt2:    rgba(237,233,227,0.45);
  --txt3:    rgba(237,233,227,0.22);
  --prime:   #9fe6d3;
  --perform: #ffd400;
  --unwind:  #ba40ee;
  --drift:   #8a8f97;
  --accent:  var(--prime);
}

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: hidden; }
sup { font-size: 60%; top: -.4em; position: relative; }

/* ─── Screens ─────────────────────────────────── */
.screen{
  display: none;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}
.screen.active{ display: block; }

.wrap{
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 0 96px;
}
.wrap-center{
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 48px);
  padding: 24px 0 96px;
}

/* ─── Typography ──────────────────────────────── */
.eyebrow{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--txt2);
  margin-bottom: 28px;
}
.headline{
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}
.subhead{
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--txt2);
  margin-bottom: 32px;
}
.tiny{
  font-size: 11px;
  color: var(--txt3);
  letter-spacing: 0.03em;
  margin-top: 16px;
  text-align: center;
  line-height: 1.5;
}

/* ─── Bullets (intro) ─────────────────────────── */
.bullets{
  list-style: none;
  margin-bottom: 44px;
}
.bullets li{
  position: relative;
  padding-left: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.55;
  margin-bottom: 12px;
}
.bullets li::before{
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 6px;
  border-left: 1.5px solid var(--prime);
  border-bottom: 1.5px solid var(--prime);
  transform: rotate(-45deg);
}

/* ─── Buttons ─────────────────────────────────── */
.btn{
  display: inline-block;
  padding: 18px 24px;
  border-radius: 14px;
  border: 1.5px solid var(--bd2);
  background: transparent;
  color: var(--txt);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  line-height: 1;
}
.btn:active{ transform: scale(0.98); }
.btn-primary{
  background: var(--txt);
  color: var(--bg);
  border-color: var(--txt);
}
.btn-primary:disabled{
  opacity: 0.3;
  cursor: default;
  transform: none !important;
}

/* ─── Back button ─────────────────────────────── */
.back-btn{
  position: absolute;
  top: 24px;
  left: 24px;
  background: none;
  border: none;
  color: var(--txt2);
  cursor: pointer;
  padding: 10px;
  margin: -10px;
  transition: color 0.2s;
  z-index: 5;
}
.back-btn:hover,
.back-btn:active{ color: var(--txt); }

/* ─── Questions ───────────────────────────────── */
.q-label{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--txt2);
  margin-bottom: 16px;
}
.q-headline{
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 10px;
}
.q-helper{
  font-size: 13px;
  font-weight: 400;
  color: var(--txt2);
  font-style: italic;
  margin-bottom: 32px;
  line-height: 1.5;
}

.options{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}
.option{
  display: block;
  width: 100%;
  background: var(--s1);
  border: 1.5px solid var(--bd);
  border-radius: 14px;
  padding: 18px 20px;
  color: var(--txt);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  text-align: left;
  min-height: 56px;
}
.option:hover{ border-color: var(--bd2); }
.option:active{ transform: scale(0.99); }
.option.selected{
  border-color: var(--prime);
  background: rgba(159, 230, 211, 0.06);
}

.q-nav{ display: flex; }
.q-nav .btn{ min-width: 140px; }

/* ─── Email form ──────────────────────────────── */
.email-form{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-form input{
  background: var(--s1);
  border: 1.5px solid var(--bd);
  border-radius: 14px;
  padding: 16px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.email-form input:focus{ border-color: var(--bd2); }
.email-form input::placeholder{ color: var(--txt3); font-weight: 500; }
.err{
  font-size: 12px;
  color: #f87070;
  font-weight: 600;
  min-height: 18px;
  padding: 2px 4px;
  letter-spacing: 0.02em;
}
.email-form .btn{ margin-top: 6px; }

/* ─── Loading (line-scan) ─────────────────────── */
.load-wrap{ text-align: center; }
.load-line-track{
  width: 140px;
  height: 2px;
  background: rgba(237, 233, 227, 0.08);
  border-radius: 1px;
  margin: 0 auto 26px;
  overflow: hidden;
  position: relative;
}
.load-line-fill{
  position: absolute;
  top: 0;
  left: -45%;
  width: 45%;
  height: 100%;
  background: var(--prime);
  border-radius: 1px;
  animation: load-slide 1.6s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes load-slide {
  0%   { left: -45%; }
  100% { left: 100%; }
}
.load-text{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--txt2);
}

/* ─── Inline question progress bar ────────────── */
.q-progress{
  height: 2px;
  background: rgba(237, 233, 227, 0.1);
  border-radius: 1px;
  margin-bottom: 28px;
  overflow: hidden;
}
.q-progress-fill{
  height: 100%;
  width: 0;
  background: var(--prime);
  border-radius: 1px;
  transition: width 0.4s ease;
}

/* ─── Result: hero ────────────────────────────── */
.result-hero{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}
.r-label{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--txt2);
  margin-bottom: 22px;
}
.r-name{
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 22px;
  max-width: 10ch;
}
.r-line{
  font-size: 16px;
  font-weight: 500;
  color: var(--txt2);
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 72px;
}
.r-scroll-hint{
  color: var(--txt2);
  animation: hint-bounce 1.8s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50%      { transform: translateY(8px); opacity: 0.95; }
}

/* ─── Result: body ────────────────────────────── */
.result-body{
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.r-section{ margin-bottom: 52px; }
.r-section-label{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: var(--txt2);
  margin-bottom: 18px;
}
.r-copy{
  font-size: 15px;
  line-height: 1.7;
  color: var(--txt);
}
.r-copy p{ margin-bottom: 16px; }
.r-copy p:last-child{ margin-bottom: 0; }
.r-copy strong{ color: var(--txt); font-weight: 700; }

/* Breakdown bars */
.breakdown{ display: flex; flex-direction: column; gap: 14px; }
.bd-row{
  display: flex;
  align-items: center;
  gap: 14px;
}
.bd-name{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  width: 74px;
  flex-shrink: 0;
}
.bd-bar-track{
  flex: 1;
  height: 6px;
  background: var(--s2);
  border-radius: 3px;
  overflow: hidden;
}
.bd-bar-fill{
  height: 100%;
  border-radius: 3px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.bd-pct{
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Rhythm viz */
.rhythm-viz{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rv-row{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: 16px;
}
.rv-pip{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.rv-content{ flex: 1; }
.rv-name{
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
}
.rv-desc{
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.55;
  font-weight: 400;
}

/* CTA */
.r-section-cta{ margin-bottom: 40px; }
.btn-cta{
  display: block;
  margin-top: 28px;
  padding: 20px;
  font-size: 12px;
}

/* Footer */
.r-footer{
  padding-top: 44px;
  text-align: center;
  border-top: 1px solid var(--bd);
}
.r-footer-logo{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--txt);
  margin-bottom: 8px;
}
.r-footer-copy{
  font-size: 10px;
  color: var(--txt2);
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* ─── Per-state accent switching ──────────────── */
body[data-state="prime"]   { --accent: var(--prime);   }
body[data-state="perform"] { --accent: var(--perform); }
body[data-state="unwind"]  { --accent: var(--unwind);  }
body[data-state="drift"]   { --accent: var(--drift);   }

body[data-state="prime"]   .r-name { color: var(--prime);   }
body[data-state="perform"] .r-name { color: var(--perform); }
body[data-state="unwind"]  .r-name { color: var(--unwind); opacity: 0.82; }
body[data-state="drift"]   .r-name { color: var(--drift);   }

body[data-state] .btn-cta{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
body[data-state="unwind"] .btn-cta{ opacity: 0.82; }

body[data-state] #progress-fill{ background: var(--accent); }

/* ─── Hero timestamp block (v2) ───────────────── */
.timestamp-block{
  margin-bottom: 48px;
}
.timestamp{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--txt);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timestamp-desc{
  font-size: 14px;
  font-weight: 400;
  color: var(--txt2);
  line-height: 1.55;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.timestamp-punchline{
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.55;
  letter-spacing: 0.005em;
}

/* Bullets v2 */
.bullet-aside{
  color: var(--txt3);
  font-weight: 400;
}
.bullet-emphasis{
  font-weight: 700;
  color: var(--txt) !important;
}

/* Email gate emphasized line */
.subhead-emphasis{
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.5;
  margin-top: -18px;
  margin-bottom: 32px;
}

/* ─── Micro-moments (YOU RECOGNIZE THIS) ──────── */
.micro-moments{
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.moment{
  font-size: 15px;
  line-height: 1.65;
  color: var(--txt);
  font-weight: 400;
  padding-left: 18px;
  border-left: 2px solid var(--accent, var(--prime));
  letter-spacing: 0.005em;
}

/* ─── Share block ─────────────────────────────── */
.r-section-share{ margin-bottom: 44px; }
.share-row{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.share-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--bd2);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--txt2);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.1s;
  text-decoration: none;
  min-height: 48px;
  line-height: 1;
}
.share-btn:hover{
  color: var(--txt);
  background: var(--s1);
  border-color: var(--txt2);
}
.share-btn:active{ transform: scale(0.97); }
.share-btn svg{ opacity: 0.7; flex-shrink: 0; }
.share-btn:hover svg{ opacity: 1; }

/* ─── Returning user banner ───────────────────── */
.returning-banner{
  background: var(--s1);
  border-bottom: 1px solid var(--bd);
  padding: 16px 24px;
  position: relative;
  z-index: 5;
}
.returning-inner{
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.returning-text{
  font-size: 13px;
  font-weight: 500;
  color: var(--txt2);
  letter-spacing: 0.02em;
}
.returning-btns{
  display: flex;
  gap: 8px;
}
.btn-small{
  padding: 10px 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  min-height: 0;
}
.btn-ghost{
  background: transparent;
  color: var(--txt);
  border-color: var(--bd2);
}

/* ─── Toast ───────────────────────────────────── */
.toast{
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--s2);
  border: 1px solid var(--bd2);
  color: var(--txt);
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Desktop (≥768px) ────────────────────────── */
@media (min-width: 768px) {
  .screen{ padding: 48px 64px; }
  .wrap{ padding: 88px 0 120px; }

  .headline { font-size: 42px; }
  .subhead  { font-size: 18px; }

  .q-headline { font-size: 34px; }
  .q-helper   { font-size: 15px; }

  .option { font-size: 15px; padding: 20px 24px; }

  .email-form input { font-size: 15px; padding: 18px 20px; }

  .r-name { font-size: 64px; max-width: none; }
  .r-line { font-size: 18px; }
  .r-copy { font-size: 16px; }
  .moment { font-size: 16px; }

  .back-btn{ top: 36px; left: 44px; }

  .result-body{ padding: 60px 24px 96px; }

  /* Hero timestamp — larger on desktop */
  .timestamp          { font-size: 30px; }
  .timestamp-desc,
  .timestamp-punchline{ font-size: 16px; }
  .subhead-emphasis   { font-size: 18px; }

  /* Share row: 4 columns on desktop */
  .share-row{ grid-template-columns: repeat(4, 1fr); }

  /* Returning banner: inline layout on wider screens */
  .returning-inner{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .q-headline { font-size: 38px; }
  .r-name     { font-size: 76px; }
}
