/*
 * Styling for the landing page (index.html) and the 404 page.
 *
 * Palette is the product's, from app/lib/core/theme.dart — warm grey surfaces
 * with the energetic green accent, and the cyan the app reserves for cardio.
 * It deliberately no longer matches legal/legal.css and the server-rendered
 * pages (server/src/routes/checkout-done.ts, mcp/oauth/signin-page.ts), which
 * still carry the older blue-grey. Moving those over is a separate decision.
 *
 * Dark only: there is no light theme in the product, so there is none here.
 *
 * Deliberately zero external requests: no CDN, no analytics pixel, no remote
 * image. Inter is served from this domain (see below) rather than from
 * fonts.gstatic.com — fetching it there is exactly why google_fonts was
 * removed from the app, since it made Google Fonts a recipient of every user's
 * IP. The privacy policy on this domain enumerates every recipient of user
 * data, and this page must never quietly add one.
 */

/* Subset of app/assets/fonts/*.ttf (SIL OFL, licence text ships alongside):
   latin + latin-ext + punctuation + arrows, converted to WOFF. Regenerate with
   pyftsubset --flavor=woff --layout-features='kern,liga,calt'
     --unicodes='U+0000-00FF,U+0100-024F,U+2000-206F,U+2190-21FF,U+20AC,U+2122,U+2212'
   Latin Extended-A is not optional — the operator's name contains "Pająk". */
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1b1c20;
  --surface: #232429;
  --surface-alt: #1f2024;   /* the banded sections */
  --chip: #2a2c32;
  --border: #43454f;
  --hairline: #2c2e35;      /* section separators; quieter than --border */
  --text: #e8e9ed;
  --muted: #9a9da9;
  --accent: #4ade80;
  --accent-hover: #8aecb0;
  --on-accent: #07290f;
  --cyan: #5ec9e8;          /* the app's cardio colour */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

/* :visited included — without it the browser's default purple turns a footer
   into a mix of two colours the second time someone reads the terms. */
a, a:visited { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { text-wrap: balance; }

/* Every section shares one column. */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 76px 20px;
}

/* ---- brand mark ----
   The app icon is a green ring on a dark plate; two divs reproduce it at the
   two sizes used here, which beats shipping a PNG for 26 pixels of chrome. */

.mark {
  display: block;
  flex: none;
  width: 26px;
  height: 26px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}
.mark.small { width: 22px; height: 22px; }

/* ---- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(27, 28, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.site-header nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px 20px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--text); }

.site-header .spacer { flex: 1 1 auto; }

.site-header .links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
}
.site-header .links a { color: var(--muted); }
.site-header .links a:hover { color: var(--text); }
/* More specific than the two rules above, or the header's "Open app" button
   renders muted-on-accent — near-invisible text that only appeared on hover. */
.site-header .links a.btn { color: var(--on-accent); }
.site-header .links a.btn:hover { color: var(--on-accent); }

/* ---- buttons ---- */

/* Every colour rule here carries its :visited twin. `a:visited` above is
   (0,1,1) and outranks bare `.btn` (0,1,0), so once /app/ is in the browser's
   history the button text went accent-on-accent — invisible except on hover
   (`.btn:hover` ties :visited and wins by source order). */
.btn,
.btn:visited {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn.secondary,
.btn.secondary:visited {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn.secondary:hover { background: var(--surface); color: var(--text); }

/* The header's own call to action is smaller than the ones in the page body. */
.btn.compact { padding: 9px 16px; font-size: 14px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

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

.hero .wrap {
  padding-top: 76px;
  padding-bottom: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 48px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 7px 14px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.dot {
  display: block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 24px 0 0;
  max-width: 15ch;
}

.hero .lede {
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 22px 0 0;
  max-width: 50ch;
}

/* Closed-testing notice. Comes off with the approval gate — see
   server/src/approval.ts and docs/landing-page-brief.md §9. */
.notice {
  margin-top: 28px;
  max-width: 56ch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.notice strong { color: var(--text); font-weight: 600; }

/* ---- phone frames ---- */

.phone {
  justify-self: center;
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 8px;
}
.phone img { width: 100%; height: auto; border-radius: 19px; }

.phone.wide { max-width: 328px; }

.phone.snug {
  max-width: 300px;
  border-radius: 24px;
}
.phone.snug img { border-radius: 17px; }

/* ---- sections ---- */

section { border-top: 1px solid var(--hairline); }
section.banded { background: var(--surface-alt); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}
.eyebrow.cyan { color: var(--cyan); }

h2 {
  font-size: clamp(27px, 5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 14px 0 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(248px, 100%), 1fr));
  gap: 16px;
  margin-top: 38px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.card h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.card h3.cyan { color: var(--cyan); }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0; }

.aside { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 16px 0 0; }

/* ---- de-duplication explainer ---- */

.split {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(288px, 100%), 1fr));
  gap: 28px;
  align-items: center;
}

.split h3 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
}
.split .blurb { font-size: 15.5px; line-height: 1.62; color: var(--muted); margin: 0 0 18px; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.row .dot { width: 7px; height: 7px; background: var(--cyan); }

.row.dropped { opacity: 0.45; text-decoration: line-through; }
.row.dropped .dot { background: var(--muted); }

.row.kept {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---- alternating feature rows ---- */

.features .wrap {
  display: flex;
  flex-direction: column;
  gap: 76px;
}

.feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 44px;
  align-items: center;
}
.feature h2 { margin: 14px 0 16px; max-width: 20ch; }
.feature .blurb { font-size: 16px; line-height: 1.62; color: var(--muted); margin: 0; }

/* The screenshot sits second in the DOM but is authored first in two of the
   rows; ordering keeps the prose first on every screen width, including when
   the grid collapses to one column. */
.feature .copy { order: 1; }
.feature .phone { order: 2; }

.tagline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 999px;
  padding: 3px 8px;
}

/* ---- privacy ---- */

.privacy .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 44px;
}
.privacy h2 { margin: 14px 0 18px; max-width: 22ch; }
.privacy .lede { font-size: 15.5px; line-height: 1.65; color: var(--muted); margin: 0 0 18px; }
.privacy a.more { font-size: 15px; font-weight: 600; }

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.checks li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.checks li::before {
  content: "\00b7";
  color: var(--accent);
  font-weight: 700;
  flex: none;
}
.checks strong { color: var(--text); font-weight: 600; }

/* ---- pricing ---- */

.pricing h2 { margin: 14px 0 8px; max-width: 26ch; }
.pricing .lede { font-size: 15.5px; line-height: 1.65; color: var(--muted); margin: 0 0 34px; max-width: 56ch; }

.prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}

.price {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
}
.price .tier { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 12px; }
.price .amount { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.price .credits { font-size: 14.5px; color: var(--muted); margin: 8px 0 0; }

/* Introductory-price and currency note under the cards. Deliberately plain
   text with no struck-through "was" price: announcing a price *reduction*
   triggers the 30-day-lowest-price rule (art. 4 ust. 2 ustawy o informowaniu
   o cenach), and there is no earlier price to reference. */
.pricing .fineprint {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 18px 0 0;
  max-width: 62ch;
}

/* Premium is granted by hand during testing, never sold — so it gets a card
   without a price and deliberately without a buy button. */
.price.granted { background: var(--surface-alt); border-style: dashed; }
.price.granted .tier { color: var(--cyan); }
.price.granted .amount { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.price.granted .credits { line-height: 1.5; }

.footnotes {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footnotes li { font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ---- closing call to action ---- */

.closing .wrap { padding: 72px 20px; text-align: center; }
.closing h2 { margin: 0 0 16px; }
.closing p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 auto 28px; max-width: 48ch; }
.closing .btn { padding: 14px 30px; }

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

.site-footer { border-top: 1px solid var(--hairline); }
.site-footer .wrap { padding: 52px 20px 60px; }

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 36px;
}

.columns .colhead {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}

.columns .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.columns .brand span { font-size: 15px; font-weight: 700; }
.columns p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }

.columns ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
}
.columns li { display: flex; flex-direction: column; gap: 9px; }
.columns .gloss { font-size: 13px; line-height: 1.5; color: var(--muted); }
.columns .spaced { margin-top: 6px; }

.disclaimer {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 38px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  max-width: 78ch;
}

/* ---- 404 ----
   404.html shares this stylesheet; it uses .btn, .actions and .links only. */

body.centred {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
body.centred main { text-align: center; width: min(100%, 460px); }
body.centred h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 10px; }
body.centred p { color: var(--muted); margin: 0 0 24px; }
body.centred .actions { justify-content: center; }
body.centred footer { margin-top: 40px; font-size: 14px; }
body.centred .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  color: var(--muted);
}

/* 900px is the app's own breakpoint for a wide layout, and it is the right one
   here too: the two-column rows only fold at 720px on their own, which leaves a
   tablet reading a 56px headline in a 328px column. */
@media (max-width: 900px) {
  .hero .wrap,
  .split,
  .feature,
  .privacy .wrap {
    grid-template-columns: 1fr;
  }
}

/* The header is sticky, so it cannot be allowed to wrap onto three rows and
   eat a third of a phone screen. Below this width only the wordmark and the
   call to action survive; the section links are a scroll away, and every legal
   link is in the footer. */
@media (max-width: 700px) {
  .site-header .links a:not(.btn) { display: none; }
}

@media (max-width: 560px) {
  .wrap { padding-top: 56px; padding-bottom: 56px; }
  .hero .wrap { gap: 36px; }
  .features .wrap { gap: 56px; }
  .feature { gap: 28px; }
}
