:root {
  --paper: #e7e8ea;
  --paper-2: #f1f2f4;
  --ink: #1d2036;
  --blue: #3a4bff;
  --pink: #ff5c8f;
  --slate: #5d6376;
  --rule: #c5c8d1;
  --ok: #1f7a55;
  --bad: #b3261e;
  --ui: "Familjen Grotesk", system-ui, sans-serif;
  --doc: "Literata", Georgia, serif;
  --r: 3px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: var(--r); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* top bar */
.top { display: flex; align-items: center; gap: 28px; padding: 22px 36px 18px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.mark { position: relative; width: 30px; height: 30px; display: inline-block; }
.mark i { position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: multiply; }
.mark i:first-child { background: var(--blue); transform: translate(-3px, -2px); }
.mark i:last-child { background: var(--pink); transform: translate(4px, 3px); }
.name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.tag { color: var(--slate); max-width: 62ch; font-size: 15px; }

/* layout */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr) 330px; gap: 0; min-height: calc(100vh - 140px); }
.ledger { border-right: 1px solid var(--rule); padding: 26px 0 26px 36px; }
.panel { padding: 30px 44px 60px; min-width: 0; outline: none; }
.sheet { border-left: 1px solid var(--rule); padding: 30px 28px 40px; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow: auto; }

/* ledger */
#steps { list-style: none; margin: 0; padding: 0; }
#steps li { position: relative; }
#steps button {
  display: grid; grid-template-columns: 26px 1fr; align-items: baseline; gap: 6px; width: 100%;
  text-align: left; background: none; border: 0; padding: 9px 12px 9px 0; cursor: pointer; color: var(--slate);
}
#steps .n { font-variant-numeric: tabular-nums; font-weight: 600; }
#steps li.done button { color: var(--ink); }
#steps li.done .n { color: var(--blue); }
#steps li.on button { color: var(--ink); font-weight: 600; }
#steps li.on::before { content: ""; position: absolute; left: -36px; top: 8px; bottom: 8px; width: 4px; background: var(--blue); }
#steps button:disabled { cursor: default; opacity: .55; }

/* type */
.panel h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; max-width: 18ch; }
.panel h2 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; max-width: 26ch; }
.lede { color: var(--slate); margin-top: 12px; max-width: 58ch; }
.group { margin-top: 30px; }
.group > h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.hint { color: var(--slate); font-size: 14px; }

/* format specimens */
.specimens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
.spec {
  position: relative; text-align: left; background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 20px 20px 22px; cursor: pointer;
}
.spec[aria-pressed="true"] { border-color: var(--ink); box-shadow: 5px 5px 0 -1px var(--blue), -3px -3px 0 -1px var(--pink); }
.spec b { display: block; font-size: 18px; margin-bottom: 4px; }
.spec .eg { font-family: var(--doc); font-size: 14.5px; line-height: 1.5; margin-top: 14px; color: #2b2f48; }
.spec .eg u { text-decoration: none; display: block; font-style: italic; color: var(--slate); margin-bottom: 2px; }
.spec .eg p + p { margin-top: 8px; }

/* choice lists */
.choices { list-style: none; margin: 14px 0 0; padding: 0; columns: 3 190px; column-gap: 28px; }
.choices li { break-inside: avoid; }
.choice {
  display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 0; cursor: pointer;
}
.box { width: 16px; height: 16px; margin-top: 3px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--paper-2); display: grid; place-items: center; }
.choice[aria-pressed="true"] .box { background: var(--blue); border-color: var(--blue); }
.choice[aria-pressed="true"] .box::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.choice[aria-pressed="true"] span:last-child { font-weight: 600; }
.sub-block { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }
.sub-block h3 { font-size: 17px; }

/* fields */
label.f { display: block; margin-top: 22px; }
label.f > span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.in, textarea.in, select.in {
  width: 100%; background: var(--paper-2); border: 1px solid #aeb2bf; border-radius: var(--r); padding: 11px 13px;
}
textarea.in { min-height: 118px; resize: vertical; font-family: var(--doc); font-size: 16.5px; line-height: 1.55; }
.in:hover { border-color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.seg button { background: var(--paper-2); border: 1px solid #aeb2bf; border-radius: var(--r); padding: 8px 15px; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }
.check input { margin-top: 5px; accent-color: var(--blue); width: 16px; height: 16px; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }
.btn { border: 1.5px solid var(--ink); background: var(--paper-2); border-radius: var(--r); padding: 11px 20px; font-weight: 600; cursor: pointer; }
.btn:hover:not(:disabled) { background: #fff; }
.btn.go { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.go:hover:not(:disabled) { background: #2a39e6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* blueprint */
.bp { margin-top: 22px; border-top: 1px solid var(--ink); }
.bp-row { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.bp-row > b { font-size: 14px; }
.bp ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.bp li { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; padding: 3px 9px; font-size: 14px; }
.bp .tree { display: grid; gap: 8px; }
.bp .tree div > strong { font-weight: 600; }
.bp .tree small { color: var(--slate); }
.note { margin-top: 14px; padding: 10px 14px; border-left: 4px solid var(--pink); background: var(--paper-2); font-size: 14.5px; }
.note.bad { border-left-color: var(--bad); }
.note.ok { border-left-color: var(--ok); }

/* spec sheet */
.sheet h2 { font-size: 18px; margin-bottom: 14px; }
.sheet dl { margin: 0; }
.sheet .line { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 14.5px; }
.sheet dt { color: var(--slate); }
.sheet dd { margin: 0; overflow-wrap: anywhere; }
.sheet .est { margin-top: 18px; font-size: 14.5px; color: var(--slate); }
.sheet .est b { color: var(--ink); }

/* run: the printed deck */
.count { display: flex; align-items: baseline; gap: 10px; margin-top: 24px; }
.count .big { font-size: clamp(54px, 9vw, 92px); line-height: 1; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.count .of { font-size: 22px; color: var(--slate); }
.bar { height: 6px; background: var(--rule); margin-top: 14px; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .5s ease; }
.state { margin-top: 10px; color: var(--slate); }
.press { position: relative; height: 230px; margin: 30px 0 8px; }
.card {
  position: absolute; left: 0; top: 0; width: min(100%, 640px); padding: 18px 22px 20px; background: #fbfbfc; border: 1px solid #aeb2bf; border-radius: 2px;
  font-family: var(--doc); font-size: 15px; line-height: 1.5; overflow: hidden; height: 190px;
}
.card::before, .card::after { content: ""; position: absolute; inset: -1px; border-radius: 2px; pointer-events: none; mix-blend-mode: multiply; }
.card::before { box-shadow: 4px 3px 0 0 var(--pink); z-index: -1; }
.card::after { box-shadow: -3px -2px 0 0 var(--blue); z-index: -1; }
.card em { display: block; font-style: italic; color: var(--slate); font-size: 13px; margin-bottom: 3px; font-family: var(--ui); }
.card .a { margin-top: 10px; color: #3a3f5a; }
.card .clip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.print { animation: print .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes print { from { transform: translate(14px, -10px); opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card.print { animation: none; } .bar > i { transition: none; } }

.table { margin-top: 28px; border-top: 1px solid var(--ink); }
.trow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.trow .id { color: var(--slate); font-variant-numeric: tabular-nums; }
.trow .p { font-family: var(--doc); }
.trow .meta { color: var(--slate); font-size: 13px; margin-top: 2px; }
.trow details { margin-top: 6px; }
.trow summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; }
.trow .full { font-family: var(--doc); white-space: pre-wrap; margin-top: 8px; font-size: 15px; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 26px; border-top: 1px solid var(--ink); }
.stats div { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rule); }
.stats b { display: block; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--slate); font-size: 13.5px; }

.foot { display: flex; justify-content: space-between; gap: 20px; padding: 18px 36px 26px; border-top: 1px solid var(--rule); color: var(--slate); font-size: 13.5px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .ledger { border: 0; border-bottom: 1px solid var(--rule); padding: 10px 20px; overflow-x: auto; }
  #steps { display: flex; gap: 4px; }
  #steps button { grid-template-columns: auto auto; white-space: nowrap; padding: 8px 12px; }
  #steps li.on::before { left: 0; right: 0; top: auto; bottom: 0; height: 3px; width: auto; }
  .sheet { position: static; border: 0; border-top: 1px solid var(--rule); max-height: none; }
  .panel { padding: 24px 20px 40px; }
  .top { padding: 18px 20px 14px; flex-wrap: wrap; gap: 8px 18px; }
}
@media (max-width: 640px) {
  .specimens, .row2 { grid-template-columns: 1fr; }
  .bp-row { grid-template-columns: 1fr; gap: 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .press { height: 250px; }
}
