/* ============================================================
   31macchia: punk zine portfolio
   Tweak the colors & fonts here:
   ============================================================ */
:root {
  --paper: #f1ece0;
  --paper-dark: #e3dccb;
  --ink: #141210;
  --ink-soft: #3a3632;
  --pink: #ff2e88;
  --yellow: #f4ff3a;
  --blue: #2e5bff;
  --green: #19c37d;
  --red: #ff3b1f;
  --accent: var(--pink);

  --font-display: "Archivo Black", Impact, "Arial Black", sans-serif;
  --font-body: "Courier Prime", "Courier New", monospace;
  --font-hand: "Permanent Marker", "Comic Sans MS", cursive;

  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --maxw: 1120px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* photocopy grain */
  background-image:
    radial-gradient(rgba(0, 0, 0, .06) 1px, transparent 1.2px),
    radial-gradient(rgba(0, 0, 0, .04) 1px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

::selection { background: var(--yellow); color: var(--ink); }

:focus-visible {
  outline: 3px dashed var(--pink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) clamp(1rem, 4vw, 2.5rem) .7rem;
  background: var(--ink);
  color: var(--paper);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: -.02em;
}
.logo span {
  background: var(--pink);
  color: var(--ink);
  padding: 0 .25em;
  margin-left: .1em;
  display: inline-block;
  transform: rotate(-3deg);
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header nav a {
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .08em;
  padding: .15em .2em;
}
.site-header nav a:hover {
  background: var(--yellow);
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 7rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 7vw, 5rem);
  container-type: inline-size;
}

.issue-tag {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: .2rem .6rem;
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .12em;
  transform: rotate(-1.5deg);
}

/* ransom-note letters: sized to the hero's width so the name stays on one line.
   The nine letters with padding, borders and gaps come to about 9em + 40px. */
.ransom {
  display: flex;
  flex-wrap: nowrap;
  gap: .08em;
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: min(7.5rem, calc((100cqi - 48px) / 9.6));
  line-height: 1;
  font-weight: 400;
}
.ransom span {
  display: inline-block;
  padding: .02em .1em .06em;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}
.ransom span:nth-child(1) { transform: rotate(-4deg); background: var(--ink); color: var(--paper); }
.ransom span:nth-child(2) { transform: rotate(3deg) translateY(.06em); background: var(--pink); }
.ransom span:nth-child(3) { transform: rotate(-2deg); font-family: var(--font-hand); }
.ransom span:nth-child(4) { transform: rotate(5deg) translateY(-.04em); background: var(--yellow); }
.ransom span:nth-child(5) { transform: rotate(-3deg); font-family: var(--font-body); font-weight: 700; }
.ransom span:nth-child(6) { transform: rotate(2deg) translateY(.08em); background: var(--blue); color: var(--paper); }
.ransom span:nth-child(7) { transform: rotate(-5deg); background: var(--ink); color: var(--yellow); }
.ransom span:nth-child(8) { transform: rotate(4deg); font-family: var(--font-hand); background: var(--green); }
.ransom span:nth-child(9) { transform: rotate(-2deg) translateY(.05em); background: var(--red); color: var(--paper); }

.hero-sub {
  max-width: 34rem;
  font-size: 1.2rem;
  margin: 0 0 2rem;
}
.hero-sub mark {
  background: var(--yellow);
  padding: 0 .2em;
  font-weight: 700;
  font-size: 1.35em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.scribble {
  position: absolute;
  right: clamp(5rem, 16vw, 13rem);
  bottom: clamp(2.5rem, 6vw, 5rem);
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--pink);
  transform: rotate(-8deg);
}

/* The d20: a button, so it can be clicked and focused. The hexagon is cut from
   the inner face so the focus outline on the button isn't clipped away. */
.die {
  position: absolute;
  right: clamp(1rem, 5vw, 3rem);
  bottom: clamp(1.5rem, 5vw, 4rem);
  width: clamp(4rem, 10vw, 7rem);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: wobble 6s ease-in-out infinite;
}
.die-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--paper);
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: background .2s, color .2s;
}
.die:hover .die-face { background: var(--ink-soft); }
.die.rolling { animation: tumble .7s cubic-bezier(.2, .7, .3, 1); }
.die.crit .die-face { background: var(--yellow); color: var(--ink); }
.die.fumble .die-face { background: var(--red); color: var(--paper); }
@keyframes wobble {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg) translateY(-6px); }
}
@keyframes tumble {
  0% { transform: rotate(-8deg) scale(1); }
  30% { transform: rotate(260deg) scale(1.2) translateY(-14px); }
  100% { transform: rotate(712deg) scale(1); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .7rem 1.3rem;
  border: var(--border);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: .03em;
  box-shadow: 4px 4px 0 var(--pink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pink);
}
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--pink);
}
.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-ghost:hover { box-shadow: 6px 6px 0 var(--ink); }
.btn-ghost:active { box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem);
  scroll-margin-top: 3.5rem;
}

.section-title {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  line-height: 1;
  text-transform: uppercase;
}
.section-title span {
  display: inline-block;
  padding: .1em .3em;
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-2deg);
  position: relative;
}
/* masking tape */
.section-title span::after {
  content: "";
  position: absolute;
  top: -.35em;
  right: -.5em;
  width: 1.8em;
  height: .55em;
  background: rgba(244, 255, 58, .75);
  transform: rotate(18deg);
}

.section-intro { max-width: 40rem; margin: -1rem 0 2rem; }

/* ---------- Game cards ----------
   Each card and game page gets --g-* variables from its game's theme in js/projects.js. */
.games-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 2.5rem 2rem;
}
.game-card:nth-child(4n+1) { --tilt: -.8deg; }
.game-card:nth-child(4n+2) { --tilt: .7deg; }
.game-card:nth-child(4n+3) { --tilt: .5deg; }
.game-card:nth-child(4n+4) { --tilt: -.6deg; }
.game-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: var(--border);
  box-shadow: 6px 6px 0 var(--g-accent, var(--ink));
  transform: rotate(var(--tilt, 0deg));
  transition: transform .15s, box-shadow .15s;
}
.game-card > a:hover {
  transform: translate(-3px, -3px) rotate(0deg);
  box-shadow: 11px 11px 0 var(--g-accent, var(--pink));
}
.game-card > a:focus-visible { outline-offset: 6px; }
.game-card .g-cover { border-bottom: var(--border); }

/* The cover: a small copy of each game's wiki hero */
.g-cover {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  min-height: 270px;
  padding: 2.2rem 1.4rem 1.3rem;
  overflow: hidden;
  background: var(--g-hero, var(--ink));
  color: var(--g-hero-ink, var(--paper));
  container-type: inline-size;
}
.g-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 28%, transparent 31%);
  background-size: 6px 6px;
  pointer-events: none;
}
.g-tape {
  position: absolute;
  top: -6px;
  left: 24px;
  width: 90px;
  height: 24px;
  background: var(--g-hi, var(--yellow));
  opacity: .7;
  transform: rotate(-5deg);
}
.g-kicker {
  max-width: 70%;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g-kicker, var(--yellow));
}
.g-title {
  margin-top: .2rem;
  font-family: var(--g-font, var(--font-display));
  font-weight: var(--g-weight, 400);
  font-size: clamp(2rem, 11cqi, 3.6rem);
  line-height: 1;
  letter-spacing: var(--g-track, 0);
  color: #fff;
  text-wrap: balance;
}
.g-glitch .g-title,
.is-glitch .gp-title {
  text-shadow: 3px 0 0 rgba(255, 59, 59, .55), -3px 0 0 rgba(94, 242, 214, .45);
}
.g-pre {
  font-size: .5em;
  vertical-align: .55em;
  font-style: italic;
  letter-spacing: .02em;
  margin-right: .06em;
  color: var(--g-kicker);
}
.g-sub {
  max-width: 85%;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--g-hi, var(--yellow));
  transform: rotate(-2deg);
}
.g-version {
  position: absolute;
  top: .9rem;
  right: .9rem;
  padding: .1rem .6rem;
  background: var(--g-hi, var(--yellow));
  color: var(--g-hi-ink, var(--ink));
  border: 2px solid var(--ink);
  font-family: var(--font-hand);
  font-size: .95rem;
  transform: rotate(4deg);
}

/* Cover ornaments, one per game */
.orn { margin-top: auto; align-self: flex-end; }
.orn-bands {
  position: absolute;
  top: 3.4rem;
  right: 1.2rem;
  bottom: 1.2rem;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding-left: .8rem;
  border-left: 2px dashed rgba(232, 240, 248, .5);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(232, 240, 248, .85);
}
@container (min-width: 440px) { .orn-bands { display: flex; } }
.orn-dice { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.d8 {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.3rem;
  font-weight: 700;
  font-size: .9rem;
  color: #b4c0de;
  background: #18233f;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.d8-inf { background: #5ef2d6; color: #04151a; }
.d8-hit { background: #8fb0ff; color: #0a0f1e; }
.d8-loss { background: #ff3b3b; color: #fff; }
.orn-dice small {
  width: 100%;
  text-align: right;
  font-family: var(--font-hand);
  font-size: .95rem;
  color: var(--g-hi);
}
.orn-cards { display: flex; padding: .6rem 0 0 1.2rem; }
.pc {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 3.4rem;
  aspect-ratio: 5 / 7;
  margin-left: -1.1rem;
  padding: .25rem .35rem;
  background: #fffdf9;
  color: #1d1024;
  border: 2px solid #2a1633;
  border-radius: 6px;
  box-shadow: 3px 3px 0 #120616;
  font: 700 .95rem/1 "Cinzel", Georgia, serif;
  transform-origin: 50% 120%;
}
.pc i { font-style: normal; font-size: 1.6rem; align-self: center; margin-bottom: .3rem; }
.pc-red { color: #c42a3e; }
.pc:nth-child(1) { transform: rotate(-14deg); }
.pc:nth-child(2) { transform: rotate(-5deg); }
.pc:nth-child(3) { transform: rotate(5deg); }
.pc:nth-child(4) { transform: rotate(14deg); }
.orn-moon { display: flex; align-items: center; gap: .6rem; text-align: right; }
.orn-moon b {
  font-family: var(--g-font, var(--font-display));
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  color: #fff;
}
.orn-moon span {
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g-kicker);
}

.g-info {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.3rem 1.3rem;
  flex: 1;
}
.g-lede { color: var(--ink-soft); line-height: 1.5; }
.g-engine {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.g-engine::before { content: "Engine · "; color: var(--ink-soft); }
.g-more {
  margin-top: auto;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--g-accent, var(--pink));
}

.badge {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .05rem .45rem;
  border: 2px solid var(--ink);
}
.badge-playtest { background: var(--g-hi, var(--yellow)); color: var(--g-hi-ink, var(--ink)); }
.badge-released { background: var(--green); }
.badge-in-progress { background: var(--yellow); }
.badge-jam { background: var(--pink); }

.empty { font-family: var(--font-hand); font-size: 1.4rem; }

/* ---------- Engines strip ---------- */
.engines { margin-top: 4rem; }
.engines-title {
  display: inline-block;
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  text-transform: uppercase;
  background: linear-gradient(transparent 60%, var(--yellow) 60% 92%, transparent 92%);
}
.engines-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}
.engine {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 2px dashed var(--ink);
  background: var(--paper);
}
.engine h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; }
.engine p { margin: 0; font-size: .95rem; line-height: 1.5; }
.engine-games { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto !important; padding-top: .3rem; }
.engine-games a {
  padding: .2rem .7rem;
  border: 2px solid var(--ink);
  background: var(--g-hero);
  color: #fff;
  font-family: var(--g-font);
  font-weight: var(--g-weight, 400);
  letter-spacing: .04em;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.engine-games a:hover { transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--g-accent); }

/* ---------- Homebrew (5.5e) link ---------- */
.homebrew { margin-top: 3rem; }
.homebrew-card {
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.homebrew-card:hover { transform: translate(-2px, -2px) rotate(-.5deg); box-shadow: 8px 8px 0 var(--pink); }
.homebrew-card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.homebrew-tag {
  align-self: flex-start;
  padding: .05rem .45rem;
  border: 2px solid var(--ink);
  background: var(--pink);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.homebrew-go { margin-top: .3rem; font-family: var(--font-hand); font-size: 1.2rem; }

/* ---------- Game page ---------- */
.game-page {
  min-height: 80vh;
  background-color: var(--g-bg, var(--paper));
  background-image: radial-gradient(color-mix(in srgb, var(--g-ink, var(--ink)) 8%, transparent) 1px, transparent 1.2px);
  background-size: 8px 8px;
  color: var(--g-ink, var(--ink));
}
.gp-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}
.game-page .back-link { color: var(--g-ink); border-bottom-color: var(--g-accent); }
.game-page .back-link:hover { background: var(--g-hi); color: var(--g-hi-ink); }

.gp-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 820px) { .gp-hero { grid-template-columns: 1fr; } }
.gp-hero .g-cover {
  min-height: 380px;
  border: 2px solid var(--g-line);
  box-shadow: 8px 8px 0 var(--g-line);
  transform: rotate(-.6deg);
}
.gp-status {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g-ink2);
}
.gp-title {
  margin: 0 0 1rem;
  font-family: var(--g-font);
  font-weight: var(--g-weight, 400);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: var(--g-track, 0);
  text-wrap: balance;
}
.gp-title .g-pre { color: var(--g-accent); }
.gp-lede { margin: 0 0 1.5rem; font-size: 1.1rem; line-height: 1.65; color: var(--g-ink2); max-width: 36em; }
.gp-lede mark {
  background: var(--g-hi);
  color: var(--g-hi-ink);
  padding: 0 .2em;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.gp-ctas { display: flex; flex-wrap: wrap; gap: .9rem; }
.gp-btn {
  display: inline-block;
  padding: .7rem 1.1rem;
  border: 2px solid var(--g-line);
  background: var(--g-surface);
  color: var(--g-ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--g-line);
  transition: transform .12s, box-shadow .12s;
}
.gp-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--g-accent); }
.gp-btn-hi { background: var(--g-hi); color: var(--g-hi-ink); }

.gp-section { margin-top: clamp(3rem, 7vw, 4.5rem); }
.gp-h {
  display: inline;
  font-family: var(--g-font);
  font-weight: var(--g-weight, 400);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1.3;
  letter-spacing: .02em;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--g-hi) 45%, transparent) 62% 92%, transparent 92%);
}
.gp-pillars {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.25rem;
}
.gp-pillars li {
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--g-surface);
  border: 2px solid var(--g-line);
  box-shadow: 4px 4px 0 var(--g-accent);
}
.gp-pillars h3 {
  margin: 0 0 .45rem;
  font-family: var(--g-font);
  font-weight: var(--g-weight, 400);
  font-size: 1.2rem;
  line-height: 1.2;
}
.gp-pillars p { margin: 0; color: var(--g-ink2); font-size: .98rem; line-height: 1.55; }

.gp-roll-text {
  max-width: 44em;
  margin: 1.5rem 0 1rem;
  padding: 1.1rem 1.4rem;
  background: var(--g-surface);
  border: 2px solid var(--g-line);
  border-left: 8px solid var(--g-accent);
  font-size: 1.15rem;
  line-height: 1.6;
}
.gp-engine { margin: 0 0 1rem; color: var(--g-ink2); }
.gp-engine b { color: var(--g-ink); }
.gp-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.gp-facts li {
  padding: .3rem .75rem;
  border: 2px solid var(--g-line);
  background: var(--g-surface);
  font-size: .9rem;
  font-weight: 700;
}

.gp-note { margin: .75rem 0 0; color: var(--g-ink2); font-size: .95rem; }
.gp-tools {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 1rem;
}
.gp-tools a {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  height: 100%;
  padding: .95rem 1.1rem;
  background: var(--g-surface);
  color: var(--g-ink);
  border: 2px solid var(--g-line);
  box-shadow: 3px 3px 0 var(--g-line);
  text-decoration: none;
}
.gp-tools a:hover { background: color-mix(in srgb, var(--g-hi) 22%, var(--g-surface)); box-shadow: 5px 5px 0 var(--g-accent); }
.gp-tools b { font-family: var(--g-font); font-weight: var(--g-weight, 400); font-size: 1.15rem; }
.gp-tools span { color: var(--g-ink2); font-size: .92rem; line-height: 1.45; }

.gp-posts { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .7rem; max-width: 44em; }
.gp-posts a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem .9rem;
  padding: .7rem 1rem;
  border: 2px solid var(--g-line);
  background: var(--g-surface);
  color: var(--g-ink);
  text-decoration: none;
}
.gp-posts a:hover { box-shadow: 4px 4px 0 var(--g-accent); }
.gp-posts time { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink2); }

.gp-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--g-line);
}
.gp-pager a {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  max-width: 48%;
  padding: .7rem 1rem;
  border: 2px solid var(--g-line);
  background: var(--g-surface);
  color: var(--g-ink);
  text-decoration: none;
}
.gp-pager a.next { margin-left: auto; text-align: right; }
.gp-pager a:hover { box-shadow: 4px 4px 0 var(--g-accent); }
.gp-pager span { font-size: .8rem; color: var(--g-ink2); }
.gp-pager b { font-family: var(--g-font); font-weight: var(--g-weight, 400); font-size: 1.1rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .polaroid { max-width: 280px; }
}

.polaroid {
  margin: 0;
  padding: .8rem .8rem 0;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
  position: relative;
}
.polaroid::before {
  /* tape */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 90px;
  height: 26px;
  background: rgba(255, 46, 136, .55);
  transform: translateX(-50%) rotate(-4deg);
}
.portrait {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background-color: var(--ink);
  background-image: radial-gradient(var(--ink-soft) 30%, transparent 32%);
  background-size: 10px 10px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}
.portrait-photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: 30% 50%;
}

.polaroid figcaption {
  font-family: var(--font-hand);
  text-align: center;
  padding: .7rem 0 .9rem;
}

.about-text .lead { font-size: 1.3rem; margin-top: 0; }
.about-text strong { background: var(--pink); padding: 0 .2em; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.stats li {
  border: var(--border);
  padding: .5rem 1rem;
  background: var(--paper);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: .06em;
}
.stats li:nth-child(2) { transform: rotate(2deg); background: var(--yellow); }
.stats b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
}

/* ---------- Services ---------- */
.services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1.5rem;
}
.service {
  position: relative;
  padding: 1.5rem 1.3rem 1.3rem;
  border: var(--border);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.service:nth-child(odd) { transform: rotate(-.8deg); }
.service:nth-child(even) { transform: rotate(.8deg); }
.service:nth-child(1) { background: var(--yellow); }
.service:nth-child(3) { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--pink); }
.service-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: .8rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 1.4rem;
}
.service h3 {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  text-transform: uppercase;
}
.service p { margin: 0; font-size: .98rem; }

/* ---------- Contact ---------- */
.contact-card {
  position: relative;
  max-width: 760px;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--pink);
  border: var(--border);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(-1deg);
}
.contact-lead { font-size: 1.2rem; margin-top: 0; }
.contact-email {
  display: inline-block;
  margin: .5rem 0 1.5rem;
  padding: .2em .4em;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4.5vw, 2.4rem);
  text-decoration: none;
  word-break: break-all;
}
.contact-email:hover { background: var(--yellow); color: var(--ink); }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.socials a {
  display: inline-block;
  padding: .3rem .8rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  font-size: .9rem;
  letter-spacing: .05em;
}
.socials a:hover { background: var(--yellow); transform: rotate(-3deg); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  color: var(--paper);
  font-size: .9rem;
}
.site-footer p { margin: 0; }

/* ---------- Blog list ---------- */
.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  max-width: 820px;
}
.post-card a {
  display: grid;
  gap: .35rem;
  padding: 1.25rem 1.4rem 1.3rem;
  border: var(--border);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.post-card:nth-child(odd) a { transform: rotate(-.6deg); }
.post-card:nth-child(even) a { transform: rotate(.5deg); }
.post-card a:hover {
  transform: translate(-3px, -3px) rotate(0deg);
  box-shadow: 10px 10px 0 var(--pink);
}
.post-card time,
.post-header time {
  justify-self: start;
  background: var(--ink);
  color: var(--paper);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .05rem .5rem;
}
.post-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.1;
  text-wrap: balance;
}
.post-card-excerpt { color: var(--ink-soft); }
.post-card-more {
  justify-self: start;
  font-family: var(--font-hand);
  color: var(--pink);
  font-size: 1.1rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .78rem;
  font-weight: 700;
  padding: 0 .4rem;
  border: 2px solid var(--ink);
  background: var(--yellow);
}

/* ---------- Single post ---------- */
.post-view {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem) 2rem;
}
.back-link {
  display: inline-block;
  margin: 0 0 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .9rem;
  text-decoration: none;
  border-bottom: 3px solid var(--pink);
}
.back-link:hover { background: var(--yellow); }
.post-view > .back-link:last-child { margin: 3rem 0 0; }

.post-header { display: grid; gap: .8rem; margin-bottom: 2rem; }
.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 1;
  text-wrap: balance;
}

.post-body { font-size: 1.1rem; line-height: 1.7; }
.post-body > :first-child { margin-top: 0; }
.post-body h2,
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 2.2rem 0 .8rem;
  text-wrap: balance;
}
.post-body h2 { font-size: 1.7rem; }
.post-body h2::before { content: "// "; color: var(--pink); }
.post-body h3 { font-size: 1.3rem; }
.post-body a { text-decoration-color: var(--pink); text-decoration-thickness: 3px; }
.post-body a:hover { background: var(--yellow); }
.post-body strong { background: linear-gradient(transparent 55%, rgba(244, 255, 58, .9) 55%); }
.post-body blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.3rem;
  border: var(--border);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-hand);
  font-size: 1.3rem;
  line-height: 1.4;
  transform: rotate(-1deg);
  box-shadow: 6px 6px 0 var(--pink);
}
.post-body blockquote p { margin: 0; }
.post-body img { border: var(--border); box-shadow: var(--shadow); height: auto; }
.post-body code {
  background: var(--paper-dark);
  padding: .05em .3em;
  font-size: .95em;
}
.post-body pre {
  overflow-x: auto;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: var(--paper-dark);
}
.post-body pre code { background: none; padding: 0; }
.post-body hr { border: 0; border-top: 3px dashed var(--ink); margin: 2.5rem 0; }
.post-body ul { padding-left: 1.3rem; }
.post-body li::marker { color: var(--pink); }

.loading { font-family: var(--font-hand); font-size: 1.2rem; }
.notice {
  padding: .8rem 1rem;
  border: 2px dashed var(--ink);
  background: var(--paper);
}

/* ---------- Comments ---------- */
.comments {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 3px dashed var(--ink);
}
.comments-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  text-transform: uppercase;
}
.comments-title span {
  display: inline-block;
  padding: .05em .3em;
  background: var(--pink);
  transform: rotate(-2deg);
}
.comments-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.comments-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.comment-list-nested {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--ink);
}
.comment {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
}
.comment-list:not(.comment-list-nested) > .comment {
  padding: 1rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
}
.avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  object-fit: cover;
  filter: grayscale(.3) contrast(1.1);
}
.avatar-empty {
  display: grid;
  place-items: center;
  background: var(--yellow);
  font-family: var(--font-display);
}
.comment-meta { margin: 0; font-size: .88rem; line-height: 1.4; }
.comment-author { font-weight: 700; text-decoration: none; }
.comment-author:hover { background: var(--yellow); }
.comment-handle,
.comment-time { color: var(--ink-soft); }
.comment-text {
  margin: .3rem 0 .4rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-actions {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-size: .85rem;
  font-weight: 700;
}
.comment-actions a { color: var(--ink); }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .site-header ul { gap: .2rem .9rem; }
  .scribble { display: none; }
  .die { position: static; display: block; margin-top: 2rem; }
  .section { scroll-margin-top: 6rem; }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .die, .scribble, .hero-cta { display: none; }
  body { background: #fff; }
}
