/* ── Was it AI, or Al? ────────────────────────────────────────────────
   Type rule that outranks all others: the face must render capital I and
   lowercase l as the same glyph, or the app has no title. Helvetica and
   Arial both do. Do not add a font whose l has a tail.
   ------------------------------------------------------------------ */

:root {
  --paper:      #faeedf;
  --paper-deep: #ece1d0;
  --ink:        #141210;
  --ink-soft:   #6a6357;
  --rule:       rgba(20, 18, 16, 0.18);
  --vermilion:  #d0492a;
  --teal:       #47686c;

  --font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --pad: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: light;           /* the paper is the design; never auto-invert */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100svh;
  position: relative;
}

/* ── screens ─────────────────────────────────────────────────────── */

.screen {
  display: none;
  min-height: 100svh;
  padding: calc(var(--pad) + 8px) var(--pad) calc(var(--pad) + var(--safe-b));
  flex-direction: column;
}
.screen.is-active { display: flex; }

.stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.stack--left { justify-content: flex-start; align-items: flex-start; text-align: left; gap: 14px; padding-top: 8px; }
.stack--reveal { gap: 22px; }

.foot { flex: 0 0 auto; padding-top: 20px; }

/* ── title ───────────────────────────────────────────────────────── */

.wordmark {
  font-size: clamp(40px, 13vw, 64px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.04;
}

.lede {
  font-size: 16px;
  line-height: 1.5;
  max-width: 30ch;
  color: var(--ink);
}
.lede--quiet { color: var(--ink-soft); font-size: 15px; }

/* ── quote screen ────────────────────────────────────────────────── */

.screen--quote { justify-content: space-between; }

.quotewrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 24px;
}

.quote {
  font-size: clamp(23px, 6.2vw, 31px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.017em;
  text-wrap: balance;
  text-align: left;
}
.quote::before { content: "\201C"; }
.quote::after  { content: "\201D"; }

/* ── buttons ─────────────────────────────────────────────────────── */
/* The two choice buttons must be pixel-identical but for the last glyph.
   Fixed positions: AI always left, Al always right. Never swap them. */

.btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.006em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 17px 12px;
  cursor: pointer;
  transition: background 90ms linear, color 90ms linear;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { background: var(--ink); color: var(--paper); }
@media (hover: hover) {
  .btn:hover { background: var(--ink); color: var(--paper); }
}
.btn:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }

.choices {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;   /* equal halves, permanently */
  gap: 10px;
  padding-bottom: 2px;
}
.btn--choice { width: 100%; }
.btn--wide   { width: 100%; }

/* ── reveal ──────────────────────────────────────────────────────── */

.mark {
  font-size: 14px;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}
.mark[data-right="yes"] { color: var(--teal); }
.mark[data-right="no"]  { color: var(--vermilion); }

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.portrait {
  width: clamp(150px, 46vw, 196px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait svg { width: 100%; height: 100%; display: block; }

.attrib {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.014em;
}

.source {
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 32ch;
  line-height: 1.4;
}

.tell {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  max-width: 32ch;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.tell:empty { display: none; }

.counter {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: 14px;
}

/* ── score ───────────────────────────────────────────────────────── */

.tally {
  font-size: clamp(46px, 15vw, 68px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}
.verdict { font-size: 18px; max-width: 26ch; line-height: 1.4; }

.recap {
  list-style: none;
  width: 100%;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}
.recap li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  text-align: left;
}
.recap .r-mark { flex: 0 0 14px; color: var(--ink-soft); }
.recap .r-mark[data-right="no"] { color: var(--vermilion); }
.recap .r-name { flex: 1; }
.recap .r-you  { color: var(--ink-soft); }

.colophon-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── colophon ────────────────────────────────────────────────────── */

.screen--colophon { overflow-y: auto; }
.h2 { font-size: 19px; font-weight: 600; margin-top: 10px; }
.body { font-size: 15px; line-height: 1.55; color: var(--ink); }
.sources { list-style: none; width: 100%; }
.sources li {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.sources b { color: var(--ink); font-weight: 600; }
.sources a { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
