/* Mercina landing page. Tokens from SITE_BRIEF §5. Dark only. */

@font-face {
  font-family: "Google Sans Flex";
  src: url("assets/fonts/GoogleSansFlex.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "Google Sans Code";
  src: url("assets/fonts/GoogleSansCode.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --canvas: #0F1119;
  --surface: #171A24;
  --surface-raised: #1D212D;
  --frame-edge: #0A0B10;
  --text: #E6E6E6;
  --text-muted: rgba(230, 230, 230, 0.60);
  --text-faint: rgba(230, 230, 230, 0.32);
  --accent: #DE5431;
  --accent-fill: rgba(222, 84, 49, 0.12);
  --accent-glow: rgba(222, 84, 49, 0.24);
  --accent-light: #F0926F;
  --logo-light: #D9D9D9;
  --hairline: rgba(94, 96, 95, 0.14);
  --outline: rgba(230, 230, 230, 0.20);
  --phone-shadow: 0 30px 60px rgba(7, 8, 13, 0.55);
  --hero-bloom: 0 0 80px rgba(222, 84, 49, 0.18);

  --font-sans: "Google Sans Flex", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "Google Sans Code", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-pill: 999px;
  --r-card: 28px;
  --r-small: 12px;

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: 20px;
  --section-pad: 72px;
  --badge-h: 46px;
}

@media (min-width: 420px) { :root { --badge-h: 52px; } }
@media (min-width: 900px) {
  :root { --gutter: 32px; --section-pad: 128px; --badge-h: 54px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--canvas);
  /* Sparse, static starfield (§5.2) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='960' height='960'%3E%3Cg fill='%23E6E6E6'%3E%3Ccircle cx='42' cy='88' r='1' opacity='.3'/%3E%3Ccircle cx='188' cy='31' r='.8' opacity='.25'/%3E%3Ccircle cx='297' cy='164' r='1' opacity='.35'/%3E%3Ccircle cx='455' cy='72' r='.7' opacity='.22'/%3E%3Ccircle cx='611' cy='140' r='1' opacity='.28'/%3E%3Ccircle cx='768' cy='52' r='.8' opacity='.35'/%3E%3Ccircle cx='905' cy='201' r='1' opacity='.24'/%3E%3Ccircle cx='96' cy='312' r='.8' opacity='.3'/%3E%3Ccircle cx='247' cy='407' r='1' opacity='.22'/%3E%3Ccircle cx='402' cy='289' r='.7' opacity='.35'/%3E%3Ccircle cx='538' cy='371' r='1' opacity='.26'/%3E%3Ccircle cx='702' cy='318' r='.8' opacity='.3'/%3E%3Ccircle cx='860' cy='436' r='1' opacity='.22'/%3E%3Ccircle cx='31' cy='523' r='1' opacity='.26'/%3E%3Ccircle cx='171' cy='611' r='.7' opacity='.34'/%3E%3Ccircle cx='349' cy='548' r='1' opacity='.24'/%3E%3Ccircle cx='487' cy='655' r='.8' opacity='.3'/%3E%3Ccircle cx='639' cy='560' r='1' opacity='.36'/%3E%3Ccircle cx='804' cy='642' r='.7' opacity='.24'/%3E%3Ccircle cx='931' cy='590' r='.8' opacity='.3'/%3E%3Ccircle cx='82' cy='781' r='.8' opacity='.24'/%3E%3Ccircle cx='233' cy='862' r='1' opacity='.32'/%3E%3Ccircle cx='391' cy='758' r='.7' opacity='.26'/%3E%3Ccircle cx='562' cy='888' r='1' opacity='.22'/%3E%3Ccircle cx='718' cy='792' r='.8' opacity='.34'/%3E%3Ccircle cx='879' cy='905' r='1' opacity='.26'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 960px 960px;
  color: var(--text);
  font-family: var(--font-sans);
  font-variation-settings: "GRAD" 0, "ROND" 0, "wdth" 100;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-small);
}

h1, h2, h3, p { margin: 0; }

.container {
  width: 100%;
  max-width: calc(1120px + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */
.site-header { padding-block: 24px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.005em;
}
.brand img { width: 32px; height: 32px; border-radius: var(--r-small); }

/* ---------- Type ---------- */
.hero__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero__title em { font-style: normal; color: var(--accent); }

.hero__sub, .section-sub {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 34em;
}
.hero__sub { margin-top: 16px; }

.section-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.section-sub { margin-top: 12px; }

@media (min-width: 900px) {
  .hero__title { font-size: 64px; }
  .hero__sub, .section-sub { font-size: 19px; }
  .section-title { font-size: 40px; }
}

.ts, .feature__num, .fact__figure {
  font-family: var(--font-code);
  font-variant-numeric: tabular-nums;
}
.ts { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- Store badges ---------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.badges--center { justify-content: center; }

.store-badge {
  display: block;
  height: var(--badge-h);
  overflow: hidden;
  border-radius: calc(var(--badge-h) * 0.18);
  transition: transform 120ms var(--ease);
}
.store-badge:active { transform: scale(0.975); }
.store-badge--ios img {
  height: var(--badge-h);
  width: calc(var(--badge-h) * 2.9916);
}
/* iOS isn't out yet: dim the badge and pin a tag to its corner. */
.store-badge--soon {
  position: relative;
  overflow: visible;
  cursor: default;
}
.store-badge--soon:active { transform: none; }
.store-badge--soon img { opacity: 0.4; }
.store-badge__soon {
  position: absolute;
  top: -9px;
  right: -6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
/* The official Google Play PNG includes transparent padding (visible badge
   ≈ 564×166 inside 646×250). Scale it so the visible badge matches the
   App Store badge height, and trim the padding without altering the art. */
.store-badge--android { width: calc(var(--badge-h) * 3.3976); }
.store-badge--android img {
  width: calc(var(--badge-h) * 3.8916);
  height: calc(var(--badge-h) * 1.506);
  max-width: none;
  margin: calc(var(--badge-h) * -0.253) 0 0 calc(var(--badge-h) * -0.241);
}

/* ---------- Phone frame (§4.2) ---------- */
.phone {
  --w: 260px;
  position: relative;
  width: var(--w);
  max-width: 100%;
  margin: 0;
  padding: calc(var(--w) * 0.035);
  border-radius: calc(var(--w) * 0.15);
  background: linear-gradient(160deg, var(--surface-raised), var(--frame-edge));
  box-shadow: var(--phone-shadow), inset 0 0 0 1px var(--hairline);
}
.phone::before {
  /* Punch-hole camera */
  content: "";
  position: absolute;
  z-index: 2;
  top: calc(var(--w) * 0.06);
  left: 50%;
  width: calc(var(--w) * 0.04);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--frame-edge);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.phone__screen {
  position: relative;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.12);
  background: var(--canvas);
  display: grid;
  place-items: center;
}
.phone__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.phone__label {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-faint);
  padding: 4px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
}

.phone--hero {
  --w: 300px;
  box-shadow: var(--phone-shadow), var(--hero-bloom), inset 0 0 0 1px var(--hairline);
}

/* ---------- Hero ---------- */
.hero { padding-top: 32px; overflow: hidden; }

.hero__grid {
  display: grid;
  gap: 48px;
}
.hero__visual {
  display: flex;
  justify-content: center;
  /* Crop the phone at the bottom edge on mobile */
  max-height: 520px;
  overflow: hidden;
  margin-inline: calc(var(--gutter) * -1);
  padding: 48px var(--gutter) 0;
}

@media (min-width: 900px) {
  .hero { padding-top: 64px; padding-bottom: var(--section-pad); overflow: visible; }
  .hero__grid {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 64px;
  }
  .hero__visual { max-height: none; overflow: visible; margin: 0; padding: 0; }
  .phone--hero { --w: 320px; }
}

/* ---------- Value prop ---------- */
.value { padding-block: var(--section-pad); border-top: 1px solid var(--hairline); }

.section-head { margin-bottom: 64px; }

.feature {
  display: grid;
  gap: 32px;
  justify-items: center;
}
.feature + .feature { margin-top: 96px; }

.feature__copy { width: 100%; max-width: 440px; }
.feature__copy p { color: var(--text-muted); margin-top: 12px; }

.feature__num {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-fill);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}
.feature__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 96px;
  }
  .feature + .feature { margin-top: 128px; }
  .feature .phone { justify-self: end; }
  .feature__copy { justify-self: start; }
  .feature--flip .phone { order: 2; justify-self: start; }
  .feature--flip .feature__copy { order: 1; justify-self: end; }
  .feature__title { font-size: 24px; }
  .feature__copy p { font-size: 19px; }
}

/* How it works strip */
.steps {
  list-style: none;
  margin: 128px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}
.step__title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.step p { color: var(--text-muted); font-size: 15px; margin-top: 4px; }

.icon-chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-small);
  background: var(--surface-raised);
}

.icon-chip svg, .fact__icon, .pill svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ---------- Proof ---------- */
.proof { padding-block: var(--section-pad); border-top: 1px solid var(--hairline); }

.proof__quote {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 18em;
}
.proof__quote span { color: var(--text-muted); }

@media (min-width: 900px) { .proof__quote { font-size: 40px; } }

.facts {
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  transition: background-color 120ms var(--ease);
}
.fact:hover { background: var(--surface-raised); }
.fact__icon { color: var(--text-muted); margin-bottom: 8px; }
.fact__figure {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}
.fact__line { color: var(--text-muted); font-size: 15px; }

@media (min-width: 560px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .facts { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .fact__figure { font-size: 28px; }
}

.early {
  margin-top: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.early p { color: var(--text-muted); max-width: 30em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  padding-inline: 24px;
  border-radius: var(--r-pill);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 120ms var(--ease), background-color 120ms var(--ease);
}
.pill:active { transform: scale(0.975); }
.pill--outline { border: 1px solid var(--outline); }
.pill--outline:hover { background: var(--surface); }
.pill svg { width: 18px; height: 18px; }

/* ---------- Final CTA ---------- */
.cta {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--hairline);
  background: radial-gradient(60% 60% at 50% 100%, var(--accent-fill), transparent 70%);
}
.cta__inner { text-align: center; }
.cta .section-title { max-width: 14em; margin-inline: auto; }
.cta .section-sub { margin-inline: auto; }

/* ---------- Coach guides (generated by seo/build.mjs) ---------- */
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 120ms var(--ease);
}
.header__link:hover { color: var(--text); }

.guide-hero { padding: 40px 0 var(--section-pad); }
.guide-hero__inner { max-width: calc(760px + var(--gutter) * 2); }
.guide-hero__inner--wide { max-width: calc(1120px + var(--gutter) * 2); }
.guide-hero__inner--wide > * { max-width: 760px; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 32px;
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-fill);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.guide-hero__title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.guide-hero__lede {
  margin-top: 20px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 34em;
}
.guide__updated { margin-top: 20px; font-size: 14px; color: var(--text-faint); }
@media (min-width: 900px) {
  .guide-hero { padding-top: 64px; }
  .guide-hero__title { font-size: 64px; }
  .guide-hero__lede { font-size: 21px; }
}

.guide__body { max-width: calc(760px + var(--gutter) * 2); }
.guide__block + .guide__block { margin-top: 64px; }
.guide__block > p { color: var(--text-muted); font-size: 18px; }
.guide__block > p + p { margin-top: 16px; }
.guide__body:last-child { padding-bottom: var(--section-pad); }
.guide__h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin-bottom: 24px;
}
@media (min-width: 900px) { .guide__h2 { font-size: 28px; } }

.guide__list { margin: 16px 0 0; padding-left: 1.2em; color: var(--text-muted); }
.guide__list li + li { margin-top: 10px; }
.guide__list li::marker { color: var(--accent); }

.mistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mistake {
  display: grid;
  gap: 6px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-small);
}
.mistake__title { font-weight: 700; }
.mistake__text { color: var(--text-muted); font-size: 16px; }

.guide__features { margin-top: var(--section-pad); }
.plan { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.plan__step { display: flex; gap: 14px; align-items: baseline; color: var(--text-muted); }
.plan__step .feature__num { margin: 0; flex: none; }
.feature__copy .guide__note { margin-top: 24px; font-size: 15px; color: var(--text-faint); }

.faq {
  border-bottom: 1px solid var(--hairline);
  padding-block: 20px;
}
.faq:first-of-type { border-top: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-family: var(--font-code);
  transition: transform 200ms var(--ease);
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: 12px; color: var(--text-muted); }

.guide-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .guide-grid--wide { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  text-decoration: none;
  transition: background-color 120ms var(--ease), transform 120ms var(--ease);
}
.guide-card:hover { background: var(--surface-raised); }
.guide-card:active { transform: scale(0.975); }
.guide-card__kind { font-size: 13px; font-weight: 600; color: var(--accent); }
.guide-card__title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.guide-card__line { font-size: 15px; color: var(--text-muted); }
.section-head--spaced { margin-top: 128px; }

/* Topic links on the home page */
.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 48px; }
.topics__label { color: var(--text-faint); font-size: 15px; margin-right: 8px; }
.topic {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--outline);
  border-radius: var(--r-pill);
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.topic:hover { background: var(--surface); color: var(--text); }
.topic--all { color: var(--accent); border-color: var(--accent-glow); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding-block: 48px;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.footer__mark { width: 44px; height: auto; fill: var(--logo-light); }
.footer__links { display: flex; gap: 24px; }
.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
}
.footer__links a:hover { color: var(--text); }
.footer__legal {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-faint);
  max-width: 60em;
}
.footer__legal + .footer__legal { margin-top: 12px; }
.footer__legal a { color: var(--text-muted); }

/* ---------- Motion (§5.6) ---------- */
/* Single blocks fade up once as they enter. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Groups reveal their children in reading order, 80ms apart
   (main.js sets --i on each child). */
.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-stagger].is-in > * { opacity: 1; transform: none; }

/* Feature phones travel a little further than their copy, and the copy
   follows a beat later, so the screenshot lands first. */
.js .feature[data-stagger] > .phone {
  transform: translateY(32px) scale(0.98);
  transition-duration: 500ms;
}
.js .feature[data-stagger] > .feature__copy { transition-delay: 160ms; }
.js .feature[data-stagger].is-in > * { transform: none; }

/* Hero: the phone rises after the copy, then its orange bloom settles in. */
.js .hero__visual.reveal { transition-duration: 600ms; transition-delay: 240ms; }
.js .phone--hero { transition: box-shadow 900ms var(--ease) 500ms; }
.js .hero__visual:not(.is-in) .phone--hero {
  box-shadow: var(--phone-shadow), inset 0 0 0 1px var(--hairline);
}

/* Section seams: an orange hairline draws out from the centre of each
   section's top border as you scroll into it, then fades back to a glint. */
.seam { position: relative; }
.seam::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(560px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-50%) scaleX(0);
  opacity: 0;
  pointer-events: none;
}
.js .seam.is-in::before {
  animation: seam-draw 1400ms var(--ease) forwards;
}
@keyframes seam-draw {
  0%   { transform: translateX(-50%) scaleX(0); opacity: 0; }
  35%  { opacity: 0.9; }
  100% { transform: translateX(-50%) scaleX(1); opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal,
  .js [data-stagger] > *,
  .js .phone--hero { opacity: 1; transform: none; transition: none; }
  .store-badge, .pill, .fact, .guide-card, .faq summary::after { transition: none; }
  .store-badge:active, .pill:active { transform: none; }
  .js .hero__visual:not(.is-in) .phone--hero {
    box-shadow: var(--phone-shadow), var(--hero-bloom), inset 0 0 0 1px var(--hairline);
  }
  .js .seam.is-in::before { animation: none; transform: translateX(-50%) scaleX(1); opacity: 0.35; }
}
