/* ==========================================================
   Grains of Art: ink, paper & wheat
   ========================================================== */

:root {
  --paper: #f4ecdc;
  --paper-deep: #e9dcc3;
  --ink: #2a2622;        /* the logo's ink */
  --ink-soft: #625649;
  --ink-faint: #9a8b78;
  --gold: #efc46c;       /* wheat gold from the logo */
  --gold-wash: rgba(239, 196, 108, .55);
  --brown: #5c3b17;      /* wheat outline */
  --mint: #2f8a60;       /* "open" / her green */
  --plum: #4d3564;
  --rule: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='6' viewBox='0 0 240 6'><path d='M0 3.2C20 2.1 38 4.1 60 3.1s41-1.3 60 .1 42 1.2 60-.2 42-.7 60 .4' fill='none' stroke='%232a2622' stroke-opacity='.35' stroke-width='1.2' stroke-linecap='round'/></svg>");
  --grain-opacity: .5;
  --wash-open: rgba(88, 214, 146, .55);
  --wash-waitlist: rgba(239, 190, 90, .7);
  --wash-closed: rgba(150, 135, 115, .3);
  /* highlighter shape: wobbly edges, ragged chisel-tip ends */
  --marker: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30' preserveAspectRatio='none'><path d='M4 5C22 2 40 4.5 60 3.2S88 2.4 97 3.5l-1.6 5 3.4 4.2-2.6 4.6 2.2 5.4C80 26 62 25.5 44 26.8S14 27.6 2.5 26.6l2-4.8L1 17l2.8-4.4L1.6 7.8z'/></svg>");

  --f-display: "Young Serif", Georgia, serif;
  --f-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1618;
    --paper-deep: #251e20;
    --ink: #f1e7d6;
    --ink-soft: #c2b39f;
    --ink-faint: #8c7e6d;
    --gold: #f0c870;
    --gold-wash: rgba(240, 200, 112, .28);
    --brown: #d9a95b;
    --mint: #7dd6a8;
    --rule: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='6' viewBox='0 0 240 6'><path d='M0 3.2C20 2.1 38 4.1 60 3.1s41-1.3 60 .1 42 1.2 60-.2 42-.7 60 .4' fill='none' stroke='%23f1e7d6' stroke-opacity='.3' stroke-width='1.2' stroke-linecap='round'/></svg>");
    --grain-opacity: .35;
    --wash-open: rgba(110, 214, 160, .38);
    --wash-waitlist: rgba(240, 200, 112, .38);
    --wash-closed: rgba(200, 185, 165, .2);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper tooth: fine noise + a soft warm vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(120, 80, 30, .14) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .15  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; }
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 400; }

:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
}

.sheet {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 20px 40px;
}

/* ---------- Icons ---------- */
.ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
  flex: none;
}
.ico-svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Masthead ---------- */
.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 40px;
}

.masthead__logo {
  position: relative;
  width: min(540px, 90vw);
}
.logo { width: 100%; }

/* four-point sparkles, same shape as in the logo */
.spark {
  position: absolute;
  fill: var(--gold);
  animation: twinkle 5s ease-in-out infinite;
}
.spark--a { width: 14px; top: 30%; right: 30%; }
.spark--b { width: 9px; top: 2%; left: 52%; animation-delay: -1.7s; }
.spark--c { width: 12px; bottom: 4%; right: 2%; animation-delay: -3.2s; }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(.55) rotate(20deg); opacity: .6; }
}

/* ---------- Commission status (set on <body data-commissions>) ---------- */
body { --status: var(--mint); --status-wash: var(--wash-open); }
body[data-commissions="waitlist"] { --status: var(--brown); --status-wash: var(--wash-waitlist); }
body[data-commissions="closed"] { --status: var(--ink-faint); --status-wash: var(--wash-closed); }
[data-when] { display: none; font-style: normal; }
body[data-commissions="open"] [data-when="open"],
body[data-commissions="waitlist"] [data-when="waitlist"],
body[data-commissions="closed"] [data-when="closed"] { display: inline; }

/* rubber stamp */
.stamp {
  position: absolute;
  right: 2%;
  top: 4%;
  display: grid;
  place-items: center;
  padding: 7px 12px 6px;
  border: 2.5px solid var(--status);
  border-radius: 6px;
  outline: 1px solid var(--status);
  outline-offset: 2px;
  color: var(--status);
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
  transform: rotate(8deg);
  /* uneven ink */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='60'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.9'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>");
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='60'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.9'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>");
  transition: transform .3s var(--ease);
}
.stamp span { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; }
.stamp strong { font-family: var(--f-display); font-weight: 400; font-size: 22px; white-space: nowrap; letter-spacing: .06em; margin-top: 3px; }
.stamp:hover { transform: rotate(3deg) scale(1.05); }

.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  margin-top: 26px;
  text-align: left;
}
.byline p { margin: 0; color: var(--ink-soft); }
.byline strong { color: var(--ink); }

.byline__avatar {
  flex: none;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink);
  overflow: hidden;
  transition: transform .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.byline__avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline__avatar:hover { transform: rotate(-6deg); }

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  margin-top: 26px;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .2s;
}
.socials a:hover { color: var(--ink); }
.socials a:hover .socials__label {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
@media (max-width: 420px) {
  .socials { gap: 4px 16px; }
  .socials__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .socials .ico { width: 24px; height: 24px; }
}

/* ---------- Game ---------- */
.game {
  display: grid;
  gap: 22px;
  padding: 36px 0;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
@media (min-width: 720px) {
  .game { grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
}

.game__art {
  display: block;
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1deg);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.game__art img { width: 100%; }
.game__art:hover { transform: rotate(0) translate(-2px, -2px); box-shadow: 9px 9px 0 var(--ink); }

.game h2 {
  font-family: var(--f-display);
  font-size: clamp(32px, 6vw, 42px);
  line-height: 1.05;
  margin-bottom: 10px;
}
.game__text > p:not(.game__new) { margin: 0 0 20px; color: var(--ink-soft); }

.game__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--gold);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--gold); }
.btn:active { transform: none; box-shadow: 1px 1px 0 var(--gold); }

.textlink {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.textlink:hover { text-decoration-color: var(--ink); }

/* ---------- Link index ---------- */
.index {
  display: grid;
  gap: 40px;
  padding: 44px 0 20px;
}
.index > * { min-width: 0; }
@media (min-width: 720px) {
  .index { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px 56px; }
}

.list__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 24px;
  margin-bottom: 4px;
}
.list__head::before {
  /* tiny wheat kernel */
  content: "";
  width: 9px;
  height: 15px;
  flex: none;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--gold);
  box-shadow: -2px 1px 0 var(--brown);
  transform: rotate(28deg);
}

.list ul { list-style: none; margin: 0; padding: 0; }
.list li { position: relative; }
/* hand-drawn divider, "inked" left to right when the list scrolls into view */
.list li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--rule) repeat-x left center / 240px 6px;
  transform-origin: left;
  transition: transform .8s var(--ease) calc(var(--i, 0) * 110ms);
  pointer-events: none;
}
.js-draw .list:not(.is-drawn) li::after { transform: scaleX(0); }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px 13px;
  text-decoration: none;
}
.row__ico { font-size: 19px; color: var(--ink-soft); transition: color .2s, transform .3s var(--ease); }
.row__text { display: grid; flex: 1; min-width: 0; }
.row__title {
  justify-self: start;
  font-family: var(--f-display);
  font-size: 19px;
  line-height: 1.3;
  /* marker swipe on hover */
  background: linear-gradient(100deg, transparent 0 2%, var(--gold-wash) 3% 97%, transparent 98%) no-repeat 0 85% / 0% 55%;
  transition: background-size .4s var(--ease);
  padding: 0 3px;
  margin: 0 -3px;
}
.row__meta { font-size: 14.5px; color: var(--ink-faint); }
.row__arrow { color: var(--ink-faint); font-size: 18px; transition: transform .3s var(--ease), color .2s; }

.row:hover .row__title,
.row:focus-visible .row__title { background-size: 100% 55%; }
.row:hover .row__ico { color: var(--ink); transform: rotate(-8deg); }
.row:hover .row__arrow { color: var(--ink); transform: translate(2px, -2px); }

/* highlighter stroke instead of a pill */
.row__tag,
.hl {
  position: relative;
  flex: none;
  isolation: isolate;
  padding: 2px 9px 1px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
}
.row__tag::before,
.row__tag::after,
.hl::before,
.hl::after {
  content: "";
  position: absolute;
  z-index: -1;
  background: var(--status-wash);
  -webkit-mask: var(--marker) center / 100% 100% no-repeat;
  mask: var(--marker) center / 100% 100% no-repeat;
}
.row__tag::before,
.hl::before { inset: 0 -3px; }
/* a second, thinner pass so it looks drawn by hand */
.row__tag::after,
.hl::after { inset: 45% 2px -2px -5px; opacity: .55; transform: rotate(1.5deg); }

.hl {
  display: inline-block;
  --status-wash: var(--wash-waitlist); /* wheat gold */
}
.game__new { margin: 0 0 12px; }
.game__new .hl { font-size: 14px; padding: 3px 12px 2px; transform: rotate(-3deg); }
.row--feature .row__title { font-size: 21px; }

/* ---------- Contact ---------- */
.contact {
  margin-top: 36px;
  padding: 32px 0 8px;
  border-top: 1.5px solid var(--ink);
  text-align: center;
}
.contact h2 { font-family: var(--f-display); font-size: 30px; }
.contact p { margin: 4px 0 0; color: var(--ink-soft); }
.contact__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 12px !important;
}
.contact__mail {
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}
.contact__mail:hover { text-decoration-color: var(--ink); }
.contact__copy {
  cursor: pointer;
  padding: 2px 10px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 4px;
  background: none;
  font-size: 14px;
  color: var(--ink-soft);
}
.contact__copy:hover { border-color: var(--ink); color: var(--ink); }

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  font-size: 14px;
  color: var(--ink-faint);
}
.footer p { margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  translate: -50% 16px;
  padding: 9px 16px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 3px 3px 0 var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, translate .25s var(--ease);
  z-index: 10;
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- Hearts (avatar click) ---------- */
.heart {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  width: 22px;
  height: 22px;
  animation: float-heart 1.3s var(--ease) forwards;
}
@keyframes float-heart {
  0% { transform: translate(0, 0) scale(.3); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ==========================================================
   Desktop: sticky masthead left, content flows on the right
   ========================================================== */
@media (min-width: 1080px) {
  .sheet {
    width: min(1360px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    padding: 0 48px;
  }

  .masthead {
    justify-content: center;
    padding: 56px 56px 56px 0;
  }
  .masthead__logo { width: min(500px, 100%); }

  .flow {
    min-width: 0;
    padding: 72px 0 40px 64px;
    border-left: 1.5px solid var(--ink);
  }

  .flow .game { border-top: 0; padding-top: 0; }

  /* link groups balance across two newspaper-style columns */
  .index {
    display: block;
    columns: 2;
    column-gap: 56px;
    padding-top: 44px;
  }
  .index > .list {
    break-inside: avoid;
    margin-bottom: 44px;
  }

  .contact { margin-top: 4px; }
}

/* only pin the masthead when the window is tall enough to show all of it */
@media (min-width: 1080px) and (min-height: 700px) {
  .masthead {
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

@media (min-width: 1400px) {
  .flow { padding-left: 80px; }
  .game { gap: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .001ms !important;
  }
}
