/* The Wild Horse story site. One shared stylesheet, no external requests.
   Comic-page look: flat saturated panels, thick ink borders, hard offset shadows on buttons only. */
@font-face { font-family: "Anton"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/anton-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-700.woff2") format("woff2"); }

:root {
  --ink: #0b0b0f;
  --cream: #fffbe8;
  --paper: #fffdf3;
  --muted: #4d4a3f;
  --teal-deep: #0c3b47;
  --yellow: #ffcf33;
  --red: #ff5040;
  --red-deep: #c8261a;
  --mint: #5ee0a6;
  --purple: #8c63ff;
  --teal: #2bb7c4;
  --pink: #ff8ccf;
  --blue: #0a4fd1;
  --amber: #e0a800; --g: #ffcf33;
  --display: "Anton", Impact, "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --body: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --border: 5px solid var(--ink);
  /* speaker colors: light enough to carry ink text */
  --c-ralph: #ff6b5b; --c-stacy: #b898ff; --c-bailey: #86e083; --c-dani: #ff93d0; --c-lin: #66d4ff;
  --c-giselle: #bccadb; --c-quartz: #ffb347; --c-steinberg: #c8dc55; --c-charlie: #dcab6c; --c-judge: #70e6c4; --c-girl: #e3acff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background-color: var(--ink);
  background-image: radial-gradient(ellipse 120% 80% at 30% -10%, #145a6b 0%, #0c3b47 38%, #0b0b0f 100%);
  background-attachment: fixed;
  font: 17px/1.6 var(--body);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
.roster > *, .panels > *, .credits-grid > * { min-width: 0; }
a { color: var(--blue); text-underline-offset: .15em; }
a:hover { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.panel :focus-visible, .hero :focus-visible, .fulltext :focus-visible, .box :focus-visible, .char :focus-visible, .rcard :focus-visible { outline-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow); }
code { font: .88em ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: #efe6b8; padding: 0 .25em; }
.skip { position: absolute; left: .5rem; top: -4rem; background: var(--yellow); color: var(--ink); border: 4px solid var(--ink); padding: .6rem 1rem; font-weight: 700; z-index: 100; }
.skip:focus { top: .5rem; }

/* ---------- site bar ---------- */
.top { background: var(--ink); border-bottom: 4px solid var(--yellow); }
.bar { max-width: 74rem; margin: 0 auto; padding: .5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem; }
.brand { font: 1.5rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--yellow); text-decoration: none; white-space: nowrap; padding: .3rem .2rem; }
.brand:hover { background: none; color: #fff; }
.menu { display: flex; flex-wrap: wrap; gap: .3rem; }
.menu a { color: var(--cream); text-decoration: none; font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding: .55rem .8rem; border: 3px solid transparent; white-space: nowrap; }
.menu a:hover { background: var(--cream); color: var(--ink); }
.menu a.cur { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* ---------- chapter bar (gear pages) ---------- */
.chapbar { position: sticky; top: 0; z-index: 20; background: var(--g); color: var(--ink); border-bottom: 4px solid var(--ink); }
.chapbar-in { max-width: 74rem; margin: 0 auto; padding: .3rem 1rem; display: flex; align-items: center; gap: .6rem; }
.chapbar .tag { font: 1.25rem/1 var(--display); letter-spacing: .08em; background: var(--ink); color: var(--g); padding: .3rem .7rem; text-decoration: none; white-space: nowrap; }
.chapbar .tag:hover { background: var(--ink); color: #fff; }
.chapbar .sp { flex: 1; }
.chapbar a.step, .chapbar summary { font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: .4rem .75rem; cursor: pointer; list-style: none; white-space: nowrap; }
.chapbar summary::-webkit-details-marker { display: none; }
.chapbar a.step:hover, .chapbar summary:hover { background: var(--yellow); }
.chapbar a.step:active, .chapbar summary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chapbar .scenes { position: static; }
.chapbar .scenes > div { position: absolute; left: 0; right: 0; top: 100%; max-height: 70vh; overflow: auto; background: var(--cream); border-bottom: 5px solid var(--ink); padding: .6rem 1rem 1rem; }
.chapbar .scenes ol { max-width: 74rem; margin: 0 auto; }
.chapbar .scenes a[aria-current] { background: var(--yellow); font-weight: 700; }
.progress { height: 6px; background: var(--ink); }
.progress i { display: block; height: 100%; width: 0; background: var(--cream); }

/* ---------- page frame ---------- */
main { overflow-x: clip; max-width: 74rem; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; line-height: 1.1; }
main > h2 { font-size: 2rem; margin: 2.4rem 0 .8rem; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); }
main > h2 + p, main > p, main > ul { color: var(--cream); }
main > p a, main > ul a { color: var(--yellow); }
main > p a:hover, main > ul a:hover { color: var(--ink); }
main > p code, main > ul code { color: var(--ink); }
h3 { font-size: 1.3rem; margin: 1.2rem 0 .4rem; }

footer { max-width: 74rem; margin: 0 auto; padding: 1.2rem 1rem 3rem; color: var(--cream); font-size: .85rem; }
footer p { margin: .3rem 0; }
footer a { color: var(--yellow); }
footer a:hover { color: var(--ink); }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 0; flex-wrap: wrap; }
.pager a { background: var(--cream); color: var(--ink); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: .8rem 1.4rem; text-decoration: none; font: 1.25rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; min-height: 3rem; }
.pager a:hover { background: var(--yellow); }
.pager a:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- hero (title panel of every page but the cover) ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34%); background: var(--g); border: var(--border); overflow: hidden; margin: 1rem 0 1.6rem; }
.hero::before, .panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(115deg, rgba(255,255,255,.16) 0 16px, transparent 16px 52px); }
.hero > *, .panel > * { position: relative; }
.hero-text { padding: 4.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; justify-content: flex-end; }
.hero h1 { margin: 0; font-size: clamp(2.4rem, 6.2vw, 4.6rem); line-height: 1; color: var(--ink); text-shadow: 3px 3px 0 rgba(255,255,255,.55); }
.hero .lede { margin: 0; background: var(--cream); border: 4px solid var(--ink); padding: .8rem 1rem; font-size: 1.02rem; max-width: 38rem; }
.hero-art { width: 100%; height: 100%; min-height: 15rem; object-fit: cover; border-left: var(--border); }
.ribbon { position: absolute; top: 1.4rem; left: -3rem; width: 26rem; max-width: 80%; transform: rotate(-4deg); transform-origin: left center; background: var(--ink); color: var(--g); font: 2rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; text-align: center; padding: .6rem 1rem .5rem 3rem; border-block: 4px solid var(--cream); z-index: 2; }
.g1 { --g: #ffcf33; } .g2 { --g: #2bb7c4; } .g3 { --g: #a58bff; } .g4 { --g: #5ee0a6; } .g5 { --g: #ff5a48; }
.p-characters { --g: #ff93d0; } .p-places { --g: #ffb347; } .p-open-questions { --g: #66d4ff; } .p-credits { --g: #cfd8dc; }

/* ---------- boxes, tables, tape ---------- */
.box { background: var(--cream); border: var(--border); padding: .4rem 1.3rem 1.3rem; margin: 1.4rem 0; }
.box h2, .box h3 { border: 0; margin-top: 1rem; }
.box h2 { font-size: 1.9rem; }
.summary { border-top: 12px solid var(--g); }
.summary h2::before { content: "\25A0  "; color: var(--g); -webkit-text-stroke: 2px var(--ink); }
.summary dl { display: grid; grid-template-columns: 11rem 1fr; gap: .5rem 1.2rem; margin: .6rem 0 0; }
.summary dt { font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding-top: .25rem; }
.summary dd { margin: 0; }
.note { background: #fff1b8; border: 4px solid var(--ink); padding: .8rem 1.1rem; margin: 1rem 0; }
.warn { background: repeating-linear-gradient(-45deg, #ffcf33 0 12px, #fff1b8 12px 24px); position: relative; }
.warn > * { background: #fff6d0; padding: .1rem .5rem; margin: .4rem 0; }
table { border-collapse: collapse; width: 100%; background: var(--paper); font-size: .95rem; border: 4px solid var(--ink); }
th, td { border: 2px solid var(--ink); padding: .5rem .65rem; text-align: left; vertical-align: top; }
th { background: var(--ink); color: var(--cream); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.tablewrap { overflow-x: auto; margin: 1rem 0; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .6rem; border: 2px solid var(--ink); background: var(--paper); margin: 0 .2rem .25rem 0; }
.pill.red { background: var(--red); }
.pill.blue { background: var(--teal); }
.tape { background: repeating-linear-gradient(-45deg, #ffcf33 0 16px, var(--ink) 16px 32px); border-block: 4px solid var(--ink); padding: .5rem 1rem; text-align: center; transform: rotate(-1.5deg); margin: 1rem -.6rem; position: relative; z-index: 3; }
.tape span { display: inline-block; background: #ffcf33; color: var(--ink); border: 3px solid var(--ink); padding: .1rem .9rem; font: 1.3rem/1.3 var(--display); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- segment-kind badges ---------- */
.kind { display: inline-block; font: 700 .7rem/1.4 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: .05rem .5rem; border: 2px solid var(--ink); color: var(--ink); background: #ddd; vertical-align: .12em; white-space: nowrap; }
.kind-cutscene { background: #d9d3c0; } .kind-choice { background: var(--pink); } .kind-tutorial { background: var(--mint); }
.kind-open-world { background: #9fe8c9; } .kind-robot-combat { background: #ff9a4a; } .kind-boss { background: var(--red); }
.kind-shooter { background: #b898ff; } .kind-linear-level { background: #ffd96b; } .kind-travel { background: #66d4ff; } .kind-hub { background: #ff93d0; }
.segments { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0; padding: 0; list-style: none; }
.segments li::after { content: "\2192"; margin-left: .4rem; }
.segments li:last-child::after { content: ""; }
.segments a { text-decoration: none; }

/* ---------- table of contents ---------- */
.toc { columns: 2 340px; column-gap: 2rem; padding-left: 1.4rem; font-size: .95rem; }
.toc li { margin: .25rem 0; break-inside: avoid; }
.toc a { text-decoration: none; display: inline-block; padding: .15rem .25rem; }
.toc a:hover { text-decoration: underline; }
.p-gear .toc-box { background: var(--cream); border: var(--border); padding: .2rem 1.3rem 1rem; }

/* ---------- the full text: a comic reading page ---------- */
.fulltext { max-width: 43rem; margin: 1.4rem auto; background: var(--cream); border: var(--border); padding: 0 1.5rem 2rem; font-size: 1.06rem; line-height: 1.7; }
.fulltext p { margin: 0 0 1rem; position: relative; }
.fulltext .scene { scroll-margin-top: 5.2rem; margin: 3rem -1.5rem 1.4rem; padding: .7rem 1.5rem .6rem; background: var(--ink); color: var(--cream); font-size: 1.5rem; border-top: 8px solid var(--g); display: block; }
.fulltext .scene:first-child { margin-top: 0; }
.fulltext .scene .kind { font-size: .68rem; margin-right: .5rem; }
.fulltext .perma { font: 700 .8rem var(--body); color: #ffcf33; text-decoration: none; margin-left: .4rem; padding: .3rem .5rem; }
.fulltext .perma:hover { background: var(--yellow); color: var(--ink); }
.fulltext .gearhead { display: none; }
.fulltext .b { font-weight: 700; } .fulltext .i { font-style: italic; }

/* dialogue as speech: a balloon per spoken paragraph, the speaker's name as a colored tag */
.fulltext p.say, .fulltext p.mix.by-ralph, .fulltext p.mix[class*="by-"] { --c: #fff; background: color-mix(in srgb, var(--c) 22%, #fff); border: 3px solid var(--ink); border-radius: 20px; padding: .6rem 1rem; margin-bottom: 1.3rem; }
.fulltext p.say::after, .fulltext p.mix[class*="by-"]::after { content: ""; position: absolute; bottom: -10px; left: 30px; width: 15px; height: 15px; background: inherit; border: 3px solid var(--ink); border-top: 0; border-left: 0; transform: rotate(45deg); }
.fulltext p.mix[class*="by-"]:not(.by-ralph), .fulltext p.say:not(.by-ralph)[class*="by-"] { margin-left: 8%; }
.fulltext p.mix[class*="by-"]:not(.by-ralph)::after, .fulltext p.say:not(.by-ralph)[class*="by-"]::after { left: auto; right: 30px; }
.fulltext p.by-ralph { margin-right: 8%; }
.fulltext p.mix { padding-left: .9rem; border-left: 4px solid rgba(11,11,15,.28); }
.fulltext p.mix[class*="by-"] { border-left: 3px solid var(--ink); }
.fulltext p.stage { font-style: italic; background: #fff0a8; border: 2px solid var(--ink); padding: .5rem .9rem; font-size: .98rem; }
.fulltext p.aside { font-style: italic; background: #fff; border: 2px dashed var(--ink); border-radius: 10px; padding: .45rem .9rem; font-size: .98rem; }
.fulltext p.mechanics { background: #fff; border: 4px solid var(--ink); border-left-width: 14px; border-left-color: var(--red); padding: .8rem 1rem .8rem 1rem; font-style: normal; font-size: 1rem; margin: 1.2rem 0; }
.fulltext p.mechanics::before { content: "Boss mechanics"; display: block; font: .75rem/1.2 var(--body); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-deep); margin-bottom: .3rem; }
.spk { font-weight: 700; font-style: normal; padding: .02rem .45rem; border: 2px solid var(--ink); background: var(--c, #ddd); color: var(--ink); font-size: .9em; white-space: nowrap; }
.spk-ralph, .by-ralph { --c: var(--c-ralph); } .spk-stacy, .by-stacy { --c: var(--c-stacy); } .spk-bailey, .by-bailey { --c: var(--c-bailey); }
.spk-dani, .by-dani { --c: var(--c-dani); } .spk-lin, .by-lin { --c: var(--c-lin); } .spk-giselle, .by-giselle { --c: var(--c-giselle); }
.spk-quartz, .by-quartz { --c: var(--c-quartz); } .spk-steinberg, .by-steinberg { --c: var(--c-steinberg); } .spk-charlie, .by-charlie { --c: var(--c-charlie); }
.spk-judge, .by-judge { --c: var(--c-judge); } .spk-girl, .by-girl { --c: var(--c-girl); }
.fulltext p.say.by-ralph, .fulltext p.say[class*="by-"] { background: color-mix(in srgb, var(--c) 30%, #fff); }
.spk-ralph { --c: var(--c-ralph); }

/* callouts */
.callout { text-align: center; font-weight: 700; margin: 1.6rem -1.5rem 1.2rem !important; padding: .7rem 1rem; }
.callout > span { font-size: inherit !important; color: inherit !important; font-style: normal !important; font-weight: inherit; }
.callout-boss { background: var(--red); color: var(--ink); font: 2.5rem/1.05 var(--display); letter-spacing: .06em; text-transform: uppercase; border-block: 6px solid var(--ink); padding: 1rem; background-image: repeating-linear-gradient(-45deg, rgba(11,11,15,.12) 0 14px, transparent 14px 28px); }
.callout-boss::before { content: ""; display: block; height: 14px; margin: -1rem -1rem .7rem; background: repeating-linear-gradient(-45deg, #ffcf33 0 14px, var(--ink) 14px 28px); border-bottom: 4px solid var(--ink); }
.callout-unlock { margin-inline: auto !important; width: fit-content; max-width: 100%; background: var(--mint); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transform: rotate(-2deg); font-size: 1.05rem; letter-spacing: .03em; border-radius: 6px; }
.callout-choice { background: var(--pink); border: 4px dashed var(--ink); font: 1.35rem/1.2 var(--display); letter-spacing: .1em; }
.callout-branch { background: #fff; border: 3px dashed var(--ink); width: fit-content; margin: 0 auto 1.2rem !important; font: .9rem var(--body); letter-spacing: .08em; padding: .35rem 1rem; }
.callout-branch::before { content: "\2442  "; }
.flag-note { border-left: 10px solid var(--amber) !important; box-shadow: none; }
.flag-note::before { content: ""; display: block; height: 6px; margin: -.6rem -1rem .5rem; background: repeating-linear-gradient(-45deg, #ffcf33 0 8px, var(--ink) 8px 16px); }

/* ---------- places: the ten spoken lines on place cards ---------- */
.p-places .fulltext { max-width: none; background: transparent; border: 0; padding: 0; margin: 1rem 0; }
.p-places .fulltext > p.poi { text-align: center; }
.p-places .fulltext > p.poi span { display: inline-block; background: var(--ink); color: #ffb347; font: 3.4rem/1 var(--display) !important; letter-spacing: .18em; padding: .3rem 1.6rem; transform: rotate(-2deg); border: 4px solid #ffb347; }
.p-places .fulltext ul { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 2.4rem 1.4rem; }
.p-places li.poi { position: relative; margin: 0; padding: 2.8rem 1.1rem 1rem; background: #fff; border: 4px solid var(--ink); border-radius: 18px; font-size: .98rem; line-height: 1.6; }
.p-places li.poi::after { content: ""; position: absolute; bottom: -13px; left: 34px; width: 20px; height: 20px; background: #fff; border: 4px solid var(--ink); border-top: 0; border-left: 0; transform: rotate(45deg); }
.p-places li.poi .poi-name { position: absolute; top: -1.1rem; left: 1rem; background: var(--pc, #ffb347); border: 4px solid var(--ink); padding: .15rem .9rem; font: 1.45rem/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.p-places li.poi:nth-child(5n+1) { --pc: #ffcf33; } .p-places li.poi:nth-child(5n+2) { --pc: #66d4ff; } .p-places li.poi:nth-child(5n+3) { --pc: #5ee0a6; }
.p-places li.poi:nth-child(5n+4) { --pc: #ff93d0; } .p-places li.poi:nth-child(5n) { --pc: #ffb347; }
.mapfig { margin: 1.4rem 0; border: var(--border); background: var(--cream); }
.mapfig img { width: 100%; height: auto; }
.mapfig figcaption { padding: .6rem 1rem; border-top: 4px solid var(--ink); font-size: .9rem; }

/* ---------- cover page ---------- */
.montage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 1rem 0 0; }
.montage figure { margin: 0; border: var(--border); background: var(--ink); aspect-ratio: 3 / 4; overflow: hidden; }
.montage figure:nth-child(odd) { transform: rotate(-1.2deg); }
.montage figure:nth-child(even) { transform: rotate(1deg) translateY(10px); }
.montage img { width: 100%; height: 100%; object-fit: cover; object-position: top center; animation: bob 4.6s ease-in-out infinite; }
.montage figure:nth-child(2) img { animation-delay: -1.2s; } .montage figure:nth-child(3) img { animation-delay: -2.4s; } .montage figure:nth-child(4) img { animation-delay: -3.4s; }
@keyframes bob { 50% { transform: translateY(-5px) scale(1.03); } }
.cover { position: relative; margin: 0 0 1.6rem; }
.cover-ribbon { position: relative; z-index: 2; margin: -2.2rem -1.5rem 0; transform: rotate(-2.5deg); background: var(--red); border-block: 6px solid var(--ink); text-align: center; padding: .9rem 1rem 1.1rem; box-shadow: 0 0 0 4px var(--cream); background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.14) 0 16px, transparent 16px 52px); }
.cover-title { margin: 0; font-size: clamp(3rem, 11vw, 8.2rem); line-height: .95; letter-spacing: .06em; color: var(--cream); text-shadow: 5px 5px 0 var(--ink); }
.cover-sub { margin: .3rem 0 0; font: 700 clamp(.78rem, 2vw, 1.05rem)/1.3 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.cover-lede, main > p.cover-lede { color: var(--ink); background: var(--cream); border: var(--border); padding: 1rem 1.3rem; margin: 2rem auto 1.4rem; max-width: 58rem; font-size: 1.08rem; }
.panels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin: 1.2rem 0; }
.panel { --pc: var(--yellow); position: relative; overflow: hidden; background: var(--pc); border: var(--border); min-width: 0; display: flex; flex-direction: column; }
.panel .pic { width: 100%; height: 13rem; object-fit: cover; object-position: center 30%; border-bottom: var(--border); }
.panel .pbody { padding: 1rem 1.2rem 1.2rem; flex: 1; }
.panel h2, .panel h3 { margin: 0 0 .4rem; border: 0; padding: 0; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.panel .num { display: block; font: 1.1rem/1 var(--display); letter-spacing: .25em; text-transform: uppercase; margin-bottom: .2rem; }
.panel p { margin: .4rem 0; }
.panel .hook { font: 1.5rem/1.15 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.panel .meta { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: .7rem; }
.panel .meta b { background: var(--ink); color: var(--cream); padding: .05rem .4rem; margin-right: .3rem; }
.panel h2 a, .panel h3 a { color: inherit; text-decoration: none; }
.panel h2 a::after, .panel h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.panel h2 a:hover, .panel h3 a:hover { background: none; }
.panel h2 a:focus-visible::after, .panel h3 a:focus-visible::after { outline: 4px solid var(--ink); outline-offset: -8px; box-shadow: inset 0 0 0 8px var(--yellow); }
.panel h2 a:focus-visible, .panel h3 a:focus-visible { outline: none; box-shadow: none; }
.panel.link { transition: transform .12s; }
.panel.link:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.panel .go { display: inline-block; margin-top: .6rem; font: 1.15rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase; background: var(--cream); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: .5rem .9rem; }
.p1 { --pc: #ffcf33; } .p2 { --pc: #2bb7c4; } .p3 { --pc: #a58bff; } .p4 { --pc: #5ee0a6; } .p5 { --pc: #ff5a48; }
.pch { --pc: #ff93d0; } .ppl { --pc: #ffb347; } .pq { --pc: #66d4ff; } .pv { --pc: var(--cream); } .ppa { --pc: #fff1b8; } .ppr { --pc: var(--cream); }
.s12 { grid-column: span 12; } .s8 { grid-column: span 8; } .s7 { grid-column: span 7; } .s6 { grid-column: span 6; } .s5 { grid-column: span 5; } .s4 { grid-column: span 4; }
.panel .tape { margin: 1rem -1.6rem 0; }
.rosterline { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 .2rem; padding: 0; list-style: none; }
.rosterline li { display: flex; align-items: center; gap: .4rem; background: var(--paper); border: 3px solid var(--ink); padding: .2rem .7rem .2rem .25rem; font-weight: 700; font-size: .9rem; }
.rosterline .n { display: grid; place-items: center; width: 2rem; height: 2rem; border: 3px solid var(--ink); border-radius: 50%; background: var(--c, #ddd); font: 1.05rem/1 var(--display); }
.rosterline li.unknown { background: repeating-linear-gradient(-45deg, #ffcf33 0 10px, #fff1b8 10px 20px); }
.panels .box { margin: 0; border-width: 5px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 19rem); gap: 1.4rem; align-items: start; }
.shot { margin: .4rem 0 0; border: var(--border); background: var(--ink); color: var(--cream); }
.shot figcaption { padding: .5rem .8rem; font-size: .82rem; }
.kinds-box p { margin: .8rem 0; }

/* ---------- characters ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 14px; margin: 1rem 0 1.6rem; }
.rcard { --c: var(--yellow); position: relative; background: var(--c); border: var(--border); display: flex; flex-direction: column; text-align: left; transition: transform .12s; }
.rcard:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.rcard .pic, .rcard .avatar { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top center; border-bottom: var(--border); background: var(--ink); }
.rcard .avatar { display: grid; place-items: center; font: 6rem/1 var(--display); color: var(--ink); background: var(--c); background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.25) 0 14px, transparent 14px 40px); }
.rcard .pic { animation: bob 5s ease-in-out infinite; }
.rcard .rb { padding: .6rem .8rem .9rem; }
.rcard h3 { margin: 0; font-size: 1.7rem; }
.rcard h3 a { color: var(--ink); text-decoration: none; }
.rcard h3 a::after { content: ""; position: absolute; inset: 0; }
.rcard h3 a:hover { background: none; }
.rcard p { margin: .2rem 0; font-size: .88rem; line-height: 1.4; }
.rcard .first { position: relative; z-index: 2; font-size: .8rem; font-weight: 700; }
.char { --c: var(--yellow); background: var(--cream); border: var(--border); margin: 1.6rem 0; scroll-margin-top: 1rem; padding: 0 1.4rem 1.2rem; }
.char > h2 { margin: 0 -1.4rem 1rem; padding: .7rem 1.4rem .5rem; background: var(--c); border-bottom: var(--border); font-size: 2.4rem; color: var(--ink); }
.char .portrait { float: right; width: min(15rem, 40%); margin: 0 0 1rem 1.2rem; border: var(--border); background: var(--ink); }
.char .facts { display: flex; flex-wrap: wrap; gap: .1rem; margin: 0 0 .6rem; }
.char h3 { font: 700 .82rem/1.3 var(--body); text-transform: uppercase; letter-spacing: .14em; margin: 1.1rem 0 .3rem; background: var(--ink); color: var(--cream); display: inline-block; padding: .15rem .6rem; }
.char ul { margin: .3rem 0; padding-left: 1.3rem; }
.c-ralph { --c: var(--c-ralph); } .c-stacy { --c: var(--c-stacy); } .c-bailey { --c: var(--c-bailey); } .c-charlie { --c: var(--c-charlie); }
.c-dani { --c: var(--c-dani); } .c-lin { --c: var(--c-lin); } .c-judge { --c: var(--c-judge); } .c-steinberg { --c: var(--c-steinberg); }
.c-giselle { --c: var(--c-giselle); } .c-quartz { --c: var(--c-quartz); } .c-girl { --c: var(--c-girl); } .c-minor { --c: #d9d3c0; } .c-armageddon { --c: #ff5a48; }
.relmap { width: 100%; height: auto; background: var(--paper); border: 4px solid var(--ink); }

/* ---------- open questions ---------- */
.p-open-questions .box h2 { background: var(--g); border: 3px solid var(--ink); padding: .3rem .8rem; display: block; }
.p-open-questions .box[id] { border-top: 12px solid var(--g); }
.p-open-questions #content-note { border-top-color: var(--amber); }

/* ---------- credits ---------- */
.credits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 14px; margin: 1rem 0; }
.credits-grid figure { margin: 0; background: var(--cream); border: 4px solid var(--ink); }
.credits-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 4px solid var(--ink); }
.credits-grid figcaption { padding: .5rem .8rem; font-size: .85rem; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; height: 12rem; border-left: 0; border-top: var(--border); grid-row: 2; }
  .hero-text { padding: 4.4rem 1rem 1.2rem; }
  .ribbon { font-size: 1.5rem; top: 1.2rem; left: -2.5rem; }
  .panels { grid-template-columns: 1fr; }
  .panel { grid-column: auto !important; }
  .split { grid-template-columns: 1fr; }
  .panel h2, .panel h3 { font-size: 2.2rem; }
  .montage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .montage figure:nth-child(n+3) { display: none; }
  .cover-ribbon { margin-inline: -1rem; }
  .summary dl { grid-template-columns: 1fr; gap: .1rem; }
  .summary dd { margin-bottom: .6rem; }
  .fulltext { padding: 0 .9rem 1.5rem; font-size: 1.02rem; border-left-width: 3px; border-right-width: 3px; }
  .fulltext .scene { margin-inline: -.9rem; padding-inline: .9rem; font-size: 1.25rem; }
  .callout { margin-inline: -.9rem !important; }
  .callout-boss { font-size: 1.9rem; }
  .fulltext p.mix[class*="by-"]:not(.by-ralph), .fulltext p.say:not(.by-ralph)[class*="by-"] { margin-left: 0; }
  .fulltext p.by-ralph { margin-right: 0; }
  .fulltext p.mix[class*="by-"]:not(.by-ralph)::after, .fulltext p.say:not(.by-ralph)[class*="by-"]::after { left: 30px; right: auto; }
  .chapbar-in { padding: .3rem .6rem; gap: .4rem; }
  .chapbar a.step span { display: none; }
  .menu a { padding: .5rem .55rem; font-size: .72rem; }
  .bar { padding: .4rem .6rem; }
  .char .portrait { float: none; width: 60%; margin: .6rem 0; }
  .p-places .fulltext ul { grid-template-columns: 1fr; }
  .p-places .fulltext > p.poi span { font-size: 2.4rem !important; }
  th, td { padding: .35rem .45rem; }
  .box { padding: .3rem .9rem 1rem; }
  .toc { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* ---------- 3D viewers (progressive enhancement, see viewer.js) ---------- */
.viewer { position: relative; overflow: hidden; background-color: #fff1b8; border: var(--border); aspect-ratio: 1; touch-action: pan-y; }
.viewer > img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.viewer canvas:active { cursor: grabbing; }
.viewer.ready > img { visibility: hidden; }
.vhint, .vnote { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--cream); font: 700 .72rem/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; padding: .35rem .6rem; text-align: center; pointer-events: none; }
.vhint:empty { display: none; }
.vnote { letter-spacing: .02em; text-transform: none; background: #fff1b8; color: var(--ink); border-top: 4px solid var(--ink); font-weight: 400; }
.viewer.failed .vhint { display: none; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 18rem)); gap: 14px; justify-content: start; margin-top: 1rem; }
.vfig { margin: 0; }
.vfig figcaption { font: 1.4rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .05em; padding-top: .3rem; }
@media print {
  .top, .pager, .chapbar, .montage, .skip { display: none; }
  body { background: #fff; }
  .fulltext { border: 0; max-width: none; }
  .hero, .panel { break-inside: avoid; }
}

/* ---------- sections: one reusable component (built by tools/docx-site/page.awk, see its "sections" note) ----------
   A sub-box with the section name on its own line as a colored title bar in Anton. */
.secs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 16px; margin: 1rem 0 0; align-items: start; }
.sec { --sc: var(--g, #ffcf33); background: var(--paper); border: 4px solid var(--ink); margin: 1rem 0; min-width: 0; }
.secs > .sec { margin: 0; }
.secs > .sec.wide { grid-column: 1 / -1; }
.secs > .sec:nth-child(4n+1) { --sc: #ffcf33; } .secs > .sec:nth-child(4n+2) { --sc: #66d4ff; }
.secs > .sec:nth-child(4n+3) { --sc: #5ee0a6; } .secs > .sec:nth-child(4n) { --sc: #ff93d0; }
.p-gear .secs > .sec { --sc: var(--g); }
.p-gear .secs > .sec:nth-child(even) { --sc: color-mix(in srgb, var(--g) 70%, #fff); }
.char .sec { --sc: var(--c); }
.sec > .sec-title, .box .sec > .sec-title, .panel .sec > .sec-title, .char .sec > .sec-title {
  display: block; margin: 0; padding: .5rem .9rem .35rem; background: var(--sc); color: var(--ink);
  border: 0; border-bottom: 4px solid var(--ink); text-shadow: none;
  font: 400 1.65rem/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.sec > .sec-title.warn { background: repeating-linear-gradient(-45deg, #ffcf33 0 14px, #ffe17a 14px 28px); }
.sec-n { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-right: .45rem; background: var(--ink); color: var(--sc); border-radius: 50%; font: 400 1.1rem/1 var(--display); letter-spacing: 0; vertical-align: .08em; }
.sec-body { padding: .8rem 1rem 1rem; min-width: 0; }
.sec-body > :first-child { margin-top: 0; }
.sec-body > :last-child { margin-bottom: 0; }
.sec-body p { margin: .5rem 0; }
.note > .sec-title { margin: -.8rem -1.1rem .6rem; padding: .5rem 1.1rem .35rem; background: repeating-linear-gradient(-45deg, #ffcf33 0 14px, #ffe17a 14px 28px); color: var(--ink); border-bottom: 4px solid var(--ink); font: 400 1.5rem/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.note > .sec-body { padding: 0; }
.warn > .sec-body { background: none; padding: 0; }
.sec-body ul, .sec-body ol:not(.segments):not(.finishers):not(.rosterline) { margin: .4rem 0; padding-left: 1.3rem; }
.sec-body li { margin: .25rem 0; }

/* "Name: text" entries: a two-column row. The name box on the left is filled with the character's color
   (--lc, set inline by page.awk; a pair like "Lin and Dani" also sets --lc2 and the box splits in two),
   a divider, then the text on a tint of the same color. The whole row is bordered in that color. */
li.lab { --lc: #ffcf33; list-style: none; margin: .7rem 0 !important; padding: 0; display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); background: color-mix(in srgb, var(--lc) 14%, #fff); border: 4px solid color-mix(in srgb, var(--lc) 45%, var(--ink)); }
ul:has(> li.lab) { padding-left: 0 !important; }
.lab-name { display: flex; align-items: center; padding: .55rem .8rem .45rem; background: linear-gradient(135deg, var(--lc) 0 50%, var(--lc2, var(--lc)) 50% 100%); border-right: 4px solid var(--ink); color: var(--ink); font: 400 1.4rem/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.lab-text { display: block; padding: .6rem .9rem .7rem; }
.box li.lab:nth-child(4n+1) { --lc: #ffcf33; } .box li.lab:nth-child(4n+2) { --lc: #66d4ff; }
.box li.lab:nth-child(4n+3) { --lc: #5ee0a6; } .box li.lab:nth-child(4n) { --lc: #ff93d0; }
.char li.lab, .char li.lab:nth-child(n) { --lc: color-mix(in srgb, var(--c) 55%, #fff); }
@media (max-width: 600px) {
  li.lab { grid-template-columns: 1fr; }
  .lab-name { border-right: 0; border-bottom: 4px solid var(--ink); font-size: 1.25rem; }
}
p.kv { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; } p.kv > .kv-text { flex: 1 1 14rem; min-width: 0; }
p.kv { background: #fff; border: 3px solid var(--ink); padding: .4rem .8rem; margin: 0 0 .9rem; }
p.kv > strong { font: 400 1.15rem/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: var(--cream); padding: .05rem .6rem; }

/* chips and finishers */
ul.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0 !important; margin: 0 0 .8rem; }
ul.chips > li { margin: 0; padding: .3rem .75rem; background: #fff; border: 3px solid var(--ink); font-size: .93rem; line-height: 1.35; }
ol.finishers { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
ol.finishers > li { display: grid; grid-template-columns: 9rem 1fr; align-items: center; gap: .7rem; margin: 0; }
ol.finishers > li > span { background: var(--ink); color: var(--cream); padding: .2rem .6rem; font: 400 1rem/1.3 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.wideshot { margin-top: 1rem; max-width: 40rem; }
.panel .sec, .panel .sec p, .panel .sec li { color: var(--ink); }
.panel .sec .tape { margin: 1rem -.6rem 0; }
.panel .secs { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.panel .secs > .sec { display: flex; flex-direction: column; }
.panel .secs > .sec > .sec-body { flex: 1; }
.panel .secs > .sec.wide { grid-column: 1 / -1; }
.summary .secs > .sec { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .secs { grid-template-columns: 1fr; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rcard .avatar { font-size: 3.4rem; }
  .rcard h3 { font-size: 1.35rem; }
  .panel .secs { grid-template-columns: 1fr; }
  .sec > .sec-title, .box .sec > .sec-title, .panel .sec > .sec-title, .char .sec > .sec-title { font-size: 1.4rem; }
  ol.finishers > li { grid-template-columns: 1fr; gap: .2rem; }
  .sec-body { padding: .7rem .8rem .9rem; }
}
