/* Shredz, the inner pages: models, API guide, privacy, terms and the 404. Only what they need on top of
   styles.css. Same parts as everywhere: plastic keys, the LED, paper, ink rules on the grey desk. */

/* ---------- shared by the text pages */
.page .prose { margin-top: clamp(30px, 5vw, 52px); }
.prose > h2:first-child { margin-top: 0; }
.prose h2, .prose h3 { scroll-margin-top: 104px; text-wrap: balance; }
.prose a { font-weight: 600; }
.prose .code code { font: inherit; }
.prose .key { margin: 4px 0 8px; }
.dated { margin-top: 16px; font-size: var(--fs-1); color: var(--mute); }
.page .ledger + .fine { max-width: 44em; }

/* ---------- models: the tools above the list */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin: clamp(28px, 4vw, 44px) 0 20px; }
.find { flex: 1 1 260px; max-width: 400px; }
.find input { width: 100%; height: 48px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font: 500 var(--fs-2)/1 var(--text); }
.find input::placeholder { color: var(--mute); opacity: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters .key[aria-pressed='true'] { --face: var(--blue); --edge: var(--blue-deep); --on: #fff; }
.count { margin-left: auto; font-size: var(--fs-1); color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- models: the list. Fixed columns, so nothing jumps while you type. */
.models { table-layout: fixed; }
.models th { position: sticky; top: 77px; z-index: 2; padding: 12px 0 11px; background: var(--desk); border-bottom: 0; box-shadow: inset 0 -2px 0 var(--ink); }
.models th.n { font-size: var(--fs-0); }
.models th.ctx { width: 124px; }
.models th.in, .models th.out { width: 132px; }
.models th.act { width: 118px; }
.models td.act { text-align: right; padding-left: 18px; }
.models td.m { overflow-wrap: anywhere; }
.models .note td { padding: 22px 0; font-weight: 400; }
.models tbody tr.note:hover td { background: none; }

.sort { display: inline-flex; align-items: center; gap: 7px; padding: 5px 0; margin: -5px 0; background: none; border: 0; font: inherit; color: inherit; }
.sort:hover { color: var(--ink); }
.sort::after { content: ''; flex: none; width: 0; height: 0; border-inline: 4px solid transparent; border-bottom: 6px solid transparent; }
.models th.n .sort { flex-direction: row-reverse; }
.models th[aria-sort] .sort { color: var(--ink); }
.models th[aria-sort='ascending'] .sort::after { border-bottom-color: currentColor; }
.models th[aria-sort='descending'] .sort::after { border-bottom: 0; border-top: 6px solid currentColor; }

.copy-id { min-width: 76px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--desk-lo); color: var(--ink); font: 600 var(--fs-0)/1 var(--text); }
.copy-id:hover { background: var(--line); }
.copy-id.done { background: var(--blue); color: #fff; }

/* ---------- API guide */
.guide { display: grid; grid-template-columns: 196px minmax(0, 44em); gap: clamp(32px, 6vw, 88px); align-items: start; margin-top: clamp(30px, 5vw, 56px); }
.guide .prose { margin-top: 0; }
.guide-side { position: sticky; top: 104px; }
.guide-nav { border-left: 2px solid var(--line); }
.guide-nav a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font: 600 var(--fs-1)/1.3 var(--text); color: var(--mute); text-decoration: none; }
.guide-nav a:hover { color: var(--ink); }
.guide-nav a[aria-current] { color: var(--ink); border-left-color: var(--ink); }

/* a slide switch, the kind on the side of the machine */
.switch { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 0; background: none; border: 0; text-align: left; font: 600 var(--fs-1)/1.3 var(--text); }
.switch i { position: relative; flex: none; width: 46px; height: 26px; border-radius: 13px; background: #2a2d38; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5); transition: background-color .12s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--plastic); box-shadow: 0 2px 0 var(--plastic-lo); transition: transform .12s; }
.switch[aria-checked='true'] i { background: var(--blue); }
.switch[aria-checked='true'] i::after { transform: translateX(20px); }

.switch span { text-wrap: balance; }
.code.wraps pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-name { padding: 9px 13px 15px; font: 600 var(--fs-1)/1 var(--text); color: #9095ad; }
.prose .errors code { background: none; padding: 0; font-size: .875rem; }
.prose .errors td:first-child { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.prose .errors td:nth-child(2) { white-space: nowrap; }
.prose .settings td:first-child { width: 34%; font-weight: 700; }
.prose .settings td { overflow-wrap: anywhere; }

/* ---------- 404: a sheet that went through */
.lost .wrap { display: grid; justify-items: center; text-align: center; padding-block: clamp(10px, 5vh, 60px); }
.lost-sheet { width: min(100%, 380px); padding: 34px 28px 46px; }
.lost-sheet h1 { font: 800 clamp(6rem, 3rem + 13vw, 9rem)/.86 var(--text); letter-spacing: -.05em; }
.led-line { display: flex; justify-content: center; margin-top: 20px; }
.led-line .led { padding: 9px 16px 8px; font-size: 1.25rem; line-height: 1; }
.lost-text { margin: 120px 0 22px; font-size: 1.1875rem; color: var(--body); }

/* ---------- small screens */
@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .guide-side { position: static; }
  .guide-nav { columns: 2; column-gap: 24px; padding: 12px 0; border-left: 0; border-block: 1px solid var(--line); }
  .guide-nav a { margin-left: 0; padding-left: 0; border-left: 0; break-inside: avoid; }
  .switch { margin-top: 20px; }
  .models th.ctx { width: 84px; }
  .models th.in, .models th.out { width: 104px; }
  .models th.act { width: 100px; }
}
@media (max-width: 720px) {
  .tools { gap: 14px; }
  .find { flex-basis: 100%; max-width: none; }
  .count { margin-left: 0; flex-basis: 100%; }

  /* the list: each model is two lines, the column heads become the line you sort with */
  .models, .models thead, .models tbody { display: block; }
  .models thead { position: sticky; top: 77px; z-index: 2; background: var(--desk); box-shadow: inset 0 -2px 0 var(--ink); }
  .models thead tr { display: flex; align-items: baseline; gap: 13px; padding: 11px 0; }
  .models thead tr::before { content: 'Sort by'; font: 600 var(--fs-0)/1.2 var(--text); color: var(--mute); }
  .models th, .models th.n, .models th.ctx { position: static; display: block; width: auto; padding: 0; background: none; box-shadow: none; }
  .models th.act { display: none; }
  .models th.n .sort { flex-direction: row; gap: 5px; }
  .models tbody tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 7px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .models tbody td, .models tbody td.n, .models tbody td.ctx { display: block; padding: 0; border: 0; }
  .models td.m { grid-area: 1 / 1 / 2 / 4; }
  .models tbody td.act { grid-area: 1 / 4; padding: 0; }
  .models td.in { grid-area: 2 / 1; }
  .models td.out { grid-area: 2 / 2; }
  .models td.ctx { grid-area: 2 / 3; }
  .models td.n { text-align: left; font-size: .875rem; }
  .models td.n::before { content: attr(data-label); margin-right: 6px; font: 400 var(--fs-0)/1 var(--text); color: var(--mute); }
  .models tbody tr.note { display: block; }
  .models .note td { padding: 8px 0; }
  .models tbody tr:hover td { background: none; }

  /* errors: status and code on one line, the meaning below */
  .prose .errors thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose .errors, .prose .errors tbody { display: block; }
  .prose .errors tbody { border-top: 2px solid var(--ink); }
  .prose .errors tr { display: grid; grid-template-columns: 3.1em minmax(0, 1fr); padding: 11px 0; border-bottom: 1px solid var(--line); }
  .prose .errors td { display: block; padding: 0; border: 0; }
  .prose .errors td:nth-child(3) { grid-column: 1 / -1; margin-top: 4px; }
  .prose .settings td:first-child { width: 30%; }
}
