/* Cold Boot, issue 01. One stylesheet for the web and for print.
   Palette: riso black + riso fluorescent pink on white stock.
   Every page is an A5 sheet; on screen they sit on a halftone desk. */

:root {
  --ink: #141414;
  --paper: #ffffff;
  --spot: #ff48b0;        /* riso Fluorescent Pink */
  --spot-tint: #ffd3ec;
  --tone: rgba(20, 20, 20, 0.5);
  --desk: #e6e0e4;

  --display: "Dela Gothic One", "Noto Sans CJK JP", "Arial Black", sans-serif;
  --voice: "Zen Maru Gothic", "Noto Sans CJK JP", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Noto Sans Mono", monospace;

  --line: 3px;
}

* { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body {
  margin: 0;
  font-family: var(--voice);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--desk);
  background-image: radial-gradient(rgba(20, 20, 20, 0.13) 1px, transparent 1.4px);
  background-size: 7px 7px;
  padding-block: 2rem 4rem;
  padding-inline: 1rem;
}

a { color: inherit; text-decoration-color: var(--spot); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:focus-visible { outline: 3px solid var(--spot); outline-offset: 2px; }

.desk-note {
  max-width: 71rem;
  margin: 0 auto 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* ---------- the stack of sheets ---------- */

.zine {
  display: grid;
  grid-template-columns: min(100%, 35rem);
  justify-content: center;
  row-gap: 2rem;
}

@media (min-width: 76rem) {
  .zine { grid-template-columns: repeat(2, 35rem); row-gap: 3rem; }
  .page.cover { grid-column: 2; }
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  aspect-ratio: 148 / 210;
  padding: 1rem 1rem 0.6rem;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 14px 30px -18px rgba(40, 20, 35, 0.45);
}

.panels { flex: 1; display: grid; gap: 0.5rem; min-height: 0; }

/* ---------- who-line: the page footer is the CADR's own status line ---------- */

.wholine { font-family: var(--mono); font-size: 0.72rem; line-height: 1.2; }
.wholine .label { padding-block: 0.1rem 0.15rem; }
.wholine .bar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 4px solid var(--ink);
  padding-top: 0.15rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wholine .bar span:last-child { color: var(--ink); background: var(--spot); padding-inline: 0.3rem; }

/* ---------- panels ---------- */

.panel {
  position: relative;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.panel.ink { background: var(--ink); color: var(--paper); }
.panel.pink { background: var(--spot); }
.panel.bare { border: 0; padding: 0; overflow: visible; }
.panel.center { align-items: center; justify-content: center; text-align: center; }
.panel.end { justify-content: flex-end; }

.tone { background-image: radial-gradient(var(--tone) 0.9px, transparent 1.2px); background-size: 5px 5px; }
.tone-pink { background-image: radial-gradient(var(--spot) 1.5px, transparent 1.8px); background-size: 7px 7px; }

/* focus lines (manga 集中線) */
.focus::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 3deg, var(--ink) 0deg 0.7deg, transparent 0.7deg 5.3deg);
  -webkit-mask: radial-gradient(circle, transparent 22%, #000 58%);
  mask: radial-gradient(circle, transparent 22%, #000 58%);
  pointer-events: none;
}
.focus > * { position: relative; }

/* ---------- lettering ---------- */

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.95;
  text-wrap: balance;
  text-shadow: 0.07em 0.05em 0 var(--spot);   /* second drum, slightly off */
}
.t-xl { font-size: 4.6rem; letter-spacing: -0.02em; }
.t-l { font-size: 2.3rem; }
.t-m { font-size: 1.45rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: flex-start;
  background: var(--spot);
  color: var(--ink);
  padding: 0.05rem 0.35rem;
}

.cap {
  align-self: flex-start;
  max-width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  text-wrap: pretty;
}
.cap.light { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.panel.ink .cap { background: var(--paper); color: var(--ink); }

.say {
  position: relative;
  align-self: flex-start;
  max-width: 92%;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 1.4rem / 1.1rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: pretty;
  margin-bottom: 0.7rem;
}
.say::before, .say::after {
  content: "";
  position: absolute;
  top: calc(100% - 2px);
  left: 1.2rem;
  width: 1.1rem;
  height: 0.85rem;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 12% 100%);
}
.say::after {
  top: calc(100% - 3px);
  left: calc(1.2rem + 3px);
  width: calc(1.1rem - 8px);
  height: calc(0.85rem - 4px);
  background: var(--paper);
}
.say.r { align-self: flex-end; }
.say.r::before, .say.r::after { left: auto; right: 1.2rem; clip-path: polygon(0 0, 100% 0, 88% 100%); }
.say.r::after { right: calc(1.2rem + 3px); }
.say.up { margin-bottom: 0; margin-top: 0.7rem; }
.say.up::before, .say.up::after { top: auto; bottom: calc(100% - 2px); clip-path: polygon(12% 0, 0 100%, 100% 100%); }
.say.up::after { bottom: calc(100% - 3px); }

.shout {
  align-self: center;
  background: var(--spot);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: center;
  padding: 1.6rem 1.9rem;
  clip-path: polygon(50% 0, 60% 16%, 80% 4%, 78% 24%, 100% 22%, 88% 40%, 100% 55%, 84% 62%, 96% 82%, 74% 78%, 70% 100%, 55% 84%, 40% 100%, 34% 80%, 10% 90%, 18% 68%, 0 58%, 14% 44%, 2% 24%, 24% 26%, 22% 6%, 40% 18%);
}

.sfx {
  font-family: var(--display);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--spot);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  transform: rotate(-9deg);
  white-space: nowrap;
}
.sfx small {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  -webkit-text-stroke: 0;
  letter-spacing: 0.1em;
  text-align: right;
}

.vertical {
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  line-height: 1;
}

p { margin: 0; text-wrap: pretty; }
.small { font-size: 0.78rem; }
.mono { font-family: var(--mono); }

/* ---------- screens, commands, keys ---------- */

.term {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.45;
  padding: 0.5rem 0.6rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term b { color: var(--spot); font-weight: 400; }
.term i { font-style: normal; opacity: 0.7; }

.shot { display: block; width: 100%; max-width: 100%; height: auto; image-rendering: pixelated; border: var(--line) solid var(--ink); }

.key {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}
.key.lm { background: var(--spot-tint); }

.keyrow { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; align-items: center; }
.pair { display: inline-flex; align-items: center; gap: 0.2rem; }
.pair .arrow { font-family: var(--mono); font-size: 0.72rem; }

.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; font-size: 0.78rem; }
.legend li { display: grid; grid-template-columns: 1.3rem 1fr; gap: 0.4rem; align-items: baseline; }
.num {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--spot);
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* ---------- characters and profile cards ---------- */

.chara { display: block; width: 100%; height: auto; max-width: 100%; }

.card { display: grid; grid-template-columns: 38% 1fr; gap: 0.5rem; align-items: start; }
.card .name { font-family: var(--display); font-size: 1.3rem; line-height: 1; text-shadow: 0.06em 0.05em 0 var(--spot); }
.card .role { font-size: 0.74rem; font-weight: 700; }
.stats { margin: 0; display: grid; gap: 0.2rem; font-size: 0.72rem; }
.stats div { display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.3rem; }
.stats dt { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.stats dd { margin: 0; }

.meter { display: grid; grid-template-columns: 2.6rem 1fr 3.4rem; gap: 0.3rem; align-items: center; font-family: var(--mono); font-size: 0.7rem; }
.meter .track { position: relative; height: 0.62rem; border: 2px solid var(--ink); }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: var(--v); background: repeating-linear-gradient(-45deg, var(--ink) 0 2px, var(--spot) 2px 5px); }
.meter .track::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: var(--one); width: 2px; background: var(--ink); }
.meter.plain { grid-template-columns: 2.6rem 1fr 2.6rem; }
.meter.plain .track::after { display: none; }
.scale-note { font-family: var(--mono); font-size: 0.68rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.tags span { font-family: var(--mono); font-size: 0.68rem; border: 1.5px solid var(--ink); padding: 0 0.25rem; background: var(--spot-tint); }

.toc { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.toc li { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.4rem; align-items: baseline; border-bottom: 2px dotted var(--ink); padding-bottom: 0.2rem; }
.toc .ep { font-family: var(--mono); font-size: 0.74rem; }
.toc .nm { font-family: var(--display); font-size: 0.95rem; }
.toc .pg { font-family: var(--mono); font-size: 0.74rem; font-variant-numeric: tabular-nums; }

.big-number { font-family: var(--display); font-size: 2.6rem; line-height: 0.95; text-shadow: 0.06em 0.05em 0 var(--spot); font-variant-numeric: tabular-nums; }

/* crops of real muir screens, zoomed so the CADR's own font reads */
.crop { position: relative; overflow: hidden; width: 100%; max-width: 100%; background: var(--ink); }
.crop img { display: block; width: 100%; max-width: 100%; height: auto; }
.crop .num { position: absolute; right: 0.3rem; width: 1rem; height: 1rem; font-size: 0.62rem; translate: 0 -50%; }

.keymap { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 0.35rem 0.6rem; }
.keylist { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.5rem; font-size: 0.78rem; }
.keylist > span { display: flex; align-items: center; gap: 0.35rem; }

.forms { margin: 0; display: grid; gap: 0.3rem; }
.forms div { display: grid; grid-template-columns: 13.5rem 1fr; gap: 0.5rem; align-items: baseline; }
.forms dt { font-family: var(--mono); font-size: 0.76rem; background: var(--ink); color: var(--paper); padding: 0.05rem 0.35rem; overflow-wrap: anywhere; }
.forms dd { margin: 0; font-size: 0.8rem; }

.links { margin: 0; display: grid; gap: 0.35rem; }
.links div { display: grid; grid-template-columns: 5rem 1fr; gap: 0.4rem; align-items: baseline; }
.links dt { font-family: var(--display); font-size: 0.8rem; line-height: 1.1; }
.links dd { margin: 0; font-family: var(--mono); font-size: 0.74rem; overflow-wrap: anywhere; }
.docs { margin: 0; display: grid; gap: 0.4rem; }
.docs dt { font-family: var(--display); font-size: 0.8rem; line-height: 1.15; }
.docs dd { margin: 0; font-size: 0.74rem; line-height: 1.3; }
.docs dd .mono { display: block; overflow-wrap: anywhere; }


/* phone: the sheets become one long strip, panel under panel */
@media screen and (max-width: 34rem) {
  .page { aspect-ratio: auto; }
  .panels { grid-template-columns: 1fr !important; grid-template-rows: none !important; }
  .panels > .panel { grid-column: auto !important; }
  .forms div { grid-template-columns: 1fr; gap: 0.1rem; }
  .keymap { grid-template-columns: repeat(2, auto); justify-content: start; }
  .t-xl { font-size: 3.4rem; }
}

/* build.sh check: sheets at their printed size on screen */
.quote { margin: 0; display: grid; gap: 0.3rem; background: var(--paper); border: 2px solid var(--ink); padding: 0.5rem 0.6rem; }
.quote p { font-size: 0.8rem; font-weight: 700; line-height: 1.35; }
.quote footer { font-family: var(--mono); font-size: 0.68rem; }

.sheet-check .zine { display: block; }
.sheet-check .page { width: 148mm; height: 210mm; aspect-ratio: auto; overflow: hidden; padding: 7mm 7mm 4mm; margin-bottom: 1rem; }
.sheet-check .focus::before { display: none; }

/* ---------- print: one A5 sheet per page, nothing else ---------- */

@page { size: A5; margin: 0; }

@media print {
  body { background: var(--paper); padding: 0; }
  .desk-note { display: none; }
  .zine { display: block; }
  .page {
    width: 148mm;
    height: 210mm;
    aspect-ratio: auto;
    box-shadow: none;
    overflow: hidden;
    break-after: page;
    padding: 7mm 7mm 4mm;
  }
}
