/* Ad Absurdum - site style.
   Paper-white line art by day, white-on-black "night mode" for the web games,
   yellow highlighter like the in-game hints. */

:root {
  --ink: #111;
  --paper: #fff;
  --soft: #f3f1ec;
  --muted: #666;
  --accent: #ffcc1f;
  --night: #000;
  --night-ink: #fff;
  --line: 3px;
  --radius: 16px;
  --max: 1160px;
  --font: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
/* Dark theme: the sun/moon button in the header sets <html data-theme="dark"> (remembered in localStorage) */
html[data-theme="dark"] {
  --ink: #f2f2f2;
  --paper: #0d0d0d;
  --soft: #1b1b1b;
  --muted: #a9a9a9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 18px;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.section { padding: 72px 0; }
.section--soft { background: var(--soft); }
.section--night { background: var(--night); color: var(--night-ink); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46em; }
.section--night .lead { color: #bbb; }
.mark { background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%); }
.todo { border: 2px dashed #d9a400; background: #fff8dc; color: #6b5200; padding: 2px 8px; border-radius: 8px; font-size: .8rem; font-weight: 700; }
.section--night .todo { background: #2a2300; color: var(--accent); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .55em 1.4em .65em;
  border: var(--line) solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  font: 800 1.05rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: #111; }
.btn--small { padding: .35em 1em .45em; font-size: .95rem; }
.section--night .btn, .btn--night { background: var(--night); color: var(--night-ink); border-color: var(--night-ink); }
.section--night .btn:hover, .btn--night:hover { background: var(--night-ink); color: var(--night); }
.section--night .btn--accent { background: var(--accent); color: var(--ink); border-color: var(--accent); }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: var(--line) solid var(--ink);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: .02em; }
.logo svg { width: 40px; height: 40px; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav > a, .nav .dd > .dd-top {
  font: 700 1rem var(--font); text-decoration: none; color: var(--ink);
  background: none; border: 0; padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.nav > a:hover, .nav .dd > .dd-top:hover, .nav .dd.open > .dd-top, .nav a[aria-current="page"] { background: var(--soft); }
.nav .dd > .dd-top { display: inline-block; }
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--radius);
  padding: 8px; display: none; box-shadow: 6px 6px 0 var(--ink);
}
.dd.open .dd-menu { display: block; }
/* invisible bridge over the 8px gap, so the menu does not close while the mouse moves down to it */
.dd-menu::before { content: ""; position: absolute; left: -2px; right: -2px; top: -12px; height: 12px; }
.dd-menu a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.dd-menu a:hover { background: var(--soft); }
.dd-menu .dd-more { border-top: 2px solid var(--soft); margin-top: 6px; padding-top: 12px; font-weight: 800; }
.card:target { box-shadow: 0 0 0 4px var(--accent); }
.dd-menu small { display: block; color: var(--muted); font-weight: 400; }
.nav-toggle { display: none; margin-left: auto; background: none; border: var(--line) solid var(--ink); border-radius: 10px; padding: 6px 10px; font: 800 1rem var(--font); cursor: pointer; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
         background: var(--paper); border-bottom: var(--line) solid var(--ink); padding: 10px 20px 20px; }
  .nav.open { display: flex; }
  .dd-menu { position: static; box-shadow: none; display: block; border: 0; padding: 0 0 0 14px; }
  .dd > .dd-top { display: block; }
  .dd-menu::before { display: none; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 80px 0 64px; border-bottom: var(--line) solid var(--ink); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero-art { width: 100%; max-width: 460px; justify-self: end; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } .hero-art { justify-self: center; max-width: 320px; } }

.page-head { padding: 64px 0 40px; border-bottom: var(--line) solid var(--ink); }
.page-head--night { background: var(--night); color: var(--night-ink); border-bottom-color: var(--night); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: inherit; }

/* ------------------------------------------------------------------ cards */
.grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  border: var(--line) solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background: var(--paper); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.card--static, .card--static:hover, .section--night .card--static:hover { transform: none; box-shadow: none; cursor: default; }  /* preview only, not a link */
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--night); margin: 12px 12px 0; border: 6px solid var(--accent); border-radius: 12px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { color: var(--muted); margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; }
.chip { border: 2px solid currentColor; border-radius: 999px; padding: 1px 10px; font-weight: 700; }
.card-body .btn { align-self: flex-start; margin-top: auto; }
.section--night .card { background: var(--night); border-color: var(--night-ink); color: var(--night-ink); }
.section--night .card:hover { box-shadow: 6px 6px 0 var(--accent); }
.section--night .card-body p { color: #bbb; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.feature-media { border: var(--line) solid var(--ink); border-radius: var(--radius); aspect-ratio: 16 / 9; background: var(--soft);
  display: grid; place-items: center; color: var(--muted); font-weight: 700; text-align: center; padding: 20px; }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } }
.badge { display: inline-block; color: #111; background: var(--accent); border: var(--line) solid var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: .9rem; margin-bottom: 14px; }

/* ------------------------------------------------------------------ language wall (Hugo) */
.wall-tools { display: flex; gap: 12px; align-items: center; margin: 20px 0 28px; flex-wrap: wrap; }
.wall-tools input { font: 600 1rem var(--font); padding: 10px 14px; border: var(--line) solid var(--ink); border-radius: 12px; min-width: 260px; }
.wall { columns: 4 240px; column-gap: 20px; }
.tile { break-inside: avoid; margin-bottom: 20px; border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 18px; background: var(--paper); }
.tile-lang { font-weight: 800; font-size: 1.2rem; }
.tile-who { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.tile-quote { font-size: 1.05rem; }
.tile-media { aspect-ratio: 4 / 5; background: var(--night); color: var(--night-ink); border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; font-weight: 700; }
.tile--audio .tile-media { aspect-ratio: 3 / 1; background: var(--soft); color: var(--ink); }
.st { padding: 0 6px; border-radius: 6px; }
.st--final { background: #d8f5d0; color: #1f6b12; }
.st--review { background: #fff1c2; color: #7a5a00; }
.st--progress { background: #e6e6e6; color: #555; }
.step-no { width: 44px; height: 44px; border-radius: 50%; color: #111; background: var(--accent); border: var(--line) solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; margin-bottom: 12px; }
.tile-type { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ------------------------------------------------------------------ team */
.team { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.member { border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 22px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; border: var(--line) solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.8rem; background: var(--accent); color: #111; margin-bottom: 14px; }
.member .role { font-weight: 700; margin-bottom: 8px; }
.member p { color: var(--muted); font-size: .95rem; }
.member .avail { font-size: .9rem; }

/* ------------------------------------------------------------------ prose (legal etc.) */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--night); color: #ccc; padding: 56px 0 30px; margin-top: 0; }
.site-footer .cols { display: grid; gap: 30px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.site-footer a { color: #ccc; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: var(--accent); }
.site-footer .logo { color: #fff; margin-bottom: 10px; }
.site-footer .bottom { border-top: 1px solid #333; margin-top: 36px; padding-top: 18px; font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ play page */
body.play { background: #000; color: #fff; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.playbar { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 50px; border-bottom: 2px solid #333; font-size: .95rem; flex: none; }
.playbar a { color: #fff; text-decoration: none; font-weight: 700; }
.playbar a:hover { color: var(--accent); }
.playbar .title { font-weight: 800; }
.playbar .grow { flex: 1; }
.playbar .promo { color: #aaa; font-weight: 600; }
.playbar button { font: 700 .9rem var(--font); background: #000; color: #fff; border: 2px solid #fff; border-radius: 10px; padding: 5px 12px; cursor: pointer; }
.playbar button:hover { background: #fff; color: #000; }
.play-frame { flex: 1; width: 100%; border: 0; display: block; background: #000; }
@media (max-width: 640px) { .playbar .promo { display: none; } }

/* ------------------------------------------------------------------ theme switch + dark tweaks */
.theme-toggle { margin-left: 8px; width: 42px; height: 42px; border-radius: 50%; border: var(--line) solid var(--ink); background: var(--paper); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .2s; }
.theme-toggle:hover { transform: rotate(-20deg); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (max-width: 820px) { .nav-toggle { margin-left: auto; } .theme-toggle { margin-left: 0; } }

.hero-art > g { fill: var(--paper); stroke: var(--ink); }
.logo svg rect { stroke: var(--ink); stroke-width: 2; }
html[data-theme="dark"] .mark { background: var(--accent); color: #111; padding: 0 .12em; border-radius: 4px; }
html[data-theme="dark"] .todo { background: #2a2300; color: var(--accent); }
.wall-tools input { background: var(--paper); color: var(--ink); }
.logo { white-space: nowrap; }
@media (max-width: 420px) { .logo { font-size: 1.1rem; } .logo svg { width: 34px; height: 34px; } .site-header .wrap { gap: 12px; } }

/* ------------------------------------------------------------------ newsletter */
.newsletter { border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 24px; }
.newsletter label { display: block; font-weight: 800; margin-bottom: 10px; }
.newsletter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.newsletter input { flex: 1 1 220px; font: 600 1rem var(--font); padding: 12px 14px; border: var(--line) solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); }
.newsletter input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.newsletter-msg { margin: 12px 0 0; font-weight: 700; min-height: 1.4em; }
.newsletter-msg.ok { color: #2e8b1f; }
.newsletter-msg.err { color: #d23b2e; }
html[data-theme="dark"] .newsletter-msg.ok { color: #7bd96a; }
.newsletter-note { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
