/* learn.css — shared stylesheet for /learn/ content route (EN + ES).
   Track A owns this file. Track B (ES) imports it via /learn/learn.css.
   Tokens: ADR 028 "light is earned" palette.
   No external resources — CSP forbids Google Fonts; no woff2 in repo → system fallback.
   Built: 2026-06-26 (ADR 037, bilingual static SEO route). */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

/* ── Design tokens (ADR 028) ──────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --ns-bg:       #0A0712;
  --ns-surface:  #150E24;
  --ns-surface-2:#1F1633;
  --ns-line:     #221842;
  --ns-line-2:   #2A2050;

  /* Text */
  --ns-text:     #F4ECFF;
  --ns-text-mid: #B6A6D6;
  --ns-text-low: #8B7CAE;

  /* Roles */
  --ns-action:   #FF4FA3;
  --ns-tax:      #FBBF24;
  --ns-gain:     #57D6A0;

  /* Celebration — earned only, single CTA per page */
  --ns-celebrate: linear-gradient(100deg, #FBBF24, #FF4FA3 48%, #B36BFF);

  /* Typography — system fallback stacks (no woff2 in repo; CSP forbids Google Fonts) */
  --ns-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ns-ui:      'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Space */
  --ns-1: 4px;
  --ns-2: 8px;
  --ns-3: 12px;
  --ns-4: 16px;
  --ns-5: 20px;
  --ns-6: 24px;

  /* Radius */
  --ns-r-card: 16px;
  --ns-r-inner: 12px;
  --ns-r-pill: 999px;

  /* Motion */
  --ns-ease: cubic-bezier(.2, .8, .2, 1);

  /* Layout */
  --nav-h: 60px;
  --measure: 68ch;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  background: var(--ns-bg);
  color: var(--ns-text);
  font-family: var(--ns-ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--ns-text-mid);
  text-decoration: none;
}

a:hover {
  color: var(--ns-text);
}

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

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.learn-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 7, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ns-line);
}

.learn-nav__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--ns-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ns-4);
}

.learn-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--ns-3);
  font-family: var(--ns-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--ns-text);
  text-decoration: none;
  flex-shrink: 0;
}

.learn-nav__logo img {
  width: 28px;
  height: 28px;
}

.learn-nav__right {
  display: flex;
  align-items: center;
  gap: var(--ns-4);
}

/* ── Language switch ──────────────────────────────────────────────────────── */
.lang-switch {
  font-size: 13px;
  font-weight: 600;
  color: var(--ns-text-mid);
  padding: 6px 12px;
  border: 1px solid var(--ns-line-2);
  border-radius: var(--ns-r-pill);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.lang-switch:hover {
  border-color: var(--ns-action);
  color: var(--ns-text);
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.learn-breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--ns-4) var(--ns-5) 0;
  font-size: 13px;
  color: var(--ns-text-low);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.learn-breadcrumb a {
  color: var(--ns-text-low);
  text-decoration: none;
}

.learn-breadcrumb a:hover {
  color: var(--ns-text-mid);
}

.learn-breadcrumb__sep {
  color: var(--ns-line-2);
  user-select: none;
}

.learn-breadcrumb__current {
  color: var(--ns-text-mid);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.learn-hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px var(--ns-5) 32px;
}

.learn-hero__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ns-text-low);
  display: block;
  margin-bottom: var(--ns-3);
  font-family: var(--ns-ui);
}

.learn-hero h1 {
  font-family: var(--ns-display);
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--ns-text);
  margin-bottom: var(--ns-5);
  max-width: var(--measure);
}

.learn-hero__dek {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--ns-text-mid);
  line-height: 1.65;
  max-width: var(--measure);
  margin-bottom: var(--ns-5);
}

/* ── Main article area ────────────────────────────────────────────────────── */
.learn-article {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--ns-5) 64px;
  /* Two-column on wide: article left, sidebar right — simple approach */
}

/* Article prose (max reading measure) */
.learn-article__body {
  max-width: var(--measure);
}

.learn-article__body h2 {
  font-family: var(--ns-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ns-text);
  margin-top: 48px;
  margin-bottom: var(--ns-4);
}

.learn-article__body h3 {
  font-family: var(--ns-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ns-text);
  margin-top: 32px;
  margin-bottom: var(--ns-3);
}

.learn-article__body p {
  color: var(--ns-text-mid);
  margin-bottom: var(--ns-5);
  max-width: var(--measure);
}

.learn-article__body ul,
.learn-article__body ol {
  color: var(--ns-text-mid);
  margin: 0 0 var(--ns-5) var(--ns-6);
}

.learn-article__body li {
  margin-bottom: var(--ns-2);
  line-height: 1.65;
}

.learn-article__body strong {
  color: var(--ns-text);
  font-weight: 700;
}

/* Comparison table (used in ns-vs-serverlife) */
.learn-table-wrap {
  overflow-x: auto;
  margin: var(--ns-6) 0;
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-r-card);
}

.learn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--ns-surface);
}

.learn-table thead th {
  background: var(--ns-surface-2);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--ns-display);
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--ns-line);
  color: var(--ns-text-mid);
  white-space: nowrap;
}

.learn-table thead th:first-child {
  width: 50%;
}

.learn-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ns-line);
  vertical-align: middle;
  color: var(--ns-text-mid);
}

.learn-table tbody tr:last-child td { border-bottom: 0; }

.learn-table td.t-win {
  color: var(--ns-gain);
  font-weight: 700;
}

/* ── Tax disclaimer ───────────────────────────────────────────────────────── */
.learn-disclaimer {
  background: var(--ns-surface);
  border: 1px solid var(--ns-line);
  border-left: 4px solid var(--ns-tax);
  border-radius: var(--ns-r-inner);
  padding: var(--ns-5) var(--ns-6);
  margin: 32px 0;
  max-width: var(--measure);
}

.learn-disclaimer p {
  font-size: 13.5px;
  color: var(--ns-text-mid);
  line-height: 1.6;
  margin: 0;
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.learn-faq {
  max-width: var(--measure);
  margin: 48px 0 0;
}

.learn-faq__heading {
  font-family: var(--ns-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--ns-text);
  margin-bottom: 24px;
}

.learn-faq__list {
  border-top: 1px solid var(--ns-line);
  list-style: none;
  margin: 0;
  padding: 0;
}

.learn-faq__item {
  border-bottom: 1px solid var(--ns-line);
}

.learn-faq__q {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: var(--ns-text);
  cursor: pointer;
  font-family: var(--ns-ui);
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  padding: 18px 36px 18px 0;
  position: relative;
  line-height: 1.4;
}

.learn-faq__q::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--ns-action);
  font-weight: 400;
  transition: transform 0.2s var(--ns-ease), content 0.1s;
}

.learn-faq__item[open] .learn-faq__q::after {
  content: "\2212";
}

.learn-faq__a {
  padding: 0 0 20px;
  font-size: 14.5px;
  color: var(--ns-text-mid);
  line-height: 1.65;
  max-width: var(--measure);
}

/* Accessible disclosure using <details>/<summary> */
details.learn-faq__item summary {
  list-style: none;
}

details.learn-faq__item summary::-webkit-details-marker {
  display: none;
}

/* ── CTA (the single earned element per page) ─────────────────────────────── */
.learn-cta {
  margin: 56px 0 0;
  text-align: center;
  padding: 56px var(--ns-5);
  background: var(--ns-surface);
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-r-card);
  max-width: var(--measure);
}

.learn-cta__heading {
  font-family: var(--ns-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  color: var(--ns-text);
  margin-bottom: var(--ns-4);
  line-height: 1.25;
}

/* Celebration gradient — the single earned-light element */
.learn-cta__btn {
  display: inline-block;
  background: var(--ns-celebrate);
  color: #fff;
  font-family: var(--ns-display);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: var(--ns-r-pill);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(255, 79, 163, 0.35);
  transition: transform 0.15s var(--ns-ease), box-shadow 0.2s;
}

.learn-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 79, 163, 0.5);
  color: #fff;
}

.learn-cta__sub {
  margin-top: var(--ns-4);
  font-size: 12.5px;
  color: var(--ns-text-low);
}

/* ── Hub grid ─────────────────────────────────────────────────────────────── */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--ns-5);
  margin-top: 40px;
  list-style: none;
  padding: 0;
}

.learn-card {
  background: var(--ns-surface);
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-r-card);
  padding: var(--ns-6);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, transform 0.15s var(--ns-ease);
}

.learn-card:hover {
  border-color: var(--ns-action);
  transform: translateY(-2px);
  color: var(--ns-text);
}

.learn-card__title {
  font-family: var(--ns-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ns-text);
  line-height: 1.3;
  margin-bottom: var(--ns-3);
}

.learn-card__dek {
  font-size: 14px;
  color: var(--ns-text-mid);
  line-height: 1.55;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.learn-footer {
  border-top: 1px solid var(--ns-line);
  padding: 32px var(--ns-5) 48px;
  color: var(--ns-text-low);
  font-size: 13px;
}

.learn-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.learn-footer__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.learn-footer__links a {
  color: var(--ns-text-low);
  font-size: 13px;
  text-decoration: none;
}

.learn-footer__links a:hover {
  color: var(--ns-text-mid);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .learn-cta__btn:hover,
  .learn-card:hover {
    transform: none;
  }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .learn-hero {
    padding-top: 32px;
  }

  .learn-cta {
    padding: 40px var(--ns-4);
  }

  .learn-table {
    font-size: 13px;
  }

  .learn-table thead th,
  .learn-table tbody td {
    padding: 10px 10px;
  }
}
