/*
 * Savanna Time — landing site styles.
 *
 * A deliberate parallel copy of the token values in `web/src/app/globals.css`
 * (the same precedent as `desktop/src/App.css`): the three front ends share no
 * package, and inventing one for a palette would be the larger change. If a
 * token changes in the web app, change it here too — the values are named
 * identically to make that a mechanical diff.
 *
 * ---------------------------------------------------------------------------
 * SIZING: every dimension is `rem`, and every value is the design canvas's
 * pixel / 12.5.
 *
 * The canvas was drawn at a scale where body copy measured 12.5px. This sheet
 * originally transcribed those pixels verbatim — 9.5px chips, 10px section
 * labels, 13px body — while hand-patching only `body` to 15px. The result was
 * the defect the web app carried before it was rescaled: type rendered at
 * roughly 78% of a browser's 16px default, so the page only looked right at
 * 125% zoom, with the half-patched body leaving the ramp internally
 * inconsistent on top of that.
 *
 * Dividing by 12.5 makes `--text-body` exactly 1rem and preserves every ratio
 * between steps — a rescale, not a redesign. Spacing, radii and fixed widths
 * are converted by the same factor, so the layout keeps the canvas's
 * proportions rather than crowding against newly larger type. (The web app got
 * that for free: Tailwind's spacing scale was already rem.)
 *
 * `rem` rather than `px` so the page also honours a reader who has set a larger
 * default font size; a px ramp silently ignores that preference.
 *
 * Exceptions, deliberately still px: hairline borders and the 1px ribbon gap,
 * which are meant to be one device pixel and become a sub-pixel mess in rem.
 * `letter-spacing` stays in `em`, which is already relative.
 * ---------------------------------------------------------------------------
 *
 * Dark mode follows the OS via `prefers-color-scheme`: a marketing page has no
 * account to remember a preference for, so a toggle would be state without an
 * owner.
 */

/*
 * Typefaces. The same three families the web app and the desktop app use —
 * IBM Plex Sans for text, IBM Plex Mono for every figure and micro-label,
 * Instrument Serif for display. Vendored here rather than fetched from a font
 * CDN, so loading a page tells no third party that you did.
 *
 * `ibm-plex-sans-latin.woff2` is a VARIABLE font carrying a `wght` axis from
 * 100 to 700, and the declared range has to say so. It previously claimed
 * `400 600`, which quietly capped `<strong>` and `<b>` — both weight 700 by
 * default — at 600, so bold text on this site was a step lighter than the same
 * markup in the app. The mono and serif files are single static weights, so
 * they are declared as exact values.
 *
 * `font-display: swap` matches the web app: on a marketing page, text that is
 * readable in a fallback beats text that is invisible while a font loads. The
 * desktop app uses `block` instead, deliberately — a flash of fallback inside
 * an application shell reads as a glitch rather than as progress.
 */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #f2f2f0;
  --surface: #ffffff;
  --sunken: #f7f7f5;
  --line: #e2e2de;
  --line-soft: #ebebe7;
  --rule: #dcdcd7;
  --ink: #1a1a1a;
  --ink-2: #3d3d3d;
  --muted: #6e6e68;
  --faint: #75756d;
  --brand: #ff5c00;
  --brand-hover: #d14a00;
  --brand-soft: #fff1ea;
  --positive: #2f6f5e;
  --positive-soft: #e4efea;
  --negative: #d0342c;
  --negative-soft: #f8e6e1;
  --warn-ink: #9a6420;
  --warn-soft: #fbeedc;
  --track: #ebebe7;
  --panel: #1a1a1a;
  --panel-line: #2e2e2e;
  --panel-ink: #f7f7f5;
  --panel-ink-2: #ebebe7;
  --panel-ink-3: #c9c9c4;
  --panel-idle: #a0a09a;

  --level-2: #2f6f5e;
  --level-1: #7fa893;
  --level-0: #c9c9c4;
  --level--1: #e08a2e;
  --level--2: #d0342c;

  /* Named `--font-*` to match the web app's theme tokens and the desktop
     app's, and carrying the desktop app's fuller fallback chains: if the
     vendored file fails, the next choice should still be the right shape on
     that platform rather than whatever `sans-serif` resolves to. */
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* Type scale, named by role, mirroring `--text-*` in the web app's
     globals.css. Canvas pixels noted so the mapping stays checkable. */
  --text-micro: 0.76rem; /* 9.5px — mono micro-labels: chips, wordmark tag */
  --text-tick: 0.8rem; /* 10px — section labels, download kind */
  --text-meta: 0.84rem; /* 10.5px */
  --text-fine: 0.88rem; /* 11px — step numerals */
  --text-sub: 0.92rem; /* 11.5px — legends, captions, secondary detail */
  --text-body-sm: 0.96rem; /* 12px — hero note */
  --text-body: 1rem; /* 12.5px — default body copy */
  --text-emphasis: 1.04rem; /* 13px — nav links, card copy, trust questions */
  --text-lead: 1.12rem; /* 14px — card titles, lead paragraphs */
  --text-display-sm: 1.76rem; /* 22px — panel headings */
  --text-display-md: 2rem; /* 25px */
  --text-display-lg: 2.16rem; /* 27px — section titles */
  --text-display-xl: 2.72rem; /* 34px — stat numerals, hero minimum */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141413;
    --surface: #1a1a1a;
    --sunken: #202020;
    --line: #2e2e2e;
    --line-soft: #272726;
    --rule: #2e2e2e;
    --ink: #f7f7f5;
    --ink-2: #ebebe7;
    --muted: #a0a09a;
    --faint: #8e8e88;
    --brand: #ff7a2f;
    --brand-hover: #ff9557;
    --brand-soft: #2a1a10;
    --positive: #5cbf9c;
    --positive-soft: #16261f;
    --negative: #e5695f;
    --negative-soft: #2c1917;
    --warn-ink: #e5ab63;
    --warn-soft: #2a2113;
    --track: #37372f;
    --panel: #0f0f0f;

    --level-2: #4f9d85;
    --level-1: #8fbfaa;
    --level-0: #6e6e68;
    --level--1: #d99a4e;
    --level--2: #e5695f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  color: var(--brand-hover);
}

/* Keyboard users get a visible ring everywhere. The site is almost entirely
   links, so losing this to a reset would make it unnavigable without a mouse. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 0.16rem;
}

/* The header repeats on all six pages, so without this a keyboard or screen
   reader user tabs through it again on every navigation. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ground);
  padding: 0.64rem 1.28rem;
  border-radius: 0 0 0.4rem 0;
  z-index: 10;
}
.skip-link:focus {
  left: 0;
  color: var(--ground);
}

.wrap {
  /* 64rem preserves the canvas's 64em measure now that body copy is 1rem;
     the literal 960px would have narrowed the line against the larger type. */
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.92rem;
}
.wrap-narrow {
  max-width: 46rem;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.28rem;
  padding: 1.76rem 0;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.96rem;
  color: var(--ink);
}
.wordmark img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.56rem;
}
.wordmark-name {
  font-family: var(--font-display);
  font-size: 1.68rem;
  line-height: 1.1;
}
.wordmark-tag {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.12em;
  color: var(--faint);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.44rem;
  font-size: var(--text-emphasis);
  flex-wrap: wrap;
}
.header-links a:not(.btn) {
  color: var(--ink-2);
}
.header-links a:not(.btn):hover,
.header-links a[aria-current="page"] {
  color: var(--brand);
}

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

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 0.4rem;
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--ground);
  border: 0;
}
.btn-primary:hover {
  background: var(--ink-2);
  color: var(--ground);
}
.btn-outline {
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-outline:hover {
  border-color: var(--faint);
  color: var(--ink);
}

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

.hero {
  padding: 5.76rem 0 4.48rem;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  /* min and max in rem so the clamp still grows for a reader who has enlarged
     their default font size; a px clamp pins them out of it. */
  font-size: clamp(2.72rem, 6vw, 4.32rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 auto 1.44rem;
  max-width: 51.2rem;
}
.hero p {
  color: var(--muted);
  font-size: var(--text-lead);
  max-width: 43.2rem;
  margin: 0 auto 2.4rem;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 0.96rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 1.12rem;
  font-size: var(--text-body-sm);
  color: var(--faint);
}

/* ---------- page header (secondary pages) ---------- */

.page-head {
  padding: 3.52rem 0 1.6rem;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display-lg);
  line-height: 1.1;
  margin: 0 0 0.64rem;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-lead);
  max-width: 43.2rem;
  text-wrap: pretty;
}
.page-meta {
  font-family: var(--font-mono);
  font-size: var(--text-tick);
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  margin: 0 0 0.8rem;
}

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

section {
  padding: 3.52rem 0;
}
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-tick);
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display-lg);
  line-height: 1.1;
  margin: 0 0 2.08rem;
}
.section-intro {
  color: var(--muted);
  max-width: 43.2rem;
  margin: -1.28rem 0 2.08rem;
  text-wrap: pretty;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19.2rem, 100%), 1fr));
  gap: 1.28rem;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.56rem;
  padding: 1.6rem;
}
.step-num {
  font-family: var(--font-mono);
  font-size: var(--text-fine);
  color: var(--brand);
  margin-bottom: 0.64rem;
}
.step h3 {
  font-size: var(--text-lead);
  font-weight: 600;
  margin: 0 0 0.48rem;
}
.step p {
  font-size: var(--text-emphasis);
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

/* ---------- outcome grid ---------- */

.outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19.2rem, 100%), 1fr));
  gap: 1.28rem;
}
.outcome {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.56rem;
  padding: 1.6rem;
}
.outcome h3 {
  font-size: var(--text-lead);
  font-weight: 600;
  margin: 0 0 0.48rem;
}
.outcome p {
  font-size: var(--text-emphasis);
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}
.outcome-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.64rem;
}

/* ---------- product illustration ---------- */

.shot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.64rem;
  padding: 2.08rem;
  display: flex;
  gap: 2.24rem;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 1.44rem 3.2rem -2.24rem rgba(34, 32, 28, 0.35);
}
.ring {
  flex: none;
  width: 10.24rem;
  height: 10.24rem;
  border-radius: 50%;
  /* 78% — the same fixed sample the design canvas draws. */
  background: conic-gradient(
    var(--positive) 0turn 0.78turn,
    var(--track) 0.78turn 1turn
  );
  display: grid;
  place-items: center;
}
.ring-inner {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
}
.ring-value {
  font-family: var(--font-mono);
  font-size: var(--text-display-xl);
  font-weight: 500;
  line-height: 1;
}
.ring-label {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-top: 0.24rem;
}
.shot-right {
  flex: 1;
  min-width: min(20.8rem, 100%);
}
.ribbon {
  display: flex;
  height: 2.08rem;
  border-radius: 0.32rem;
  overflow: hidden;
  /* 1px, not rem: a hairline separator between bands. */
  gap: 1px;
  background: var(--track);
}
.ribbon > i {
  display: block;
  height: 100%;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.64rem 1.44rem;
  margin-top: 1.12rem;
  font-size: var(--text-sub);
  color: var(--ink-2);
}
.legend i {
  display: inline-block;
  width: 0.64rem;
  height: 0.64rem;
  border-radius: 0.16rem;
  margin-right: 0.48rem;
}
.shot-caption {
  margin-top: 0.8rem;
  font-size: var(--text-sub);
  color: var(--faint);
}

/* ---------- trust ---------- */

.trust {
  background: var(--panel);
  color: var(--panel-ink);
  border-radius: 0.64rem;
  overflow: hidden;
}
.trust-head {
  padding: 1.76rem 1.92rem 1.28rem;
}
.trust-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display-sm);
  margin: 0 0 0.32rem;
}
.trust-head p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--panel-ink-3);
}
.trust ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.trust li {
  display: flex;
  gap: 0.96rem;
  align-items: flex-start;
  padding: 1.04rem 1.92rem;
  border-top: 1px solid var(--panel-line);
}
.chip {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  padding: 0.16rem 0.56rem;
  border-radius: 0.24rem;
  margin-top: 0.16rem;
  white-space: nowrap;
}
.chip-yes {
  background: #2f6f5e;
  color: #f7f7f5;
}
.chip-no {
  background: #d0342c;
  color: #f7f7f5;
}
.chip-cond {
  background: #2e2e2e;
  color: #ebebe7;
}
.trust-q {
  font-size: var(--text-emphasis);
  color: var(--panel-ink-2);
}
.trust-d {
  display: block;
  font-size: var(--text-sub);
  color: var(--panel-idle);
  margin-top: 0.24rem;
}

/* ---------- download ---------- */

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20.8rem, 100%), 1fr));
  gap: 1.12rem;
}
.download-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.56rem;
  padding: 1.44rem 1.6rem;
  color: var(--ink);
}
.download-card:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.download-kind {
  font-family: var(--font-mono);
  font-size: var(--text-tick);
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 0;
}
.download-name {
  font-size: var(--text-lead);
  font-weight: 600;
  margin: 0.48rem 0 0.16rem;
}
.download-meta {
  font-family: var(--font-mono);
  font-size: var(--text-sub);
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}
.download-note {
  margin-top: 1.28rem;
  font-size: var(--text-body);
  color: var(--muted);
  text-wrap: pretty;
}

/* Platform blocks on the dedicated downloads page. */
.platform {
  border-top: 1px solid var(--rule);
  padding-top: 2.08rem;
  margin-top: 2.08rem;
}
.platform:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.platform-head {
  display: flex;
  align-items: baseline;
  gap: 0.96rem;
  flex-wrap: wrap;
  margin-bottom: 1.28rem;
}
.platform-head h3 {
  font-size: var(--text-lead);
  font-weight: 600;
  margin: 0;
}
.badge {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.16rem 0.56rem;
  border-radius: 0.24rem;
}
.badge-suggested {
  display: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.platform.is-suggested .badge-suggested {
  display: inline-block;
}
.download-card.is-suggested {
  border-color: var(--brand);
}

/* ---------- prose (legal and long-form pages) ---------- */

.prose {
  max-width: 46rem;
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display-sm);
  line-height: 1.15;
  margin: 2.56rem 0 0.64rem;
}
.prose h3 {
  font-size: var(--text-lead);
  font-weight: 600;
  margin: 1.6rem 0 0.48rem;
}
.prose p,
.prose li {
  color: var(--ink-2);
  text-wrap: pretty;
}
.prose ul,
.prose ol {
  padding-left: 1.44rem;
}
.prose li {
  margin-bottom: 0.48rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--sunken);
  border: 1px solid var(--line-soft);
  border-radius: 0.24rem;
  padding: 0.08rem 0.32rem;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.28rem 0;
  font-size: var(--text-emphasis);
}
.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.64rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
.prose th {
  font-family: var(--font-mono);
  font-size: var(--text-tick);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}
/* A wide table scrolls inside itself rather than pushing the page sideways. */
.table-scroll {
  overflow-x: auto;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 0.24rem solid var(--brand);
  border-radius: 0.4rem;
  padding: 1.28rem 1.6rem;
  margin: 1.6rem 0;
}
.callout p {
  margin: 0;
}
.callout p + p {
  margin-top: 0.8rem;
}
.callout-title {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- contact ---------- */

.contact-form {
  max-width: 32rem;
  display: grid;
  gap: 1.28rem;
}
.form-field {
  display: grid;
  gap: 0.4rem;
}
.form-field label {
  font-size: var(--text-sub);
  font-weight: 500;
  color: var(--ink-2);
}
.form-field input,
.form-field textarea,
.form-field select {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.72rem 0.88rem;
}
.form-field textarea {
  resize: vertical;
  min-height: 10rem;
}
.form-thanks {
  margin: 0;
  font-size: var(--text-lead);
  color: var(--ink-2);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.2rem;
  padding: 2.08rem 0 3.2rem;
  font-size: var(--text-body);
  color: var(--faint);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 1.6rem;
  margin-bottom: 2.08rem;
}
.footer-cols h2 {
  font-family: var(--font-mono);
  font-size: var(--text-tick);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin: 0 0 0.8rem;
}
.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-cols li {
  margin-bottom: 0.48rem;
}
.footer-cols a {
  color: var(--ink-2);
  font-size: var(--text-emphasis);
}
.footer-cols a:hover {
  color: var(--brand);
}
.footer-base {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.28rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.6rem;
}
.footer-base .wordmark-name {
  font-size: 1.28rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
