/*
 * LifeTrack — presentation page stylesheet.
 *
 * Tokens are the product's own (docs/design/ux-pages.md §4.1): the site and the
 * app must read as one thing. Dark values are normative and copied verbatim;
 * the light set is the documented light-theme twin of the same roles.
 *
 * No @font-face, no @import, no url() pointing anywhere: the page must not make
 * a single network request beyond its own two files.
 *
 * Contrast (checked, WCAG 2.1):
 *   ink / base ................. 18.1:1 dark · 18.6:1 light
 *   ink-secondary / base ....... 10.9:1 dark ·  7.5:1 light
 *   ink-muted / base ...........  5.4:1 dark ·  4.6:1 light
 *   #FFFFFF / accent-strong ....  6.6:1 (primary button, both themes)
 *   accent / base ..............  5.3:1 dark  — accent-strong / base 6.3:1 light
 * #3987E5 on white is only 3.6:1, which is why the filled button uses the dark
 * step of the same blue ramp (#1C5CAB, ux-pages §4.4) instead of the accent.
 */

:root {
  color-scheme: light dark;

  /* Light theme (ux-pages §4.1, « thème clair, mêmes rôles »). */
  --base: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f1ec;
  --border: rgba(11, 11, 11, 0.12);
  --border-strong: rgba(11, 11, 11, 0.22);
  --ink: #0b0b0b;
  --ink-secondary: #52514e;
  --ink-muted: #63625e;
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  /* Accent used as TEXT. #2a78d6 on #f9f9f7 is only 4.18:1 — under AA for body
     sizes — so light mode drops to the dark step of the ramp (6.3:1). Dark mode
     keeps the identity blue, which is 5.3:1 on #0d0d0d. */
  --accent-text: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.1);
  --positive: #006300;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.06), 0 8px 24px rgba(11, 11, 11, 0.05);

  --radius-card: 12px;
  --radius-lg: 20px;
  --shell: 72rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark theme — normative hex values, do not change (ux-pages §4.1). */
    --base: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242423;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.22);
    --ink: #ffffff;
    --ink-secondary: #c3c2b7;
    --ink-muted: #898781;
    --accent: #3987e5;
    --accent-strong: #1c5cab;
    --accent-text: #3987e5;
    --accent-soft: rgba(57, 135, 229, 0.14);
    --positive: #0ca30c;
    --shadow: none;
  }
}

/* ----------------------------------------------------------------- reset -- */

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

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

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

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

/* Needed because several [hidden] elements below carry a display rule. */
[hidden] {
  display: none !important;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.2em;
}

/* One visible, high-contrast focus ring everywhere — keyboard navigation is
   the only way some people use this page. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent-strong);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--base) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

@supports not (backdrop-filter: blur(10px)) {
  .site-header {
    background: var(--base);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2rem);
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: inline-flex;
  color: var(--accent);
  width: 2rem;
  height: 2rem;
}

.brand__mark svg {
  width: 100%;
  height: 100%;
}

.brand__mark--small {
  width: 1.5rem;
  height: 1.5rem;
}

.brand__word {
  font-size: 1.15rem;
}

.site-nav {
  margin-inline-start: auto;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
}

.site-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 47.99em) {
  .site-nav {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
    border-top: 1px solid var(--border);
    padding-block: 0.25rem 0.5rem;
  }
  .site-nav ul {
    justify-content: space-between;
  }
  .site-header__inner > .button {
    margin-inline-start: auto;
  }
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button--primary {
  background: var(--accent-strong);
  color: #ffffff;
}

.button--primary:hover {
  background: #164a8b;
}

.button--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.button--secondary:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.button--ghost {
  background: transparent;
  color: var(--accent-text);
  border-color: var(--border-strong);
}

.button--ghost:hover {
  background: var(--accent-soft);
}

.button--compact {
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}

.button--block {
  width: 100%;
}

/* The APK button when no APK is published: not a link any more, so no dead
   href can be clicked (see apk.js). */
.button[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--ink-muted);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

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

.hero {
  padding-block: clamp(2.5rem, 8vw, 5.5rem);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--accent-soft), transparent 70%);
}

.hero__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

@media (min-width: 62em) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.lede {
  margin-top: 1rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-secondary);
  max-width: 44ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero__facts {
  margin-top: 2rem;
  display: grid;
  gap: 0.6rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.hero__facts li {
  position: relative;
  padding-inline-start: 1.5rem;
}

/* Decorative check: the meaning is carried by the text, never by the glyph. */
.hero__facts li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.15rem;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--positive);
}

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

.section {
  padding-block: clamp(3rem, 8vw, 5rem);
}

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

.section__head {
  max-width: 52ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  letter-spacing: -0.015em;
}

.section__lede {
  margin-top: 0.9rem;
  color: var(--ink-secondary);
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow);
}

.section--alt .card {
  background: var(--base);
}

.modules {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.module h3,
.feature h3,
.privacy h3,
.download__title {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 0.6rem;
}

.module p,
.feature p,
.privacy p {
  color: var(--ink-secondary);
  font-size: 0.97rem;
}

.privacy {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

/* ------------------------------------------------------ screenshot slots -- */

/*
 * Deliberately neutral: a labelled empty frame, never a mocked-up interface.
 * A later agent swaps .shot__placeholder for a real <img> (see index.html).
 */
.shot {
  margin: 1.25rem 0 0;
}

/* A real capture sits in the frame the placeholder used to draw: same radius,
   same border, so a filled slot and an empty one read as the same component.
   `img { max-width: 100% }` in the reset keeps it responsive; the width/height
   attributes in the HTML reserve the box before the file arrives. */
.shot img {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-2);
}

.shot--hero img {
  border-radius: var(--radius-lg);
}

.shot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  aspect-ratio: 16 / 10;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: repeating-linear-gradient(
    135deg,
    var(--surface-2),
    var(--surface-2) 10px,
    transparent 10px,
    transparent 20px
  );
  color: var(--ink-muted);
  text-align: center;
  padding: 1rem;
}

.shot__label {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.shot__hint {
  font-size: 0.82rem;
}

.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.shot--hero {
  margin-top: 0;
}

.shot--hero .shot__placeholder {
  aspect-ratio: 16 / 11;
  border-radius: var(--radius-lg);
}

.shot--android {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.shot--android .shot__placeholder {
  aspect-ratio: 16 / 7;
}

/* --------------------------------------------------------------- android -- */

.android {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
}

@media (min-width: 62em) {
  .android {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 22rem);
  }
}

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

.feature {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 1rem;
}

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

.download {
  position: sticky;
  top: 5rem;
}

@media (max-width: 61.99em) {
  .download {
    position: static;
  }
}

.download__version {
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 650;
}

.download__meta {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download__meta > div {
  min-width: 0;
}

.download__meta-full {
  grid-column: 1 / -1;
}

.download__meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 650;
}

.download__meta dd {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.download__meta-full dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.checksum {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.35rem 0.5rem;
}

.download__status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.download__status:empty {
  display: none;
}

.download__help,
.download__noscript {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: clamp(2rem, 5vw, 3rem);
}

.site-footer__inner {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48em) {
  .site-footer__inner {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .site-footer__legal {
    grid-column: 1 / -1;
  }
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.site-footer__version {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.site-footer__links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

@media (min-width: 48em) {
  .site-footer__links ul {
    justify-content: flex-end;
  }
}

.site-footer__muted {
  color: var(--ink-muted);
}

.site-footer__legal {
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 70ch;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
