/* The Robber Barons' Guide to Getting Rich — "Which Robber Baron Are You?"
   Design language: cover green, engraved gold, cream ink. Playfair Display + Oswald. */

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('../fonts/playfair-display-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('../fonts/playfair-display-latin-wght-italic.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url('../fonts/oswald-latin-wght-normal.woff2') format('woff2'); }

:root {
  --green: #174024;
  --green-hi: #1d4d2c;
  --green-lo: #122f1b;
  --green-deep: #142f1b;
  --gold: #c9a24b;
  --gold-hi: #e2c37a;
  --gold-ink: #8a6a24;
  --ink: #efe6cd;
  --ink-85: rgba(239, 230, 205, 0.86);
  --ink-70: rgba(239, 230, 205, 0.72);
  --ink-55: rgba(239, 230, 205, 0.58);
  --gold-60: rgba(201, 162, 75, 0.6);
  --gold-45: rgba(201, 162, 75, 0.45);
  --gold-30: rgba(201, 162, 75, 0.3);
  --gold-15: rgba(201, 162, 75, 0.14);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --label: 'Oswald', 'Arial Narrow', 'Helvetica Neue', sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--green);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
html { background: var(--green-lo); }
/* vignette, held still behind scrolling content (works on iOS, unlike background-attachment: fixed) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 35%, var(--green-hi) 0%, var(--green) 55%, var(--green-lo) 100%);
}
/* paper grain, after the cover stock */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.label {
  font-family: var(--label); text-transform: uppercase; letter-spacing: .24em; font-weight: 400;
  font-size: 12px; line-height: 1.4;
}

/* ── Page frame ───────────────────────────────────────────── */
.page { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 50, 30, .82);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--gold-45);
  padding-top: env(safe-area-inset-top);
}
.site-header__row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.site-header__title { color: var(--gold); text-decoration: none; font-size: 13px; letter-spacing: .23em; }
.site-header__title:hover { color: var(--gold-hi); }
.site-header__aside { color: var(--ink-70); font-size: 12px; letter-spacing: .2em; text-align: right; }
.title-short { display: none; }
.progress { height: 3px; background: var(--gold-15); }
.progress__bar { height: 100%; width: 0; background: var(--gold); transition: width 320ms var(--ease); }
.progress[hidden] { display: none; }

.site-footer {
  border-top: 1px solid var(--gold-45);
  padding: 22px var(--gutter);
  padding-bottom: max(22px, calc(14px + env(safe-area-inset-bottom)));
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  color: var(--ink-55); font-size: 11.5px; letter-spacing: .18em;
}
.site-footer .accent { color: var(--gold); }

main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }
.enter { animation: enter 520ms var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Shared pieces ────────────────────────────────────────── */
.eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; color: var(--gold); font-size: 13px; letter-spacing: .3em; }
.eyebrow::before { content: ""; height: 1px; width: 48px; background: var(--gold); flex: none; }
.eyebrow--center { justify-content: center; }
.eyebrow--center::after { content: ""; height: 1px; width: 48px; background: var(--gold); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--label); text-transform: uppercase; letter-spacing: .2em; font-size: 15px; font-weight: 500;
  padding: 18px 40px; min-height: 56px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  transition: background 160ms, color 160ms, box-shadow 160ms, opacity 160ms;
  touch-action: manipulation;
}
.btn--engraved {
  color: var(--green-deep); background: var(--gold); border-color: var(--gold-hi);
  box-shadow: 0 0 0 4px var(--green), 0 0 0 5px var(--gold-60);
}
.btn--engraved:hover { background: var(--gold-hi); color: var(--green-deep); }
.btn--outline { border-color: var(--gold-60); }
.btn--outline:hover { background: var(--gold-15); color: var(--gold-hi); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: default; color: rgba(239,230,205,.38); background: transparent; border-color: var(--gold-30); box-shadow: none; }
.btn--text {
  border: 0; background: none; padding: 12px 4px; min-height: 44px; font-size: 13px; letter-spacing: .2em; color: var(--ink-70);
}
.btn--text:hover { color: var(--ink); background: none; }

.retail { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.retail__note { color: var(--ink-70); font-size: 12px; letter-spacing: .2em; text-align: center; }
.retail__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.retail__link {
  font-family: var(--label); text-transform: uppercase; letter-spacing: .16em; font-size: 12px;
  color: var(--gold); border: 1px solid var(--gold-45); padding: 11px 16px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background 160ms, color 160ms;
}
.retail__link:hover { background: var(--gold-15); color: var(--gold-hi); }

/* ── Landing ──────────────────────────────────────────────── */
.landing {
  flex: 1; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px);
  max-width: 1240px; width: 100%; margin: 0 auto; padding: clamp(40px, 7vh, 80px) var(--gutter);
}
.landing__h1 {
  margin: 0 0 28px; font-weight: 600; line-height: 1.04; letter-spacing: -.005em;
  font-size: clamp(44px, 5.6vw, 76px); text-wrap: balance;
}
.landing__h1 em { font-weight: 500; }
.landing__lede { margin: 0 0 14px; font-size: clamp(20px, 1.9vw, 25px); line-height: 1.42; font-weight: 500; text-wrap: pretty; max-width: 30em; }
.landing__turn { margin: 0 0 22px; font-size: clamp(20px, 1.9vw, 25px); line-height: 1.4; font-style: italic; color: var(--gold); }
.landing__body { margin: 0 0 36px; font-size: clamp(17px, 1.45vw, 19px); line-height: 1.65; color: var(--ink-85); max-width: 34em; text-wrap: pretty; }
.landing__cta { display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap; }
.landing__meta { color: var(--ink-55); font-size: 12px; letter-spacing: .18em; }
.landing__book { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.cover-frame { position: relative; padding: 16px; border: 1px solid var(--gold-60); }
.cover-frame::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold-30); pointer-events: none; }
.cover-frame img, .cover-frame picture { display: block; }
.cover-frame img { width: clamp(220px, 27vw, 360px); height: auto; box-shadow: 0 24px 60px rgba(0,0,0,.5); }

/* ── Before you begin ─────────────────────────────────────── */
.intro { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: clamp(40px, 9vh, 96px) var(--gutter) 56px; display: flex; flex-direction: column; justify-content: center; }
.intro__big { margin: 0 0 22px; font-size: clamp(25px, 3.3vw, 34px); line-height: 1.3; font-weight: 500; text-wrap: pretty; }
.intro__body { margin: 0 0 40px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.65; color: var(--ink-85); text-wrap: pretty; }
.intro__body em { color: var(--gold); }
.intro__actions { display: flex; align-items: center; gap: 16px 26px; flex-wrap: wrap; }
.resume-note { color: var(--ink-70); font-size: 12px; letter-spacing: .18em; margin: 0 0 18px; }

/* ── Question ─────────────────────────────────────────────── */
.question { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: clamp(32px, 7vh, 72px) var(--gutter) 40px; display: flex; flex-direction: column; }
.question__count { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; color: var(--gold); font-size: 13px; letter-spacing: .3em; }
.question__count::after { content: ""; height: 1px; flex: 1; background: var(--gold-30); }
.question__prompt { margin: 0 0 36px; font-size: clamp(26px, 3.6vw, 42px); line-height: 1.2; font-weight: 600; text-wrap: balance; }
.answers { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; border: 0; }
.answer {
  display: flex; align-items: center; gap: 20px; width: 100%; text-align: left;
  padding: 18px 22px; min-height: 76px; cursor: pointer;
  color: var(--ink); background: rgba(0,0,0,.18); border: 1px solid var(--gold-45);
  transition: background 160ms, color 160ms, box-shadow 200ms, border-color 160ms, transform 120ms;
  touch-action: manipulation;
}
@media (hover: hover) {
  .answer:hover { background: rgba(0,0,0,.28); border-color: var(--gold); }
}
.answer:active { transform: scale(.992); }
.answer__badge {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-style: italic; font-weight: 600; font-size: 19px; line-height: 1; padding-bottom: 2px;
  color: var(--gold); border: 1px solid var(--gold); transition: inherit;
}
.answer__text { font-size: 19px; line-height: 1.48; text-wrap: pretty; }
.answer[aria-checked="true"] {
  color: var(--green-deep); background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--green), 0 0 0 5px var(--gold);
}
.answer[aria-checked="true"] .answer__badge { color: var(--ink); background: var(--green); border-color: var(--green); }
.question__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; }
.question__nav .btn--engraved { padding-left: 32px; padding-right: 32px; }
.question__hint { color: var(--ink-55); font-size: 11px; letter-spacing: .18em; margin-top: 18px; text-align: right; }

/* ── Verdict ──────────────────────────────────────────────── */
.verdict { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: clamp(36px, 7vh, 72px) var(--gutter) 56px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.medal { padding: 13px; border: 1px solid var(--gold-60); border-radius: 50%; margin: 0 0 40px; width: min(640px, 100%); }
.medal__oval {
  container-type: inline-size;
  aspect-ratio: 1.55; border-radius: 50%; background: var(--ink); border: 1px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 6% 12%; color: var(--green);
  background-image: radial-gradient(ellipse at 50% 40%, #f5eedb 0%, #efe6cd 60%, #e4d8b6 100%);
  box-shadow: inset 0 0 0 6px var(--ink), inset 0 0 0 7px rgba(201,162,75,.55);
}
.medal__label { color: var(--gold-ink); font-size: 12.5px; letter-spacing: .28em; }
.medal__name { margin: 0; font-weight: 600; line-height: 1.02; color: var(--green); }
.medal__pre { display: block; font-size: max(22px, 5.4cqi); font-weight: 500; margin-bottom: 4px; }
.medal__baron { display: block; font-size: min(11cqi, 74px); font-style: italic; font-weight: 600; }
.medal__rule { height: 1px; width: 64px; background: var(--gold); margin: 4px 0; }
.medal__q { font-size: clamp(18px, 3.9cqi, 26px); font-style: italic; line-height: 1.3; color: var(--green); text-wrap: balance; max-width: 22em; }

.shadow-line { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 0 26px; flex-wrap: wrap; }
.shadow-line::before, .shadow-line::after { content: ""; height: 1px; width: 40px; background: var(--gold-60); }
.shadow-line__label { color: var(--gold); font-size: 13px; letter-spacing: .26em; }
.shadow-line__name { font-size: 26px; font-weight: 600; }
.read { text-wrap: balance; margin: 0 0 8px; font-size: clamp(19px, 2vw, 22px); line-height: 1.6; max-width: 34em; text-wrap: pretty; }
.read--shadow { font-style: italic; color: var(--ink-85); font-size: clamp(18px, 1.8vw, 20px); }
.verdict__actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 40px 0 0; }
.verdict__book { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--gold-30); width: 100%; max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.verdict__book-inner { display: flex; gap: 26px; align-items: center; text-align: left; }
.verdict__book-inner img { width: 96px; height: auto; box-shadow: 0 10px 28px rgba(0,0,0,.45); flex: none; }
.verdict__book-title { text-wrap: balance; font-size: 21px; line-height: 1.3; font-weight: 600; margin: 6px 0 0; }
.verdict__book-title em { font-weight: 500; }

/* reveal sequence */
.reveal > * { animation: enter 640ms var(--ease) both; }
.reveal > :nth-child(2) { animation-delay: 380ms; }
.reveal > :nth-child(3) { animation-delay: 520ms; }
.reveal > :nth-child(4) { animation-delay: 640ms; }
.reveal > :nth-child(5) { animation-delay: 760ms; }
.reveal > :nth-child(n+6) { animation-delay: 880ms; }
.reveal .medal { animation-name: stamp; animation-duration: 760ms; }
@keyframes stamp { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* ── Share dialog ─────────────────────────────────────────── */
.share-dialog {
  border: 1px solid var(--gold-60); background: var(--green); color: var(--ink); padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%;
  box-shadow: 0 0 0 4px var(--green), 0 0 0 5px var(--gold-30), 0 30px 80px rgba(0,0,0,.6);
}
.share-dialog::backdrop { background: rgba(8, 20, 12, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.share-dialog__inner { padding: 28px; display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: start; }
.share-dialog__card { width: 150px; height: auto; display: block; border: 1px solid var(--gold-45); }
.share-dialog__title { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
.share-dialog__sub { margin: 0 0 18px; color: var(--ink-70); font-size: 15px; line-height: 1.5; }
.share-dialog__list { display: grid; gap: 10px; }
.share-dialog__list .btn { width: 100%; padding: 12px 16px; min-height: 46px; font-size: 13px; }
.share-dialog__close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink-70); font-size: 26px; cursor: pointer; line-height: 1; }
.share-dialog__close:hover { color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  background: var(--ink); color: var(--green-deep); padding: 12px 20px; font-family: var(--label); text-transform: uppercase; letter-spacing: .18em; font-size: 12px;
  transition: opacity 200ms, transform 200ms var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Shared-verdict landing (/r/<baron>/) ─────────────────── */
.shared__h2 { margin: 6px 0 14px; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.1; font-weight: 600; text-wrap: balance; }
.shared__h2 em { font-weight: 500; }
.shared__p { margin: 0 0 30px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--ink-85); max-width: 32em; }

/* ── Tablet ───────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .landing { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .landing__h1 { font-size: clamp(42px, 6.4vw, 60px); }
  .cover-frame img { width: clamp(200px, 28vw, 300px); }
}

/* ── Phone (and narrow tablet windows) ────────────────────── */
@media (max-width: 759px) {
  .site-header__row { padding-top: 13px; padding-bottom: 13px; }
  .site-header__aside { display: none; }
  .site-header__row { justify-content: center; }
  .title-full { display: none; }
  .title-short { display: inline; }
  .site-header__title { font-size: 12px; letter-spacing: .22em; }

  .landing { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 48px; align-items: start; }
  .landing__h1 { font-size: clamp(40px, 11.6vw, 54px); margin-bottom: 22px; }
  .landing__lede, .landing__turn { font-size: 21px; }
  .landing__body { font-size: 17px; margin-bottom: 30px; }
  .landing__cta { flex-direction: column; align-items: stretch; text-align: center; }
  .landing__cta .btn { width: 100%; }
  .landing__book { padding-top: 40px; border-top: 1px solid var(--gold-30); }
  .cover-frame img { width: min(62vw, 260px); }
  .retail__row { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px; }

  .eyebrow { font-size: 12px; letter-spacing: .26em; margin-bottom: 20px; }
  .eyebrow::before { width: 32px; }

  .intro__actions { flex-direction: column; align-items: stretch; }
  .intro__actions .btn { width: 100%; }

  .question { padding-top: 26px; padding-bottom: 28px; }
  .question__count { font-size: 12px; letter-spacing: .26em; margin-bottom: 14px; }
  .question__prompt { font-size: clamp(23px, 6.6vw, 28px); margin-bottom: 24px; line-height: 1.22; }
  .answers { gap: 11px; }
  .answer { gap: 14px; padding: 14px 16px; min-height: 64px; }
  .answer__badge { width: 34px; height: 34px; font-size: 16px; }
  .answer__text { font-size: 17px; line-height: 1.42; }
  .question__nav { margin-top: 26px; }
  .question__nav .btn--engraved { padding: 14px 22px; min-height: 50px; font-size: 13.5px; }
  .question__hint { display: none; }
  [data-screen="question"] .site-footer { display: none; }

  .medal { padding: 9px; width: min(360px, 100%); margin-bottom: 32px; }
  .medal__oval { aspect-ratio: .9; padding: 10% 12%; gap: 10px; }
  .medal__pre { font-size: 9cqi; }
  .medal__baron { font-size: min(15.5cqi, 60px); }
  .medal__q { font-size: 7cqi; }
  .medal__label { font-size: 11px; letter-spacing: .24em; }
  .shadow-line { gap: 10px 14px; }
  .shadow-line::before, .shadow-line::after { width: 24px; }
  .shadow-line__name { font-size: 23px; }
  .verdict__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 380px; }
  .verdict__actions .btn { width: 100%; }
  .verdict__book-inner { flex-direction: column; text-align: center; gap: 18px; }
  .verdict__book-inner img { width: 110px; }

  .share-dialog__inner { grid-template-columns: 1fr; padding: 24px 20px; }
  .share-dialog__card { width: 120px; margin: 0 auto; }

  .site-footer { flex-direction: column; justify-content: center; text-align: center; font-size: 10.5px; letter-spacing: .16em; gap: 8px; }
}

@media (max-width: 759px) and (orientation: landscape) and (max-height: 500px) {
  .medal__oval { aspect-ratio: 1.5; padding: 5% 12%; }
  .medal { width: min(520px, 100%); padding: 9px; }
  .medal__pre { font-size: 4.6cqi; }
  .medal__baron { font-size: 9cqi; }
  .medal__q { font-size: 3.8cqi; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* landing: retailers as a tidy 2×2 under the cover */
.landing__book .retail__row { display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px; }
@media (min-width: 760px) and (max-width: 1023px) {
  .question__prompt { font-size: clamp(30px, 4.3vw, 42px); }
  .landing__lede, .landing__turn { font-size: 21px; }
}
@media (pointer: coarse) { .question__hint { display: none; } }
