/*
 * The app's own tokens, transposed.
 *
 * Same names, same values as `learnpath-frontend-service/src/styles/tokens.css`
 * — a visitor who installs the app must not meet a different product. The one
 * deliberate difference is the DEFAULT: the app follows the system, this site
 * opens LIGHT and offers a toggle. A brochure page is usually met once, from a
 * search result, and light is what the rest of the web looks like.
 *
 * Three ways in, and the order matters: `:root` is light, the media query
 * darkens only when nothing has been chosen, and `[data-theme]` on the root —
 * written by the toggle — beats both.
 */

:root {
  color-scheme: light;

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;

  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-display: clamp(2rem, 1.2rem + 3.4vw, 3.5rem);

  --leading-tight: 1.1;
  --leading-prose: 1.7;
  --tracking-tight: -0.022em;
  --tracking-caps: 0.06em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  --measure: 68ch;

  /* Light — the app's own light palette, ratios included. */
  --bg: #ffffff;
  --surface: #f2f2f7;
  --surface-raised: #ffffff;
  --surface-control: #e4e4ea;
  --ink: #1d1d1f; /* 16.83:1 on --bg */
  --ink-muted: #6d6d72; /*  5.15:1 on --bg */
  --ink-faint: #77777b; /*  4.46:1 on --bg — large text and icons only */
  --ink-inverse: #ffffff;
  --accent: #d70022; /* 5.37:1 on --bg */
  --accent-fill: #d70022;
  --accent-hover: #b8001d;
  --accent-soft: #fdeaed;
  --line: rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Only when the visitor has expressed nothing. The toggle's [data-theme]
   below outranks this, in both directions. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-raised: #2c2c2e;
    --surface-control: #3a3a3d;
    --ink: #f5f5f7;
    --ink-muted: #98989f;
    --ink-faint: #84848a;
    --ink-inverse: #000000;
    --accent: #ff5770;
    --accent-fill: #eb0023;
    --accent-hover: #ff7286;
    --accent-soft: #2a1015;
    --line: rgba(255, 255, 255, 0.14);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-raised: #2c2c2e;
  --surface-control: #3a3a3d;
  --ink: #f5f5f7;
  --ink-muted: #98989f;
  --ink-faint: #84848a;
  --ink-inverse: #000000;
  --accent: #ff5770;
  --accent-fill: #eb0023;
  --accent-hover: #ff7286;
  --accent-soft: #2a1015;
  --line: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f2f2f7;
  --surface-raised: #ffffff;
  --surface-control: #e4e4ea;
  --ink: #1d1d1f;
  --ink-muted: #6d6d72;
  --ink-faint: #77777b;
  --ink-inverse: #ffffff;
  --accent: #d70022;
  --accent-fill: #d70022;
  --accent-hover: #b8001d;
  --accent-soft: #fdeaed;
  --line: rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--leading-prose);
  /* The one transition on the page: the theme swap, so the toggle reads as a
     change of light rather than a page replacement. */
  transition: background-color 160ms ease, color 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* --- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand svg {
  display: block;
}

.controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.langs {
  display: flex;
  gap: 2px;
  background: var(--surface-control);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.langs a {
  display: block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--ink-muted);
  text-decoration: none;
}

.langs a[aria-current='true'] {
  background: var(--bg);
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-control);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The sun and the moon swap by theme; both ship, one is hidden. */
.theme-toggle .moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun {
    display: none;
  }

  :root:not([data-theme]) .theme-toggle .moon {
    display: block;
  }
}

/* --- Sections ---------------------------------------------------------- */

section {
  padding: var(--space-8) 0;
}

h1,
h2,
h3 {
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0;
}

h1 {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  max-width: 18ch;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

p {
  margin: 0;
}

.lead {
  margin-top: var(--space-5);
  max-width: var(--measure);
  color: var(--ink-muted);
}

.hero {
  padding-top: var(--space-8);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-fill);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-control);
  color: var(--ink);
}

.note {
  margin-top: var(--space-4);
  font-size: var(--text-md);
  color: var(--ink-faint);
}

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}

.card p {
  color: var(--ink-muted);
  font-size: var(--text-md);
}

.steps {
  counter-reset: step;
}

.steps .card {
  position: relative;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.band {
  background: var(--surface);
}

.band ul {
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.band li {
  position: relative;
  padding-left: var(--space-5);
  color: var(--ink-muted);
  font-size: var(--text-md);
}

.band li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.band p {
  max-width: var(--measure);
  color: var(--ink-muted);
}

.closing {
  text-align: center;
}

.closing h2 {
  font-size: var(--text-display);
  margin-bottom: var(--space-3);
}

.closing p {
  color: var(--ink-muted);
}

.closing .actions {
  justify-content: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-6) 0;
  color: var(--ink-faint);
  font-size: var(--text-md);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
}
