/* Light Phone II is an e-ink phone: ink on neutral paper, one red for the risky step. */
:root {
  color-scheme: light;
  --paper: #f2f3f3;
  --sheet: #ffffff;
  --ink: #141414;
  --muted: #474b4d;
  --rule: #cfd2d3;
  --press: #e4e6e6;
  --warn-ink: #9b1c1c;
  --warn-bg: #fbecec;
  --warn-rule: #e7b4b4;
  --font: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Consolas, monospace;
  --fast: 120ms ease-out;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111213;
    --sheet: #1b1d1e;
    --ink: #ececec;
    --muted: #b4b8ba;
    --rule: #34383a;
    --press: #2a2d2f;
    --warn-ink: #ffb4b4;
    --warn-bg: #2a1616;
    --warn-rule: #5c2a2a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111213;
  --sheet: #1b1d1e;
  --ink: #ececec;
  --muted: #b4b8ba;
  --rule: #34383a;
  --press: #2a2d2f;
  --warn-ink: #ffb4b4;
  --warn-bg: #2a1616;
  --warn-rule: #5c2a2a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; accent-color: var(--ink); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
}
::selection { background: var(--ink); color: var(--paper); }
main { max-width: 720px; margin: 0 auto; padding: 56px 16px 72px; }

h1 { font-size: 42px; line-height: 1.08; font-weight: 800; margin: 0 0 16px; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 25px; line-height: 1.2; font-weight: 800; margin: 56px 0 16px; text-wrap: balance; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 0; }
p, li { max-width: 66ch; text-wrap: pretty; }
.lead { font-size: 20px; line-height: 1.5; margin: 0 0 12px; }
.meta { color: var(--muted); margin: 0; font-size: 15px; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-thickness var(--fast); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

code { font-family: var(--mono); font-size: 0.92em; }
:not(pre) > code { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }

/* Back link above the APN page title */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 20px; font-size: 15px; font-weight: 600; }

/* Download row, split by rules, no box */
.dl { border-top: 2px solid var(--ink); }
.dl-row { display: grid; gap: 14px; padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.dl-row p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 11px 14px;
  border: 1px solid var(--ink); border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.4;
  background: var(--sheet); white-space: nowrap;
  transition: background-color var(--fast), color var(--fast);
}
.links a small { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; transition: color var(--fast); }
.links a:hover, .links a:hover small { background: var(--ink); color: var(--paper); }
.links a:active { background: var(--press); color: var(--ink); }

/* Steps: real sequence, so real numbers */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 26px 46px; max-width: none; }
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; line-height: 1;
}
ol.steps > li > p:first-child { margin-top: 1px; }
ol.steps p { margin: 8px 0; }
.if { color: var(--muted); font-size: 16px; }
.if strong { color: var(--ink); }
.expect { color: var(--muted); font-size: 15px; }

/* Command blocks */
.cmd { display: flex; align-items: stretch; margin: 10px 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; }
.cmd pre { margin: 0; padding: 11px 14px; flex: 1; min-width: 0; font-family: var(--mono); font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; align-self: center; }
.cmd button {
  flex: none; min-width: 84px; min-height: 44px; border: 0; border-left: 1px solid var(--rule); border-radius: 0 7px 7px 0;
  background: transparent; color: var(--ink); font: 600 14px var(--font); cursor: pointer;
  transition: background-color var(--fast), color var(--fast);
}
.cmd button:hover { background: var(--press); }
.cmd button[data-state="done"] { background: var(--ink); color: var(--paper); }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-rule); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.warn p { margin: 0; color: var(--ink); }
.warn strong { color: var(--warn-ink); }

/* Key commands: label + copyable command per row */
.keys { margin: 0; border-top: 1px solid var(--rule); }
.keys > div { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.keys dt { font-weight: 600; }
.keys dd { margin: 0; }
.keys .cmd { margin: 4px 0; }

/* Link to the APN page */
.next { display: block; margin-top: 56px; padding: 18px 0 0; border-top: 2px solid var(--ink); text-decoration: none; }
.next strong { display: block; font-size: 20px; font-weight: 800; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.next span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }
.next:hover strong { text-decoration-thickness: 2px; }

footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
footer p { margin: 4px 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 600px) {
  main { padding-top: 24px; }
  h1 { font-size: 34px; }
  h2 { margin-top: 48px; }
  .lead { font-size: 18px; }
  ol.steps > li { padding-left: 42px; }
  .keys > div { grid-template-columns: 1fr; gap: 0; padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
