/* Palaestraa — landing page
   Tokens mirror the app's v3 "Crimson Pro" dark theme. */
:root {
  --bg: #000000;
  --surface-lowest: #0A0C0F;
  --surface-low: #0C0E12;
  --surface: #14171D;
  --surface-high: #1B1F27;
  --surface-highest: #222731;
  --outline: #70767F;
  --outline-variant: #424851;
  --line: rgba(66, 72, 81, .45);
  --text: #E0E6F1;
  --text-muted: #A5ABB6;
  --primary: #FB7185;          /* rose — accent text, charts, icons */
  --primary-fill: #E11D48;     /* crimson — buttons, active states */
  --primary-fill-hover: #F43F5E;
  --on-primary: #FFFFFF;

  --font-display: "Alata", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, monospace;

  --r-sm: 8px; --r: 12px; --r-md: 14px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 28px;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --wrap: 1180px;
  --gutter: 24px;
}

@font-face { font-family: "Alata"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/alata-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/instrument-sans.woff2") format("woff2"); }
@font-face { font-family: "Red Hat Mono"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("assets/fonts/red-hat-mono.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--primary-fill); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--primary-fill); color: #fff; padding: 10px 14px; border-radius: var(--r); }
.skip:focus { top: 16px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- Type ---------- */
.display {
  font: 400 clamp(40px, 6.2vw, 72px)/1.04 var(--font-display);
  letter-spacing: -.025em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.headline {
  font: 400 clamp(32px, 4.4vw, 52px)/1.08 var(--font-display);
  letter-spacing: -.02em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.title { font: 600 20px/1.3 var(--font-body); letter-spacing: -.01em; margin: 0 0 8px; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--text-muted); max-width: 34em; margin: 0 0 32px; }
.sub { color: var(--text-muted); font-size: 17px; margin: 0; max-width: 36em; }
.accent { color: var(--primary); }


/* ---------- Coming soon label ---------- */
.soon {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  height: 52px; padding: 0 24px; border-radius: 999px;
  background: var(--surface); border: 1px solid rgba(251, 113, 133, .35);
  color: var(--text); font-weight: 600; font-size: 16px; white-space: nowrap;
}
.soon__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-fill); animation: pulse 2.4s ease-out infinite; }
.soon--sm { height: 40px; padding: 0 18px; font-size: 14px; color: var(--primary); background: rgba(225, 29, 72, .12); }
.soon--center { margin-inline: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: rgba(225, 29, 72, .12); border: 1px solid rgba(251, 113, 133, .28);
  color: var(--primary); font-size: 13px; font-weight: 500;
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(251,113,133,.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(251,113,133,.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(251,113,133,0); } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding-top: env(safe-area-inset-top);
  transition: background-color .25s ease-out, border-color .25s ease-out;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(0, 0, 0, .72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 21px/1 var(--font-display); letter-spacing: -.01em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand--sm { font-size: 18px; }
.brand--sm .brand__mark { width: 26px; height: 26px; }
.nav__links { display: flex; gap: 32px; font-size: 15px; color: var(--text-muted); }
.nav__links a { transition: color .15s; }
@media (hover: hover) { .nav__links a:hover { color: var(--text); } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: calc(132px + env(safe-area-inset-top)) 0 96px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto auto; width: 900px; height: 900px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(225, 29, 72, .28), rgba(225, 29, 72, .08) 55%, transparent 75%);
  filter: blur(10px);
}
.hero::after { /* fine grid, fades out */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .25;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 10%, transparent 70%);
          mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 10%, transparent 70%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .display {
  font-size: clamp(46px, 8.4vw, 118px); line-height: .98; letter-spacing: -.035em;
  max-width: 11.5em; margin-bottom: 56px;
}
.hero__foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px 64px;
  padding-top: 32px; border-top: 1px solid var(--line);
}
.hero__foot .lede { margin: 0; }
.hero__aside { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.etym { margin: 0; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.etym .mono { color: var(--text); margin-right: 4px; }
.etym i { font-style: normal; color: var(--primary); margin-right: 2px; }

/* The coaching loop: one step lights up at a time */
.loop { list-style: none; margin: 104px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.loop li {
  position: relative; padding-top: 22px;
  font: 400 clamp(22px, 2.6vw, 34px)/1 var(--font-display); letter-spacing: -.015em;
  color: #4A505A; transition: color .5s var(--ease-out);
}
.loop li::before, .loop li::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; border-radius: 2px; }
.loop li::before { background: var(--line); }
.loop li::after { background: var(--primary-fill); transform: scaleX(0); transform-origin: left; }
.loop li .mono { display: block; font-size: 13px; letter-spacing: 0; color: var(--text-muted); margin-bottom: 14px; transition: color .5s; }
.loop li.is-active, .loop li.is-done { color: var(--text); }
.loop li.is-active .mono { color: var(--primary); }
.loop li.is-active::after { transform: scaleX(1); transition: transform var(--loop-step, 2.6s) linear; }
.no-loop .loop li { color: var(--text); }

/* Ring */
.ring {
  --p: 50; --size: 44px; --w: 4px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center;
  background:
    radial-gradient(closest-side, var(--surface) calc(100% - var(--w)), transparent calc(100% - var(--w) + 1px)),
    conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-highest) 0);
}
.ring .mono { font-size: 12px; color: var(--text); }
.ring--lg { --size: 96px; --w: 7px; }
.ring--lg .mono { font-size: 22px; font-weight: 600; }

/* ---------- Statement ---------- */
.statement { padding: 72px 0 112px; }
.statement__text {
  font: 400 clamp(26px, 3.3vw, 40px)/1.28 var(--font-display); letter-spacing: -.015em;
  max-width: 26em; margin: 0; color: var(--text-muted); text-wrap: pretty;
}
.statement__text .hl { color: var(--text); background: linear-gradient(transparent 62%, rgba(225,29,72,.45) 62%); padding: 0 .08em; }

/* ---------- Section heads ---------- */
.section-head { margin-bottom: 48px; }

/* ---------- Features ---------- */
.features { padding: 48px 0 128px; }
.feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); }
.feat { padding: 28px; display: flex; flex-direction: column; transition: border-color .25s ease-out, transform .25s var(--ease-out); }
@media (hover: hover) { .feat:hover { border-color: rgba(251,113,133,.35); transform: translateY(-2px); } }
.feat p { margin: 0; color: var(--text-muted); max-width: 32em; }
.feat__demo {
  background: var(--surface-low); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px; margin-bottom: 28px; min-height: 196px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
}

/* demo: week */
.demo-week__row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.demo-week__row span { color: var(--text-muted); font-size: 13px; }
.demo-week__row b { font-weight: 500; height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.demo-week__row b.done { background: var(--surface); }
.demo-week__row b.done::after { content: "✓"; margin-left: auto; color: var(--primary); }
.demo-week__row b.live { background: var(--primary-fill); border-color: transparent; color: #fff; }
.demo-week__row b.moved i { font-style: normal; font-size: 12px; color: var(--primary); background: rgba(225,29,72,.14); padding: 2px 8px; border-radius: 999px; }

/* demo: sets */
.set { display: grid; grid-template-columns: 28px 1fr 1fr 1.2fr; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border-radius: var(--r); font-size: 16px; }
.set .dim { color: var(--text-muted); font-size: 14px; text-align: right; }
.chk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-fill); color: #fff; font-size: 13px; }
.set--live { background: var(--surface); border: 1px solid var(--outline-variant); height: 56px; }
.num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--primary); border: 1.5px solid var(--primary); background: rgba(225,29,72,.14); }
.timer { justify-self: end; color: var(--primary); font-size: 15px; padding: 4px 10px; border-radius: 999px; background: rgba(225,29,72,.12); }

/* demo: chart */
.demo-chart { justify-content: space-between; }
.demo-chart__top { display: flex; align-items: center; justify-content: space-between; }
.demo-chart .big { font-size: 26px; font-weight: 600; }
.delta { color: var(--primary); font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.demo-chart svg { width: 100%; height: 90px; overflow: visible; }
.demo-chart .draw { stroke-dasharray: 420; stroke-dashoffset: 420; transition: stroke-dashoffset 1.6s var(--ease-out) .2s; }
.is-in .demo-chart .draw, .no-js .demo-chart .draw { stroke-dashoffset: 0; }
.demo-chart__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* demo: recovery */
.demo-recovery { flex-direction: row; align-items: center; gap: 28px; }
.demo-recovery ul { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 8px; }
.demo-recovery li { display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.demo-recovery li span { color: var(--text-muted); }
.demo-recovery li b { font-weight: 500; color: var(--primary); }
.demo-recovery .ring { background:
    radial-gradient(closest-side, var(--surface-low) calc(100% - var(--w)), transparent calc(100% - var(--w) + 1px)),
    conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-highest) 0); }

/* ---------- Coming soon ---------- */
.launch { padding: 0 0 128px; }
.launch__card {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(48px, 8vw, 96px) clamp(24px, 6vw, 80px);
  border-radius: 36px; border: 1px solid rgba(251,113,133,.2);
  background: linear-gradient(180deg, #1a0a10, var(--surface-lowest) 70%);
}
.launch__card > * { position: relative; }
.launch__glow {
  position: absolute !important; left: 50%; top: -40%; width: 900px; height: 600px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(225,29,72,.35), transparent 70%);
}
.launch .sub { margin: 0 auto 36px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.footer__made { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; color: var(--text); }
.footer__made .ch { width: 20px; height: 20px; }
.footer__copy { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pill__dot, .soon__dot { animation: none; }
  .loop li, .loop li .mono { transition: none; }
  .demo-chart .draw { stroke-dashoffset: 0; transition: none; }
  .feat { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero { padding-top: calc(112px + env(safe-area-inset-top)); }
  .hero__foot { grid-template-columns: 1fr; }
  .hero__aside { align-items: flex-start; }
  .hero__glow { width: 640px; height: 640px; }
  .feat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav__links { display: none; }
  .hero .display { margin-bottom: 40px; }
  .hero { padding-bottom: 72px; }
  .loop { margin-top: 64px; grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .etym { white-space: normal; }
  .statement { padding: 32px 0 80px; }
  .features { padding-bottom: 96px; }
  .section-head { margin-bottom: 32px; }
  .feat { padding: 20px; }
  .feat__demo { padding: 16px; min-height: 0; }
  .demo-recovery { gap: 16px; }
  .demo-recovery .ring--lg { --size: 80px; }
  .launch { padding-bottom: 96px; }
  .footer__inner { flex-direction: column; text-align: center; }
}
