/* ==========================================================================
   Shared stylesheet for the four guide sites.
   --------------------------------------------------------------------------
   These are reading sites. Someone arrives mid-problem, on a phone, often on a
   poor connection, wanting an answer — so the priorities are: text that is
   comfortable to read at arm's length, a measure that does not force the eye to
   track across half a screen, and no layout that shifts while it loads.

   One stylesheet serves all four. Each site sets --accent on :root; nothing
   else differs, so a fix here fixes it everywhere.

   No web font is loaded on purpose. A system font stack renders instantly, has
   no layout shift and no third-party request, and on a guide page the reader
   gains nothing from a typeface that costs them a second on 3G.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --accent: #1f6feb;          /* overridden per site */
  --accent-ink: #14539a;      /* the accent at text contrast on light surfaces */

  --ink: #1a1d21;
  --ink-soft: #4a5058;
  --ink-faint: #6b727c;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --line: #e3e6ea;
  --code-bg: #f2f4f7;
  --shadow: 0 1px 2px rgba(16, 20, 26, .05), 0 8px 24px -16px rgba(16, 20, 26, .25);

  --measure: 68ch;            /* ~90 characters is too wide; this reads well */
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --ink-soft: #b3b9c2;
    --ink-faint: #8b929c;
    --bg: #121417;
    --bg-soft: #1a1d21;
    --line: #2b2f36;
    --code-bg: #1e2228;
    --accent-ink: #7fb2ff;    /* lifted for contrast on dark */
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -16px rgba(0, 0, 0, .8);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
@media (max-width: 26rem) { .wrap { width: calc(100% - 1.75rem); } }

/* --- header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); flex: none; }
.nav { display: flex; gap: 1.4rem; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .9375rem; }
.nav a:hover { color: var(--accent-ink); }
@media (max-width: 40rem) { .nav { gap: 1rem; } .nav a { font-size: .875rem; } }
@media (max-width: 26rem) { .nav a.opt { display: none; } }

/* --- type ---------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.65rem); margin: 2.6rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.9rem 0 .5rem; }
p, ul, ol, table { max-width: var(--measure); }
p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.1rem; padding-inline-start: 1.3rem; }
li { margin-bottom: .45rem; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
strong { font-weight: 650; }
code {
  font: .9em/1.5 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: .12em .38em;
  border-radius: 4px;
  word-break: break-word;
}
table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: .9375rem; }
th, td { text-align: start; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--ink); }
/* A wide table must scroll inside itself, not push the page sideways. */
.table-scroll { overflow-x: auto; max-width: var(--measure); }

/* --- hero ---------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.hero .lead { font-size: 1.1875rem; color: var(--ink-soft); max-width: var(--measure); }

/* --- guide cards --------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 1.5rem 0 0; max-width: none; }
.card {
  display: block;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card h3 { margin: 0 0 .4rem; font-size: 1.0625rem; }
.card p { margin: 0; font-size: .9375rem; color: var(--ink-soft); max-width: none; }

/* --- article ------------------------------------------------------------- */
.article { padding: clamp(2rem, 5vw, 3.5rem) 0 1rem; }
.article-meta { color: var(--ink-faint); font-size: .875rem; margin-bottom: .5rem; }
.callout {
  max-width: var(--measure);
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* --- footer -------------------------------------------------------------- */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; padding: 2.25rem 0; }
.footer-col h4 { margin: 0 0 .6rem; font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .35rem; }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: .9375rem; }
.footer-col a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-note { padding: 0 0 2rem; color: var(--ink-faint); font-size: .8125rem; max-width: 60ch; }

/* --- WhatsApp ------------------------------------------------------------ */
.wa-float {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .95rem;
  border-radius: 999px;
  background: #1fa855;
  color: #fff;
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5);
}
.wa-float:hover { background: #178f47; }
.wa-float svg { width: 22px; height: 22px; fill: currentColor; display: block; }
@media (max-width: 30rem) { .wa-float span { display: none; } .wa-float { padding: .8rem; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.1rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; color: var(--accent-ink); border-color: var(--line); }

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 60; background: var(--bg); padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 8px; }

@media print {
  .site-header, .wa-float, .site-footer { display: none; }
  body { font-size: 11pt; }
}
