/* SPLITSTEEL · quickstart/quickstart.css
   The quick start: the site's look, plus a faithful Linux console for the replay. */

/* Box-drawing glyphs come from a DejaVu Sans Mono subset with every advance
   set to 0.6 em, so they line up cell for cell with IBM Plex Mono, which has
   none. The unicode-range keeps this face out of everything else. */
@font-face {
  font-family: "SPLITSTEEL Box";
  src: url("/fonts/BoxDrawing.woff2") format("woff2");
  unicode-range: U+2500-257F;
  font-display: block;
}

.qs { padding: 4.5rem 0 1rem; }
.qs .wrap { max-width: 1060px; }
.qs h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 0.9rem; }
.qs .lead { color: var(--muted); max-width: 66ch; font-size: 1.05rem; }
.qs .lead strong { color: var(--fg); }
.qs-hero .hero-inner { padding-top: 7.5rem; }
.qs-hero h1 { max-width: 20ch; }
.qs-stamp { display: inline-block; line-height: 1.5; margin-top: 1.4rem; padding: 0.45rem 0.8rem;
  border: 1px solid var(--line); border-radius: 6px; font-size: 0.8rem; color: var(--muted); }
.qs-stamp b { color: var(--ok); font-weight: 500; }

/* ---------- lists and cards ---------- */
.qs-grid { display: grid; gap: 1.2rem; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.qs-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 1.3rem 1.4rem; }
.qs-card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.qs-card p, .qs-card li { color: var(--muted); font-size: 0.93rem; }
.qs-card ul { padding-left: 1.1rem; }
.qs-card li + li { margin-top: 0.3rem; }
.qs-card li strong, .qs-card p strong { color: var(--fg); font-weight: 500; }
.pad { color: var(--pad); } .cipher { color: var(--cipher); } .ok { color: var(--ok); }
.qs-steps { counter-reset: s; list-style: none; padding: 0; margin-top: 1.6rem; display: grid; gap: 0.9rem; }
.qs-steps li { position: relative; padding-left: 3.2rem; color: var(--muted); }
.qs-steps li strong { color: var(--fg); font-weight: 500; }
.qs-steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0.1rem;
  font-family: var(--mono); font-size: 0.8rem; color: var(--accent); border: 1px solid var(--line); border-radius: 4px;
  padding: 0.1rem 0.4rem; }

/* ---------- diagrams ---------- */
.fig { margin: 2.2rem 0 0; }
.fig svg { display: block; width: 100%; height: auto; max-width: 100%; color: var(--fg); }
.fig figcaption { margin-top: 0.8rem; font-size: 0.86rem; color: var(--muted); max-width: 70ch; }
.fig .ink { stroke: currentColor; fill: none; stroke-width: 1.4; }
.fig .ink-soft { stroke: currentColor; fill: none; stroke-width: 1; opacity: 0.45; }
.fig .face { fill: var(--bg-2); stroke: currentColor; stroke-width: 1.4; }
.fig .face-dark { fill: #000; stroke: currentColor; stroke-width: 1.4; }
.fig .txt { fill: currentColor; font-family: var(--sans); font-size: 12px; }
.fig .txt-s { fill: var(--muted); font-family: var(--sans); font-size: 11px; }
.fig .mono-t { fill: currentColor; font-family: var(--mono); font-size: 10.5px; }
.fig .mono-amber { fill: #ffff55; font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.fig .mono-green { fill: #55ff55; font-family: var(--mono); font-size: 10px; }
.fig .padfill { fill: var(--pad); } .fig .padline { stroke: var(--pad); fill: none; stroke-width: 1.6; }
.fig .cipherfill { fill: var(--cipher); } .fig .cipherline { stroke: var(--cipher); fill: none; stroke-width: 1.6; }
.fig .okline { stroke: var(--ok); fill: none; stroke-width: 1.6; }
.fig .badline { stroke: var(--bad); fill: none; stroke-width: 2; }
.fig .steel { fill: #4a5058; stroke: #9aa3ad; stroke-width: 1.2; }
.fig .arrow { stroke: currentColor; fill: none; stroke-width: 1.3; marker-end: url(#arrow); }
.fig .arrow-pad { stroke: var(--pad); fill: none; stroke-width: 1.5; marker-end: url(#arrow-pad); }
.fig .arrow-cipher { stroke: var(--cipher); fill: none; stroke-width: 1.5; marker-end: url(#arrow-cipher); }
.fig .dash { stroke-dasharray: 5 4; }
.fig .pulse { animation: qs-pulse 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes qs-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.fig .travel { stroke-dasharray: 6 8; animation: qs-travel 1.6s linear infinite; }
@keyframes qs-travel { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { .fig .pulse, .fig .travel { animation: none; } }

/* ---------- the player ---------- */
.player { display: grid; gap: 1.4rem; margin-top: 2.2rem; grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .player { grid-template-columns: minmax(0, 1fr); } }
.player > * { min-width: 0; }   /* the 80-column pre must never widen its column; it scrolls inside .screen instead */
.chapters { display: grid; gap: 0.35rem; position: sticky; top: 5.2rem; }
.chapters button { display: grid; grid-template-columns: 2.2rem 1fr; grid-template-rows: auto auto; column-gap: 0.4rem; align-items: baseline;
  text-align: left; padding: 0.6rem 0.75rem; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-2);
  color: var(--fg); transition: border-color 0.2s, background 0.2s; }
.chapters button:hover { border-color: var(--line); background: var(--bg-3); }
.chapters button.active { border-color: var(--accent); background: var(--bg-3); }
.chapters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chapters .n { color: var(--accent); font-size: 0.75rem; }
.chapters .t { font-size: 0.95rem; font-weight: 500; }
.chapters .c { grid-column: 2; color: var(--muted); font-size: 0.72rem; }
@media (max-width: 900px) { .chapters { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

.screen { background: #000; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem 0.9rem; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 24px 60px rgba(0,0,0,0.5); }
.screen-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.7rem;
  font-size: 0.78rem; color: var(--muted); }
.screen-bar .mono { color: var(--steel); }
.term { font-family: "SPLITSTEEL Box", "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 15px; line-height: 1.18; color: #aaaaaa; white-space: pre; overflow-x: auto; min-height: 20em; margin: 0;
  font-variant-ligatures: none; tab-size: 8; }
/* the Linux console palette: normal, bold = bright, dim = dark grey whatever the colour */
.term .w { color: #aaaaaa; } .term .r { color: #aa0000; } .term .g { color: #00aa00; } .term .y { color: #aa5500; }
.term .b { color: #ffffff; font-weight: 600; } .term .c { color: #00aaaa; } .term .B { color: #5555ff; }
.term .w.b { color: #ffffff; } .term .r.b { color: #ff5555; } .term .g.b { color: #55ff55; } .term .y.b { color: #ffff55; }
.term .c.b { color: #55ffff; } .term .B.b { color: #5555ff; }
.term span.d { color: #555555; }
.term .typed { color: #ffffff; }
.term .cur { color: #aaaaaa; animation: qs-blink 1.1s steps(1) infinite; }
@keyframes qs-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term .cur { animation: none; } }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin-top: 0.9rem; }
.controls .btn { padding: 0.5rem 0.95rem; font-size: 0.86rem; }
.controls .btn-ghost { border: 1px solid var(--line); }
.controls select { background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 0.42rem 0.6rem;
  font: inherit; font-size: 0.86rem; }
.controls input[type="range"] { flex: 1 1 140px; accent-color: var(--accent); min-width: 120px; }
.controls .counter { color: var(--muted); font-size: 0.8rem; min-width: 5.5ch; text-align: right; }
.keys { margin-top: 0.7rem; font-size: 0.8rem; color: var(--steel); min-height: 1.3em; }
.cap-box { margin-top: 1rem; padding: 1rem 1.15rem; border-left: 2px solid var(--accent); background: var(--bg-2); border-radius: 0 8px 8px 0; }
.cap-box .ep { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.cap-box .blurb { color: var(--muted); font-size: 0.86rem; margin-top: 0.15rem; }
.cap { margin-top: 0.6rem; color: var(--fg); font-size: 1rem; line-height: 1.55; opacity: 0; transition: opacity 0.35s ease; min-height: 3.2em; }
.cap.show { opacity: 1; }
.videos { margin-top: 1.6rem; }
.videos summary { cursor: pointer; color: var(--accent); }
.videos ul { margin: 0.8rem 0 0 1.1rem; color: var(--muted); font-size: 0.9rem; }
.videos li + li { margin-top: 0.3rem; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 0.6rem; }

/* ---------- print ---------- */
@media print {
  .nav, .controls, .chapters, .videos, .hero-badge { display: none !important; }
  body { background: #fff; color: #111; }
  .screen { box-shadow: none; }
}

/* ---------- the cards on the table ---------- */
.chapters-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2rem; }
.chapters-strip button { display: grid; grid-template-columns: auto 1fr; column-gap: 0.45rem; align-items: baseline; text-align: left;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-2); color: var(--fg);
  transition: border-color 0.2s, background 0.2s; }
.chapters-strip button:hover { border-color: var(--line); background: var(--bg-3); }
.chapters-strip button.active { border-color: var(--accent); background: var(--bg-3); }
.chapters-strip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chapters-strip .n { color: var(--accent); font-size: 0.72rem; }
.chapters-strip .t { font-size: 0.88rem; font-weight: 500; }
.chapters-strip .c { grid-column: 2; color: var(--muted); font-size: 0.68rem; }
.stage { display: grid; gap: 1.4rem; margin-top: 1.2rem; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
@media (max-width: 1000px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.stage > * { min-width: 0; }
.cards { position: sticky; top: 5rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1rem 1rem; }
@media (max-width: 1000px) { .cards { position: static; } }
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.tabs button { font-size: 0.72rem; padding: 0.3rem 0.55rem; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted);
  background: transparent; position: relative; }
.tabs button.has { color: var(--fg); }
.tabs button.has::after { content: ""; position: absolute; right: 0.35rem; top: 0.42rem; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.tabs button.active { border-color: var(--accent); color: var(--accent-hi); background: var(--bg-3); }
.tabs.pinned button.active { border-style: dashed; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-view { min-width: 0; max-width: 100%; overflow-x: auto; }
.card-view table { max-width: 100%; }
.card-title { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.7rem; }
.card-read { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-top: 0.7rem; line-height: 1.5; }
.cards-note { color: var(--muted); font-size: 0.78rem; margin-top: 0.6rem; min-height: 1.2em; }

/* paper grids */
.pg { margin-bottom: 0.85rem; }
.pg-label { font-family: var(--mono); font-size: 0.7rem; color: var(--steel); margin-bottom: 0.3rem; }
.pg-boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.3rem; }
.pg-box { position: relative; border: 1.5px solid rgba(226,232,240,0.28); border-radius: 4px; height: 2.35rem; background: #f3efe6;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0.25rem; transition: border-color 0.25s, box-shadow 0.25s; }
.pg-spacer { visibility: hidden; }
.pg-n { position: absolute; top: 0.12rem; left: 0.28rem; font-family: var(--mono); font-size: 0.55rem; color: #6a6f78; }
.pg-v { font-family: var(--mono); font-size: 0.82rem; font-weight: 600; color: #1d2430; letter-spacing: 0.04em; min-height: 1em; }
.pg-box.writing .pg-v::after { content: "_"; color: #6a6f78; }
.pg-box.on { border-color: rgba(226,232,240,0.45); }
.pg-in .pg-box.on { border-color: var(--steel); }
.pg-seed .pg-box.on { border-color: var(--ok); }
.pg-pad .pg-box.on { border-color: var(--pad); }
.pg-cip .pg-box.on { border-color: var(--cipher); }
.pg-box.cur { border-color: #e2b13c; box-shadow: 0 0 0 2px rgba(226,177,60,0.35); }
.pg-box.bad { border-color: var(--bad); box-shadow: 0 0 0 2px rgba(224,122,95,0.35); }
.pg-box.bad .pg-v { color: var(--bad); text-decoration: line-through; }

/* the two tables */
.dice, .xor { border-collapse: collapse; width: 100%; min-width: 0; table-layout: fixed; font-family: var(--mono); background: #f3efe6; color: #1d2430;
  border-radius: 4px; overflow: hidden; }
.dice th, .dice td { text-align: center; padding: 0.3rem 0; font-size: 0.8rem; border: 1px solid rgba(29,36,48,0.18); }
.dice th { color: var(--accent); background: #e9e3d6; font-weight: 600; }
.dice td.reroll { font-size: 0.55rem; color: #6a6f78; background: #ebe6db; }
.xor th, .xor td { text-align: center; padding: 0.1rem 0; font-size: 0.58rem; border: 1px solid rgba(29,36,48,0.14); overflow: hidden; }
.xor th { color: var(--accent); background: #e9e3d6; font-weight: 600; }
.dice .hl, .xor .hl { background: rgba(226,177,60,0.28); }
.dice th.hl, .xor th.hl { background: rgba(226,177,60,0.55); color: #1d2430; }
.dice .hit, .xor .hit { background: #e2b13c; color: #1d2430; font-weight: 700; }

/* the paper seed */
.wordlist { columns: 2; column-gap: 1.2rem; padding-left: 0; margin: 0; list-style: none; counter-reset: w; background: #f3efe6; color: #1d2430;
  border-radius: 4px; padding: 0.6rem 0.8rem; }
.wordlist li { counter-increment: w; font-family: var(--mono); font-size: 0.8rem; padding: 0.15rem 0.3rem; border-radius: 3px; break-inside: avoid; }
.wordlist li::before { content: counter(w) " "; color: #6a6f78; font-size: 0.65rem; display: inline-block; width: 1.5rem; }
.wordlist li.blank::after { content: "________"; color: #b9b3a6; }
.wordlist li.cur { background: rgba(226,177,60,0.45); }

/* the box being combined, shown above the arithmetic card */
.box-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.7rem; }
.box-row .pg-box { width: 4.4rem; flex: none; }
.box-row .box-op { font-family: var(--mono); color: var(--muted); font-size: 0.9rem; }
.pg-in-box.on { border-color: var(--steel); } .pg-seed-box.on { border-color: var(--ok); }
.pg-pad-box.on { border-color: var(--pad); } .pg-cip-box.on { border-color: var(--cipher); }

/* ---------- hero image, board parts, the why table ---------- */
.qs-hero .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%; z-index: -1; }
.qs-hero { min-height: 82svh; }
.fig .sm { font-size: 9.5px; }
.fig .mono-dim { fill: #666a70; font-family: var(--mono); }
.fig .pcb { fill: #2b6b45; stroke: #7fc39b; stroke-width: 1.2; }
.fig .hole { fill: #0b0c0e; stroke: #cfd6de; stroke-width: 1; }
.fig .pin { fill: #d8b03a; }
.fig .chip { fill: #14161a; stroke: #4a5058; stroke-width: 0.8; }
.fig .port { fill: #b6bfc9; stroke: #e6ebf0; stroke-width: 0.8; }
.fig .okfill { fill: var(--ok); font-weight: 600; }
.why-wrap { overflow-x: auto; margin-top: 1.6rem; }
.why { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.why th, .why td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.why th { color: var(--fg); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.02em; border-bottom: 1px solid var(--line); }
.why td:first-child { color: var(--fg); }
.why td.strong { color: var(--fg); background: var(--bg-2); }
.why tbody tr:last-child td { border-bottom: 0; }
