/* Andreas History — mockup styles
   Layout: mobile-first single column (max 560px), poster-style red display type,
   black-and-white photos in filmstrip frames, light "archive paper" list screens. */
:root {
  --ink: #1d1d1d;          /* near-black ground, like the template */
  --paper: #f3f1ee;        /* off-white list screens */
  --paper-2: #e7e4df;      /* card fill on paper */
  --red: #e0533d;          /* poster red */
  --grey: #8a8784;
  --white: #fbfaf8;
  --good: #3f8f5a;
  --font-display: "Anton", "Oswald", Impact, "Arial Narrow", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 4px;
  --tap: 52px;             /* minimum touch target height */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.paper { background: var(--paper); color: var(--ink); }

.screen {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-x: hidden;
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: 12px;
  background: inherit;
}
.logo {
  font-family: var(--font-display);
  font-size: clamp(22px, 6.6vw, 30px); letter-spacing: .01em; line-height: 1;
  color: inherit; text-decoration: none; text-transform: uppercase;
}
.menu {
  width: var(--tap); height: var(--tap); margin-right: -12px;
  display: grid; place-items: center; background: none; border: 0; color: inherit; cursor: pointer;
}
.menu span { display: block; height: 2px; background: currentColor; }
.menu .lines { display: grid; gap: 7px; justify-items: end; }
.menu .lines span:first-child { width: 34px; }
.menu .lines span:last-child { width: 26px; }

/* Eyebrow with red dot */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--red); flex: none; }
.eyebrow .more { margin-left: auto; color: var(--red); text-transform: none; letter-spacing: 0; font-weight: 600; }

/* Poster headline */
.poster {
  font-family: var(--font-display);
  color: var(--red);
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: -.005em;
  margin: 0;
}
.poster.xl { font-size: clamp(96px, 34vw, 190px); }
.poster.lg { font-size: clamp(48px, 15vw, 84px); }
.poster.md { font-size: clamp(34px, 10vw, 54px); }

/* Photo placeholder — replaced by real B/W photos later */
.photo {
  position: relative; overflow: hidden; border-radius: 2px;
  background:
    radial-gradient(120% 90% at 30% 25%, #9b9894 0%, #5d5a57 45%, #2a2928 100%);
  filter: grayscale(1) contrast(1.08);
}
.photo::after { /* caption showing which image goes here */
  content: attr(data-shot);
  position: absolute; left: 10px; bottom: 8px; right: 10px;
  font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.7);
  text-transform: uppercase; letter-spacing: .06em;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Filmstrip frame */
.film {
  position: relative; background: #f2efe9; padding: 26px 10px; border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.film::before, .film::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 14px;
  background: repeating-linear-gradient(90deg, #1d1d1d 0 12px, transparent 12px 26px);
  border-radius: 2px;
}
.film::before { top: 6px; }
.film::after { bottom: 6px; }
.film .edge {
  position: absolute; top: 2px; right: 16px; font-family: var(--font-mono); font-size: 10px;
  font-weight: 500; color: #1d1d1d; letter-spacing: .1em;
}

/* Chips */
.chip {
  display: inline-block; background: var(--red); color: var(--white);
  font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 2px; line-height: 1.3;
}
.chip.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .75; }

.meta { font-size: 14px; opacity: .8; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 14px 22px; border-radius: 999px; border: 0;
  font: 700 17px/1.2 var(--font-body); letter-spacing: .01em; cursor: pointer;
  background: var(--red); color: var(--white); text-decoration: none; width: 100%;
}
.btn.light { background: var(--white); color: var(--ink); }
.btn.outline { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn:focus-visible, .answer:focus-visible, .menu:focus-visible, .cat:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* Grain canvas overlay */
#grain {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 50; opacity: .09; mix-blend-mode: overlay;
}
@media (prefers-reduced-motion: reduce) { #grain { opacity: .06; } }

.lede { font-size: clamp(20px, 5.4vw, 25px); line-height: 1.32; font-weight: 500; margin: 0; text-wrap: pretty; }
.small { font-size: 14px; opacity: .75; }

/* ---------- App screens (merged from mockups) ---------- */
#app { min-height: 100dvh; }
body.paper #app .bar { background: var(--paper); }
body:not(.paper) #app .bar { background: var(--ink); }

/* Home */
.hero { position: relative; min-height: 400px; margin-top: 8px; }
.hero .poster { position: relative; z-index: 1; margin-top: 120px; }
.hero .film { position: absolute; z-index: 2; right: -36px; top: 0; width: 66%; transform: rotate(-9deg); }
.hero .film .photo { aspect-ratio: 4 / 3; }
.hero .poster .line2 { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .hero .film { animation: drop .9s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes drop { from { transform: translateY(-24px) rotate(-3deg); } to { transform: rotate(-9deg); } }
}
.stats { display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.stats b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: 0; color: var(--red); }
.actions { display: grid; gap: 12px; margin-top: auto; }
.foot { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .5; text-align: center; }

/* Fronts */
.feature { position: relative; color: var(--white); text-decoration: none; display: block; border-radius: 2px; overflow: hidden; background: none; border: 0; padding: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; }
.feature .photo { aspect-ratio: 4 / 3.6; }
.feature .over { position: absolute; inset: 0; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.8) 100%); }
.feature .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.feature h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.2; }
.feature p { margin: 0; font-size: 15px; opacity: .9; }
.list { display: grid; gap: 10px; }
.cat { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: stretch; background: var(--paper-2); color: var(--ink); border: 0; padding: 0; width: 100%; text-align: left; font: inherit; border-radius: 2px; overflow: hidden; min-height: 120px; cursor: pointer; }
.cat .photo { height: 100%; min-height: 120px; }
.cat .photo::after { font-size: 9px; }
.cat .txt { padding: 12px 12px 12px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cat h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.cat .meta { margin-top: auto; font-size: 13px; }
.cat:hover, .feature:hover { filter: brightness(1.04); }
@media (max-width: 360px) { .cat { grid-template-columns: 88px 1fr; } }
.eyebrow button.more { background: none; border: 0; font: inherit; color: var(--red); font-weight: 600; cursor: pointer; padding: 10px 0 10px 10px; text-transform: none; letter-spacing: 0; }

/* Question + reveal */
.progress { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.track { flex: 1; height: 3px; background: rgba(255,255,255,.18); }
.track i { display: block; height: 100%; background: var(--red); transition: width .4s ease; }
.qphoto { aspect-ratio: 16 / 10; }
.q { font-size: clamp(22px, 6vw, 28px); line-height: 1.25; font-weight: 700; margin: 0; text-wrap: pretty; }
.q.small-q { font-size: clamp(18px, 5vw, 21px); font-weight: 600; opacity: .85; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.answers { display: grid; gap: 10px; }
.answer { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 12px 16px; text-align: left; background: #2a2a2a; color: var(--white); border: 1.5px solid #3a3a3a; border-radius: var(--radius); font: 500 17px/1.3 var(--font-body); cursor: pointer; transition: border-color .15s, background .15s; }
.answer .key { flex: none; width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; border: 1.5px solid #555; border-radius: 50%; }
.answer:not([disabled]):hover { border-color: var(--red); }
.answer[disabled] { cursor: default; }
.answer.right { background: var(--white); color: var(--ink); border-color: var(--white); }
.answer.right .key { background: var(--good); border-color: var(--good); color: #fff; }
.answer.wrong { border-color: var(--red); color: #f1b3a8; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.answer.wrong .key { border-color: var(--red); color: var(--red); }
.answer.dim { opacity: .45; }
.verdict { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.verdict .poster.good { color: var(--white); }
.fact { border-left: 3px solid var(--red); padding: 2px 0 2px 14px; display: grid; gap: 6px; }
.fact .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.fact p { margin: 0; font-size: 16px; line-height: 1.5; opacity: .92; }
.next { margin-top: auto; }

/* Results */
.rphoto { aspect-ratio: 1 / 1; }
.score { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.score .n { font-family: var(--font-display); font-size: clamp(88px, 28vw, 140px); line-height: .85; color: var(--white); }
.score .of { font-family: var(--font-mono); font-size: 14px; letter-spacing: .08em; opacity: .7; padding-bottom: 10px; }
.rank { display: grid; gap: 4px; }
.rank .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.breakdown { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.breakdown li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; font-size: 15px; }
.breakdown .bar2 { grid-column: 1 / -1; height: 4px; background: rgba(255,255,255,.15); }
.breakdown .bar2 i { display: block; height: 100%; background: var(--red); }
.breakdown b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Menu sheet */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; justify-content: flex-end; }
.sheet nav { width: min(320px, 86vw); height: 100%; background: var(--ink); color: var(--white); padding: max(20px, env(safe-area-inset-top, 0px)) 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.sheet nav button { background: none; border: 0; color: inherit; text-align: left; font: 400 30px/1.15 var(--font-display); text-transform: uppercase; padding: 10px 0; cursor: pointer; }
.sheet nav button:hover { color: var(--red); }
.sheet nav .close { align-self: flex-end; font: 600 15px var(--font-body); text-transform: none; min-height: var(--tap); }
.sheet nav p { margin-top: auto; font-size: 14px; opacity: .6; }

/* Hide placeholder caption once the real photo is there */
.photo:has(img)::after { display: none; }
