/* ==========================================================================
   Kioo design system — kioo.css
   Static, self-contained, light + dark. System fonts only.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand: #F97316;          /* Kioo Orange — fills, accents. NOT for small text on light. */
  --brand-deep: #EA580C;
  --brand-ink: #C2410C;      /* orange darkened for text use in light mode (4.5:1+ on white/cream) */
  --brand-ink-strong: #9A3412;
  --brand-soft: #FFEDD5;     /* tinted chips/backgrounds */
  --brand-soft-2: #FFE4C7;
  --on-brand: #431407;       /* dark warm ink used ON orange fills */

  /* Canvas & surfaces */
  --bg: #FFF7ED;             /* cream canvas */
  --surface: #FFFFFF;
  --surface-2: #FFFBF5;
  --tint: #FFFFFF;           /* .section--tint background */
  --header-bg: rgba(255, 247, 237, 0.92);
  --bezel: #211A15;          /* phone frame */

  /* Text */
  --text: #111827;
  --text-soft: #374151;
  --muted: #6B7280;
  --border: #E5E7EB;
  --border-strong: #D6CDC2;

  /* Feedback */
  --ok: #15803D;
  --ok-soft: #DCFCE7;
  --info: #1D4ED8;
  --info-soft: #DBEAFE;
  --warn: #92400E;
  --warn-soft: #FEF3C7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --error: #B91C1C;

  /* Subjects */
  --subj-math: #FF6B35;
  --subj-english: #4A90E2;
  --subj-science: #00897B;
  --subj-social: #2E7D32;
  --subj-re: #C62828;

  /* Brand band */
  --band-bg: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
  --band-text: #FFF7ED;
  --band-text-soft: rgba(255, 247, 237, 0.85);

  /* Effects */
  --shadow-1: 0 1px 2px rgba(67, 20, 7, 0.05), 0 2px 8px rgba(67, 20, 7, 0.05);
  --shadow-2: 0 2px 6px rgba(67, 20, 7, 0.06), 0 10px 28px rgba(67, 20, 7, 0.09);
  --shadow-3: 0 6px 16px rgba(67, 20, 7, 0.10), 0 24px 56px rgba(67, 20, 7, 0.16);
  --focus: #C2410C;

  /* Geometry & type */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

/* Dark palette — every token above gets a dark value here AND in [data-theme="dark"] */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #F97316;
    --brand-deep: #FB8A3C;
    --brand-ink: #FDBA74;
    --brand-ink-strong: #FED7AA;
    --brand-soft: rgba(249, 115, 22, 0.14);
    --brand-soft-2: rgba(249, 115, 22, 0.22);
    --on-brand: #431407;

    --bg: #161210;
    --surface: #211A15;
    --surface-2: #2A211A;
    --tint: #1D1712;
    --header-bg: rgba(22, 18, 16, 0.88);
    --bezel: #0C0908;

    --text: #F4EDE5;
    --text-soft: #DCD2C7;
    --muted: #B0A398;
    --border: #3B2F25;
    --border-strong: #4E4034;

    --ok: #4ADE80;
    --ok-soft: rgba(34, 197, 94, 0.16);
    --info: #93C5FD;
    --info-soft: rgba(59, 130, 246, 0.16);
    --warn: #FCD34D;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --danger: #FCA5A5;
    --danger-soft: rgba(239, 68, 68, 0.16);
    --error: #FCA5A5;

    --band-bg: linear-gradient(135deg, #9A3412 0%, #7C2D12 100%);
    --band-text: #FFF7ED;
    --band-text-soft: rgba(255, 247, 237, 0.82);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4);
    --shadow-3: 0 6px 16px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
    --focus: #FDBA74;

    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #F97316;
  --brand-deep: #FB8A3C;
  --brand-ink: #FDBA74;
  --brand-ink-strong: #FED7AA;
  --brand-soft: rgba(249, 115, 22, 0.14);
  --brand-soft-2: rgba(249, 115, 22, 0.22);
  --on-brand: #431407;

  --bg: #161210;
  --surface: #211A15;
  --surface-2: #2A211A;
  --tint: #1D1712;
  --header-bg: rgba(22, 18, 16, 0.88);
  --bezel: #0C0908;

  --text: #F4EDE5;
  --text-soft: #DCD2C7;
  --muted: #B0A398;
  --border: #3B2F25;
  --border-strong: #4E4034;

  --ok: #4ADE80;
  --ok-soft: rgba(34, 197, 94, 0.16);
  --info: #93C5FD;
  --info-soft: rgba(59, 130, 246, 0.16);
  --warn: #FCD34D;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --danger: #FCA5A5;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --error: #FCA5A5;

  --band-bg: linear-gradient(135deg, #9A3412 0%, #7C2D12 100%);
  --band-text: #FFF7ED;
  --band-text-soft: rgba(255, 247, 237, 0.82);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 6px 16px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
  --focus: #FDBA74;

  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: inline-block; }

a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-ink-strong); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-soft-2); color: var(--text); }

/* ---------- Skip link & visually hidden ---------- */
.visually-hidden,
.skip {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  width: auto; height: auto;
  margin: 0;
  padding: 0.75rem 1.25rem;
  clip: auto; clip-path: none;
  white-space: normal;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--brand);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-2);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.wrap--narrow { max-width: 760px; }

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

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

.section--brand {
  background: var(--band-bg);
  color: var(--band-text);
}
.section--brand .muted,
.section--brand .lead { color: var(--band-text-soft); }
.section--brand .eyebrow { color: var(--band-text); }
.section--brand a { color: var(--band-text); }
.section--brand :focus-visible { outline-color: #FFF7ED; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Type ---------- */
.h1, .h2, .h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text);
  text-wrap: balance;
}
.section--brand .h1, .section--brand .h2, .section--brand .h3 { color: var(--band-text); }

.h1 { font-size: clamp(2.1rem, 5.4vw, 3.35rem); margin: 0 0 0.5em; }
.h2 { font-size: clamp(1.55rem, 3.4vw, 2.25rem); margin: 0 0 0.55em; }
.h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); margin: 0 0 0.5em; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin: 0 0 0.9rem;
}

.lead {
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 62ch;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { flex: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 2px 0 rgba(154, 52, 18, 0.35), var(--shadow-1);
}
.btn--primary:hover {
  background: var(--brand-deep);
  color: var(--on-brand);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(154, 52, 18, 0.35), var(--shadow-2);
}
.btn--primary:active { transform: translateY(1px); box-shadow: var(--shadow-1); }

.btn--ghost {
  background: transparent;
  color: var(--brand-ink);
  border-color: currentColor;
}
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-ink-strong); }

.btn--quiet {
  background: transparent;
  color: var(--brand-ink);
  padding-inline: 0.6rem;
}
.btn--quiet:hover { background: var(--brand-soft); color: var(--brand-ink-strong); }

.btn--lg { padding: 0.95rem 1.9rem; font-size: 1.08rem; }
.btn--block { display: flex; width: 100%; }

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Buttons inside the brand band */
.section--brand .btn--primary { background: #FFF7ED; color: #9A3412; box-shadow: var(--shadow-2); }
.section--brand .btn--primary:hover { background: #FFFFFF; color: #7C2D12; }
.section--brand .btn--ghost { color: var(--band-text); border-color: rgba(255, 247, 237, 0.6); }
.section--brand .btn--ghost:hover { background: rgba(255, 247, 237, 0.12); color: var(--band-text); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card--pad { padding: clamp(1.25rem, 3vw, 1.75rem); }
.card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.card__body { color: var(--text-soft); }
.card__body > :last-child { margin-bottom: 0; }

.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
  color: inherit;
}

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  vertical-align: middle;
}
.badge--free { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.badge--pro { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Stats ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
.stat { min-width: 130px; flex: 1 1 130px; max-width: 220px; }
.stat__n {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  line-height: 1.1;
}
.stat__l {
  display: block;
  margin-top: 0.3rem;
  font-weight: 700;
  color: var(--text);
}
.stat__sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.section--brand .stat__n { color: var(--band-text); }
.section--brand .stat__l { color: var(--band-text); }
.section--brand .stat__sub { color: var(--band-text-soft); }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  counter-reset: step;
}
.step { position: relative; }
.step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-1);
}
.step__t {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.step__d { color: var(--text-soft); margin: 0; }

/* ---------- Pricing ---------- */
.plans {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  align-items: stretch;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  box-shadow: var(--shadow-1);
}
.plan--featured {
  border: 2px solid var(--brand);
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--surface) 34%);
  box-shadow: var(--shadow-2);
}
.plan__flag {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
}
.plan__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}
.plan__price {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.plan__period { font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.plan__list {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
  flex: 1;
}
.plan__list li {
  position: relative;
  padding: 0.32rem 0 0.32rem 1.9rem;
  color: var(--text-soft);
}
.plan__list li::before {
  content: "\2713";
  position: absolute;
  left: 0.15rem;
  top: 0.32rem;
  font-weight: 800;
  color: var(--ok);
}
.plan__foot { margin-top: auto; }
.plan__foot .muted { font-size: 0.85rem; }

/* ---------- Subject tiles ---------- */
.subjects {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
@media (min-width: 1080px) {
  .subjects { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
.subject {
  --accent: var(--brand);
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-m);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.subject:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); color: inherit; }
.subject__img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}
.subject__body { padding: 1rem 1.1rem 1.15rem; }
.subject__body > :last-child { margin-bottom: 0; }
.subject__body strong,
.subject__body .card__title { font-family: var(--font-display); }

.subject--math { --accent: var(--subj-math); }
.subject--english { --accent: var(--subj-english); }
.subject--science { --accent: var(--subj-science); }
.subject--social { --accent: var(--subj-social); }
.subject--re { --accent: var(--subj-re); }

/* ---------- Phone mockups ---------- */
.phone {
  background: var(--bezel);
  border-radius: 46px;
  padding: 11px;
  box-shadow: var(--shadow-3), inset 0 0 0 2px rgba(255, 255, 255, 0.07);
  width: min(100%, 300px);
  flex: none;
}
.phone__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 36px;
  background: #FFFFFF;
}

.phones {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 1rem;
}
@media (min-width: 761px) {
  .phones .phone { width: 37%; max-width: 270px; }
  .phones .phone:only-child { width: min(64%, 300px); }
  .phones .phone:nth-child(2) { z-index: 2; }
  .phones .phone:first-child:nth-last-child(n+2) { transform: rotate(-5deg) translateY(16px); margin-right: -8%; z-index: 1; }
  .phones .phone:nth-child(3) { transform: rotate(5deg) translateY(16px); margin-left: -8%; z-index: 1; }
}
@media (max-width: 760px) {
  .phones {
    justify-content: flex-start;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0.25rem 1.5rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .phones .phone { width: 220px; scroll-snap-align: center; }
  .phones .phone:only-child { margin-inline: auto; }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-1);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.nav__logo img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav__link:hover { background: var(--brand-soft); color: var(--brand-ink-strong); }
.nav__link.is-active { background: var(--brand-soft); color: var(--brand-ink); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav__actions .btn { padding: 0.55rem 1.15rem; font-size: 0.95rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--border-strong); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-burger { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

.nav__drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  padding: 0.75rem 0 1.25rem;
}
.nav__drawer.is-open { display: block; }
.nav__drawer .nav__links {
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
}
.nav__drawer .nav__link {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-s);
  font-size: 1.05rem;
}
.nav__drawer .btn { margin-top: 0.9rem; }

@media (max-width: 900px) {
  .nav > .nav__links { display: none; }
  .nav__actions > .btn { display: none; }
  .nav__toggle { display: inline-flex; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--tint);
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  font-size: 0.95rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .footer__grid { grid-template-columns: minmax(0, 1fr); } }

.footer__col { min-width: 0; }

.footer__head {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 0.45rem; }
.footer__links a {
  color: var(--text-soft);
  text-decoration: none;
}
.footer__links a:hover { color: var(--brand-ink); text-decoration: underline; }

.footer__bottom {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer__legal { margin: 0; }

/* ---------- FAQ / accordion ---------- */
.faq { display: grid; gap: 0.85rem; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::marker { content: ""; }
.faq__item summary::after {
  content: "";
  flex: none;
  width: 0.65rem; height: 0.65rem;
  border-right: 2.5px solid var(--brand-ink);
  border-bottom: 2.5px solid var(--brand-ink);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -0.25rem;
}
.faq__item[open] summary::after { transform: rotate(225deg); margin-top: 0.25rem; }
.faq__item[open] summary { border-bottom: 1px solid var(--border); }
.faq__item summary:hover { background: var(--surface-2); }
.faq__item > :not(summary) { padding: 1rem 1.3rem; }
.faq__item > :not(summary) { color: var(--text-soft); margin: 0; }
.faq__item p + p { margin-top: 0.6em; }

/* ---------- Legal / doc pages ---------- */
.doc {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.doc__aside {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.5rem;
}
@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc__aside {
    position: static;
    max-height: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 1rem 1.25rem;
  }
}

.toc { font-size: 0.92rem; }
.toc ol, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.42rem 0.85rem;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.toc a:hover { color: var(--text); border-left-color: var(--border-strong); }
.toc a.is-active {
  color: var(--brand-ink);
  border-left-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.toc > .h3, .toc__head {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.doc__meta {
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
}

.doc__body { max-width: 68ch; font-size: 1.02rem; }
.doc__body h1, .doc__body h2, .doc__body h3, .doc__body h4 {
  scroll-margin-top: 96px;
  letter-spacing: -0.015em;
}
.doc__body h2 {
  font-size: 1.5rem;
  margin: 2.2em 0 0.7em;
  padding-top: 0.4em;
}
.doc__body h2:first-child { margin-top: 0; }
.doc__body h3 { font-size: 1.15rem; margin: 1.8em 0 0.6em; }
.doc__body p, .doc__body li { color: var(--text-soft); }
.doc__body ul, .doc__body ol { padding-left: 1.4rem; margin: 0 0 1.1em; }
.doc__body li { margin-bottom: 0.4em; }
.doc__body li::marker { color: var(--brand-ink); }
.doc__body blockquote {
  margin: 1.4em 0;
  padding: 0.85rem 1.25rem;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--text);
}
.doc__body blockquote p:last-child { margin-bottom: 0; }
.doc__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  color: var(--text);
  overflow-wrap: break-word;
}
.doc__body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1rem 1.25rem;
  overflow-x: auto;
}
.doc__body pre code { background: none; border: 0; padding: 0; }
.doc__body table { width: 100%; }
.doc__body hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.doc__body a { overflow-wrap: break-word; }

/* Anchor offset for all in-page targets, not just docs */
[id] { scroll-margin-top: 90px; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  margin-block: 1.25em;
}
.table-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0;
}
.table-wrap caption {
  text-align: left;
  padding: 0.9rem 1.1rem 0;
  font-weight: 700;
  font-family: var(--font-display);
}
.table-wrap th, .table-wrap td {
  padding: 0.75rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-wrap thead th {
  background: var(--surface-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody th { font-weight: 600; }

/* ---------- Forms ---------- */
.form { display: block; }
.form .field + .field { margin-top: 1.1rem; }

.field { display: block; }

.label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
}
.label .muted { font-weight: 500; }

.hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.input, .select, .textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-s);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft-2);
}
.textarea { min-height: 8rem; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

/* invalid only after interaction */
.input:user-invalid, .select:user-invalid, .textarea:user-invalid,
.was-validated .input:invalid, .was-validated .select:invalid, .was-validated .textarea:invalid {
  border-color: var(--error);
}
.input:user-invalid:focus-visible,
.was-validated .input:invalid:focus-visible {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.error {
  display: block;
  color: var(--error);
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.98rem;
  color: var(--text-soft);
  cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] {
  flex: none;
  width: 1.2rem; height: 1.2rem;
  margin-top: 0.18rem;
  accent-color: var(--brand);
  cursor: pointer;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.radio-card:hover { border-color: var(--brand); }
.radio-card input[type="radio"], .radio-card input[type="checkbox"] {
  flex: none;
  width: 1.2rem; height: 1.2rem;
  margin-top: 0.2rem;
  accent-color: var(--brand);
}
.radio-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.radio-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}
.form-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.9rem;
}

fieldset.field, .form fieldset {
  border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0;
}
.form legend { padding: 0; }

/* ---------- Notices ---------- */
.note {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin-block: 1.25em;
  color: var(--text-soft);
  font-size: 0.98rem;
}
.note > :last-child { margin-bottom: 0; }
.note__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.3rem;
}
.note--info { background: var(--info-soft); border-color: transparent; border-left: 4px solid var(--info); }
.note--warn { background: var(--warn-soft); border-color: transparent; border-left: 4px solid var(--warn); }
.note--danger { background: var(--danger-soft); border-color: transparent; border-left: 4px solid var(--danger); }
.note--info .note__title { color: var(--info); }
.note--warn .note__title { color: var(--warn); }
.note--danger .note__title { color: var(--danger); }

/* ---------- Misc ---------- */
.crumbs {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.crumbs ol, .crumbs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0; padding: 0;
}
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before {
  content: "/";
  margin: 0 0.5rem;
  color: var(--border-strong);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.crumbs [aria-current], .crumbs li:last-child { color: var(--text-soft); font-weight: 600; }

.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.cta-band {
  background: var(--band-bg);
  color: var(--band-text);
  border-radius: var(--radius-l);
  padding: clamp(2rem, 6vw, 3.75rem);
  text-align: center;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 420px; height: 420px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(255, 247, 237, 0.16), transparent 70%);
  pointer-events: none;
}
.cta-band .h2, .cta-band h2 { color: var(--band-text); }
.cta-band .lead, .cta-band p { color: var(--band-text-soft); }
.cta-band .btn-row { justify-content: center; }
.cta-band .btn--primary { background: #FFF7ED; color: #9A3412; box-shadow: var(--shadow-2); }
.cta-band .btn--primary:hover { background: #FFFFFF; color: #7C2D12; }
.cta-band .btn--ghost { color: var(--band-text); border-color: rgba(255, 247, 237, 0.6); }
.cta-band .btn--ghost:hover { background: rgba(255, 247, 237, 0.12); color: var(--band-text); }
.cta-band :focus-visible { outline-color: #FFF7ED; }

/* Store badge (drawn locally, no external assets) */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: #111827;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.55rem 1.15rem 0.6rem;
  text-decoration: none;
  line-height: 1.15;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: #FFFFFF; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge__txt { display: flex; flex-direction: column; text-align: left; }
.store-badge__kicker {
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.85;
}
.store-badge__name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
}
.store-badge--soon { opacity: 0.6; pointer-events: none; }

/* ---------- Reveal on scroll ---------- */
.reveal { /* visible by default; JS opts elements in */ }
.reveal.is-hidden {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-hidden, .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
