/* Same visual language as the rulebook: Barlow Condensed italic titles, Source Serif text,
   a light cyan header band, dark numbered section chips, cut-corner shapes, sand notes. */
:root {
  --bg: #ffffff;
  --band: #e3f2f3;
  --cream: #faf6f0;
  --ink: #12202b;
  --text: #1f1a24;
  --muted: #4f5b62;
  --cyan: #2fb6c0;
  --cyan-ink: #1b5a7e;
  --chip: #8fe3e8;
  --chip-bg: #12202b;
  --teal: #1f6b70;
  --rust: #a8431f;
  --sand: #ede0cd;
  --line: #d9c8b3;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1820;
    --band: #15232d;
    --cream: #15232d;
    --ink: #e4eef0;
    --text: #e4eef0;
    --muted: #9db2ba;
    --cyan: #3cc4ce;
    --cyan-ink: #8fe3e8;
    --chip: #8fe3e8;
    --chip-bg: #24414e;
    --teal: #2a8a90;
    --rust: #c4572e;
    --sand: #2c2620;
    --line: #2a4552;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.55 var(--serif);
}

p { margin: 0; text-wrap: pretty; }
a { color: var(--cyan-ink); }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.05; text-wrap: balance; }

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

/* header band */
.top {
  background: var(--band);
  border-bottom: 3px solid var(--cyan);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 2.25rem; height: 2.25rem; }
.brand b { display: block; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.3rem; text-transform: uppercase; line-height: 1; }
.brand small { display: block; font-family: var(--display); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan-ink); }

.lang { display: flex; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1.5px solid var(--cyan);
  border-radius: 0.5rem;
  color: var(--cyan-ink);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.lang a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* hero, like the rulebook cover */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin-block: 2rem 2.5rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--cyan);
}

/* thick cyan corner brackets, as on the rulebook cover */
.hero::before, .hero::after { content: ""; position: absolute; width: 5rem; height: 3rem; border: 0 solid var(--cyan); pointer-events: none; }
.hero::before { top: -7px; left: -7px; border-width: 3px 0 0 3px; }
.hero::after { bottom: -7px; right: -7px; border-width: 0 3px 3px 0; }

.kicker { font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cyan-ink); }

.hero h1 { margin-top: 0.4rem; font-style: italic; font-weight: 800; text-transform: uppercase; color: var(--ink); }
.hero h1 .big { display: block; font-size: clamp(3.5rem, 15vw, 7.5rem); line-height: 0.9; letter-spacing: 0.01em; }
.hero h1 .sub { display: block; font-size: clamp(1.8rem, 7vw, 3.2rem); color: var(--cyan); }

.tagline { margin-top: 0.75rem; font-style: italic; font-size: 1.3rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.tag {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  padding: 0.25rem 1.1rem 0.3rem 0.8rem;
  clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0.4rem 100%, 0 calc(100% - 0.4rem));
}

.tag.teal { background: var(--teal); }
.tag.rust { background: var(--rust); }

.hero .lead { margin-top: 1.25rem; font-size: 1.1rem; }
.mars { width: min(18rem, 70vw); justify-self: center; }

@media (min-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr) 17rem; padding: 2.5rem; }
  .mars { width: 17rem; }
}

/* numbered sections */
.sec {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cyan);
}

.sec h2 { font-style: italic; font-weight: 800; font-size: clamp(1.8rem, 6vw, 2.4rem); text-transform: uppercase; color: var(--ink); }

.num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--chip);
  background: var(--chip-bg);
  padding: 0.2rem 0.75rem 0.25rem;
  clip-path: polygon(0.5rem 0, 100% 0, 100% calc(100% - 0.5rem), calc(100% - 0.5rem) 100%, 0 100%, 0 0.5rem);
}

/* tiles, like "Matériel" */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1.5px solid var(--cyan);
  border-radius: 0.75rem;
}

.tile h3 { font-weight: 700; font-size: 1.2rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.tile .big { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--cyan-ink); }
.tile p { color: var(--muted); font-size: 1rem; }
.tile .button { margin-top: auto; align-self: flex-start; }

/* two-column panels with a coloured header, like "Ce qu'il a / Ce qu'il n'a pas" */
.panels { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

.panel { border: 1.5px solid var(--teal); border-radius: 0.75rem; overflow: hidden; background: var(--cream); display: flex; flex-direction: column; }
.panel.rust { border-color: var(--rust); }
.panel > h2 { background: var(--teal); color: #ffffff; padding: 0.8rem 1.25rem; font-style: italic; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; }
.panel.rust > h2 { background: var(--rust); }
.panel > div { padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.panel h3 { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan-ink); margin-top: 0.4rem; }
.panel .button { margin-top: auto; align-self: flex-start; }

/* notes */
.note { border-radius: 0.75rem; padding: 1rem 1.25rem; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.note.sand { background: var(--sand); }
.note.cyan { background: var(--band); }
.note .bt { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust); }
.note.cyan .bt { color: var(--cyan-ink); }

/* downloads, filled in by scripts/build-site.mjs */
.files { margin: 0.25rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }

.files a {
  display: inline-block;
  padding: 0.4rem 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--cyan-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.files a:hover { text-decoration: underline; }

.files a::before { content: "↓ "; color: var(--cyan); }
.size { color: var(--muted); font-size: 0.9rem; }

.soon {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1.5px dashed var(--muted);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.6rem 1.5rem 0.65rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 0.75rem, 100% 100%, 0 100%);
}

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

footer { margin-top: 3rem; }

footer .wrap {
  padding-block: 1rem 2rem;
  background: linear-gradient(var(--cyan), var(--cyan)) 1rem 0 / calc(100% - 2rem) 2px no-repeat;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

footer .ft { font-family: var(--display); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.8rem; }

/* home page without JS: one link per language */
.choose { display: flex; flex-wrap: wrap; gap: 1rem; }

/* drawings of automa cards in "how it plays" (printed cards stay white in dark mode) */
.illus { display: flex; align-items: center; justify-content: center; gap: 0.75rem; min-height: 10.5rem; padding: 0.25rem 0 0.5rem; }
.mcard { position: relative; width: 8.4rem; aspect-ratio: 63 / 88; flex-shrink: 0; background: #ffffff; color: #1f1a24; border: 1px solid #bdbdbd; border-radius: 0.4rem; padding: 0.3rem; display: flex; flex-direction: column; gap: 0.2rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); font-family: var(--text); font-size: 0.6rem; line-height: 1.25; overflow: hidden; }
.mcard .kb { display: flex; flex-shrink: 0; height: 1.5rem; color: #ffffff; clip-path: polygon(0 0, calc(100% - 0.4rem) 0, 100% 0.4rem, 100% 100%, 0.25rem 100%, 0 calc(100% - 0.25rem)); }
.mcard .kb i { width: 1.15rem; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.26); font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.9rem; }
.mcard .kb span { display: flex; align-items: center; padding: 0 0.3rem; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.72rem; text-transform: uppercase; white-space: nowrap; }
.mcard .mt { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 600; font-size: 0.45rem; letter-spacing: 0.14em; text-transform: uppercase; color: #1b5a7e; border-bottom: 1px solid #2fb6c0; }
.mcard .au { border-radius: 0.2rem; padding: 0.3rem; font-size: 0.6rem; }
.mcard .sp { flex: 1; }
.mcard .cb { display: flex; align-items: center; gap: 0.15rem; border: 1px solid #2fb6c0; border-radius: 0.2rem; padding: 0.15rem 0.25rem; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.6rem; min-width: 0; overflow: hidden; text-transform: uppercase; white-space: nowrap; }
.mcard .cb b { margin-left: auto; display: flex; align-items: center; font-style: normal; }
.mcard .jo { border-top: 1px dashed #b9a48c; padding-top: 0.15rem; font-size: 0.5rem; color: #33302e; }
.mcard .jo b { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; background: #e2be2c; padding: 0 0.2rem; }
.mcard .pi { vertical-align: -1px; }
.cubes { display: flex; align-items: center; gap: 0.3rem; }
.cubes .arr { font-family: var(--display); font-weight: 800; font-size: 1.8rem; color: var(--cyan-ink); margin: 0 0.2rem; }
.cubes .lbl { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.6rem; text-transform: uppercase; color: var(--ink); }
.illus .params { display: flex; flex-direction: column; gap: 0.5rem; width: 7rem; }
.illus .params span { display: flex; align-items: center; gap: 0.4rem; }
.illus .params i { flex: 1; height: 0.45rem; border-radius: 0.3rem; background: linear-gradient(90deg, var(--cyan) var(--w), var(--line, #cfe0e2) var(--w)); }
.illus .engine path { stroke: var(--ink); }

/* illustrated example round */
.round { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); counter-reset: step; }
.round li { background: var(--bg); border-radius: 0.6rem; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-align: center; }
.round li p { font-size: 0.95rem; color: var(--muted); }
.round .rh { font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-ink); }
.round .duo { display: flex; justify-content: center; gap: 0.5rem; }
.round .rp { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.round .who { font-family: var(--display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.round .rr { display: flex; align-items: center; justify-content: center; gap: 0.3rem; flex-wrap: wrap; min-height: 2.6rem; }
.round .cu { display: inline-flex; }
.round .out .cu { opacity: 0.45; }
.round .cu.new { border-radius: 0.35rem; outline: 2px solid var(--cyan); outline-offset: 1px; }
.round .arr, .round .plus { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--cyan-ink); }
.round .out { font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: var(--rust); display: inline-flex; align-items: center; gap: 0.2rem; }
.round .eng .up { stroke: var(--cyan); stroke-width: 2; }
.round .mcard { width: 6.6rem; transform: rotate(3deg); }
.round .mcard.pcard { transform: rotate(-3deg); }
/* the automa card component (app/components/automa-card.js): the hand-drawn card inside is its
   no-JS fallback, so the rotation goes on the component */
automa-card { display: inline-block; position: relative; flex-shrink: 0; vertical-align: top; }
.round automa-card > .mcard, automa-card > .mcard { transform: none; }
.round automa-card { --automa-card-width: 6.6rem; transform: rotate(3deg); }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.95rem; text-transform: uppercase; color: #ffffff; padding: 0.2rem 0.7rem 0.25rem 0; clip-path: polygon(0 0, calc(100% - 0.5rem) 0, 100% 0.5rem, 100% 100%, 0 100%); }
.chip i { background: rgba(0, 0, 0, 0.26); padding: 0.2rem 0.5rem 0.25rem; margin: -0.2rem 0 -0.25rem; }
.mcard.pcard .cp { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; font-size: 0.5rem; line-height: 1.2; padding: 0 0.1rem; }
.mcard.pcard .cp b { font-family: var(--display); font-weight: 700; font-size: 0.42rem; letter-spacing: 0.16em; text-transform: uppercase; color: #6e625a; }
.mcard.pcard .bn { background: #12202b; color: #ffffff; border-radius: 0.2rem; padding: 0.2rem 0.25rem; font-size: 0.48rem; display: flex; gap: 0.25rem; align-items: center; }
.mcard.pcard .bn b { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; color: #e2be2c; }
.mcard.pcard .au { font-size: 0.46rem; line-height: 1.2; padding: 0.2rem; }
.mcard.pcard .au .tg { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 0.5rem; text-transform: uppercase; background: #12202b; color: #8fe3e8; padding: 0 0.25rem; margin-right: 0.2rem; }

/* what you need to play */
.need { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; color: var(--muted); }
.need b { color: var(--ink); }
.cubes { flex-wrap: wrap; justify-content: center; }
.cubes .five { display: inline-flex; flex-wrap: wrap; width: 5.4rem; gap: 0.15rem; justify-content: center; }

/* a tile title with its number on the same line */
.tile h3.count { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }

/* justified body text, with hyphenation (the pages declare their language) */
.tile p, .note p:not(.bt), .lead, .need li, .round li p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.round li p { text-align: center; }

/* "versus the official solo" comparison */
.vs-lead { font-size: 1.1rem; margin-bottom: 1rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.vs-wrap { overflow-x: auto; }
.vs { width: 100%; border-collapse: separate; border-spacing: 0; border: 1.5px solid var(--cyan); border-radius: 0.75rem; overflow: hidden; }
.vs th, .vs td { padding: 0.7rem 0.9rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.vs thead th { border-top: none; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 1.15rem; text-transform: uppercase; color: var(--muted); }
.vs thead th.us { color: var(--bg); background: var(--teal); }
.vs tbody th { font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan-ink); width: 18%; }
.vs td { color: var(--muted); width: 41%; }
.vs td:last-child { color: var(--ink); background: var(--band); font-weight: 600; }
@media (max-width: 600px) {
  .vs, .vs tbody, .vs tr, .vs th, .vs td { display: block; width: auto; }
  .vs thead { display: none; }
  .vs tbody th { width: auto; border-top: 1.5px solid var(--cyan); background: transparent; }
  .vs tbody tr:first-child th { border-top: none; }
  .vs td { width: auto; }
  .vs td { border-top: none; padding-top: 0.2rem; }
  .vs td::before { content: attr(data-l); display: block; font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .vs td:last-child { border-radius: 0.5rem; margin: 0 0.6rem 0.6rem; }
}
