/* Cubist Booth — shared styles */
:root {
  --paper: #f4ecdc;
  --paper-2: #ebe0c9;
  --card: #fffaf0;
  --ink: #1d1a16;
  --ink-soft: #4a433a;
  --muted: #6b6155;
  --blue: #1f4e8c;
  --blue-deep: #142f57;
  --rose: #d9776b;
  --rose-soft: #f1c3b5;
  --ochre: #b9822f;
  --red: #c8371f;
  --green: #3f6b4f;
  --line: #1d1a16;
  --focus: #1f4e8c;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 4px;
  --head: "Syne", "Trebuchet MS", system-ui, sans-serif;
  --body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #15171c;
  --paper-2: #1d2027;
  --card: #22262e;
  --ink: #f2eadb;
  --ink-soft: #d4cab8;
  --muted: #aca290;
  --blue: #7aa5e6;
  --blue-deep: #a9c4ef;
  --rose: #ee9a8e;
  --rose-soft: #5a3632;
  --ochre: #e0ad5c;
  --red: #f0745c;
  --green: #8cc29d;
  --line: #f2eadb;
  --focus: #9cc0ff;
  --shadow: 6px 6px 0 #000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    linear-gradient(115deg, transparent 0 62%, rgba(31, 78, 140, .05) 62% 78%, transparent 78%),
    linear-gradient(35deg, transparent 0 70%, rgba(217, 119, 107, .07) 70% 85%, transparent 85%);
  background-attachment: fixed;
  overflow-x: hidden;
}
img, svg, canvas, video { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 8vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.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; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 3px solid var(--line);
}
.bar { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--head); font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-family: var(--body); font-weight: 500; font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; }
.nav a { display: block; padding: .45rem .6rem; font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; border: 2px solid transparent; border-radius: var(--radius); }
.nav a:hover { border-color: var(--line); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.icon-btn { background: transparent; border: 2px solid var(--line); color: var(--ink); border-radius: var(--radius); width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }
@media (max-width: 1040px) {
  .menu-btn { display: inline-grid; }
  .nav ul { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--paper); border-bottom: 3px solid var(--line); padding: .5rem 1rem 1rem; }
  .nav ul.open { display: flex; }
  .nav a { padding: .7rem .6rem; font-size: 1.05rem; }
}

/* ---------- layout ---------- */
main { display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 780px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 2.5rem 0; }
.eyebrow { font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--red); margin-bottom: .6rem; display: inline-block; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- hero ---------- */
.hero { padding: 2rem 0 1rem; }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; }
.hero h1 .b { color: var(--blue); }
.hero h1 .r { color: var(--rose); }
.hero h1 .o { color: var(--ochre); }
.cake { display: inline-flex; align-items: center; gap: .5rem; background: var(--ink); color: var(--paper); font-weight: 700; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--head); font-weight: 700; font-size: 1rem;
  padding: .7rem 1.1rem; min-height: 46px;
  border: 3px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #10131a; }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { color: #fff; }
.btn.rose { background: var(--rose); color: #1d1a16; }
.btn.ochre { background: var(--ochre); color: #1d1a16; }
.btn.small { padding: .4rem .7rem; min-height: 38px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1.25rem; }
.grid-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-card { display: block; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; }
.feature-card:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--line); }
.feature-card { transition: transform .15s, box-shadow .15s; }
.feature-card .tag { position: absolute; top: 0; right: 0; width: 70px; height: 70px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.feature-card h3 { margin-top: .4rem; }

/* ---------- booth ---------- */
.booth { display: grid; gap: 1.25rem; }
@media (min-width: 960px) { .booth { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; } }
.easel { position: relative; background: var(--ink); padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow); }
.easel canvas { width: 100%; height: auto; background: #ddd; border-radius: 2px; }
.easel .busy { position: absolute; inset: 12px; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; font-family: var(--head); font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; }
.easel.is-busy .busy { opacity: 1; }
.easel video { width: 100%; height: auto; transform: scaleX(-1); border-radius: 2px; }
.cam-ui { position: absolute; inset: 12px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .5rem; padding: 1rem; pointer-events: none; }
.cam-ui > * { pointer-events: auto; }
.controls { display: grid; gap: 1rem; }
.ctl-group { border: 0; padding: 0; margin: 0; }
.ctl-group legend, .ctl-label { font-family: var(--head); font-weight: 700; font-size: .95rem; margin-bottom: .45rem; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border: 2px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem; background: var(--card); }
.chip input:checked + span { background: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-block; }
.range-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem .75rem; }
.range-row output { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3ch; text-align: right; }
.range-row input { grid-column: 1 / -1; }
input[type="range"] { width: 100%; accent-color: var(--blue); height: 28px; }
.text-input { width: 100%; font: inherit; padding: .65rem .8rem; border: 3px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.text-input:focus-visible { outline-offset: 1px; }
.style-note { font-size: .9rem; color: var(--muted); min-height: 2.8em; margin: .4rem 0 0; }
.privacy { font-size: .85rem; color: var(--muted); display: flex; gap: .4rem; align-items: flex-start; }
.privacy svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.drop-hint { border: 3px dashed var(--muted); border-radius: var(--radius); padding: .8rem; text-align: center; font-size: .9rem; color: var(--muted); }
.easel.drag { outline: 4px dashed var(--rose); outline-offset: 4px; }

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.wall button { padding: 0; border: 3px solid var(--line); background: var(--ink); cursor: pointer; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.wall img { width: 100%; height: 100%; object-fit: cover; }
.wall button:hover { transform: rotate(-2deg) scale(1.03); }
.wall-empty { color: var(--muted); font-size: .95rem; }

dialog { color: var(--ink); background: var(--card); border: 3px solid var(--line); max-height: 92vh; overflow: auto; }
dialog::backdrop { background: rgba(10, 10, 14, .7); }
dialog img { max-height: 70vh; object-fit: contain; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 150%); background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: var(--radius); font-weight: 600; z-index: 90; transition: transform .25s ease; max-width: calc(100vw - 2rem); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- portrait ---------- */
.portrait-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .portrait-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.frame { background: #6b4a2b; padding: 18px; border: 3px solid var(--line); box-shadow: var(--shadow); border-radius: 2px; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 3px, transparent 3px 9px); }
.frame-inner { background: #f3ead8; padding: 0; border: 2px solid #2a1c10; }
.frame svg { width: 100%; height: auto; }
.plaque { background: linear-gradient(#e2c27a, #b88f3e); color: #2a1c10; border: 2px solid #2a1c10; text-align: center; padding: .45rem .8rem; margin: 14px auto 0; width: fit-content; max-width: 100%; font-family: var(--head); font-weight: 700; font-size: .9rem; }
.fullname { font-family: var(--head); font-weight: 700; font-size: clamp(1.15rem, 3.4vw, 1.5rem); line-height: 1.35; overflow-wrap: anywhere; }
.fullname span { display: inline; }
.fullname .w { transition: color .3s; }
.fullname .given { color: var(--blue); }
.fullname .sur { color: var(--red); }
.count-pill { display: inline-block; background: var(--ochre); color: #1d1a16; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; }
.signature { font-family: "Caveat", cursive; font-size: 2.6rem; line-height: 1; color: var(--red); }

/* ---------- quote game ---------- */
.game-card { position: relative; }
.progress { height: 10px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.progress > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.hud { display: flex; justify-content: space-between; font-weight: 700; font-size: .95rem; margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.quote { font-family: var(--head); font-weight: 700; font-size: clamp(1.3rem, 4.2vw, 2rem); line-height: 1.22; margin: .5rem 0 1.25rem; position: relative; padding-left: 2.2rem; }
.quote::before { content: "\201C"; position: absolute; left: 0; top: -.35em; font-size: 3.6rem; color: var(--rose); }
.answers { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.answers .btn { flex-direction: column; gap: .1rem; }
.answers .btn small { font-family: var(--body); font-weight: 500; font-size: .78rem; }
.answers .btn.correct { background: var(--green); color: #fff; }
.answers .btn.wrong { background: var(--red); color: #fff; }
.verdict { margin-top: 1.25rem; border-top: 3px dashed var(--line); padding-top: 1rem; animation: rise .35s ease; }
.verdict .stamp { display: inline-block; font-family: var(--head); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 3px solid currentColor; padding: .15rem .6rem; transform: rotate(-3deg); margin-bottom: .6rem; }
.stamp.said { color: var(--green); }
.stamp.didnt { color: var(--red); }
.stamp.unproven { color: var(--ochre); }
.source { font-size: .85rem; color: var(--muted); }
.result-big { font-family: var(--head); font-weight: 800; font-size: clamp(3rem, 14vw, 6rem); line-height: 1; color: var(--blue); }
.recap { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .4rem; }
.recap li { display: flex; gap: .6rem; align-items: baseline; font-size: .95rem; }
.recap b { flex: none; width: 1.3rem; text-align: center; }

/* ---------- quiz ---------- */
.q-options { display: grid; gap: .6rem; }
.q-option { text-align: left; justify-content: flex-start; font-family: var(--body); font-weight: 600; }
.period-hero { border-radius: var(--radius); border: 3px solid var(--line); padding: 1.5rem; color: #fff; position: relative; overflow: hidden; }
.period-hero h2 { color: inherit; }
.period-hero .years { font-weight: 700; opacity: .9; }
.period-hero svg.deco { position: absolute; right: -20px; bottom: -20px; width: 180px; height: 180px; opacity: .25; }
.trait-list { padding-left: 1.2rem; }
.meter-row { display: grid; grid-template-columns: 9rem 1fr 3ch; gap: .6rem; align-items: center; font-size: .9rem; margin-bottom: .35rem; }
.meter { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper-2); }
.meter i { display: block; height: 100%; }

/* ---------- timeline ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.5rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 4px solid var(--line); }
.timeline li { position: relative; margin: 0 0 1.25rem; padding-left: .5rem; animation: rise .4s ease both; }
.timeline li::before { content: ""; position: absolute; left: -2.15rem; top: .25rem; width: 22px; height: 22px; background: var(--dot, var(--ink)); border: 3px solid var(--line); transform: rotate(45deg); }
.timeline .yr { font-family: var(--head); font-weight: 800; font-size: 1.3rem; }
.timeline .age { font-size: .82rem; color: var(--muted); font-weight: 600; margin-left: .4rem; }
.timeline h3 { margin: .1rem 0 .3rem; font-size: 1.1rem; }
.timeline p { margin: 0; color: var(--ink-soft); }
.timeline .pchip { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .45rem; border: 2px solid var(--line); border-radius: 999px; margin-top: .35rem; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--card); border: 3px solid var(--line); padding: 1rem; border-radius: var(--radius); }
.stat b { display: block; font-family: var(--head); font-weight: 800; font-size: 2rem; line-height: 1.05; color: var(--blue); }
.stat span { font-size: .9rem; color: var(--ink-soft); }
.stat small { display: block; margin-top: .3rem; font-size: .75rem; color: var(--muted); }
.period-strip { display: flex; height: 46px; border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0; }
.period-strip button { border: 0; border-right: 2px solid var(--line); cursor: pointer; padding: 0; font: 700 .7rem var(--body); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); overflow: hidden; white-space: nowrap; }
.period-strip button:last-child { border-right: 0; }

/* ---------- footer ---------- */
.site-footer { margin-top: 3rem; border-top: 3px solid var(--line); padding: 1.5rem 0 2.5rem; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }

/* ---------- misc ---------- */
.prose h2 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.sources li { overflow-wrap: anywhere; }
.kbd { font-family: ui-monospace, monospace; font-size: .85em; border: 2px solid var(--line); border-radius: 4px; padding: 0 .3em; }
.shards-deco { display: flex; gap: 6px; margin: .5rem 0 1rem; }
.shards-deco i { width: 26px; height: 26px; display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.97) rotate(-.4deg); } 60% { transform: scale(1.01); } 100% { transform: scale(1); } }
.pop { animation: pop .35s ease; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
