/* The app's own palette (apps/mobile/src/theme.ts): ink, bone, candle gold, deep teal,
   ember. The night band borrows the app's night mode, pure black and a dim red, because
   that is what the phones on the table actually look like after dark. */
:root {
  --ink: #12141a;
  --ink-raised: #1a1d25;
  --line: #333846;
  --bone: #e4e6ec;
  --dim: #a3a9b6;
  --candle: #c49a48;
  --candle-deep: #7a6030;
  --teal: #2e7c74;
  --ember: #8c3a2e;
  --night: #000;
  --blood: #b8341f;
  --display: 'Spectral', Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --measure: 36rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--candle); }
:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 300; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bone); color: var(--ink); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- top bar ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem var(--gutter);
}
.bar .mark { font-family: var(--display); font-size: 1.35rem; text-decoration: none; }
.bar .lang { font-size: 0.95rem; color: var(--dim); text-decoration: none; }
.bar .lang:hover { color: var(--bone); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 7rem var(--gutter) clamp(2.5rem, 7vh, 5rem);
  isolation: isolate;
}
.hero-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero-art::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--ink) 4%, rgba(18, 20, 26, 0.72) 42%, rgba(18, 20, 26, 0.15) 75%),
    linear-gradient(to right, rgba(18, 20, 26, 0.65), transparent 60%);
}
.hero-copy { max-width: 50rem; }
.hero h1 { font-size: clamp(2.9rem, 7.4vw, 7rem); font-weight: 200; line-height: 0.98; letter-spacing: -0.025em; }
.hero .lead { margin-top: 1.5rem; max-width: 31rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--bone); }
.actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center; }
.button {
  display: inline-flex; align-items: center; gap: 0.7rem;
  background: var(--candle); color: var(--ink);
  font-weight: 500; text-decoration: none;
  padding: 0.95rem 1.4rem; border-radius: 0.5rem;
}
.button:hover { background: #d8b263; color: var(--ink); }
.button svg { width: 1.1rem; height: 1.1rem; }
.quiet { color: var(--dim); }
.quiet:hover { color: var(--bone); }

/* ---------- the card (the one bold thing) ---------- */
.deal { display: grid; justify-items: center; gap: 0.9rem; }
.card {
  --w: clamp(13rem, 21vw, 18.5rem);
  width: var(--w); aspect-ratio: 1060 / 1484;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit;
  perspective: 1400px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  border-radius: 0.9rem;
}
.card-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card.held .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 0.9rem; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(196, 154, 72, 0.35);
}
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.front { transform: rotateY(180deg); background: var(--ink); text-align: left; }
.face.front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 14, 0.96) 18%, transparent 58%);
}
.face.front .who { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.05rem; z-index: 1; }
.who .camp { font-size: 0.8rem; color: var(--candle); }
.who .name { display: block; font-family: var(--display); font-size: 1.8rem; line-height: 1.05; margin: 0.15rem 0 0.4rem; color: var(--bone); }
.who .power { font-size: 0.86rem; line-height: 1.4; color: var(--dim); }
.card:hover .back { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--candle), 0 0 40px -6px rgba(196, 154, 72, 0.45); }
.deal .hint { font-size: 0.92rem; color: var(--dim); text-align: center; }
.deal .hint small { display: block; font-size: 0.8rem; opacity: 0.8; }
@media (hover: none) { .deal .hint small { display: none; } }

/* ---------- sections ---------- */
section { padding: clamp(4rem, 9vw, 7.5rem) var(--gutter); }
.head { max-width: var(--measure); margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.head h2 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); }
.head p { margin-top: 1.1rem; color: var(--dim); font-size: 1.12rem; }

/* An evening: a real sequence, so it is numbered. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(3.5rem, 8vw, 6rem); }
.step {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(2rem, 6vw, 6rem);
}
.step:nth-child(even) > .device { order: -1; justify-self: end; }
.step .text { max-width: 26rem; }
.step .num { font-family: var(--display); font-size: clamp(3.4rem, 7vw, 5.5rem); line-height: 1; color: var(--candle-deep); font-weight: 200; }
.step h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0.6rem 0 0.9rem; }
.step p { color: var(--dim); }

/* ---------- devices: real screens in drawn frames ---------- */
.device {
  position: relative;
  background: linear-gradient(145deg, #2a2d35, #0b0c0f 40%, #15171c);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px #050506,
    0 60px 120px -40px rgba(0, 0, 0, 0.95),
    0 30px 60px -30px rgba(196, 154, 72, 0.18);
}
.device .glass { overflow: hidden; background: #000; height: 100%; }
.device .glass img { width: 100%; height: 100%; object-fit: cover; }
.device.phone { width: min(18.5rem, 70vw); aspect-ratio: 9 / 16; padding: 0.55rem; border-radius: 2.4rem; }
.device.phone .glass { border-radius: 1.9rem; }
.device.tablet { width: min(46rem, 92vw); aspect-ratio: 16 / 10; padding: 0.95rem; border-radius: 1.7rem; }
.device.tablet .glass { border-radius: 0.9rem; }

/* The two devices together, the phone in front of the tablet. */
.devices {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem); align-items: center;
  background:
    radial-gradient(ellipse 60% 55% at 32% 52%, rgba(196, 154, 72, 0.16), transparent 70%),
    var(--ink);
}
.stage { position: relative; padding-bottom: 12%; }
.stage .tablet { width: 100%; transform: perspective(1800px) rotateY(9deg) rotateX(3deg); transform-origin: left center; }
.stage .phone { position: absolute; right: -2%; bottom: 0; width: 34%; transform: rotate(-4deg); }
.devices h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.devices .lede { margin-top: 1.1rem; color: var(--dim); font-size: 1.12rem; max-width: 30rem; }
.points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.1rem; max-width: 30rem; }
.points li { padding-left: 1.4rem; position: relative; color: var(--dim); }
.points li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--candle); box-shadow: 0 0 12px var(--candle); }
.points strong { color: var(--bone); font-weight: 500; }

/* The painted steps: night and dawn are full-bleed scenes, the device sits on them. */
.step.painted {
  position: relative; isolation: isolate;
  margin-inline: calc(-1 * var(--gutter));
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
  min-height: min(52rem, 100vh);
}
.step-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.step-art .painting { width: 100%; height: 100%; object-fit: cover; }
.step.night .step-art .painting { filter: brightness(1.9) contrast(1.05); }
.step.night .step-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0, 0, 0, 0.82) 12%, rgba(0, 0, 0, 0.1) 55%, rgba(0, 0, 0, 0.45)); }
.step.dawn .step-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(18, 20, 26, 0.85) 10%, rgba(18, 20, 26, 0.15) 50%, rgba(18, 20, 26, 0.4)); }
.step.night .num, .step.night h3 { color: var(--blood); }
.step.night p, .step.dawn p { color: #d8cfc4; }
.step.painted .text { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9); }
.step.night .device { box-shadow: 0 0 0 1px #2a0d08, 0 0 90px -10px rgba(184, 52, 31, 0.35), 0 60px 120px -40px #000; }
.step.dawn .device.tablet { width: min(40rem, 90vw); }
.step.painted > .device { order: 0; justify-self: end; }
.step.tablet:not(.painted) .device.tablet { width: min(40rem, 90vw); }

/* Narrators */
.narrators { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); }
.narrator figure { margin: 0; }
.narrator .portrait { aspect-ratio: 1122 / 1402; border-radius: 0.6rem; overflow: hidden; }
.narrator .portrait img { width: 100%; height: 100%; object-fit: cover; }
.narrator h3 { font-size: 1.55rem; margin: 1.1rem 0 0.35rem; }
.narrator p { color: var(--dim); font-size: 0.98rem; }
.narrator blockquote { margin: 1rem 0 1.1rem; font-family: var(--display); font-size: 1.3rem; font-style: italic; color: var(--bone); }
.listen {
  font: 500 0.95rem var(--body); color: var(--bone);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.55rem 1.1rem 0.55rem 0.8rem; cursor: pointer;
  display: inline-flex; gap: 0.55rem; align-items: center;
}
.listen:hover { border-color: var(--candle); }
.listen .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--teal); }
.listen[aria-pressed='true'] .dot { background: var(--candle); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Roles: a wall of engravings, captions under each. */
.roles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.role { background: var(--ink); margin: 0; }
.role img { aspect-ratio: 1122 / 1402; object-fit: cover; width: 100%; filter: saturate(0.85); }
.role figcaption { padding: 0.8rem 0.9rem 1rem; }
.role .name { font-family: var(--display); font-size: 1.15rem; display: block; }
.role .camp { font-size: 0.8rem; color: var(--dim); }
.role[data-camp='loups'] .camp { color: #c2665a; }
.role[data-camp='solitaire'] .camp { color: var(--candle); }

/* The card deck: every card, filterable, each one opens to its full rule. */
.catalogue { position: relative; isolation: isolate; }
.catalogue-art { position: absolute; inset: 0 0 auto 0; height: min(40rem, 70vh); z-index: -1; overflow: hidden; }
.catalogue-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.catalogue-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(18, 20, 26, 0.35), var(--ink) 92%); }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filters button {
  font: 500 0.95rem var(--body); color: var(--dim); cursor: pointer;
  background: rgba(18, 20, 26, 0.7); border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1rem;
}
.filters button span { color: var(--candle-deep); margin-left: 0.25rem; }
.filters button[aria-pressed='true'] { color: var(--ink); background: var(--candle); border-color: var(--candle); }
.filters button[aria-pressed='true'] span { color: var(--ink); opacity: 0.7; }
.deck { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: clamp(0.8rem, 1.6vw, 1.4rem); }
.deck li[hidden] { display: none; }
.tile {
  display: block; width: 100%; padding: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit; background: var(--ink-raised);
  border: 1px solid rgba(196, 154, 72, 0.28); border-radius: 0.8rem; overflow: hidden;
  position: relative; aspect-ratio: 1122 / 1402;
  transition: transform 220ms ease, border-color 220ms ease;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 11, 14, 0.95) 8%, transparent 45%); }
.tile-name, .tile-camp { position: absolute; left: 0.85rem; right: 0.85rem; z-index: 1; }
.tile-name { bottom: 1.7rem; font-family: var(--display); font-size: 1.2rem; line-height: 1.1; }
.tile-camp { bottom: 0.7rem; font-size: 0.78rem; color: var(--dim); }
li[data-camp='loups'] .tile-camp { color: #d0766a; }
li[data-camp='solitaire'] .tile-camp { color: var(--candle); }
.tile:hover { transform: translateY(-4px); border-color: var(--candle); }
.reader {
  width: min(52rem, calc(100vw - 2rem)); padding: 0; border: 1px solid rgba(196, 154, 72, 0.4); border-radius: 1rem;
  background: var(--ink-raised); color: var(--bone);
  display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}
.reader[open] { display: grid; }
.reader::backdrop { background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(3px); }
.reader img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1122 / 1402; }
.reader-text { padding: clamp(1.4rem, 4vw, 2.6rem); display: flex; flex-direction: column; }
.reader-meta { color: var(--candle); font-size: 0.9rem; }
.reader h3 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0.4rem 0 1rem; }
.reader-rule { color: #cfd2da; font-size: 1.05rem; }
.reader form { margin-top: auto; padding-top: 2rem; }
.quietbtn { font: 500 0.95rem var(--body); color: var(--bone); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1.2rem; cursor: pointer; }
.quietbtn:hover { border-color: var(--candle); }

/* Configure a game */
.config-block { margin-top: clamp(3.5rem, 8vw, 6rem); }
.config-block:first-of-type { margin-top: 0; }
.config-block h3 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin-bottom: 1rem; }
.config-block p { color: var(--dim); max-width: 32rem; }
.scenarios { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.scenarios li { padding: 1.5rem 1.4rem 0 0; display: grid; gap: 0.5rem; align-content: start; }
.scenarios li + li { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.range { font-family: var(--display); font-size: clamp(2.4rem, 4vw, 3.4rem); font-weight: 200; color: var(--candle); line-height: 1; }
.range small { font-family: var(--body); font-size: 0.85rem; color: var(--dim); margin-left: 0.45rem; }
.scenarios strong { font-family: var(--display); font-weight: 400; font-size: 1.45rem; }
.scenarios li > span:last-child { color: var(--dim); font-size: 0.98rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.split > .device { justify-self: center; }
.device.tilt { transform: rotate(3deg); width: min(17rem, 66vw); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); margin-top: 1.8rem; }
.mode { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.6rem; align-items: center; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 1.2rem; }
.mode .device.phone { width: min(11rem, 36vw); }
.mode figcaption { color: var(--dim); }
.mode strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 0.5rem; }
.mode.dark { background: #000; border: 1px solid #2a0d08; }
.mode.dark strong { color: var(--blood); }
.mode.dark figcaption { color: #9a6b62; }
.mode.lit { background: radial-gradient(ellipse at 30% 40%, rgba(196, 154, 72, 0.2), transparent 70%), var(--ink-raised); border: 1px solid var(--line); }
.mode.lit strong { color: var(--bone); }
.rules-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.rules-block .device.tablet { width: 100%; }
table.rules { margin-top: 1.8rem; border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.rules th, .rules td { text-align: left; padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.rules thead th { font-weight: 500; color: var(--dim); font-size: 0.85rem; }
.rules tbody th { font-weight: 400; color: var(--bone); width: 44%; }
.rules td:nth-child(2) { color: var(--candle); }
.rules td:nth-child(3) { color: var(--dim); }

/* What you need */
.need { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.need div { padding: 1.4rem 1.2rem 0 0; }
.need dt { font-family: var(--display); font-size: 1.35rem; }
.need dd { margin: 0.4rem 0 0; color: var(--dim); font-size: 0.98rem; }
.closing { margin-top: clamp(3rem, 7vw, 5rem); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--gutter) 3rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between;
  color: var(--dim); font-size: 0.95rem;
}
footer nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Legal pages */
.doc { max-width: 42rem; padding: 8rem var(--gutter) 5rem; margin-inline: auto; box-sizing: content-box; }
.doc h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin-bottom: 0.6rem; }
.doc .updated { color: var(--dim); font-size: 0.95rem; margin-bottom: 2.5rem; }
.doc h2 { font-size: 1.6rem; margin: 2.6rem 0 0.7rem; font-weight: 400; }
.doc p { margin: 0 0 1rem; color: #cfd2da; }
.doc a { color: var(--candle); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .roles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .devices, .rules-block { grid-template-columns: 1fr; }
  .scenarios { grid-template-columns: 1fr 1fr; row-gap: 1.5rem; }
  .scenarios li:nth-child(3) { border-left: 0; padding-left: 0; }
  .need { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1.2rem; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; align-items: end; padding-top: 42svh; }
  /* The art keeps the top of the screen; the words sit on plain ink below it. */
  .hero-art { bottom: auto; height: 62svh; }
  .hero-art::after { background: linear-gradient(to top, var(--ink) 8%, rgba(18, 20, 26, 0.55) 45%, rgba(18, 20, 26, 0.1) 80%); }
  .hero .lead { color: #d3d6dd; }
  .hero .deal { order: 2; justify-self: start; }
  .card { --w: min(15rem, 62vw); }
  .step { grid-template-columns: 1fr; }
  .step:nth-child(even) > .device { order: 0; justify-self: start; }
  .narrators { grid-template-columns: 1fr; max-width: 26rem; gap: 3rem; }
  .step.painted { min-height: 0; }
  .step.night .step-art::after, .step.dawn .step-art::after { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.8)); }
  .modes { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .reader { grid-template-columns: 1fr; max-height: calc(100vh - 2rem); overflow: auto; }
  .reader img { max-height: 45vh; }
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage .phone { width: 40%; }
  .narrator .portrait { aspect-ratio: 4 / 3; }
  .narrator .portrait img { object-position: 50% 20%; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .need { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .need { grid-template-columns: 1fr; }
  .scenarios { grid-template-columns: 1fr; }
  .scenarios li + li { border-left: 0; padding-left: 0; }
  .mode { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-inner { transition: none; }
  .tile { transition: none; }
  .tile:hover { transform: none; }
  .listen[aria-pressed='true'] .dot { animation: none; }
}
