/* sfxrpg.com — the site's own pages (home, /tools/).
 *
 * SFX! means sound effects, so the site is a comic page: newsprint paper with
 * Ben-Day dots, ink panels with a hard offset shadow, caption boxes, starbursts
 * and a speech balloon. Bangers is for the sound effects only (headings,
 * buttons, captions); everything meant to be read is a plain sans.
 *
 * The site sits outside the machine metaphor (docs/audits/2026-10-machine,
 * D7) but keeps that audit's two rules for it: no glow (shadows here are hard
 * printed offsets, never a blur of light) and nothing moves for someone who
 * has asked for less motion.
 *
 * Not used by the Atomic Tomorrow tools:those wear atomic-ui and its machine
 * laws, and this stylesheet stops at the panel that points at the rack.
 * Rollem (tools/rollem/) is built in its own repo and copies the site's top
 * bar; a change to the masthead here wants the same change there.
 */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
  --ink: #111;
  --paper: #f3ead3;
  --paper-deep: #e8dcbc;
  --caption: #ffe45c;      /* narration-box yellow */
  --pow: #e8261f;          /* the red of the covers' lettering */
  --zap: #19b5c9;          /* Zap! teal */
  --kapow: #ffb800;
  --argh: #c4141a;
  --zounds: #8e1b22;
  --night: #100e26;        /* the Atomic Tomorrow panel's sky */
  --atomic-cyan: #7fe8ff;
  --shadow: 6px 6px 0 var(--ink);
  --border: 4px solid var(--ink);
  --measure: 62ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font: 400 17px/1.6 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(0,0,0,.09) 1.1px, transparent 1.6px);
  background-size: 9px 9px;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

h1, h2, h3, .sfx {
  font-family: 'Bangers', 'Impact', sans-serif;
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1;
  margin: 0;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---- masthead ------------------------------------------------------------ */
.masthead {
  background: var(--ink);
  color: #fff;
  border-bottom: 6px solid var(--pow);
  position: sticky; top: 0; z-index: 10;
}
.masthead .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 42px; width: auto; }
.brand span { font-family: 'Bangers', sans-serif; font-size: 30px; letter-spacing: .06em; color: var(--caption); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  font-family: 'Bangers', sans-serif; font-size: 22px; letter-spacing: .06em;
  text-decoration: none; padding: 6px 14px; border-radius: 2px;
}
.site-nav a:hover, .site-nav a:focus-visible { background: var(--caption); color: var(--ink); outline: none; }
.site-nav a[aria-current="page"] { color: var(--caption); }
.site-nav a[aria-current="page"]:hover { color: var(--ink); }
.site-nav .buy { background: var(--pow); color: #fff; border: 3px solid #fff; margin-left: 8px; }
.site-nav .buy:hover, .site-nav .buy:focus-visible { background: #fff; color: var(--pow); }

.menu-toggle {
  display: none; margin-left: auto;
  font-family: 'Bangers', sans-serif; font-size: 22px; letter-spacing: .06em;
  background: var(--caption); color: var(--ink); border: 3px solid #fff; padding: 4px 14px; cursor: pointer;
}

@media (max-width: 820px) {
  .brand span { display: none; }
  .menu-toggle { display: block; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding: 0 0 16px; margin: 0; }
  .site-nav.open { display: flex; }
  .site-nav .buy { margin: 8px 0 0; text-align: center; }
}

/* ---- panels, captions, buttons ------------------------------------------- */
.panel { background: #fff; border: var(--border); box-shadow: var(--shadow); position: relative; }

.caption {
  display: inline-block;
  background: var(--caption);
  border: 3px solid var(--ink);
  padding: 4px 12px;
  font-family: 'Bangers', sans-serif; font-size: 20px; letter-spacing: .06em; line-height: 1.2;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Bangers', sans-serif; font-size: 22px; letter-spacing: .06em; line-height: 1.2;
  text-decoration: none; color: var(--ink);
  background: var(--caption);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 18px;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover, .btn:focus-visible,
a:hover > * > .btn, a:focus-visible > * > .btn, a:hover > .btn, a:focus-visible > .btn {
  transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); outline: none;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn.red { background: var(--pow); color: #fff; }
.btn.white { background: #fff; }

a.panel { text-decoration: none; }
a.panel:focus-visible { outline: 4px solid var(--pow); outline-offset: 4px; }

/* ---- starburst ------------------------------------------------------------ */
.burst { position: relative; display: grid; place-items: center; text-align: center; }
.burst > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.burst > svg polygon { stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.burst > .burst-text { position: relative; font-family: 'Bangers', sans-serif; letter-spacing: .05em; line-height: 1.05; }

/* ---- speech balloon ------------------------------------------------------- */
.balloon {
  position: relative;
  background: #fff;
  border: var(--border);
  border-radius: 50%;
  padding: 100px 140px 104px;   /* an ellipse's corners are empty: keep text off them */
}
/* the tail: an ink wedge with a white wedge inside it, both reaching up past
   the balloon's edge so the outline breaks where the tail joins */
.balloon::after, .balloon::before { content: ''; position: absolute; border-style: solid; }
.balloon::before { border-width: 62px 0 0 46px; border-color: var(--ink) transparent transparent; left: calc(30% - 6px); bottom: -52px; }
.balloon::after  { border-width: 50px 0 0 34px; border-color: #fff transparent transparent; left: 30%; bottom: -40px; }

/* ---- sections ------------------------------------------------------------- */
section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(44px, 6vw, 72px); text-shadow: 3px 3px 0 #fff; -webkit-text-stroke: 1px var(--ink); }
.section-head p { margin: 0; max-width: var(--measure); font-size: 19px; }

/* ---- home: splash --------------------------------------------------------- */
.hero { padding: 48px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1, .page-head h1 {
  font-size: clamp(64px, 9vw, 128px);
  -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--ink);
}
.hero h1 { color: var(--pow); }
.hero .lede { font-size: 21px; max-width: 36ch; margin: 22px 0 30px; }
.hero .actions { display: flex; gap: 16px; flex-wrap: wrap; }

.bursts { display: flex; margin: 18px 0 0 -10px; }
.bursts .burst { width: 180px; height: 130px; }
.bursts .burst:nth-child(1) { transform: rotate(-8deg); }
.bursts .burst:nth-child(2) { transform: rotate(5deg) translateY(10px); margin-left: -22px; }
.bursts .burst:nth-child(3) { transform: rotate(-3deg); margin-left: -22px; }
.bursts .burst-text { font-size: 34px; }
.bursts .burst:nth-child(3) .burst-text { color: #fff; }

/* the four covers, stacked like comics on a table: each sits lower than the
   one behind it, so every title shows */
.fan { position: relative; height: 560px; }
.fan a {
  position: absolute; width: 52%; aspect-ratio: 816 / 1056;
  border: var(--border); box-shadow: var(--shadow); background: #000;
  transition: translate .15s;
}
.fan img { width: 100%; height: 100%; object-fit: cover; }
.fan a:nth-child(1) { left: 2%;  top: 0;     transform: rotate(-7deg); }
.fan a:nth-child(2) { left: 16%; top: 48px;  transform: rotate(-2deg); }
.fan a:nth-child(3) { left: 30%; top: 96px;  transform: rotate(3deg); }
.fan a:nth-child(4) { left: 44%; top: 144px; transform: rotate(8deg); }
.fan a:hover, .fan a:focus-visible { z-index: 2; translate: 0 -14px; outline: none; }

/* ---- home: the games ------------------------------------------------------ */
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.game { display: flex; flex-direction: column; }
.game .cover { aspect-ratio: 816 / 1056; overflow: hidden; border-bottom: var(--border); background: #000; }
.game .cover img { width: 100%; height: 100%; object-fit: cover; }
.game .body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game .caption { position: absolute; top: -18px; left: 14px; transform: rotate(-3deg); z-index: 1; }
.game:nth-child(even) .caption { transform: rotate(2deg); left: auto; right: 14px; }
.game h3 { font-family: 'Source Sans 3', system-ui, sans-serif; font-weight: 700; font-size: 19px; letter-spacing: 0; line-height: 1.25; }
.game p { margin: 0; font-size: 16px; }
.game .btn { margin-top: auto; align-self: flex-start; font-size: 19px; padding: 6px 14px; }
.game.kapow  .caption { background: var(--kapow); }
.game.zap    .caption { background: var(--zap); }
.game.argh   .caption { background: var(--argh); color: #fff; }
.game.zounds .caption { background: var(--zounds); color: #fff; }

/* ---- tool panels (home teaser and /tools/) --------------------------------- */
/* The Atomic Tomorrow panel is a window into the rack's world, so its inside
   is the night sky of the ATA logo, not newsprint. It only points at the rack;
   past the click everything is atomic-ui. */
.tool-ata {
  color: #fff;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(127,232,255,.18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(255,79,160,.18), transparent 55%),
    var(--night);
}
.tool-ata h2, .tool-ata h3 { color: var(--atomic-cyan); }
.tool-ata p { color: #dfe7ff; }
.tool-ata:focus-visible { outline-color: var(--caption); }

.dice { display: grid; grid-template-columns: repeat(2, 62px); gap: 6px; }
.dice span {
  font-family: 'Bangers', sans-serif; font-size: 38px;
  border: 4px solid var(--ink); border-radius: 12px; width: 62px; height: 62px;
  display: grid; place-items: center; background: var(--caption);
}
.dice span:nth-child(2) { background: #fff; transform: rotate(12deg); }
.dice span:nth-child(3) { background: var(--zap); transform: rotate(-8deg); }
.dice span:nth-child(4) { background: var(--pow); color: #fff; transform: rotate(6deg); }
.dice.row { grid-template-columns: repeat(4, 54px); gap: 10px; }
.dice.row span { width: 54px; height: 54px; font-size: 32px; border-radius: 10px; }

.tool-rollem h2, .tool-rollem h3 { color: var(--pow); -webkit-text-stroke: 1px var(--ink); }

/* home: two tools side by side */
.tools-strip { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.tools-strip .panel { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; padding: 26px; }
.tools-strip h3 { font-size: 40px; margin-bottom: 8px; }
.tools-strip p { margin: 0 0 14px; }
.tools-strip .art { aspect-ratio: 1; display: grid; place-items: center; }
.see-all { margin: 26px 0 0; text-align: right; }

/* /tools/: one wide panel over two */
.page-head { padding: 48px 0 8px; }
.page-head h1 { color: var(--caption); }
.page-head p { font-size: 21px; max-width: 48ch; margin: 16px 0 0; }

.comic-page { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.comic-page .wide { grid-column: 1 / -1; }
.comic-page .caption { position: absolute; top: -18px; transform: rotate(-2deg); color: var(--ink); }

.rack-panel { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: center; padding: 40px; }
.rack-panel .caption { left: 22px; }
.rack-panel h2 { font-size: clamp(40px, 5vw, 62px); margin-bottom: 12px; }
.rack-panel p { margin: 0 0 18px; font-size: 18px; max-width: 54ch; }
.machines { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.machines li {
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid rgba(127,232,255,.45); color: #bff3ff; padding: 3px 10px; border-radius: 3px;
}

.tool-card { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.tool-card .caption { right: 22px; transform: rotate(2deg); }
.tool-card h2 { font-size: 52px; }
.tool-card p { margin: 0; font-size: 18px; }
.tool-card .btn { align-self: flex-start; margin-top: auto; }

.next-issue {
  border: 4px dashed var(--ink); background: var(--paper-deep);
  display: grid; place-items: center; text-align: center; padding: 30px; min-height: 260px;
}
.next-issue .burst { width: 280px; height: 170px; margin: 0 auto; }
.next-issue .burst-text { font-size: 30px; }
.next-issue p { margin: 10px auto 0; font-size: 16px; max-width: 34ch; }

/* ---- about ---------------------------------------------------------------- */
.about .balloon { max-width: 1000px; margin: 0 auto; font-size: 19px; }
.about .balloon p { margin: 0 0 14px; }
.about .balloon p:last-child { margin: 0; }
.about .byline { max-width: 1000px; margin: 60px auto 0; padding-left: 22%; }

/* ---- footer --------------------------------------------------------------- */
.colophon {
  background: var(--ink); color: #cfc6ad; border-top: 6px solid var(--pow);
  padding: 32px 0; margin-top: 40px; font-size: 15px;
}
.colophon .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.colophon a { color: var(--caption); }

/* ---- narrower screens ----------------------------------------------------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .fan { height: 480px; max-width: 520px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .tools-strip { grid-template-columns: 1fr; }
  .balloon { padding: 56px 56px 60px; border-radius: 48px; }
}
@media (max-width: 860px) {
  .comic-page { grid-template-columns: 1fr; row-gap: 40px; }
  .rack-panel { grid-template-columns: 1fr; padding: 40px 24px 32px; }
  .rack-panel img { max-width: 200px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .games-grid { grid-template-columns: 1fr; }
  .tools-strip .panel { grid-template-columns: 1fr; }
  .tools-strip .art { max-width: 150px; }
  .bursts .burst { width: 130px; height: 100px; }
  .bursts .burst-text { font-size: 26px; }
  .fan { height: 400px; }
  .balloon { padding: 40px 30px; border-radius: 40px; }
  .about .byline { padding-left: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .fan a:hover, .fan a:focus-visible { translate: none; }
}
