/* ============================================================
   Mella validation site - design system
   Palette + voice come straight from MELLA_PRODUCT_VISION.docx:
   tidepool, coral, citrus, sea glass, warm sand, deep navy.
   Signature motif: the "tan line" (stepped color-progress strip).
   ============================================================ */

:root {
  --navy: #0e2a3a;
  --navy-deep: #0a1f2c;
  --tidepool: #147d8f;
  --tidepool-deep: #0f6373;
  --coral: #ff6b57;
  --coral-deep: #e14e3a;
  --citrus: #ffb937;
  --citrus-deep: #f0a11f;
  --seaglass: #c9e8d9;
  --sand: #f8eedd;
  --paper: #fffdf8;
  --ink: var(--navy);
  --ink-soft: rgba(14, 42, 58, 0.72);
  --ink-faint: rgba(14, 42, 58, 0.52);
  --hairline: rgba(14, 42, 58, 0.14);
  --radius-card: 8px;
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Avenir Next", system-ui, sans-serif;
  --font-mono: "Space Mono", "SF Mono", ui-monospace, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* author display rules beat the [hidden] UA style - restore it */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
  margin: 0 0 0.5em;
  color: var(--navy);
}

p { margin: 0 0 1em; }

a { color: var(--tidepool-deep); }

:focus-visible {
  outline: 2px solid var(--tidepool);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tidepool-deep);
  margin: 0 0 14px;
}

.band--dark .eyebrow { color: var(--citrus); }
.band--coral .eyebrow { color: var(--navy); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 238, 221, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.25s ease;
}

.nav.scrolled {
  box-shadow: 0 1px 0 var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--navy);
  text-decoration: none;
  line-height: 1;
}

.wordmark .dot { color: var(--coral); }

/* ---------- buttons + forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  padding: 14px 24px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--coral);
  color: var(--navy);
  box-shadow: 0 6px 18px rgba(225, 78, 58, 0.35);
}

.btn--primary:hover { background: var(--coral-deep); color: #fff; }

.btn--dark {
  background: var(--navy);
  color: #fff;
}

.btn--dark:hover { background: var(--navy-deep); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 1.5px var(--hairline);
}

.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }

.btn .lucide { width: 18px; height: 18px; }

.signup {
  display: flex;
  gap: 10px;
  max-width: 460px;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
}

.signup input[type="email"]:focus {
  border-color: var(--tidepool);
  outline: none;
}

.form-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-top: 10px;
}

.form-status {
  font-size: 14px;
  margin-top: 10px;
  min-height: 20px;
}

.form-status[data-state="error"] { color: var(--coral-deep); }
.form-status[data-state="ok"] { color: var(--tidepool-deep); }

/* success panel replaces the form after signup */
.signup-success {
  background: var(--paper);
  border: 1.5px solid var(--seaglass);
  border-radius: var(--radius-card);
  padding: 22px;
  max-width: 520px;
}

.signup-success h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.chip {
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---------- hero ---------- */

.hero {
  padding: 72px 0 56px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 7.2vw, 5.4rem);
  margin-bottom: 18px;
}

.hero h1 .hl { color: var(--coral-deep); }

.hero .sub {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
}

.device-float {
  width: min(420px, 88%);
  filter: drop-shadow(0 34px 44px rgba(14, 42, 58, 0.28));
  animation: floaty 7s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(-2deg); }
}

/* ---------- the tan line (signature motif) ----------
   Illustrative strip of stepped color swatches: the product
   promise in one glance. Cookie crumb: copy near it must stay
   "illustrative" - never presented as real user data. */

.tanline {
  margin: 56px auto 0;
  position: relative;
}

.tanline-track {
  display: flex;
  gap: 6px;
}

.tanline-step {
  flex: 1;
  height: 54px;
  border-radius: 6px;
  position: relative;
}

.tanline-step span {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.tanline-marker {
  position: absolute;
  top: -9px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 107, 87, 0.28);
  transform: translateX(-50%);
}

.tanline.in .tanline-marker {
  animation: tan-sweep 2.8s cubic-bezier(0.45, 0, 0.2, 1) 0.4s forwards;
}

@keyframes tan-sweep {
  from { left: 0; }
  to { left: 100%; }
}

.tanline-caption {
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-align: center;
}

/* thin divider variant */
.tanline--divider { margin: 0; }
.tanline--divider .tanline-step { height: 14px; }
.tanline--divider .tanline-step span { display: none; }
.tanline--divider .tanline-marker,
.tanline--divider .tanline-caption { display: none; }

/* ---------- bands ---------- */

.band {
  padding: 88px 0;
}

.band--paper { background: var(--paper); }
.band--sand { background: var(--sand); }
.band--tidepool { background: var(--tidepool-deep); }
.band--navy { background: var(--navy); }
.band--coral { background: var(--coral); }

.band--dark h2, .band--dark h3 { color: #fff; }
.band--dark p { color: rgba(255, 255, 255, 0.82); }
.band--coral h2, .band--coral h3 { color: var(--navy); }
.band--coral p { color: rgba(14, 42, 58, 0.8); }

.band h2 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  margin-bottom: 16px;
}

.band .lede {
  font-size: 19px;
  max-width: 56ch;
  margin-bottom: 40px;
}

/* ---------- ritual steps (real sequence, so numbering is earned) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.step {
  background: var(--sand);
  border-radius: var(--radius-card);
  padding: 26px 24px 24px;
  position: relative;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--coral-deep);
  letter-spacing: 0.1em;
}

.step h3 {
  font-size: 24px;
  margin: 10px 0 8px;
}

.step p { color: var(--ink-soft); margin: 0; }

.step .lucide {
  width: 26px;
  height: 26px;
  color: var(--tidepool-deep);
  position: absolute;
  top: 26px;
  right: 24px;
}

/* ---------- camera band ---------- */

.proof-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.proof {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-card);
  padding: 22px;
}

.proof-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.proof-swatches i {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.proof h3 {
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 600;
  margin: 0 0 6px;
}

.proof p { font-size: 14.5px; margin: 0; }

.proof--winner {
  background: var(--citrus);
  border-color: var(--citrus);
}

.proof--winner h3 { color: var(--navy); }
.proof--winner p { color: rgba(14, 42, 58, 0.78); }

/* ---------- device band ---------- */

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.colorways {
  display: flex;
  gap: 12px;
  margin: 22px 0 30px;
}

.colorway {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.colorway i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.colorway:hover i { transform: scale(1.08); }
.colorway[aria-pressed="true"] i { border-color: var(--navy); }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.facts li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
}

.facts .lucide {
  width: 20px;
  height: 20px;
  color: var(--coral-deep);
  flex-shrink: 0;
  margin-top: 3px;
}

/* phone mock: pure CSS, echoes the tan-line motif in the app */
.phone {
  width: 280px;
  margin: 0 auto;
  background: var(--navy);
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(14, 42, 58, 0.3);
}

.phone-screen {
  background: var(--paper);
  border-radius: 30px;
  padding: 26px 20px 30px;
  min-height: 380px;
}

.phone-screen .app-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.phone-screen .app-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--navy);
  margin: 8px 0 18px;
  line-height: 1.1;
}

.phone-streak {
  display: flex;
  gap: 6px;
  margin-top: 22px;
}

.phone-streak i {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--seaglass);
}

.phone-streak i.on { background: var(--coral); }

.phone-caption {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- scope band ---------- */

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}

.scope {
  border-radius: var(--radius-card);
  padding: 28px;
}

.scope--is { background: rgba(201, 232, 217, 0.14); border: 1px solid rgba(201, 232, 217, 0.3); }
.scope--isnt { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14); }

.scope h3 {
  font-size: 21px;
  margin-bottom: 14px;
}

.scope ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scope li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
}

.scope .lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 4px;
}

.scope--is .lucide { color: var(--seaglass); }
.scope--isnt .lucide { color: var(--coral); }

.scope-footnote {
  margin-top: 28px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 68ch;
}

/* ---------- reserve band ---------- */

.reserve-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.price-card {
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 34px 32px;
  color: var(--ink);
  box-shadow: 0 24px 48px rgba(14, 42, 58, 0.22);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 4px;
}

.price-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 64px;
  color: var(--navy);
  line-height: 1;
}

.price-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.price-card ul {
  list-style: none;
  margin: 20px 0 26px;
  padding: 0;
}

.price-card li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.price-card .lucide {
  width: 18px;
  height: 18px;
  color: var(--tidepool-deep);
  flex-shrink: 0;
  margin-top: 3px;
}

.deposit-note {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 12px;
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 760px;
}

.faq details {
  border-top: 1px solid var(--hairline);
  padding: 20px 0;
}

.faq details:last-child { border-bottom: 1px solid var(--hairline); }

.faq summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
  color: var(--navy);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary .lucide {
  width: 18px;
  height: 18px;
  color: var(--coral-deep);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq details[open] summary .lucide { transform: rotate(45deg); }

.faq details p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- footer ---------- */

.footer {
  background: var(--navy-deep);
  padding: 48px 0 56px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0 0 6px;
}

.footer .wordmark { color: #fff; font-size: 22px; }

.footer a { color: rgba(255, 255, 255, 0.8); }

.footer .fine {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.4);
  max-width: 52ch;
}

/* ---------- exit survey sheet ---------- */

.exit-sheet {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  width: min(360px, calc(100vw - 40px));
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(14, 42, 58, 0.35);
  padding: 22px;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.exit-sheet.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.exit-sheet h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.exit-sheet p { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }

.exit-sheet .chips { display: flex; flex-wrap: wrap; gap: 8px; }

.exit-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 6px;
}

.exit-close .lucide { width: 16px; height: 16px; }

/* ---------- reveal on scroll ----------
   Progressive enhancement: hidden state only applies when JS is
   active (html.js). Without JS the page is fully visible. */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .device-float { animation: none; }
  .tanline.in .tanline-marker { animation: none; left: 100%; }
}

/* ---------- toast (demo mode / misconfig notice) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(14, 42, 58, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
  max-width: calc(100vw - 48px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid,
  .device-grid,
  .reserve-grid,
  .scope-grid {
    grid-template-columns: 1fr;
  }

  .hero { padding: 48px 0 40px; }
  .hero-art { order: -1; }
  .device-float { width: min(300px, 76%); }

  .steps, .proof-cards { grid-template-columns: 1fr; }

  .band { padding: 64px 0; }

  .hero .sub { font-size: 17.5px; }
}

@media (max-width: 520px) {
  .signup { flex-direction: column; }
  .signup .btn { justify-content: center; }
  .tanline-step { height: 40px; }
  .price-big { font-size: 52px; }
}
