/* Lingua Moderna — BRUTALIST edition.
 * Raw paper, black ink, safety orange, acid lime. Thick borders, hard shadows,
 * no radii, no blur. Mobile-first, vanilla, no build. */

:root {
  --paper: #eae8e1;
  --ink: #0b0b0b;
  --hot: #ff4d00;
  --acid: #d7ff3a;
  --bw: 4px;
  --shadow: 6px 6px 0 var(--ink);
  --f-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --f-mono: "Space Mono", ui-monospace, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #1a1a1a;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }

/* ---------- Frame + snap ---------- */
.magazine {
  container-type: inline-size;
  max-width: 430px;
  height: 100dvh;
  margin-inline: auto;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  background: var(--paper);
  border-inline: var(--bw) solid var(--ink);
}
.page {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  padding: 56px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  border-bottom: var(--bw) solid var(--ink);
}
.page--paper { background: var(--paper); }
.page--acid { background: var(--acid); }
.page--hot { background: var(--hot); }
.page--ink { background: var(--ink); color: var(--paper); }
.page--cover { background: var(--paper); }

/* ---------- Progress ---------- */
.progress {
  position: fixed;
  top: 10px;
  right: max(10px, calc(50% - 215px + 10px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--ink);
  color: var(--acid);
  font-weight: 700;
  font-size: 12px;
  border: 2px solid var(--acid);
}
.progress__sep { opacity: 0.6; }
.progress__bar { width: 44px; height: 6px; background: #333; margin-left: 6px; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--hot); transition: width 0.2s steps(4); }

/* ---------- Type ---------- */
.h {
  font-family: var(--f-display);
  font-size: clamp(34px, 13cqw, 56px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}
.h__sub {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.5em;
  letter-spacing: 0.04em;
}
.h--light { color: var(--paper); }
.h__sub--acid { background: var(--acid); color: var(--ink); }
.page--hot .h__sub, .page--acid .h__sub { color: var(--paper); }

.kicker {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid currentColor;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.big {
  font-family: var(--f-display);
  font-size: clamp(24px, 9.5cqw, 40px);
  line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.body { text-align: left; hyphens: none; }
.tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--ink);
  color: var(--acid);
  padding: 6px 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.tag--light { background: var(--acid); color: var(--ink); }

/* ---------- Boxes ---------- */
.box {
  background: var(--paper);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px;
}
.box--ink { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--hot); }
.box--paper { box-shadow: 6px 6px 0 var(--acid); }
.eq { font-family: var(--f-display); font-size: 22px; line-height: 1.1; margin-top: 8px; color: var(--acid); }

.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: center; }
.two--rev { grid-template-columns: 120px 1fr; }
.shout {
  font-family: var(--f-display);
  font-size: clamp(34px, 14cqw, 60px);
  line-height: 0.9;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 8px 10px;
  transform: rotate(2deg);
}

/* Doodles: black line art on a coloured slab, hard-edged */
.doodle {
  width: 100%;
  max-width: 150px;
  justify-self: center;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 6px;
}
.doodle--book, .doodle--two, .doodle--pc { align-self: flex-end; max-width: 130px; }
.doodle--inv {
  background: var(--acid);
  filter: none;
  align-self: flex-start;
}

/* ---------- Cover ---------- */
.page--cover { padding-top: 0; gap: 14px; }
.ticker {
  margin: 0 -16px;
  background: var(--ink);
  color: var(--acid);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  padding: 8px 0;
}
.ticker__track { display: inline-flex; animation: tick 18s linear infinite; }
.ticker__track span { padding-right: 8px; }
@keyframes tick { to { transform: translateX(-50%); } }

.mast {
  font-family: var(--f-display);
  font-size: clamp(34px, 13.5cqw, 58px);
  line-height: 1;
  letter-spacing: 0;
  margin: 6px 0 0;
  text-transform: uppercase;
}
.cover__row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; align-items: stretch; }
.cover__photo {
  margin: 0;
  background: var(--hot);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cover__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.35);
  mix-blend-mode: multiply;
}
.cover__side { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.price {
  font-family: var(--f-display);
  font-size: clamp(30px, 11cqw, 46px);
  background: var(--acid);
  border: var(--bw) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 8px 6px;
  text-align: center;
  transform: rotate(-5deg);
}
.cover__q {
  font-family: var(--f-display);
  font-size: clamp(22px, 8cqw, 34px);
  line-height: 1;
  text-transform: uppercase;
}
mark { background: var(--hot); color: var(--ink); padding: 0 6px; }
.cover__name {
  font-family: var(--f-display);
  font-size: clamp(30px, 12cqw, 50px);
  line-height: 0.95;
  border-top: var(--bw) solid var(--ink);
  padding-top: 8px;
}
.cover__name span { display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.18em; margin-top: 4px; }
.cover__credits { font-size: 12px; font-weight: 700; border-top: 2px solid var(--ink); padding-top: 8px; }
.swipe { font-weight: 700; font-size: 12px; letter-spacing: 0.2em; animation: bob 1.2s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- Masthead font swap ---------- */
.mast { display: flex; flex-direction: column; }
.morph { display: flex; align-items: center; height: 1.15em; white-space: nowrap; }
.morph__l {
  display: inline-block;
  width: 0.86em;
  text-align: center;
  line-height: 1;
}
.morph__l.flash { animation: flash 0.4s steps(3); }
@keyframes flash {
  0% { color: var(--hot); transform: translateY(-5px); }
  100% { transform: none; }
}

/* ---------- Tap-to-reduce ---------- */
.tap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  min-height: 44px;
  padding: 14px;
  background: var(--paper);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  box-shadow: var(--shadow);
}
.tap:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.tap__hint {
  align-self: flex-start;
  background: var(--ink);
  color: var(--acid);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 2px 8px;
}
.tap__line--reduced { opacity: 0.25; }
.tap.reduced .tap__line--reduced { opacity: 1; background: var(--acid); }
.tap.reduced .tap__hint { background: var(--hot); color: var(--ink); }
s.rd { text-decoration-thickness: 3px; text-decoration-color: var(--hot); transition: opacity 0.2s steps(3); }
.tap.reduced s.rd { opacity: 0.35; }
u { text-decoration-thickness: 3px; text-underline-offset: 3px; }

/* ---------- Page 5 word stack ---------- */
.words {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.words li {
  font-family: var(--f-display);
  font-size: 16px;
  text-transform: uppercase;
  padding: 6px 10px;
  background: var(--hot);
  color: var(--ink);
  border: 3px solid var(--paper);
}
.words li:nth-child(even) { background: var(--paper); }
.words__seo { font-size: clamp(40px, 18cqw, 72px) !important; line-height: 1; background: var(--acid) !important; }

/* ---------- Quiz ---------- */
.quiz { position: relative; }
.quiz__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: 8px 8px 0 var(--hot);
}
.quiz__meta { display: flex; align-items: center; gap: 10px; }
.quiz__count { font-weight: 700; font-size: 12px; letter-spacing: 0.1em; background: var(--ink); color: var(--acid); padding: 2px 8px; }
.quiz__progress { flex: 1; height: 10px; border: 2px solid var(--ink); background: var(--paper); }
.quiz__progress-fill { display: block; height: 100%; width: 0; background: var(--hot); transition: width 0.25s steps(5); }
.quiz__prompt { font-family: var(--f-display); font-size: 17px; line-height: 1.15; }
.quiz__options { display: flex; flex-direction: column; gap: 10px; }
.quiz__opt {
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
}
.quiz__opt:hover:not(:disabled) { background: var(--acid); }
.quiz__opt:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt.is-correct { background: var(--acid); }
.quiz__opt.is-correct::before { content: "✓ "; }
.quiz__opt.is-wrong { background: var(--hot); text-decoration: line-through; box-shadow: none; }
.quiz__feedback { font-weight: 700; min-height: 1.5em; }
.quiz__feedback.is-correct { background: var(--acid); padding: 6px 8px; border: 3px solid var(--ink); }
.quiz__feedback.is-wrong { background: var(--hot); padding: 6px 8px; border: 3px solid var(--ink); }
.quiz__next {
  min-height: 48px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--acid);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--hot);
  font-family: var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quiz__next:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--hot); }
.quiz__card--score { align-items: center; text-align: center; }
.quiz__scoreline { font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.quiz__scorebig { font-family: var(--f-display); font-size: clamp(56px, 24cqw, 96px); line-height: 1; color: var(--hot); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.quiz__scoremsg { font-weight: 700; }

.confetti {
  position: absolute;
  bottom: 40%;
  width: 18px;
  height: 18px;
  fill: var(--hot);
  pointer-events: none;
  animation: pop 1s steps(8) forwards;
}
.confetti:nth-of-type(even) { fill: var(--ink); }
@keyframes pop {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.shake { animation: shake 0.4s steps(6); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Enter animation (hard cuts, no easing) ---------- */
.reveal { opacity: 0; transform: translateX(-28px); }
.in-view .reveal { opacity: 1; transform: none; transition: transform 0.35s steps(5), opacity 0.35s steps(5); }
.in-view .reveal:nth-child(2) { transition-delay: 0.06s; }
.in-view .reveal:nth-child(3) { transition-delay: 0.12s; }
.in-view .reveal:nth-child(4) { transition-delay: 0.18s; }
.in-view .reveal:nth-child(5) { transition-delay: 0.24s; }

/* ---------- Focus + motion ---------- */
:focus-visible { outline: 4px solid var(--hot); outline-offset: 3px; }
.page--ink :focus-visible { outline-color: var(--acid); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
