/*
  PulseLens marketing site — paper editorial.

  Same token system as the dashboard (dashboard/app/globals.css): the
  page runs the light "paper" set on :root, and the product demo card
  runs the dark "calm editorial" set scoped under .pl-dark, so the
  landing page shows both faces of the brand. If a token changes in the
  app, change it here too.
*/

:root {
  color-scheme: light;
  --pl-bg: #f6f1e7;
  --pl-panel: #fdfaf3;
  --pl-panel-2: #f2ecdf;
  --pl-line: rgba(36, 31, 22, 0.16);
  --pl-line-soft: rgba(36, 31, 22, 0.09);
  --pl-cream: #241f16;
  --pl-text-soft: #5a544a;
  --pl-text-dim: #8b8474;
  --pl-teal: #0e6f57;
  --pl-on-teal: #f6f1e7;
  --pl-mint: #16794f;
  --pl-amber: #8f5b06;
  --pl-red: #a32d2d;
  --pl-neg: #b03328;
  --pl-fill-soft: rgba(36, 31, 22, 0.035);
  --pl-fill: rgba(36, 31, 22, 0.06);
  --pl-track: rgba(36, 31, 22, 0.1);
  --pl-score-hi: #2f6e13;
  --pl-score-good: #0e6f57;
  --pl-score-mid: #6a665e;
  --pl-score-low: #8f5b06;
  --pl-score-poor: #a32d2d;
  --font-sans: 'Inter', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
}

.pl-dark {
  color-scheme: dark;
  --pl-bg: #0a0f12;
  --pl-panel: #10171b;
  --pl-panel-2: #151d21;
  --pl-line: rgba(242, 239, 232, 0.1);
  --pl-line-soft: rgba(242, 239, 232, 0.06);
  --pl-cream: #f2efe8;
  --pl-text-soft: #b5beba;
  --pl-text-dim: #7e8985;
  --pl-teal: #2bd4c2;
  --pl-on-teal: #06302b;
  --pl-mint: #82f0c5;
  --pl-amber: #f3b561;
  --pl-red: #ef6b63;
  --pl-neg: #ff8e84;
  --pl-fill-soft: rgba(242, 239, 232, 0.03);
  --pl-fill: rgba(242, 239, 232, 0.055);
  --pl-track: rgba(242, 239, 232, 0.08);
  --pl-score-hi: #4ade80;
  --pl-score-good: #2dd4bf;
  --pl-score-mid: #a3ada9;
  --pl-score-low: #fbbf24;
  --pl-score-poor: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background:
    radial-gradient(1100px 420px at 50% -8%, rgba(14, 111, 87, 0.05), transparent 70%),
    var(--pl-bg);
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--pl-cream);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(14, 111, 87, 0.18);
}

img {
  max-width: 100%;
}

.shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 241, 231, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pl-line-soft);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.logo {
  height: 26px;
  width: auto;
  display: block;
  /* Wordmark PNG is white + teal; invert flips white to ink and
     hue-rotate brings the teal back around. Same trick as the app. */
  filter: invert(1) hue-rotate(180deg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav a {
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--pl-text-dim);
  text-decoration: none;
  transition: color 120ms ease;
}

.topnav a:hover {
  color: var(--pl-cream);
}

/* ── Buttons + forms ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9999px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--pl-teal);
  color: var(--pl-on-teal);
  transition: opacity 120ms ease;
}

.btn:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-small {
  padding: 7px 16px;
  font-size: 0.8rem;
}

.email-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
}

.email-form input[type='email'] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--pl-line);
  border-radius: 9999px;
  background: var(--pl-panel);
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--pl-cream);
  outline: none;
  transition: border-color 120ms ease;
}

.email-form input[type='email']::placeholder {
  color: var(--pl-text-dim);
}

.email-form input[type='email']:focus {
  border-color: var(--pl-teal);
}

.form-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--pl-text-dim);
}

.form-success {
  display: none;
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--pl-mint);
}

.form-error {
  display: none;
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--pl-neg);
}

.hidden {
  display: none !important;
}

/* ── Type ────────────────────────────────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--pl-text-dim);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pl-teal);
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--pl-cream);
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.005em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.18;
}

.lede {
  margin: 18px 0 0;
  max-width: 34rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--pl-text-soft);
}

.section {
  padding: 84px 0 0;
}

.section-head {
  max-width: 40rem;
}

.section-head .eyebrow {
  margin-bottom: 14px;
}

.section-head p {
  margin: 14px 0 0;
  color: var(--pl-text-soft);
  font-size: 0.95rem;
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 56px;
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: 18px;
}

.hero-copy .email-form {
  margin-top: 28px;
}

.demo-caption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--pl-text-dim);
}

/* ── Demo card (dark, mirrors the app hero) ──────────────────────────── */

.demo-card {
  border: 1px solid var(--pl-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--pl-panel-2), var(--pl-panel));
  padding: 26px;
  color: var(--pl-cream);
  box-shadow: 0 24px 60px rgba(20, 16, 8, 0.16);
}

.demo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.demo-top .platform {
  font-size: 0.74rem;
  color: var(--pl-text-dim);
}

.demo-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.16;
  color: var(--pl-cream);
  margin: 0;
}

.demo-date {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--pl-text-dim);
}

.score-block {
  margin-top: 22px;
  border-top: 1px solid var(--pl-line);
  padding-top: 20px;
}

.score-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.score-num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 3.9rem;
  line-height: 0.82;
  letter-spacing: -0.01em;
  min-width: 2ch;
}

.score-meta .eyebrow {
  margin: 0;
}

.score-delta {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  color: var(--pl-mint);
}

.ramp {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  margin-top: 18px;
}

.ramp span {
  flex: 1;
  border-radius: 2px;
  background: var(--pl-track);
  transform: scaleY(0);
  transform-origin: bottom;
}

.demo-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
  border-top: 1px solid var(--pl-line-soft);
  padding-top: 16px;
}

.demo-metrics .label {
  font-size: 0.72rem;
  color: var(--pl-text-dim);
  margin: 0;
}

.demo-metrics .value {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pl-cream);
}

.demo-metrics .value .dim-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.demo-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid var(--pl-line-soft);
  padding-top: 14px;
  font-size: 0.72rem;
  color: var(--pl-text-dim);
}

.demo-link {
  margin: 16px 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pl-teal);
}

/* ── Chips ───────────────────────────────────────────────────────────── */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  border: 1px solid var(--pl-line-soft);
  border-radius: 9999px;
  background: var(--pl-fill-soft);
  padding: 5px 14px;
  font-size: 0.78rem;
  color: var(--pl-text-soft);
}

/* ── Cards / grids ───────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--pl-line-soft);
  border-radius: 16px;
  background: var(--pl-panel);
  padding: 26px;
}

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

.step-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--pl-teal);
  margin: 0 0 10px;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pl-cream);
}

.card p {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--pl-text-soft);
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.feature-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.feature-tag span {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.bullets {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  padding-left: 18px;
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--pl-text-soft);
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pl-teal);
  opacity: 0.55;
}

/* Meter rows inside feature cards */

.meter-row {
  display: grid;
  grid-template-columns: 92px 1fr 34px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.meter-row .m-label {
  font-size: 0.74rem;
  color: var(--pl-text-dim);
}

.meter-track {
  height: 4px;
  border-radius: 9999px;
  background: var(--pl-track);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 9999px;
  width: 0%;
}

.meter-row .m-val {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 500;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat {
  border: 1px solid var(--pl-line-soft);
  border-radius: 10px;
  background: var(--pl-fill-soft);
  padding: 10px 12px;
}

.stat .label {
  margin: 0;
  font-size: 0.68rem;
  color: var(--pl-text-dim);
}

.stat .value {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pl-cream);
}

/* ── Early access + footer ───────────────────────────────────────────── */

.cta-section {
  margin-top: 96px;
  border-top: 1px solid var(--pl-line-soft);
  padding: 76px 0;
  text-align: center;
}

.cta-section .email-form {
  margin: 28px auto 0;
}

.cta-section .lede {
  margin-left: auto;
  margin-right: auto;
}

footer {
  border-top: 1px solid var(--pl-line-soft);
  padding: 28px 0 40px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--pl-text-dim);
}

.footer-row .logo {
  height: 20px;
}

/* ── Reveal on scroll ────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 550ms ease, transform 550ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 48px;
  }

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

  .section {
    padding-top: 64px;
  }

  .topnav a:not(.btn) {
    display: none;
  }
}
