/* Pawnopolis — the game's paper-and-pen look. Fonts are the game's own (OFL, see assets/fonts). */
@font-face { font-family: "Doodle Heading"; src: url("assets/fonts/DoodleHeading-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("assets/fonts/PatrickHand-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --paper: #fbf4e2;
  --paper-deep: #f3e8cc;
  --card: #fffaf0;
  --ink: #26315c;
  --ink-soft: #4d5683;
  --mustard: #f2c14e;
  --mustard-deep: #d9a12c;
  --red: #d8483a;
  --tape: rgba(236, 222, 170, .78);
  --shadow: 0 2px 0 rgba(38, 49, 92, .9);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint pencil grain and a dotted page grid */
  background-image:
    radial-gradient(rgba(38, 49, 92, .09) 1px, transparent 1.2px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .15 0 0 0 0 .19 0 0 0 0 .36 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 26px 26px, 220px 220px;
  color: var(--ink);
  font: 400 clamp(19px, 1.25vw + 14px, 22px)/1.45 "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 4px; }

h1, h2, h3 { font-family: "Doodle Heading", "Patrick Hand", sans-serif; font-weight: 900; line-height: .98; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(46px, 7.4vw, 104px); }
h2 { font-size: clamp(38px, 5vw, 66px); }
h3 { font-size: clamp(25px, 2.1vw, 31px); }
p { margin: 0; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Highlighter swipe under a word, like the side to move in the game */
.hl { background: linear-gradient(transparent 52%, rgba(242, 193, 78, .85) 52%, rgba(242, 193, 78, .85) 90%, transparent 90%); padding: 0 .08em; }

/* ---------- header ---------- */
.site-head { padding: 18px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 900 28px/1 "Doodle Heading", sans-serif; }
.brand img { width: 46px; height: 46px; border-radius: 11px; border: 2.5px solid var(--ink); transform: rotate(-4deg); }
.site-nav { display: flex; gap: clamp(12px, 2vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline wavy var(--red); }
@media (max-width: 640px) { .site-nav { display: none; } }

/* ---------- pen-cut paper card ---------- */
.paper {
  position: relative;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px 6px 16px 8px / 8px 16px 6px 14px;
  box-shadow: 4px 5px 0 rgba(38, 49, 92, .9);
}
.tape::before {
  content: ""; position: absolute; top: -14px; left: 50%; width: 92px; height: 26px; translate: -50% 0; rotate: -4deg;
  background: var(--tape); border-left: 2px dashed rgba(0,0,0,.06); border-right: 2px dashed rgba(0,0,0,.06);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* ---------- chunky button / store tag ---------- */
.store {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--paper);
  border: 3px solid var(--ink); border-radius: 12px 8px 14px 6px;
  padding: 10px 22px 10px 16px; text-decoration: none;
  box-shadow: 4px 5px 0 var(--mustard-deep);
}
.store svg { width: 30px; height: 30px; flex: none; }
.store span { display: grid; line-height: 1.05; }
.store small { font-size: 15px; opacity: .85; }
.store strong { font: 900 26px/1 "Doodle Heading", sans-serif; letter-spacing: .01em; }
.store[aria-disabled="true"] { cursor: default; }
a.store:hover { color: var(--paper); translate: -1px -1px; box-shadow: 5px 6px 0 var(--mustard-deep); }

.stamp {
  display: inline-block; font: 900 19px/1 "Doodle Heading", sans-serif; text-transform: uppercase; letter-spacing: .06em;
  color: var(--red); border: 3px solid var(--red); border-radius: 6px; padding: 6px 10px 4px; rotate: -6deg;
  background: rgba(255, 250, 240, .7);
}

/* ---------- hero ---------- */
.hero { padding: clamp(24px, 5vw, 64px) 0 clamp(56px, 8vw, 110px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 .small { display: block; font-size: .44em; color: var(--ink-soft); margin-top: .35em; line-height: 1.05; }
.hero .lead { margin-top: 26px; max-width: 34ch; font-size: 1.12em; }
.hero .cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; }
.hero .free { font-size: .95em; color: var(--ink-soft); max-width: 22ch; line-height: 1.25; }
.phone {
  position: relative; justify-self: center; width: min(330px, 78vw); padding: 10px;
  background: var(--ink); border-radius: 46px; rotate: 3deg;
  box-shadow: 10px 12px 0 rgba(38, 49, 92, .18);
}
.phone img { border-radius: 37px; width: 100%; height: auto; }
.phone .stamp { position: absolute; left: -34px; bottom: 60px; font-size: 24px; }
.phone.tape::before { top: -12px; width: 110px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .phone { rotate: 2deg; } .phone .stamp { left: -10px; } }

/* doodle underline drawn under section headings */
.section-head { display: grid; gap: 14px; margin-bottom: clamp(30px, 4vw, 52px); max-width: 760px; }
.section-head h2::after {
  content: ""; display: block; height: 14px; width: min(260px, 70%); margin-top: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 14'%3E%3Cpath d='M3 9 C 40 3, 80 12, 120 7 S 200 4, 257 8' fill='none' stroke='%23d8483a' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left / 100% 100%;
}
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: rgba(243, 232, 204, .55); border-block: 3px dashed rgba(38, 49, 92, .18); }

/* ---------- characters ---------- */
.cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); list-style: none; padding: 0; margin: 0; }
.cast li { padding: 22px 22px 24px; display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; }
.cast li:nth-child(odd) { rotate: -.8deg; }
.cast li:nth-child(even) { rotate: .9deg; }
.cast img { width: 112px; height: 112px; object-fit: contain; image-rendering: auto; }
.cast .role { font-size: .82em; color: var(--ink-soft); }
.cast h3 { margin: 2px 0 8px; }
.cast .power { font-size: .9em; line-height: 1.3; }
.cast .power b { font-family: "Doodle Heading", sans-serif; font-weight: 900; letter-spacing: .01em; }
.cast-note { margin-top: 30px; color: var(--ink-soft); }
@media (max-width: 980px) { .cast { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cast { grid-template-columns: 1fr; } .cast li { grid-template-columns: 92px 1fr; } .cast img { width: 92px; height: 92px; } }

/* ---------- worlds: postcards ---------- */
.worlds { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(26px, 3vw, 40px) clamp(18px, 2.4vw, 30px); list-style: none; padding: 0; margin: 0; }
.postcard { padding: 10px 10px 16px; transition: rotate .25s ease, translate .25s ease; }
.postcard:nth-child(4n+1) { rotate: -2deg; } .postcard:nth-child(4n+2) { rotate: 1.4deg; }
.postcard:nth-child(4n+3) { rotate: -.8deg; } .postcard:nth-child(4n) { rotate: 2.2deg; }
.postcard:hover { rotate: 0deg; translate: 0 -4px; }
.postcard img { width: 100%; aspect-ratio: 506 / 294; object-fit: cover; border: 2px solid var(--ink); border-radius: 4px; }
.postcard h3 { margin: 12px 4px 4px; font-size: 26px; }
.postcard p { margin: 0 4px; font-size: .86em; line-height: 1.28; color: var(--ink-soft); }
.postcard .stamp { position: absolute; right: 8px; top: 10px; font-size: 15px; rotate: 8deg; background: var(--card); }
@media (max-width: 1000px) { .worlds { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .worlds { grid-template-columns: 1fr; } }
.worlds-note { margin-top: 36px; max-width: 62ch; }

/* ---------- screens ---------- */
.screens { display: flex; gap: clamp(16px, 2.6vw, 34px); overflow-x: auto; padding: 12px 4px 26px; scroll-snap-type: x mandatory; list-style: none; margin: 0; }
.screens li { flex: 0 0 min(230px, 62vw); scroll-snap-align: center; }
.screens .phone { width: 100%; padding: 7px; border-radius: 30px; rotate: 0deg; box-shadow: 6px 7px 0 rgba(38, 49, 92, .16); }
.screens .phone img { border-radius: 24px; }
.screens li:nth-child(odd) .phone { rotate: -1.6deg; }
.screens li:nth-child(even) .phone { rotate: 1.4deg; translate: 0 14px; }
.screens figcaption { text-align: center; margin-top: 18px; font-size: .9em; }

/* ---------- ways to play ---------- */
.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.note { padding: 28px 26px 30px; }
.note:nth-child(1) { rotate: -1deg; } .note:nth-child(3) { rotate: 1deg; }
.note h3 { margin-bottom: 14px; }
.note ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.note li { padding-left: 28px; position: relative; line-height: 1.3; }
.note li::before { content: ""; position: absolute; left: 0; top: .32em; width: 16px; height: 16px; border: 2.5px solid var(--ink); border-radius: 4px 2px 5px 3px; }
.note li::after { content: ""; position: absolute; left: 4px; top: .1em; width: 9px; height: 16px; border: solid var(--red); border-width: 0 3.5px 3.5px 0; rotate: 40deg; }
@media (max-width: 900px) { .notes { grid-template-columns: 1fr; } .note { rotate: 0deg !important; } }

/* ---------- closing ---------- */
.closing { text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 22px; }
.closing img { width: 120px; height: 120px; border-radius: 28px; border: 3px solid var(--ink); rotate: -5deg; box-shadow: 5px 6px 0 rgba(38,49,92,.9); }
.closing p { max-width: 46ch; }

/* ---------- footer ---------- */
.site-foot { padding: 46px 0 56px; border-top: 3px dashed rgba(38, 49, 92, .22); font-size: .9em; }
.site-foot .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; }
.site-foot small { display: block; color: var(--ink-soft); font-size: .86em; margin-top: 10px; line-height: 1.35; }
@media (max-width: 720px) { .site-foot .wrap { grid-template-columns: 1fr; } .site-foot nav { justify-content: flex-start; } }

/* ---------- press page ---------- */
.press-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.facts { padding: 26px 28px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; }
.facts dt { font-family: "Doodle Heading", sans-serif; font-weight: 900; }
.facts dd { margin: 0; }
.prose p + p { margin-top: 16px; }
.prose h3 { margin: 30px 0 10px; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; list-style: none; padding: 0; margin: 20px 0 0; }
.downloads a { display: grid; gap: 8px; text-decoration: none; font-size: .86em; }
.downloads img { border: 2.5px solid var(--ink); border-radius: 10px; background: var(--card); aspect-ratio: 1; object-fit: cover; object-position: top; }
@media (max-width: 860px) { .press-grid { grid-template-columns: 1fr; } }
