/* ============================================================
   Chrome and prose for every page that isn't the landing page:
   the legal notices, 404, and the guides. Colours come from
   assets/tokens.css — never redeclare them here.

   The base is tuned for legal text — 14px in a 680px column,
   because those are reference documents to be scanned. Anything
   carrying an `article` class on <main> opts into wider, larger
   settings meant to actually be read; see the ARTICLE section
   at the bottom.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 680px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bar);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .bar-inner {
  max-width: 680px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 620; font-size: 16px; letter-spacing: -.015em;
  color: var(--text); text-decoration: none;
}
.brand img { width: 25px; height: 25px; display: block; }
/* The brand in the corner is the way home — no page carries a separate
   "back to site" link, because the logo already is one. */
.bar-right { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  position: relative; flex: none; padding: 0;
  width: 46px; height: 26px; border-radius: 13px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-ctrl);
  transition: background .2s ease, border-color .2s ease;
}
.theme-toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2); color: var(--bar);
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  transition: transform .24s cubic-bezier(.3,.85,.3,1), background .2s ease, color .2s ease;
}
/* aria-checked marks the light theme, mirroring the app's own pill toggles:
   grey track when off, accent fill with the thumb to the right when on. */
.theme-toggle[aria-checked="true"] { background: var(--accent-tint); border-color: rgba(30,155,233,.5); }
.theme-toggle[aria-checked="true"] .knob { transform: translateX(20px); background: var(--accent); color: #fff; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- prose ---------- */
main { padding-block: clamp(32px, 5vw, 56px) clamp(44px, 7vw, 76px); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
  display: flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ""; width: 16px; height: 2px; border-radius: 1px;
  background: var(--accent); flex: none;
}

h1 {
  font-size: clamp(23px, 3.2vw, 29px); font-weight: 680;
  letter-spacing: -.025em; line-height: 1.15; margin: 0 0 8px;
  text-wrap: balance;
}
.updated { color: var(--text-3); font-size: 11.5px; margin: 0 0 32px; font-family: var(--f-mono); }

h2 {
  font-size: 15.5px; font-weight: 650; letter-spacing: -.01em;
  margin: 32px 0 10px; padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-wrap: balance;
}
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 13.5px; font-weight: 620; margin: 20px 0 6px; }

p { margin: 0 0 12px; color: var(--text-2); }
p strong, li strong { color: var(--text); font-weight: 620; }
a { color: var(--accent); }
::selection { background: var(--accent-tint); color: var(--text); }

ul { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); }
li { margin-bottom: 5px; }
li::marker { color: var(--accent); }

/* Key/value block for the addresses and identifiers */
.facts {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); box-shadow: var(--raise);
  overflow: hidden; margin: 0 0 22px;
}
.facts div {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.facts div:last-child { border-bottom: 0; }
.facts dt {
  flex: 0 0 160px; margin: 0; color: var(--text-3);
  font-size: 12.5px;
}
.facts dd { margin: 0; flex: 1 1 220px; color: var(--text); font-size: 13px; }

code {
  font-family: var(--f-mono); font-size: 12px;
  background: var(--bar); color: var(--text);
  padding: 2px 6px; border-radius: 4px;
  /* Registry keys and package paths are long and unbreakable; on a phone they
     push the whole page sideways unless they are allowed to break anywhere.
     Code *blocks* opt back out below — those scroll inside themselves. */
  overflow-wrap: anywhere;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line-soft); background: var(--bar);
  padding-block: 30px 42px;
}
.foot {
  max-width: 680px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px);
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center;
}
.foot p { font-size: 12px; color: var(--text-3); margin: 0; }
.foot .links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--text-2); text-decoration: none; font-size: 12px; }
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   ARTICLE
   Long-form guides. Wider column, larger type, more air between
   blocks — the legal defaults above are deliberately cramped and
   would be punishing over a thousand words.
   ============================================================ */
.article { font-size: 16.5px; line-height: 1.68; }
.article .wrap,
.article-page .topbar .bar-inner,
.article-page .foot { max-width: 760px; }

.article h1 { font-size: clamp(28px, 4.4vw, 40px); margin-bottom: 12px; }
.article .updated { margin-bottom: 34px; }

.article h2 {
  font-size: clamp(19px, 2.4vw, 22px); font-weight: 660;
  margin: 46px 0 14px; padding-top: 26px;
}
.article h3 { font-size: 16.5px; margin: 28px 0 8px; }

.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; }
.article li { margin-bottom: 9px; }

/* The standfirst: one paragraph answering the question before the
   reader has to scroll. Someone who arrived from a search result
   with a broken desktop should not have to earn the answer. */
.article .standfirst {
  font-size: 18.5px; line-height: 1.56; color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 18px; margin: 0 0 32px;
}

/* Numbered fixes. The counter is the point — these are meant to be
   worked through in order, cheapest and least invasive first. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 24px; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 0 46px; margin-bottom: 26px;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 13px; font-weight: 600;
  background: var(--accent-tint); color: var(--accent);
  border: 1px solid rgba(30,155,233,.35);
}
.steps > li > h3 { margin: 4px 0 6px; }
.steps .verdict {
  display: block; margin-top: 8px; font-size: 14px; color: var(--text-3);
}
.steps .verdict b { color: var(--text-2); font-weight: 620; }

.note {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px; box-shadow: var(--raise);
  padding: 16px 18px; margin: 0 0 24px;
}
.note p:last-child { margin-bottom: 0; }
.note .note-head {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 7px;
}
.note.warn { border-left-color: #E0A030; }
.note.warn .note-head { color: #E0A030; }

/* Closing product block. Deliberately at the end and deliberately
   modest: the page has to be worth reading for someone who never
   installs anything. */
.pitch {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 24px 26px; margin: 40px 0 8px;
}
.pitch h2 { margin: 0 0 10px; padding-top: 0; border-top: 0; font-size: 20px; }
.pitch p:last-of-type { margin-bottom: 18px; }
.pitch .btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14.5px; font-weight: 620; text-decoration: none;
  padding: 11px 20px; border-radius: 8px;
  transition: background .16s ease;
}
.pitch .btn:hover { background: var(--accent-hi); }
.pitch .btn-note { display: block; margin-top: 11px; font-size: 12.5px; color: var(--text-3); }

/* Code blocks keep their line breaks, so they scroll inside themselves rather
   than dragging the page sideways with them. */
.article pre {
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: 8px; padding: 15px 16px; margin: 0 0 20px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.6;
}
.article pre code {
  background: none; padding: 0; font-size: inherit;
  color: var(--text-2); overflow-wrap: normal; white-space: pre;
}

/* Comparison tables. Wrapped in .table-scroll so a wide table scrolls on a
   phone instead of widening the document. */
.table-scroll { overflow-x: auto; margin: 0 0 22px; }
/* A five-column comparison does not fit a reading column, and a table you have
   to scroll sideways on a desktop is a table nobody compares anything in. Wide
   viewports let it break out of the column and centre on the page instead. */
@media (min-width: 900px) {
  .article .table-scroll {
    width: min(1040px, calc(100vw - 48px));
    margin-left: 50%; transform: translateX(-50%);
  }
}
.article table {
  border-collapse: collapse; width: 100%; min-width: 560px;
  font-size: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.article th, .article td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.article thead th {
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; background: var(--panel-2);
}
.article tbody tr:last-child td { border-bottom: 0; }
.article td:first-child { color: var(--text); font-weight: 560; }
.article td { color: var(--text-2); }
.article .yes { color: var(--good); font-weight: 620; }
.article .no  { color: var(--text-3); }

/* Cross-links between guides. Google trusts a page more when the rest of the
   site points at it, and a reader with this problem usually has the next. */
.related { margin: 52px 0 0; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.related h2 { border-top: 0; padding-top: 0; margin: 0 0 14px; font-size: 16px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 10px; }
.related a { text-decoration: none; font-weight: 600; font-size: 15px; }
.related a:hover { text-decoration: underline; }
.related span { display: block; color: var(--text-3); font-size: 13.5px; font-weight: 400; }

.crumbs { font-size: 12.5px; color: var(--text-3); margin: 0 0 18px; font-family: var(--f-mono); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
