/* Pawn Parlor user guide. A warm card table at night, or cream paper by day.
   Built for reading: one column of 68 characters, 18px body, quiet cards,
   body text 7:1 or better in both themes. */
:root {
  --bg: #100d0b;
  --bg-glow: rgba(232, 145, 58, 0.14);
  --card: #1a1512;
  --card-2: #221b16;
  --line: rgba(255, 220, 190, 0.12);
  --line-strong: rgba(255, 180, 106, 0.38);
  --fg: #f4eee7;
  --dim: #cdc1b4;
  --head: #ffffff;
  --link: #ffbf80;
  --link-hover: #ffffff;
  --accent: #e8913a;
  --accent-ink: #160c04;
  --chip-bg: #2c221b;
  --chip-line: #574233;
  --chip-fg: #ffe2c4;
  --why-bg: rgba(255, 191, 128, 0.07);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --radius: 18px;
  --measure: 68ch;
  --wrap: 1180px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf7f1;
    --bg-glow: rgba(232, 145, 58, 0.16);
    --card: #ffffff;
    --card-2: #fff8ef;
    --line: rgba(60, 35, 15, 0.12);
    --line-strong: rgba(154, 79, 18, 0.4);
    --fg: #231a13;
    --dim: #4c3d31;
    --head: #160f0a;
    --link: #8a420c;
    --link-hover: #160f0a;
    --accent-ink: #160c04;
    --chip-bg: #fbeee0;
    --chip-line: #e2c3a2;
    --chip-fg: #4a2507;
    --why-bg: #fdf1e3;
    --shadow: 0 1px 2px rgba(60, 35, 15, 0.06), 0 18px 40px -28px rgba(60, 35, 15, 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: radial-gradient(70% 45% at 50% -10%, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  margin: 0; color: var(--fg); background: transparent;
  font: 18px/1.7 var(--sans);
  padding-inline: 20px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
strong, b { color: var(--head); }

/* What the app says on screen: a label chip, not code. */
code, kbd {
  font: 600 0.88em/1.3 var(--sans);
  color: var(--chip-fg); background: var(--chip-bg);
  border: 1px solid var(--chip-line); border-radius: 7px;
  padding: 0.12em 0.45em; white-space: nowrap;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.skip { position: absolute; left: 16px; top: -100px; z-index: 20; background: var(--card); color: var(--head); padding: 12px 16px; border-radius: 10px; border: 2px solid var(--link); }
.skip:focus { top: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  margin: 0 -20px; padding: 8px max(20px, calc((100vw - var(--wrap)) / 2)); padding-top: calc(8px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 8px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar > * { min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding-right: 6px; color: var(--head); text-decoration: none; font: 700 19px/1 var(--serif); white-space: nowrap; flex: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand:hover { color: var(--head); }
.nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: 999px;
  color: var(--dim); text-decoration: none; font: 600 15px var(--sans); white-space: nowrap;
}
.nav a:hover { color: var(--head); background: var(--card-2); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: linear-gradient(180deg, #ffc68f, #e8913a); }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; padding-bottom: 4px; }
  .nav { margin-left: 0; width: 100%; margin-inline: -6px; padding-inline: 6px; }
  .nav a { min-height: 44px; font-size: 15px; padding: 0 12px; }
}

/* Type */
h1, h2, h3 { color: var(--head); font-family: var(--serif); font-weight: 700; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(40px, 7.4vw, 76px); line-height: 1.02; margin: 0 0 18px; }
h2 { font-size: clamp(25px, 3.4vw, 32px); line-height: 1.18; margin: 0 0 14px; }
h3 { font-size: 21px; line-height: 1.3; margin: 28px 0 10px; }
p { margin: 0 0 16px; max-width: var(--measure); text-wrap: pretty; }
li { text-wrap: pretty; }
.lede { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.55; color: var(--fg); max-width: 56ch; }
.dim { color: var(--dim); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font: 700 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--link);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }
.underline { display: none; }

main { padding-block: 44px 56px; }
section { scroll-margin-top: 96px; }

/* Cards */
.tile {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px clamp(20px, 3.4vw, 36px) 14px; box-shadow: var(--shadow);
}
.tile.quiet { background: transparent; border: 0; box-shadow: none; padding: 0; }
.tile > .title {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font: 700 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--link);
}
.tile > .title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(232, 145, 58, 0.18); }
.tile > :first-child { margin-top: 0; }

.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: 20px; }
.tiles.one { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.tiles > * { min-width: 0; }

/* Lists */
ul.dots { padding-left: 0; list-style: none; margin: 0 0 16px; }
ul.dots li { position: relative; padding-left: 28px; margin-bottom: 10px; }
ul.dots li::before {
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent) 0 3px, transparent 3.5px), rgba(232, 145, 58, 0.18);
}
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 4px 0 18px; max-width: var(--measure); }
ol.steps li { counter-increment: s; position: relative; padding: 0 0 14px 48px; min-height: 34px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 700 15px/1 var(--sans); color: var(--accent-ink);
  background: linear-gradient(180deg, #ffc68f, #e8913a);
}
ol.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line);
}
dl.keys { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: 0; margin: 0 0 18px; }
dl.keys dt, dl.keys dd { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
dl.keys dt { color: var(--head); font-weight: 700; padding-right: 18px; }
dl.keys dt:first-of-type, dl.keys dt:first-of-type + dd { border-top: 0; }
@media (max-width: 560px) {
  dl.keys { grid-template-columns: 1fr; }
  dl.keys dd { border-top: 0; padding-top: 0; color: var(--dim); }
}
.cols { columns: 2 320px; column-gap: 40px; }
.cols li { break-inside: avoid; }

/* The why line in the runbook: a soft callout, labelled. */
.why {
  color: var(--fg); background: var(--why-bg); border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 0 0 20px;
}
.why::before {
  content: "Why it happens"; display: block; margin-bottom: 4px;
  font: 700 12px/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--link);
}
.why + ol.steps::before {
  content: "Fix it"; display: block; margin: 0 0 12px;
  font: 700 12px/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--link);
}
.note {
  border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; max-width: var(--measure);
  background: var(--why-bg); border: 1px solid var(--line-strong);
}

/* Home */
.hero { display: grid; gap: 32px; align-items: center; grid-template-columns: 1fr; margin: 8px 0 36px; }
.hero > .tile { background: transparent; border: 0; box-shadow: none; padding: 0; }
.hero > .tile > .title { margin-bottom: 18px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.6fr 1fr; } }
.icon {
  display: block; margin: 0 auto; width: min(70%, 280px); border-radius: 23%;
  box-shadow: 0 30px 80px -20px rgba(232, 145, 58, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
@media (max-width: 859px) { .hero > div:last-child { order: -1; } .icon { width: 120px; margin: 0; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border-radius: 999px; font: 700 16px/1 var(--sans); text-decoration: none; color: var(--accent-ink);
  background: linear-gradient(180deg, #ffc68f, #e8913a); box-shadow: 0 10px 24px -12px rgba(232, 145, 58, 0.9);
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.06); text-decoration: none; }
.btn.ghost { color: var(--head); background: var(--card); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { color: var(--head); background: var(--card-2); }

.stats {
  list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats li { padding: 20px 22px; background: var(--card); }
.stats b { display: block; font: 700 34px/1.1 var(--serif); color: var(--link); margin-bottom: 4px; }
.stats span { color: var(--dim); font-size: 15px; line-height: 1.4; }
#online.tile { border-color: var(--line-strong); background: linear-gradient(180deg, var(--card-2), var(--card)); }

/* Guide: contents. A sticky sidebar on wide screens, a card above the text on narrow ones. */
.toc h2 { font-size: 15px; font-family: var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; margin: 0 -10px;
  border-radius: 10px; text-decoration: none; color: var(--fg); font-size: 16px; line-height: 1.3;
}
.toc a:hover { color: var(--head); background: var(--card-2); }
.toc .n {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--chip-bg); border: 1px solid var(--chip-line); color: var(--chip-fg); font: 700 13px var(--sans);
}
.toc-wrap { margin-bottom: 24px; }
.toc-wrap .toc { padding-bottom: 18px; }
@media (max-width: 1099px) { .toc-wrap .toc ol { columns: 2 240px; column-gap: 24px; } .toc-wrap .toc li { break-inside: avoid; } }
@media (min-width: 1100px) {
  main.with-toc { display: grid; grid-template-columns: 270px minmax(0, 1fr); column-gap: 48px; align-items: start; }
  main.with-toc > * { grid-column: 2; }
  main.with-toc > .toc-wrap { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 92px; margin: 0; max-height: calc(100vh - 110px); overflow: auto; }
  main.with-toc > .toc-wrap .toc { background: transparent; border: 0; box-shadow: none; padding: 0 10px 0 10px; }
}

/* FAQ */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 2px; color: var(--head); font: 700 19px/1.35 var(--serif); list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font: 600 20px/1 var(--sans); color: var(--link); background: var(--chip-bg); transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
summary:hover { color: var(--link); }
details > div { padding: 0 2px 10px; }
details > div p { color: var(--fg); }

/* Footer */
footer { padding-block: 20px 40px; color: var(--dim); font-size: 15px; border-top: 1px solid var(--line); }
footer ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 0 6px; }
footer a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px; margin-left: -8px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } summary::after { transition: none; } }
@media (min-width: 1800px) { :root { --wrap: 1480px; } body { font-size: 19px; } }
@media (min-width: 2600px) { :root { --wrap: 1900px; } body { font-size: 21px; } }
@media (max-width: 559px) { .stats li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 720px) {
  .nav { overflow: visible; }
  .nav ul { flex-wrap: wrap; gap: 4px; }
  .nav a { min-height: 44px; padding: 0 12px; }
  .tile { padding: 22px 18px 8px; border-radius: 16px; }
  main { padding-block: 28px 40px; }
}
@media (max-width: 720px) { .bar { position: static; } html { scroll-padding-top: 16px; } section { scroll-margin-top: 16px; } }

/* Home: quick start as four step cards, guide pages as link cards. */
.band { margin: 56px 0 8px; }
.band > h2 { font-size: clamp(28px, 3.8vw, 40px); margin-bottom: 22px; }
.cards4, .linkcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cards4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: none; }
.cards4 li {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 8px; box-shadow: var(--shadow);
}
.cards4 h3 { margin: 14px 0 6px; font-size: 22px; }
.cards4 p { color: var(--fg); font-size: 17px; line-height: 1.6; }
.cards4 .k {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  font: 700 18px/1 var(--sans); color: var(--accent-ink); background: linear-gradient(180deg, #ffc68f, #e8913a);
  box-shadow: 0 8px 20px -10px rgba(232, 145, 58, 0.9);
}
.linkcards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.linkcards a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 120px; padding: 20px 22px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--fg); transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.linkcards b { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 22px/1.2 var(--serif); color: var(--head); }
.linkcards b::after { content: "\2192"; font: 600 20px/1 var(--sans); color: var(--link); transition: transform 0.15s; }
.linkcards span { color: var(--dim); font-size: 16px; line-height: 1.5; }
.linkcards a:hover { border-color: var(--line-strong); background: var(--card-2); transform: translateY(-2px); }
.linkcards a:hover b::after { transform: translateX(4px); }
.price { margin: -4px 0 18px; color: var(--dim); }
.price b { font: 700 30px/1 var(--serif); color: var(--link); margin-right: 4px; }
@media (prefers-reduced-motion: reduce) { .linkcards a, .linkcards b::after { transition: none; } .linkcards a:hover { transform: none; } }
