/* The Outsourced Reality · edition styles (magenta) */

.hashy { font: 600 0.95rem/1.25 var(--f-code) !important; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.kw { margin: 0; font: italic 400 0.92rem/1.45 var(--f-body); color: #3a3936; }
.glossary td:first-child { white-space: nowrap; font-weight: 700; }
.ed-or .banner { font-size: clamp(2.7rem, 8.6vw, 7.2rem); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.swap { animation: rise 0.4s var(--ease); }

/* ---------- Two chains (scroll story) ---------- */
.chains { display: grid; gap: 0.6rem; }
.chains svg { width: 100%; height: auto; max-height: 56vh; overflow: visible; }
.chains .node circle { fill: var(--paper); stroke: var(--hair-2); stroke-width: 1.6; transition: fill 0.45s, stroke 0.45s; }
.chains .node text { font-size: 12.5px; font-weight: 700; fill: var(--grey); transition: fill 0.45s; }
.chains .node .x { stroke: #fff; stroke-width: 2.2; opacity: 0; transition: opacity 0.3s; }
.chains .node.ok circle { stroke: var(--ink); }
.chains .node.ok text { fill: var(--ink); }
.chains .node.bad circle { fill: var(--spot); stroke: var(--spot); }
.chains .node.bad text { fill: var(--spot); }
.chains .node.bad .x { opacity: 1; }
.chains .link { stroke: var(--hair-2); stroke-width: 2; transition: stroke 0.45s; }
.chains .link.bad { stroke: var(--spot); stroke-dasharray: 5 4; }
.chains .tok { transition: transform 0.9s var(--ease); }
.chains .tok rect.bar { fill: var(--spot); transform-box: fill-box; transform-origin: center; animation: wave 0.9s ease-in-out infinite alternate; }
@keyframes wave { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
.chains .burst circle { fill: var(--spot); opacity: 0.55; }
.chain-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.chain-read > div { padding: 0.45rem 0.6rem 0.45rem 0; min-width: 0; }
.chain-read small { display: block; font: 600 0.74rem/1.3 var(--f-sans); color: var(--grey); }
.chain-read b { display: block; padding: 0.04em 0; font: 800 1.4rem/1.15 var(--f-sans); font-variant-numeric: tabular-nums; }
.chain-read b.spot { color: var(--spot); }
.chain-note { margin: 0; min-height: 2.8em; font: 600 0.95rem/1.4 var(--f-sans); }

/* ---------- Who makes it, who reads it ---------- */
.quad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.4rem); align-items: start; }
@media (max-width: 760px) { .quad { grid-template-columns: 1fr; } }
.quad svg { width: 100%; max-width: 30rem; height: auto; touch-action: none; user-select: none; overflow: visible; display: block; margin: 0 auto; }
.quad .puck { cursor: grab; }
.quad .puck:active { cursor: grabbing; }
.quad .cell { cursor: pointer; }
.quad-card h4 { margin: 0 0 0.2rem; padding: 0.02em 0; font: 800 1.6rem/1.15 var(--f-head); font-stretch: 76%; }
.quad-card .eg { margin: 0 0 0.5rem; font: italic 400 1rem/1.5 var(--f-body); color: var(--ink-2); }
.quad-card p { margin: 0 0 0.6rem; font: 400 1rem/1.5 var(--f-body); }
.bars { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.bars > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 3rem; gap: 0.6rem; align-items: center; font: 600 0.82rem/1.3 var(--f-sans); }
.bars .bar { height: 0.7rem; background: var(--paper-2); position: relative; overflow: hidden; }
.bars .bar i { position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); background: var(--ink); transition: width 0.35s var(--ease); }
.bars .bar.spot i { background: var(--spot); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .bars > div { grid-template-columns: 7rem minmax(0, 1fr) 2.6rem; } }

/* ---------- Pairs (sort, then flip) ---------- */
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 620px) { .pairs { grid-template-columns: 1fr; } }
.pcard { perspective: 1200px; min-height: 14rem; }
.pcard-in { position: relative; display: grid; height: 100%; min-height: inherit; transform-style: preserve-3d; transition: transform 0.75s var(--ease); }
.pcard.flipped .pcard-in { transform: rotateY(180deg); }
.pface { grid-area: 1 / 1; position: relative; display: flex; flex-direction: column; padding: 1rem 1.05rem; border: 1px solid var(--hair-2); border-top: 4px solid var(--ink); background: var(--sheet); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pface.back { transform: rotateY(180deg); border-top-color: var(--spot); }
.pface small { font: 800 0.72rem/1.3 var(--f-sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey); }
.pface .q { flex: 1; margin: 0.5rem 0 0.8rem; font: 400 1.06rem/1.45 var(--f-body); }
.pface .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pface .opts .btn { padding-inline: 0.5rem; }
.pface h4 { margin: 0.35rem 0 0.4rem; padding: 0.02em 0; font: 800 1.35rem/1.15 var(--f-head); font-stretch: 78%; }
.pface h4 .verdict { display: block; font: 700 0.8rem/1.3 var(--f-sans); color: var(--spot); }
.pface p { margin: 0 0 0.5rem; font: 400 0.94rem/1.5 var(--f-body); }
.pface .again { margin-top: auto; align-self: flex-start; border: 0; background: none; padding: 0; font: 600 0.8rem/1.2 var(--f-sans); color: var(--grey); text-decoration: underline; cursor: pointer; }
.pair-score { margin-top: 0.9rem; font: 700 0.95rem/1.4 var(--f-sans); }

/* ---------- Hash is not truth ---------- */
.hashlab textarea { width: 100%; min-height: 4.6rem; padding: 0.7rem 0.8rem; border: 1px solid var(--hair-2); border-radius: 4px; background: var(--sheet); color: var(--ink); font: 400 1.08rem/1.45 var(--f-body); resize: vertical; }
.hashlab textarea:focus { outline: 2px solid var(--spot); outline-offset: 1px; }
.hexgrid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; margin-top: 0.8rem; font: 600 clamp(0.62rem, 1.7vw, 0.95rem)/1 var(--f-code); }
.hexgrid span { display: grid; place-items: center; padding: 0.5em 0; min-width: 0; background: var(--paper-2); color: var(--ink); transition: background 0.35s, color 0.35s; }
.hexgrid span.flip { background: var(--spot); color: #fff; }
.proves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-top: 1rem; }
@media (max-width: 680px) { .proves { grid-template-columns: 1fr; } }
.proves div { padding: 0.65rem 0.8rem; border: 1px solid var(--hair); background: var(--sheet); font: 400 0.92rem/1.45 var(--f-body); }
.proves b { display: block; margin-bottom: 0.2rem; font: 800 0.72rem/1.3 var(--f-sans); letter-spacing: 0.05em; text-transform: uppercase; }
.proves .yes b { color: var(--good); }
.proves .no b { color: var(--spot); }
.proves .yes.broken { opacity: 0.55; text-decoration: line-through; }

/* ---------- Race ---------- */
.race-wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2rem); align-items: start; }
@media (max-width: 820px) { .race-wrap { grid-template-columns: 1fr; } }
.race-clock { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; font: 700 0.85rem/1.3 var(--f-sans); }
.race-clock b { font: 800 1.3rem/1.15 var(--f-sans); font-variant-numeric: tabular-nums; }
.race-wrap canvas { display: block; border: 1px solid var(--hair); background: var(--sheet); }

/* ---------- Swiss-cheese defences ---------- */
.cheese svg { width: 100%; height: auto; overflow: visible; }
.cheese .slice rect.body { fill: var(--paper-2); stroke: var(--hair-2); transition: fill 0.3s; }
.cheese .slice.open rect.body { fill: var(--spot-wash); stroke: var(--spot); }
.cheese .slice .hole { fill: var(--paper); stroke: var(--hair-2); transition: height 0.45s var(--ease), y 0.45s var(--ease); }
.cheese .slice.open .hole { stroke: var(--spot); }
.cheese .slice text { font-weight: 700; }
.fail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 0.25rem 1.2rem; margin-top: 0.9rem; }

/* ---------- Spectrum ---------- */
.spec-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; margin: 0.4rem 0 0.2rem; }
.spec-steps button { padding: 0.5rem 0.2rem; border: 0; background: var(--paper-2); cursor: pointer; font: 700 0.8rem/1.2 var(--f-sans); color: var(--ink-2); transition: background 0.3s, color 0.3s; min-width: 0; }
@media (max-width: 620px) { .spec-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.spec-steps button.on { color: #fff; }
.spec-doc { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--hair-2); background: var(--sheet); min-height: 9rem; }
.spec-doc small { display: block; margin-bottom: 0.35rem; font: 800 0.72rem/1.3 var(--f-sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey); }
.spec-doc p { margin: 0; font: 400 1rem/1.55 var(--f-body); }
.spec-doc del { color: var(--spot); text-decoration-thickness: 2px; }
.spec-doc mark { background: var(--spot-wash); color: inherit; padding: 0 0.15em; }
.spec-doc .stamp { display: inline-block; margin-top: 0.5rem; padding: 0.2rem 0.6rem; border: 2px solid var(--spot); color: var(--spot); font: 800 0.85rem/1.3 var(--f-sans); transform: rotate(-2deg); }

/* ---------- Dial ---------- */
.dial-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1rem, 3vw, 2.4rem); align-items: center; }
@media (max-width: 760px) { .dial-wrap { grid-template-columns: 1fr; } }
.dial svg { width: 100%; max-width: 26rem; height: auto; display: block; margin: 0 auto; overflow: visible; }
.dial .needle { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.dial .read { font: 800 34px/1 var(--f-sans); fill: var(--ink); }

/* ---------- Trace ---------- */
.trace-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.45rem; }
.sig { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 0.6rem; align-items: center; padding: 0.55rem 0.7rem; border: 1px solid var(--hair); background: var(--sheet); cursor: pointer; text-align: left; color: var(--ink); font: 600 0.9rem/1.3 var(--f-sans); transition: border-color 0.2s, background 0.2s; }
.sig i { grid-row: span 2; width: 1.1rem; height: 1.1rem; border: 2px solid var(--ink); border-radius: 3px; transition: background 0.2s; }
.sig small { font: 500 0.76rem/1.3 var(--f-sans); color: var(--grey); }
.sig[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
.sig[aria-pressed="true"] i { background: var(--ink); box-shadow: inset 0 0 0 2px var(--paper); }
.sig.hard small { color: var(--good); }

/* ---------- Liar's dividend / crowd dots ---------- */
.dots svg { width: 100%; height: auto; }
.dots circle { transition: fill 0.5s; }

/* ---------- Deference test (iPhone chat) ---------- */
.chat { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: 3.9cqw; }
.chat-log { flex: 1; overflow-y: auto; padding: 3cqw 4cqw 2cqw; display: flex; flex-direction: column; gap: 2.4cqw; scroll-behavior: smooth; }
.bub { max-width: 82%; padding: 2.4cqw 3.4cqw; border-radius: 4.6cqw; line-height: 1.35; animation: rise 0.35s var(--ease); }
.bub.me { align-self: flex-end; background: #0a84ff; color: #fff; border-bottom-right-radius: 1.4cqw; }
.bub.ai { align-self: flex-start; background: #ececf0; color: #111; border-bottom-left-radius: 1.4cqw; }
.iphone-screen.dark .bub.ai { background: #26262a; color: #f2f2f2; }
.bub .conf { display: block; margin-top: 1cqw; font-size: 3cqw; opacity: 0.6; }
.bub.verdict { align-self: center; max-width: 92%; background: transparent; border: 1px solid currentColor; font-size: 3.3cqw; text-align: center; }
.bub.verdict.wrong { color: #ff453a; } .bub.verdict.right { color: #30d158; }
.chat-act { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; padding: 2.4cqw 4cqw 8cqw; }
.chat-act button { padding: 2.8cqw 0; border-radius: 99px; border: 0; font: 600 3.9cqw/1 -apple-system, system-ui, sans-serif; cursor: pointer; }
.chat-act .acc { background: #0a84ff; color: #fff; }
.chat-act .chk { background: #2c2c2e; color: #fff; }
.iphone-screen:not(.dark) .chat-act .chk { background: #e5e5ea; color: #111; }
.chat-act button[disabled] { opacity: 0.4; }
.typing { display: inline-flex; gap: 1cqw; } .typing i { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: currentColor; opacity: 0.5; animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 50% { opacity: 1; } }
.checkbar { height: 1cqw; margin-top: 1.4cqw; background: rgba(127,127,127,.3); border-radius: 1cqw; overflow: hidden; }
.checkbar i { display: block; height: 100%; width: 0; background: #ff9f0a; }
.defer-score ol { margin: 0.8rem 0 0; padding-left: 1.3rem; font: 400 0.9rem/1.5 var(--f-sans); }
.defer-score li.miss { color: var(--spot); }

/* ---------- Crowd ---------- */
.replies { display: grid; gap: 0.45rem; margin-top: 0.8rem; }
.reply { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.6rem; padding: 0.5rem 0.6rem; border: 1px solid var(--hair); background: var(--sheet); font: 400 0.9rem/1.4 var(--f-sans); animation: rise 0.35s var(--ease) both; }
.reply .av { width: 2rem; height: 2rem; border-radius: 50%; }
.reply b { font-weight: 700; } .reply small { color: var(--grey); }
.reply.bot .tag { display: inline-block; margin-left: 0.3rem; padding: 0 0.35rem; border-radius: 3px; background: var(--spot); color: #fff; font: 700 0.68rem/1.5 var(--f-sans); }

/* ---------- Desk ---------- */
.desk-card { margin-top: 1rem; }
.desk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 680px) { .desk-grid { grid-template-columns: 1fr; } }
.desk-grid div { padding-top: 0.55rem; border-top: 3px solid var(--ink); }
.desk-grid div.spot { border-top-color: var(--spot); }
.desk-grid small { display: block; margin-bottom: 0.25rem; font: 800 0.72rem/1.3 var(--f-sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--grey); }
.desk-grid p { margin: 0; font: 400 0.98rem/1.5 var(--f-body); }
.fixes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin: 1.1rem 0 0; }
.outcome { margin-top: 0.8rem; padding: 0.8rem 0.95rem; border-left: 4px solid var(--spot); background: var(--spot-wash); font: 400 1rem/1.5 var(--f-body); }
.outcome.good { border-left-color: var(--good); background: rgba(35, 120, 74, 0.09); }

/* ---------- Watermark lab ---------- */
.mark-text { padding: 0.9rem 1rem; border: 1px solid var(--hair-2); background: var(--sheet); font: 400 1.04rem/1.75 var(--f-body); min-height: 9rem; }
.mark-text .w { border-radius: 2px; transition: background 0.35s, color 0.35s; padding: 0 0.04em; }
.mark-text.view .w.g { background: rgba(35, 120, 74, 0.2); }
.mark-text.view .w.r { background: rgba(196, 18, 124, 0.14); }
.mark-text .w.new { outline: 1.5px dashed var(--ink-2); outline-offset: 1px; }
.zmeter { position: relative; height: 2.8rem; margin: 1.8rem 0.9rem 0.4rem; }
.zmeter .track { position: absolute; left: 0; right: 0; top: 1.1rem; height: 0.45rem; background: linear-gradient(90deg, var(--paper-2) 0 50%, var(--spot-wash) 50%); }
.zmeter .thr { position: absolute; top: 0.2rem; bottom: 0; width: 2px; background: var(--spot); }
.zmeter .thr span { position: absolute; top: -1.2rem; left: 0.3rem; white-space: nowrap; font: 700 0.75rem/1.2 var(--f-sans); color: var(--spot); }
.zmeter .pin { position: absolute; top: 0.6rem; width: 1.4rem; height: 1.4rem; margin-left: -0.7rem; border-radius: 50%; background: var(--ink); border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px var(--ink); transition: left 0.6s var(--ease); }
.zmeter .ticks { position: absolute; left: 0; right: 0; top: 1.95rem; font: 500 0.72rem/1 var(--f-sans); color: var(--grey); }
.zmeter .ticks span { position: absolute; transform: translateX(-50%); }

/* ---------- Design toggles ---------- */
.design-wrap .src { display: block; margin-top: 1.6cqw; padding: 1.8cqw 2.4cqw; border-radius: 2.4cqw; background: rgba(127,127,127,.16); font-size: 3.3cqw; line-height: 1.35; }
.design-wrap .src b { display: block; font-size: 3cqw; opacity: 0.7; }
.design-wrap .hold { position: relative; display: block; width: 100%; margin-top: 2cqw; padding: 2.6cqw 0; border: 0; border-radius: 99px; background: #3a3a3c; color: #fff; font: 600 3.6cqw/1 -apple-system, system-ui, sans-serif; overflow: hidden; cursor: pointer; }
.design-wrap .hold i { position: absolute; inset: 0 auto 0 0; width: 0; background: #ff9f0a; opacity: 0.55; }
.design-wrap .hold span { position: relative; }
.design-wrap .sec-t { display: block; margin-top: 1.6cqw; font-size: 3cqw; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.6; }
