/* guia.torns.app — the Torns user guide. System font, as in the app. */
:root {
  --bg: #F4F7F8; --surface: #ffffff; --ink: #0F2430; --muted: #4d6a77; --line: #DDE7EA;
  --accent: #227A96; --accent-ink: #176079; --accent-soft: #DDEEF3;
  --sun: #F5A623; --sun-ink: #8a5a00; --sun-soft: #FEF3DC;
  --shadow: 0 1px 2px rgba(15, 36, 48, .05), 0 8px 24px rgba(15, 36, 48, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1a21; --surface: #142630; --ink: #e8f1f4; --muted: #9db4be; --line: #23404d;
    --accent: #34a5c4; --accent-ink: #7fd0e6; --accent-soft: #173847;
    --sun: #F5BD4F; --sun-ink: #f5bd4f; --sun-soft: #3a2c13;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1a21; --surface: #142630; --ink: #e8f1f4; --muted: #9db4be; --line: #23404d;
  --accent: #34a5c4; --accent-ink: #7fd0e6; --accent-soft: #173847;
  --sun: #F5BD4F; --sun-ink: #f5bd4f; --sun-soft: #3a2c13;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  padding-inline: 16px; padding-block: 0 64px;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1180px; margin: 0 auto; }

/* Masthead */
.masthead { padding: 32px 0 28px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow img { height: 24px; width: auto; }
h1 { font-weight: 800; font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -.025em; margin: 14px 0; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lead { max-width: 62ch; font-size: 19px; color: var(--muted); margin: 0; }
.where { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 0; list-style: none; }
.where li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.where a, .where code { font: 600 14px var(--mono); color: var(--accent-ink); text-decoration: none; }
.langs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 0; list-style: none; }
.langs a { display: block; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--muted); padding: 6px 11px; border-radius: 999px; }
.langs a[aria-current="page"] { background: var(--accent); color: #fff; }

/* Layout: index on the left on wide screens, one column on the phone */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 44px; }
.toc { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; font-size: 14px; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.toc a::before { content: counter(toc); color: var(--accent); font-weight: 700; min-width: 18px; font-variant-numeric: tabular-nums; }
.toc a:hover { background: var(--surface); }
.toc a[aria-current="true"] { background: var(--accent-soft); font-weight: 600; }
.mobile-toc { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 22px; }
.mobile-toc summary { font-weight: 700; cursor: pointer; }
.mobile-toc ol { margin: 10px 0 0; padding-left: 22px; }
.mobile-toc li { margin: 6px 0; }
.mobile-toc li::marker { color: var(--accent); font-weight: 700; }

/* Sections */
main { counter-reset: sec; min-width: 0; }
section { counter-increment: sec; padding: 6px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
section:last-child { border-bottom: 0; }
section > h2::before { content: counter(sec); display: block; font-size: 14px; font-weight: 800; color: var(--accent); letter-spacing: 0; margin-bottom: 2px; }
h2 { font-weight: 800; font-size: 30px; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 16px; text-wrap: balance; }
h3 { font-weight: 700; font-size: 19px; line-height: 1.3; margin: 22px 0 8px; }
.prose > :first-child, .prose > h3:first-child { margin-top: 0; }
p { margin: 0 0 12px; }
.prose p, .prose-lead { max-width: 66ch; }
.small { font-size: 15px; color: var(--muted); max-width: 72ch; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 6px 0 20px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.step b { display: block; font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1; }
.step strong { display: block; margin: 8px 0 6px; }
.step p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }

.pair { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; margin-bottom: 8px; }
.pair:has(> .shot) { grid-template-columns: minmax(0, 1fr) 250px; }
.pair + .pair { margin-top: 18px; }
.shot { margin: 0; text-align: center; }
.shot img { display: block; width: 100%; border-radius: 26px; box-shadow: var(--shadow), 0 0 0 1px rgba(15, 36, 48, .06); }
.shot figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

.check { list-style: none; padding: 0; margin: 0 0 14px; max-width: 70ch; }
.check li { position: relative; padding-left: 32px; margin: 0 0 10px; }
.check li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }

.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sun); border-radius: 12px; padding: 14px 16px; margin: 16px 0; max-width: 72ch; }
.note .k { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sun-ink); margin-bottom: 4px; }
.pro { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--sun-ink); background: var(--sun-soft); border-radius: 6px; padding: 2px 7px; vertical-align: 2px; margin-left: 4px; }

.table-wrap { overflow-x: auto; margin: 6px 0 14px; }
table { border-collapse: collapse; min-width: 520px; width: 100%; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
td + td, th + th { width: 22%; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 8px; max-width: 74ch; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }

footer { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; font-size: 15px; color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .mobile-toc { display: block; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair:has(> .shot) { grid-template-columns: minmax(0, 1fr); }
  .pair .shot { max-width: 240px; margin: 0 auto; }
  .masthead { grid-template-columns: 1fr; }
  .langs { justify-self: start; grid-row: 1; }
}
@media (max-width: 420px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  h2 { font-size: 26px; }
}
