/* Oeconomicus Idioticus – matchbook drawer */

:root {
  --night: #0b0b0a;
  --night-2: #151412;
  --night-3: #1e1c19;
  --ox: #4b0e17;
  --ox-2: #5e1520;
  --green: #12422e;
  --green-2: #185238;
  --card-black: #121110;
  --gold: #d4af37;
  --gold-soft: #b8963a;
  --gold-line: rgba(212, 175, 55, 0.42);
  --cream: #f2ead2;
  --cream-2: #e6dbbd;
  --cream-dim: #cfc5ab;
  --ink: #1f1a14;
  --ink-soft: #4a4034;
  --striker: #5d5d63;
  --ember: #e2541b;
  --flame: #ffb43a;

  --f-script: "Yellowtail", "Brush Script MT", cursive;
  --f-caps: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 4.5rem);
  --space: clamp(4.5rem, 9vw, 8.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --grain: 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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-soft: 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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --grit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.55'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23g)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--gold-soft) var(--night); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  background-image: var(--grain);
  color: var(--cream);
  font: 400 1.125rem/1.6 var(--f-body);
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--night); }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--cream); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 400; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--striker); border-radius: 0; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--gold); color: var(--night); padding: 0.6rem 1rem; font: 600 1rem var(--f-caps); letter-spacing: 0.1em; text-transform: uppercase; }
.skip:focus { top: 1rem; }

/* type voices */
.caps { font-family: var(--f-caps); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; }
.script { font-family: var(--f-script); font-weight: 400; color: var(--gold); letter-spacing: 0; text-transform: none; }
.star { width: 0.9em; height: 0.9em; fill: currentColor; flex: none; }

.h2 { display: flex; flex-direction: column; gap: 0.1em; line-height: 1; }
.h2 .caps { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--cream); }
.h2 .script { font-size: clamp(2.8rem, 5.4vw, 4.75rem); line-height: 1.05; padding-bottom: 0.08em; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0.85rem var(--gutter);
  background: rgba(11, 11, 10, 0.94);
  border-bottom: 1px solid var(--gold-line);
}
.bar__mark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--gold); text-decoration: none; font: 600 1rem/1 var(--f-caps); letter-spacing: 0.2em; text-transform: uppercase; }
.bar__nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.25rem); }
.bar__nav a { color: var(--cream); text-decoration: none; font: 500 0.95rem/1 var(--f-caps); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.5rem 0; }
.bar__nav a:hover { color: var(--gold); }
.bar__nav .bar__cta { color: var(--night); background: var(--gold); padding: 0.6rem 1rem; }
.bar__nav .bar__cta:hover { background: var(--cream); color: var(--night); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(1rem, 3vw, 3rem);
  min-height: min(calc(100svh - 58px), 58rem);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) clamp(3rem, 5vw, 4.5rem);
  position: relative;
}
.hero__title { display: flex; flex-direction: column; line-height: 1; margin-bottom: clamp(1.5rem, 2.6vw, 2.25rem); }
.hero__title .caps { font-size: clamp(1.25rem, 2.15vw, 1.9rem); color: var(--cream); letter-spacing: 0.16em; }
.hero__title .script { font-size: clamp(4.5rem, 9.4vw, 9rem); line-height: 0.95; margin: 0.06em 0 0 -0.04em;  }
.hero__lede { max-width: 34rem; color: var(--cream-dim); font-size: clamp(1.05rem, 1.3vw, 1.2rem); margin-bottom: 2rem; }
.hero__lede em { color: var(--cream); font-style: italic; }

/* signup */
.signup { max-width: 34rem; }
.signup__label { display: block; font: 600 0.9rem/1 var(--f-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.65rem; }
.signup__row { display: flex; gap: 0; border: 1px solid var(--gold); background: var(--night-2); }
.signup__input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cream);
  font: 400 1.1rem var(--f-body); padding: 1rem 1.1rem; caret-color: var(--gold);
}
.signup__input::placeholder { color: #9d957f; }
.signup__input:focus { outline: none; }
.signup__row:focus-within { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--gold); }
.signup__note { font-size: 0.95rem; color: var(--cream-dim); margin: 0.8rem 0 0; }
.signup__note[data-state="error"] { color: #ff9b7a; }
.signup__note[data-state="ok"] { color: var(--gold); font-weight: 500; }
.signup[aria-busy="true"] .btn { cursor: progress; opacity: 0.75; }
.signup--done .signup__row { border-color: var(--gold-soft); opacity: 0.6; }

.btn {
  border: 0; cursor: pointer; background: var(--gold); color: var(--night);
  font: 700 1.05rem/1 var(--f-caps); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 1rem 1.4rem; white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.btn:hover { background: var(--cream); }
.btn:disabled { cursor: not-allowed; }
.btn--ox { background: var(--ox); color: var(--gold); }
.btn--ox:hover { background: var(--ink); color: var(--cream); }

/* fan */
.hero__fan { position: relative; height: min(40rem, 78vh); display: grid; place-items: end center; }
.fan { position: relative; width: 100%; height: 100%; --w: clamp(12rem, 17vw, 15.5rem); }
.fan .fan__card {
  position: absolute; left: 56%; bottom: 6%;
  width: var(--w); margin-left: calc(var(--w) / -2);
  transform-origin: 50% 118%;
  transform: translateX(var(--x)) rotate(var(--r));
  box-shadow: 0 30px 50px -10px rgba(0, 0, 0, 0.75), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.fan .fan__card--front { z-index: 2; transform: translateY(-9%) scale(1.12); }

/* ---------- matchbook ---------- */
.mb {
  --cover: var(--ox);
  --cover-2: var(--ox-2);
  position: relative; aspect-ratio: 5 / 7.6;
  color: var(--gold);
  border-radius: 3px;
}
.mb--ox { --cover: var(--ox); --cover-2: var(--ox-2); }
.mb--green { --cover: var(--green); --cover-2: var(--green-2); }
.mb--black { --cover: var(--card-black); --cover-2: #1f1d1b; }

.mb__face {
  position: absolute; inset: 0; border-radius: 3px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mb__front {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 9% 9% 25%;
  background:
    var(--grain),
    radial-gradient(120% 80% at 30% 15%, var(--cover-2), var(--cover) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 0 7px var(--cover), inset 0 0 0 8px var(--gold-line);
}
.mb__front::before {
  content: ""; position: absolute; left: 14%; right: 14%; top: 7%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}
.mb__kw {
  font: 400 clamp(1.9rem, 2.6vw, 2.5rem)/1 var(--f-script); color: var(--gold);
  margin: 16% 0 auto; padding: 0 0.1em 0.12em; transform: rotate(-6deg);

  overflow-wrap: anywhere; hyphens: auto;
}
.mb__kw--ink { color: var(--ox); text-shadow: none; transform: rotate(-4deg); margin: 0 0 0.35rem; font-size: clamp(1.7rem, 2.2vw, 2.1rem); }
.mb__title {
  font: 600 0.82rem/1.3 var(--f-caps); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cream-2); margin: 0.6rem 0 1.1rem; text-wrap: balance;
}
.mb__striker {
  position: absolute; left: 0; right: 0; bottom: 0; height: 15%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grit), linear-gradient(#6a6a70, var(--striker) 40%, #4b4b50);
  border-top: 1px solid rgba(0, 0, 0, 0.6);
  color: var(--gold); font: 700 0.8rem/1 var(--f-caps); letter-spacing: 0.24em; text-transform: uppercase;
}
.mb__striker > span { background: rgba(18, 17, 16, 0.78); padding: 0.32em 0.7em; }
.mb__striker--struck::after,
.mb.is-struck .mb__striker::after {
  content: ""; position: absolute; left: 12%; top: 46%; width: 62%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(20, 12, 8, 0.85) 20%, rgba(40, 20, 10, 0.7) 70%, transparent);
  transform: rotate(-3deg); pointer-events: none;
}

/* inside of the book */
.mb__inside {
  overflow: visible;
  display: flex; flex-direction: column;
  background: var(--grain-soft), var(--cream);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.comb {
  display: flex; justify-content: center; align-items: flex-end; gap: 3.5%;
  height: 33%; padding: 0 7%;
  background: linear-gradient(var(--cream-2), var(--cream) 85%);
  border-bottom: 1px dashed rgba(31, 26, 20, 0.3);
}
.match {
  position: relative; display: block; width: 7.4%; height: 82%;
  background: linear-gradient(90deg, #efe5ca, #fbf6e8 45%, #ddd0ad);
  border-radius: 1px 1px 0 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.match::before { /* head */
  content: ""; position: absolute; left: -22%; right: -22%; top: -6%; height: 24%;
  border-radius: 46% 46% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #8a2a30, var(--ox) 65%);
}
.mb--green .match::before { background: radial-gradient(circle at 35% 30%, #2d6b4c, var(--green) 65%); }
.match.burnt { height: 68%; background: linear-gradient(#2a2420, #6d5c48 26%, #efe5ca 44%, #fbf6e8 70%, #ddd0ad); }
.match.burnt::before { background: radial-gradient(circle at 40% 35%, #3a3632, #111 70%); top: -8%; height: 18%; }
.match.gone { visibility: hidden; }
.match .flame, .match.lit-steady::after {
  content: ""; position: absolute; left: 50%; bottom: 96%; width: 260%; height: 72%;
  transform: translateX(-50%); transform-origin: 50% 100%;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse at 50% 78%, #fff6d6 0 14%, var(--flame) 34%, var(--ember) 62%, rgba(226, 84, 27, 0) 74%);
  filter: blur(0.4px);
  animation: flicker 1.6s infinite alternate var(--ease-out);
}
.match.lit-steady { overflow: visible; }
.match.lit-steady::before { background: radial-gradient(circle at 40% 35%, #4a3a30, #1a1412 70%); }
@keyframes flicker {
  0% { transform: translateX(-50%) scale(1, 1) skewX(0deg); opacity: 0.95; }
  35% { transform: translateX(-52%) scale(0.92, 1.08) skewX(-3deg); }
  70% { transform: translateX(-48%) scale(1.05, 0.95) skewX(2deg); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.97, 1.04) skewX(-1deg); opacity: 0.9; }
}
.match .flame { animation: ignite 1.9s var(--ease-out) forwards; }
@keyframes ignite {
  0% { transform: translateX(-50%) scale(0.2); opacity: 0; filter: blur(2px) brightness(1.8); }
  12% { transform: translateX(-50%) scale(1.5, 1.6); opacity: 1; filter: blur(0.6px) brightness(1.6); }
  30% { transform: translateX(-50%) scale(1, 1.05); filter: blur(0.4px) brightness(1); }
  80% { transform: translateX(-50%) scale(0.9, 1); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.1, 0.3); opacity: 0; }
}

.mb__flap { flex: 1; padding: 7% 8% 0; display: flex; flex-direction: column; min-height: 0; }
.mb__quote { font: italic 400 0.88rem/1.42 var(--f-body); color: var(--ink); margin: 0 0 0.55rem; }
.mb__mirror { font: 500 0.82rem/1.35 var(--f-body); color: var(--ink-soft); margin: 0 0 0.6rem; }
.mb__mirror span:first-child { font: 700 0.72rem var(--f-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ox); }
.mb__actions { margin-top: auto; padding-bottom: 0.7rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mb .mb__inside .mb__striker { position: relative; height: auto; min-height: 13%; flex: none; }

.strike, .close {
  font: 700 0.78rem/1.1 var(--f-caps); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
}
.strike {
  display: inline-flex; align-items: center; gap: 0.45rem; text-align: left;
  border: 1px solid var(--ox); background: var(--ox); color: var(--cream); padding: 0.55rem 0.65rem;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.strike svg { width: 0.75rem; height: 1rem; fill: var(--flame); flex: none; }
.strike:hover { background: var(--ink); border-color: var(--ink); }
.strike[aria-pressed="true"] { background: transparent; color: var(--ox); }
.strike[aria-pressed="true"] svg { fill: #2a2420; }
.close { border: 0; background: none; color: var(--ink-soft); padding: 0.55rem 0.2rem; text-decoration: underline; text-underline-offset: 0.25em; }
.close:hover { color: var(--ink); }

/* ---------- drawer ---------- */
.drawer { padding: var(--space) var(--gutter) calc(var(--space) * 0.8); border-top: 1px solid var(--gold-line); background: linear-gradient(var(--night), #0e0d0c 30%, var(--night)); }
.drawer__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; margin-bottom: clamp(3rem, 6vw, 5rem); }
.drawer__how { color: var(--cream-dim); max-width: 36rem; }
.drawer__how strong { color: var(--cream); font-weight: 600; }
.drawer__how p:last-child { margin: 0; }

.drawer__part + .drawer__part { margin-top: clamp(3.5rem, 6vw, 5.5rem); }
.part {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.2rem;
  padding-bottom: 1rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--gold-line);
}
.part__name { font: 700 1.05rem/1 var(--f-caps); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.part__latin { font: 400 clamp(1.8rem, 3vw, 2.4rem)/1 var(--f-script); color: var(--cream); }
.part__sub { font: 500 1rem/1 var(--f-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream-dim); }

.grid {
  list-style: none; margin: 0; padding: clamp(0.9rem, 1.6vw, 1.4rem);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.4rem);
  background: #080807;
  box-shadow: inset 0 14px 30px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(212, 175, 55, 0.12);
}
.drawer__part--finale .grid { grid-template-columns: repeat(auto-fill, minmax(min(14.5rem, 100%), 16.5rem)); }
.slot { perspective: 1400px; }
.slot .mb {
  transform-style: preserve-3d;
  transition: transform 0.85s var(--ease-out);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.9), 0 3px 8px rgba(0, 0, 0, 0.6);
}
.slot .mb__inside { transform: rotateY(180deg); }
.slot .mb.is-open { transform: rotateY(180deg); }
.slot .mb__front { cursor: pointer; transition: filter 0.3s var(--ease-out); }
.slot .mb:not(.is-open):hover .mb__front { filter: brightness(1.12); }
.mb__toggle {
  position: absolute; inset: 0 0 15% 0; z-index: 2; border: 0; background: transparent; cursor: pointer;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.mb.is-open .mb__toggle { pointer-events: none; }

/* struck state = a mark, not a colour */
.mb__burnt { display: none; }
.mb.is-struck .mb__burnt {
  display: block; position: absolute; right: 9%; top: 9%; width: 0.42rem; height: 2.8rem;
  background: linear-gradient(#141010, #3a2c22 30%, #efe5ca 46%, #e2d6b6);
  transform: rotate(28deg); border-radius: 1px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.mb.is-struck .mb__burnt::before { content: ""; position: absolute; left: -45%; right: -45%; top: -6%; height: 22%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a3632, #0a0a0a 70%); }
.mb.is-struck .mb__front::after {
  content: ""; position: absolute; right: -10%; top: -8%; width: 60%; height: 40%;
  background: radial-gradient(closest-side, rgba(10, 6, 4, 0.55), rgba(10, 6, 4, 0));
  pointer-events: none;
}

/* ---------- the figure ---------- */
.figure {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem);
  align-items: center; padding: var(--space) var(--gutter);
}
.figure__label {
  position: relative; justify-self: center; width: min(100%, 26rem);
  background: var(--grain-soft), var(--cream); padding: 1.6rem 1.6rem 0;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), inset 0 0 0 8px var(--cream), inset 0 0 0 9px rgba(75, 14, 23, 0.5);
  transform: rotate(-2deg);
}
.figure__label img { mix-blend-mode: multiply; width: 62%; margin: 0 auto; filter: contrast(1.04); }
.figure__label::after {
  content: "Oeconomicus Idioticus"; display: block; margin: 0 -1.6rem; padding: 0.8rem 0;
  background: var(--grit), var(--striker); color: var(--gold);
  font: 700 0.8rem/1 var(--f-caps); letter-spacing: 0.26em; text-transform: uppercase; text-align: center;
}
.figure__text { max-width: 40rem; }
.figure__text .h2 { margin-bottom: 1.75rem; }
.figure__text p { color: var(--cream-dim); }
.figure__text em { color: var(--cream); }
.pull { margin: 2.5rem 0 0; padding: 0; }
.pull p { font: 600 clamp(1.45rem, 2.3vw, 1.95rem)/1.3 var(--f-caps); letter-spacing: 0.01em; color: var(--cream); margin: 0; }
.pull .script { display: block; font-size: 2.3em; line-height: 1.05; text-transform: none; margin-top: 0.1em; }
.pull footer { margin-top: 0.8rem; font: 500 0.9rem var(--f-caps); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); }

/* ---------- reading sample ---------- */
.sample { padding: calc(var(--space) * 0.5) var(--gutter) var(--space); }
.sample__sheet {
  max-width: 50rem; margin: 0 auto; position: relative;
  background: var(--grain-soft), var(--cream); color: var(--ink);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.95), inset 0 0 0 10px var(--cream), inset 0 0 0 11px rgba(31, 26, 20, 0.22);
}
.sample__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.9rem; margin-bottom: 2rem; }
.sample__title .caps { font-size: 1.1rem; color: var(--ox); letter-spacing: 0.24em; }
.sample__title .script { color: var(--ox); font-size: clamp(2.2rem, 4vw, 3rem); }
.sample__body { font-size: clamp(1.05rem, 1.25vw, 1.15rem); line-height: 1.7; max-width: 68ch; }
.sample__body p { color: #2b241c; }
.sample__big { font: 600 clamp(1.5rem, 2.6vw, 2.1rem)/1.3 var(--f-caps) !important; letter-spacing: 0.01em; color: var(--ox) !important; margin: 1.8rem 0 1.4rem; text-wrap: balance; }
.sample__sign { font: 400 2.2rem/1 var(--f-script); color: var(--ox) !important; margin: 2rem 0 0; }

/* ---------- mirror ---------- */
.mirror { padding: var(--space) var(--gutter); border-top: 1px solid var(--gold-line); }
.mirror .h2 { max-width: 52rem; }
.mirror__lede { max-width: 40rem; color: var(--cream-dim); margin: 1.5rem 0 clamp(2.5rem, 5vw, 4rem); }
.mirror__steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--gold-line); }
.mirror__steps li { padding: 1.75rem clamp(1rem, 2.5vw, 2.5rem) 0 0; color: var(--cream-dim); font-size: 1.1rem; }
.mirror__steps li + li { padding-left: clamp(1rem, 2.5vw, 2.5rem); border-left: 1px solid var(--gold-line); }
.mirror__n { display: block; font: 400 clamp(2.2rem, 3.4vw, 3rem)/1.1 var(--f-script); color: var(--gold); margin-bottom: 0.4rem; }

/* ---------- author ---------- */
.author {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem);
  padding: var(--space) var(--gutter); border-top: 1px solid var(--gold-line); background: #0e0d0c;
}
.author__text { max-width: 40rem; color: var(--cream-dim); }
.author__quote { font: 600 clamp(1.4rem, 2.2vw, 1.8rem)/1.35 var(--f-caps); letter-spacing: 0.01em; color: var(--cream); margin-top: 2rem; }

/* ---------- last match ---------- */
.last { padding: var(--space) var(--gutter); display: grid; place-items: center; }
.last__book {
  position: relative; width: min(100%, 60rem);
  background: var(--grain-soft), var(--cream); color: var(--ink);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(0, 0, 0, 0.4);
  border-radius: 4px; overflow: hidden;
}
.comb--big { height: clamp(7rem, 15vw, 10.5rem); gap: 1.6%; padding: 0 4%; }
.comb--big .match { width: 2.6%; }
.last__flap { padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); }
.last__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1rem; line-height: 1; }
.last__title .caps { font-size: clamp(1.1rem, 1.8vw, 1.45rem); color: var(--ink); }
.last__title .script { color: var(--ox); font-size: clamp(2.9rem, 6vw, 4.8rem); line-height: 1.05; }
.last__tally { margin: 1.1rem 0 2rem; max-width: 40rem; color: var(--ink-soft); font-size: 1.1rem; }
.last__tally strong { color: var(--ox); font: 600 1.25em/1 var(--f-caps); letter-spacing: 0.04em; transition: font-weight 0.3s; }
.last__tally[data-heat="2"] strong { font-weight: 700; font-size: 1.45em; }
.last__tally[data-heat="3"] strong { font-weight: 700; font-size: 1.7em; }
.last__striker { position: relative; height: 3.2rem; }
.signup--ink { max-width: 40rem; }
.signup--ink .signup__label { color: var(--ox); }
.signup--ink .signup__row { background: #fffaf0; border-color: var(--ink); }
.signup--ink .signup__input { color: var(--ink); caret-color: var(--ox); }
.signup--ink .signup__input::placeholder { color: #6e6352; }
.signup--ink .signup__row:focus-within { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--ox); }
.signup--ink .signup__note { color: var(--ink-soft); }
.signup--ink .signup__note a { color: var(--ox); }
.signup--ink .signup__note[data-state="ok"] { color: var(--ox); }
.signup--ink .signup__note[data-state="error"] { color: #a3200f; }

/* ---------- footer ---------- */
.foot { padding: 3rem var(--gutter) 3.5rem; border-top: 1px solid var(--gold-line); display: grid; gap: 1rem; justify-items: center; text-align: center; }
.foot__mark { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.3rem 1rem; margin: 0; }
.foot__mark .script { font-size: 2rem; }
.foot__mark .caps { font-size: 0.85rem; color: var(--cream-dim); }
.foot__nav { display: flex; gap: 2rem; }
.foot__nav a { font: 500 0.9rem var(--f-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream); }
.foot__small { color: var(--cream-dim); font-size: 0.9rem; margin: 0; }

/* ---------- tally chip ---------- */
.chip {
  position: fixed; right: clamp(0.75rem, 2vw, 1.5rem); bottom: clamp(0.75rem, 2vw, 1.5rem); z-index: 40;
  display: inline-flex; align-items: center; gap: 0.7rem;
  background: var(--ox); color: var(--cream); text-decoration: none;
  padding: 0.75rem 1rem; border: 1px solid var(--gold);
  font: 600 0.95rem/1 var(--f-caps); letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.8);
  transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
}
.chip[hidden] { display: none; }
.chip.is-away { transform: translateY(150%); opacity: 0; pointer-events: none; }
.chip__flame { width: 0.8rem; height: 1.1rem; fill: var(--flame); }
.chip__go { color: var(--gold); border-left: 1px solid var(--gold-line); padding-left: 0.7rem; }
.chip:hover { background: var(--ox-2); color: var(--cream); }

/* ---------- entrance (content visible by default) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .fan__card { animation: deal 1.1s var(--ease-out) both; }
  .js .fan__card:nth-child(1) { animation-delay: 0.05s; }
  .js .fan__card:nth-child(2) { animation-delay: 0.12s; }
  .js .fan__card:nth-child(3) { animation-delay: 0.19s; }
  .js .fan__card:nth-child(4) { animation-delay: 0.26s; }
  .js .fan__card--front { animation: deal-front 1.2s 0.35s var(--ease-out) both; }
}
@keyframes deal { from { transform: translateX(0) rotate(0deg); } }
@keyframes deal-front { from { transform: translateY(20%) scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  .slot .mb { transition: none; }
  .match .flame { display: none; }
  .match.lit-steady::after { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .bar__nav a:not(.bar__cta) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 2.5rem; }
  .hero__fan { height: clamp(24rem, 70vw, 34rem); order: -1; margin: -1rem 0 0; }
  .fan { --w: clamp(9.5rem, 26vw, 13rem); }
  .fan__card { bottom: 2%; }
  .drawer__head, .figure, .author { grid-template-columns: 1fr; }
  .figure__label { width: min(80%, 22rem); }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .bar { padding-block: 0.7rem; }
  .bar__mark span { font-size: 0.85rem; letter-spacing: 0.14em; }
  .hero__fan { height: 21rem; }
  .fan { --w: 8.6rem; }
  .fan__card:nth-child(1) { --x: -98px !important; }
  .fan__card:nth-child(2) { --x: -50px !important; }
  .fan__card:nth-child(3) { --x: 50px !important; }
  .fan__card:nth-child(4) { --x: 98px !important; }
  .fan__card--front .mb__quote { font-size: 0.66rem; }
  .signup__row { flex-direction: column; }
  .btn { width: 100%; padding: 1.05rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.6rem; gap: 0.6rem; }
  .drawer__part--finale .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot:has(.mb.is-open) { grid-column: 1 / -1; }
  .slot:has(.mb.is-open) .mb { aspect-ratio: 5 / 5.4; }
  .mirror__steps { grid-template-columns: 1fr; }
  .mirror__steps li { padding: 1.25rem 0; }
  .mirror__steps li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--gold-line); }
  .chip__go { display: none; }
}

/* containment for the fanned hand */
.hero { overflow-x: clip; }
.fan .mb__quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }

/* keyword sizing follows the cover width, never breaks mid-word */
.mb { container-type: inline-size; }
.mb__kw { font-size: 15cqi; overflow-wrap: normal; hyphens: none; white-space: nowrap; }
.mb__kw[data-len="long"] { font-size: 12.5cqi; }
.mb__kw[data-len="xlong"] { font-size: 11cqi; }
.mb__kw--ink { font-size: 13cqi; }
.mb__title { font-size: max(0.6rem, 5.2cqi); }

/* figure: knees-up crop, white ground dissolved into the label card */
.figure__label img { width: 78%; aspect-ratio: 4 / 5.2; object-fit: cover; object-position: 50% 0; filter: brightness(1.07) contrast(1.06); }
.figure__label { background: #f8f3ed; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), inset 0 0 0 8px #f8f3ed, inset 0 0 0 9px rgba(75, 14, 23, 0.5); }
.figure__label img { mix-blend-mode: normal; filter: none; height: auto; }
.legal { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) var(--space); }
.skip:hover, .skip:focus { color: var(--night); }
/* role sizes on the heading elements themselves */
.hero__title { font-size: 2rem; }
.h2 { font-size: 1.6rem; }
.part { font-size: 1.25rem; }

/* ===== rebuild: material layer ===== */

/* headings: caps and script share one baseline */
.h2 { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.15em 0.6em; }

/* gold foil: a real raster texture stamped into the letters */
.foil, .hero__title .script, .h2 .script, .pull .script, .foot__mark .script, .part__name, .bar__mark span {
  background: url("assets/img/foil.jpg") 0 0 / 280px;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.75));
}
.mb__kw.foil { background-size: 160px; }

/* foil-stamped buttons with a striker band */
.btn, .bar__nav .bar__cta {
  background:
    var(--grit) 0 100% / auto 7px repeat-x,
    linear-gradient(#55555b, #55555b) 0 100% / 100% 7px no-repeat,
    url("assets/img/foil.jpg") 0 0 / 280px;
  color: #1a1307;
}
.btn { padding-bottom: calc(1rem + 7px); box-shadow: inset 0 1px 0 rgba(255, 245, 200, 0.5), inset 0 0 0 1px rgba(90, 64, 14, 0.5); }
.bar__nav .bar__cta { background-size: auto 4px, 100% 4px, 220px; padding-bottom: calc(0.6rem + 4px); }
.btn:hover, .bar__nav .bar__cta:hover {
  background:
    var(--grit) 0 100% / auto 7px repeat-x,
    linear-gradient(#55555b, #55555b) 0 100% / 100% 7px no-repeat,
    linear-gradient(var(--cream), var(--cream));
  color: var(--night);
}
.btn--ox, .btn--ox:hover {
  background:
    var(--grit) 0 100% / auto 7px repeat-x,
    linear-gradient(#55555b, #55555b) 0 100% / 100% 7px no-repeat,
    linear-gradient(var(--ox), var(--ox));
  color: var(--gold);
}
.btn--ox:hover { background:
    var(--grit) 0 100% / auto 7px repeat-x,
    linear-gradient(#55555b, #55555b) 0 100% / 100% 7px no-repeat,
    linear-gradient(var(--ink), var(--ink)); color: var(--cream); }

/* cover composition: number, script, emblem, caps */
.mb__no {
  position: absolute; top: 4.2%; left: 0; right: 0; text-align: center;
  font: 600 max(0.55rem, 3.6cqi)/1 var(--f-caps); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-soft);
}
.mb__front::before { top: 9.5%; }
.mb__front .mb__kw { margin: 13% 0 0; }
.mb__emblem {
  width: 30cqi; height: 30cqi; margin: auto 0; flex: none;
  fill: none; stroke: var(--gold); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.7));
}
.mb__front .mb__title { margin: 0 0 1rem; }

/* the striker is where you strike */
.mb__light {
  display: inline-flex; align-items: center; gap: 0.4em; cursor: pointer;
  border: 0; background: rgba(18, 17, 16, 0.82); color: var(--gold);
  font: 700 max(0.7rem, 4.4cqi)/1 var(--f-caps); letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.42em 0.75em;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.mb__light svg { width: 0.7em; height: 0.95em; fill: var(--flame); }
.mb__light:hover { background: var(--ox); color: var(--cream); }
.mb__light[aria-pressed="true"] { color: var(--cream-dim); background: rgba(18, 17, 16, 0.6); }
.mb__light[aria-pressed="true"] svg { fill: #2a2420; }
.mb__front .mb__striker { z-index: 3; }

/* flame on the burnt mark when struck from the cover */
.mb__burnt { overflow: visible; }
.mb__burnt .flame {
  position: absolute; left: 50%; bottom: 92%; width: 380%; height: 46%;
  transform: translateX(-50%); transform-origin: 50% 100%;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse at 50% 78%, #fff6d6 0 14%, var(--flame) 34%, var(--ember) 62%, rgba(226, 84, 27, 0) 74%);
  animation: ignite 1.9s var(--ease-out) forwards;
}

/* the drawer: compartments, under-light, books that lie a little crooked */
.grid {
  gap: 10px; padding: 10px;
  background: linear-gradient(#1c1712, #110e0b);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.16), 0 40px 70px -35px rgba(0, 0, 0, 0.95);
}
.slot {
  padding: clamp(0.6rem, 1.3vw, 1rem);
  background: radial-gradient(130% 70% at 50% 108%, rgba(212, 175, 55, 0.09), rgba(212, 175, 55, 0) 62%), #070606;
  box-shadow: inset 0 12px 20px rgba(0, 0, 0, 0.95), inset 0 -1px 0 rgba(212, 175, 55, 0.1);
}
.slot .mb { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--tilt, 0deg)); }
.slot .mb.is-open { transform: translate(0, 0) rotate(0deg) rotateY(180deg); }

/* Finanzspiegel as the inside of a flap */
.mirror__flap {
  position: relative; max-width: 66rem; overflow: hidden; border-radius: 4px;
  background: var(--grain-soft), var(--cream); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.95);
}
.mirror__flap .mirror__steps { border-top: 0; padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.75rem); }
.mirror__flap .mirror__steps li { color: var(--ink-soft); padding-top: 0; }
.mirror__flap .mirror__steps li + li { border-left: 1px dashed rgba(31, 26, 20, 0.32); }
.mirror__flap .mirror__n { color: var(--ox); }
.mirror__icon { display: block; width: 2.6rem; height: 2.6rem; margin-bottom: 0.6rem; fill: none; stroke: var(--ox); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mirror__striker { position: relative; height: 3rem; }

/* author quote attribution */
.author__quote { margin: 2rem 0 0; }
.author__quote p { margin: 0; }
.author__quote footer, .pull footer { font: 500 0.9rem var(--f-caps); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-soft); margin-top: 0.8rem; }

/* the real book beside the last matchbook */
.last { grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); max-width: 84rem; margin: 0 auto; align-items: center; }
.last__cover { margin: 0; justify-self: end; width: min(100%, 22rem); }
.last__cover img { width: 100%; height: auto; transform: rotate(-3deg); box-shadow: 0 40px 70px -25px rgba(0, 0, 0, 0.95), 0 6px 16px rgba(0, 0, 0, 0.6); }

@media (max-width: 860px) {
  .last { grid-template-columns: 1fr; }
  .last__cover { justify-self: center; width: min(62%, 16rem); }
}
@media (max-width: 640px) {
  .mirror__flap .mirror__steps li + li { border-left: 0; border-top: 1px dashed rgba(31, 26, 20, 0.32); padding-left: 0; }
  .slot { padding: 0.45rem; }
  .grid { gap: 6px; padding: 6px; }
}
.mb.is-struck .mb__burnt { top: 34%; right: 11%; }
.h2 { align-content: flex-start; }
.slot:has(.mb.is-open) { grid-column: span 2; }
.slot:has(.mb.is-open) .mb { aspect-ratio: 5 / 4.3; }
.slot .mb.is-open .mb__inside .comb { height: 30%; }
@media (max-width: 640px) { .slot:has(.mb.is-open) .mb { aspect-ratio: 5 / 5.4; } }

/* ===== fix batch after review ===== */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* lockups: caps at half the script, one line where room allows */
.h2 .caps { font-size: clamp(1.35rem, 2.3vw, 2.15rem); letter-spacing: 0.12em; }
.h2 .script { font-size: clamp(2.6rem, 4.4vw, 4.2rem); }
.drawer__head { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.mirror .h2 { max-width: none; }
.sample__title .script { font-size: clamp(2.6rem, 4.4vw, 3.4rem); }

/* covers: legible recognition line, more of a composition */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); }
.drawer__part--finale .grid { grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 17rem)); }
.mb__title { font-size: max(0.75rem, 5.6cqi); letter-spacing: 0.1em; }
.mb__no { font-size: max(0.66rem, 3.8cqi); display: flex; align-items: center; justify-content: center; gap: 0.6em; }
.mb__no::before, .mb__no::after { content: ""; width: 7cqi; height: 1px; background: var(--gold-soft); }
.mb__front .mb__kw { position: relative; padding-bottom: 0.32em; }
.mb__front .mb__kw::after {
  content: ""; position: absolute; left: 6%; right: -4%; bottom: -0.05em; height: 0.36em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath d='M2 11C30 3 70 2 118 4' fill='none' stroke='%23d4af37' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.mb__scene { position: relative; display: grid; place-items: center; width: 62cqi; height: 46cqi; margin: auto 0; }
.mb__scene .mb__emblem { width: 40cqi; height: 40cqi; margin: 0; stroke-width: 1.2; }
.mb__scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1cqi; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: 0.7; }
.mb__spark { position: absolute; fill: var(--gold); }
.mb__spark--a { width: 7cqi; height: 7cqi; left: 4cqi; top: 4cqi; }
.mb__spark--b { width: 4.5cqi; height: 4.5cqi; right: 6cqi; top: 15cqi; }

/* covers rest on the compartment floor */
.slot { display: flex; flex-direction: column; justify-content: flex-end; }

/* the strike scratch runs beside the label, not through it */
.mb__striker--struck::after,
.mb.is-struck .mb__striker::after { left: 4%; width: 17%; top: 40%; }

/* striker labels that sit on grit get a dark chip */
.figure__label::after {
  background:
    linear-gradient(rgba(18, 17, 16, 0.85), rgba(18, 17, 16, 0.85)) center / 15.5rem 1.7rem no-repeat,
    var(--grit), var(--striker);
}

/* Finanzspiegel: three matches in the flap, one already lit */
.mirror__flap .mirror__steps { padding-top: clamp(3.6rem, 6vw, 4.6rem); }
.mirror__match { display: block; width: 14px; height: 64px; margin: 0 0 1.1rem 6px; }
.mirror__match::before { left: -30%; right: -30%; }

/* author: name with its quote, bio beside */
.author { align-items: start; }
.author__head .author__quote { margin-top: 1.6rem; }

/* re-assert narrow layouts over the desktop overrides above */
@media (max-width: 1080px) {
  .drawer__head { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid, .drawer__part--finale .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mirror__flap .mirror__steps li + li { padding-top: 3.4rem; }
}

/* legal + thanks pages */
.legal__h { font: 600 1.05rem/1.3 var(--f-caps); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ox); margin: 2rem 0 0.6rem; }
.legal__date { font-size: 0.9rem; color: var(--ink-soft) !important; margin-top: 2.5rem; }
.sample__title .script { color: var(--ox); }
.thanks { min-height: calc(100svh - 70px); }
.thanks .comb--big .match { width: 3.6%; }
.thanks__back { display: inline-block; text-decoration: none; margin-top: 0.5rem; }
.thanks .last__book { overflow: visible; }
