/* Grimgrid website. Colours follow the app icon: an amber d20 on a deep aubergine hex grid. */

@font-face {
  font-family: "Grenze Gotisch";
  src: url("assets/fonts/grenze-gotisch-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0e0916;
  --line: rgba(255, 232, 200, 0.11);
  --text: #f4eadc;
  --muted: #b5a8c0;
  --amber: #ffb648;
  --ember: #ee7420;
  --violet: #7a4be0;
  --display: "Grenze Gotisch", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: min(1120px, 100% - 2.5rem);
  /* Pointy-top hexes, 56px across: the same grid the app draws. */
  --hexes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97'%3E%3Cpath d='M28 0v16.17L56 32.33v32.34L28 80.83 0 64.67V32.33L28 16.17M28 80.83V97' fill='none' stroke='%23fff' stroke-opacity='.08'/%3E%3C/svg%3E");
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
canvas {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 8.2vw, 6.4rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
}

h3 {
  font-size: 1.7rem;
  font-weight: 600;
}

p {
  margin: 0;
}

/* Amber, like light falling across the facets of the die. */
h1 em,
h2 em,
.steps__numeral {
  font-style: normal;
  background: linear-gradient(100deg, #ffd27a, var(--amber) 40%, var(--ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  margin-bottom: 1.1rem;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--amber);
  color: #1a1005;
  font-weight: 700;
}

.skip:focus {
  top: 1rem;
}

/* --- Buttons --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffc968, var(--amber) 45%, var(--ember));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 12px 32px -10px rgba(238, 116, 32, 0.75);
  color: #1d1104;
  font: 700 1rem/1 var(--body);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 18px 40px -10px rgba(238, 116, 32, 0.9);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--text);
}

.btn--ghost:hover {
  box-shadow: 0 0 0 1px rgba(255, 182, 72, 0.6) inset;
}

.btn--small {
  padding: 0.7rem 1.15rem;
  font-size: 0.9rem;
}

.chip,
.segmented button {
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--text);
  font: 600 0.9rem/1 var(--body);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.chip:hover:enabled,
a.chip:hover,
.chip[aria-pressed="true"] {
  box-shadow: 0 0 0 1px rgba(255, 182, 72, 0.7) inset;
  color: var(--amber);
}

.chip:disabled {
  opacity: 0.45;
  cursor: default;
}

a.chip {
  display: inline-block;
  text-decoration: none;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px var(--line) inset;
}

.segmented button {
  background: none;
  box-shadow: none;
  color: var(--muted);
}

.segmented button[aria-pressed="true"] {
  background: var(--amber);
  color: #1d1104;
}

/* --- Navigation ------------------------------------------------------------------------ */

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: var(--page);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font: 700 1.75rem/1 var(--display);
  text-decoration: none;
}

.brand img {
  border-radius: 23%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav__links {
  display: none;
  gap: 2rem;
  font-size: 0.95rem;
}

.nav__links a,
.footer__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav__links a:hover,
.footer__links a:hover {
  color: var(--text);
}

@media (min-width: 800px) {
  .nav__links {
    display: flex;
  }
}

/* --- Hero ------------------------------------------------------------------------------ */

.hero {
  position: relative;
  width: var(--page);
  margin: 0 auto;
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
  text-align: center;
}

/* The hex grid and two lights behind the headline, fading out towards the demo. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -8rem;
  left: 50%;
  width: 100vw;
  height: 62rem;
  transform: translateX(-50%);
  background:
    radial-gradient(38rem 24rem at 50% 30%, rgba(238, 116, 32, 0.22), transparent 70%),
    radial-gradient(40rem 30rem at 22% 12%, rgba(122, 75, 224, 0.28), transparent 70%),
    radial-gradient(36rem 26rem at 80% 46%, rgba(122, 75, 224, 0.16), transparent 70%),
    var(--hexes);
  -webkit-mask-image: radial-gradient(60rem 40rem at 50% 32%, #000 30%, transparent 78%);
  mask-image: radial-gradient(60rem 40rem at 50% 32%, #000 30%, transparent 78%);
}

.hero h1 {
  max-width: 13ch;
  margin: 0 auto;
}

.lede {
  max-width: 41rem;
  margin: 1.75rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

/* --- Live demo ------------------------------------------------------------------------- */

.stage {
  position: relative;
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  text-align: left;
  scroll-margin-top: 2rem;
}

.device {
  margin: 0;
}

.device__label {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tv {
  position: relative;
  padding: clamp(5px, 0.9vw, 11px);
  border-radius: clamp(10px, 1.6vw, 18px);
  background: linear-gradient(150deg, #34303d, #0d0b11 38%, #17141d);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09) inset,
    0 50px 90px -30px #000,
    0 0 140px -20px rgba(238, 116, 32, 0.28),
    0 0 220px -40px rgba(122, 75, 224, 0.5);
}

.stage canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.tv canvas {
  border-radius: clamp(3px, 0.5vw, 6px);
  /* Touch screens steer from the phone below, so a finger on the big map still scrolls the page. */
  pointer-events: none;
}

@media (pointer: fine) {
  .tv canvas {
    pointer-events: auto;
    cursor: crosshair;
    touch-action: none;
  }
}

.tv__blackout {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.3);
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.stage[data-blackout="true"] .tv__blackout {
  opacity: 1;
}

.device--phone {
  margin-top: 1.75rem;
}

.phone {
  position: relative;
  padding: 7px;
  border-radius: 30px;
  background: #08070b;
  box-shadow:
    0 0 0 1.5px #4a4455,
    0 0 0 4px #17141d,
    0 30px 60px -12px #000,
    0 0 80px -20px rgba(255, 182, 72, 0.35);
}

.phone canvas {
  border-radius: 24px;
  cursor: crosshair;
  touch-action: none;
}

/* Dynamic Island: the phone lies on its side. */
.phone::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 17px;
  top: 50%;
  width: 11px;
  height: 27%;
  border-radius: 999px;
  background: #000;
  transform: translateY(-50%);
  pointer-events: none;
}

.stage__panel {
  margin-top: 1.5rem;
}

.stage__hint {
  color: var(--muted);
  font-size: 1rem;
}

.stage__hint strong {
  color: var(--text);
}

.stage__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

/* Wide screens: the phone overlaps the corner of the TV, the panel sits beside it. */
@media (min-width: 800px) {
  .stage {
    display: grid;
    grid-template-columns: 40% 1fr;
    column-gap: 2.5rem;
  }

  .device--tv {
    grid-column: 1 / -1;
  }

  .device--phone {
    z-index: 1;
    display: flex;
    flex-direction: column-reverse;
    margin: -30% 0 0 -7%;
  }

  .device--phone .device__label {
    margin: 0.9rem 0 0 12%;
  }

  .stage__panel {
    margin-top: 1.6rem;
  }
}

/* --- Sections -------------------------------------------------------------------------- */

.section {
  width: var(--page);
  margin: 0 auto;
  padding-top: clamp(5.5rem, 12vw, 10rem);
  scroll-margin-top: -3rem;
}

.section__head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section__lede {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.15rem;
}

/* Why there are no stat blocks: plain words, a little larger than body text. */
.creed {
  max-width: 46rem;
}

.creed p {
  color: #cdc2d6;
  font-size: 1.2rem;
  line-height: 1.7;
}

.creed p + p {
  margin-top: 1.25rem;
}

.steps {
  display: grid;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.steps__numeral {
  display: inline-block;
  font: 900 4.5rem/0.9 var(--display);
}

.steps h3 {
  margin: 0.9rem 0 0.7rem;
}

.steps p,
.card p {
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 1.1rem;
}

.card {
  padding: 1.9rem 1.75rem 2rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 60%);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: rgba(255, 182, 72, 0.45);
  box-shadow: 0 24px 50px -30px rgba(238, 116, 32, 0.55);
  transform: translateY(-3px);
}

.card__icon {
  width: 2.4rem;
  height: 2.4rem;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 1.2rem 0 0.7rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .steps,
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Bestiary wall --------------------------------------------------------------------- */

.beasts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .beasts {
    grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr));
  }
}

.beast {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.9rem 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 500 0.72rem/1.2 var(--body);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.beast:hover {
  border-color: rgba(255, 182, 72, 0.55);
  color: var(--text);
}

.beast[aria-pressed="true"] {
  background: rgba(120, 12, 20, 0.16);
  border-color: rgba(200, 40, 50, 0.35);
}

.beast img {
  grid-area: 1 / 1;
  width: 64px;
  height: 64px;
  /* A pool of lamplight under each token: the dark ones (bandit leader, death knight) are
     lost against the night of the page without it. */
  background: radial-gradient(closest-side, rgba(255, 226, 190, 0.42), rgba(255, 226, 190, 0.14) 70%, transparent);
  border-radius: 50%;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.beast span {
  grid-area: 2 / 1;
}

/* The weapon a figure holds, where its creature is drawn with several: a badge as on its token in the app. */
.beast .beast__weapon {
  grid-area: 1 / 1;
  place-self: start end;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: -0.5rem 0.1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(14, 9, 22, 0.88);
  font-size: 0.85rem;
  line-height: 1;
}

.beast__dead,
.beast[aria-pressed="true"] .beast__alive {
  opacity: 0;
  transform: scale(0.8);
}

.beast[aria-pressed="true"] .beast__dead {
  opacity: 1;
  transform: none;
}

/* A creature without a corpse picture: its token falls over and pales, as in the app. */
.beast__dead--toppled {
  filter: saturate(0.25) brightness(0.8);
}

.beast[aria-pressed="true"] .beast__dead--toppled {
  transform: rotate(90deg);
}

.beasts__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* --- Bestiary page: every creature, one shelf per size ---------------------------------- */

.bestiary {
  width: var(--page);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

.bestiary h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
}

.bestiary .section__lede {
  max-width: 46rem;
}

.bestiary__actions {
  margin-top: 1.75rem;
}

.shelf {
  margin-top: 3rem;
}

.shelf h2 {
  font-size: 2.1rem;
}

.shelf > p {
  margin: 0.35rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.bestiary__get {
  margin-top: 4rem;
  text-align: center;
}

/* --- Privacy band ---------------------------------------------------------------------- */

.band {
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 6vw, 5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(122, 75, 224, 0.35), transparent 60%),
    radial-gradient(50% 100% at 100% 100%, rgba(238, 116, 32, 0.2), transparent 60%),
    var(--hexes), #150e20;
}

.band p:last-child {
  max-width: 40rem;
  margin-top: 1.5rem;
  color: #cdc2d6;
  font-size: 1.15rem;
}

/* --- Get it ---------------------------------------------------------------------------- */

.get {
  padding-bottom: clamp(5rem, 10vw, 8rem);
  text-align: center;
}

.get__icon {
  border-radius: 23%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 80px -10px rgba(238, 116, 32, 0.6);
}

.get h2 {
  margin: 2rem 0 1rem;
  font-size: clamp(2.8rem, 7vw, 5rem);
}

.get > p {
  color: var(--muted);
}

.get__join {
  margin-top: 2rem;
}

.get__fine {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

/* --- Footer ---------------------------------------------------------------------------- */

.footer {
  width: var(--page);
  margin: 0 auto;
  padding: 2.25rem 0 3rem;
  border-top: 1px solid var(--line);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2.5rem;
}

.footer .brand {
  font-size: 1.45rem;
}

.footer__links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.95rem;
}

/* The hosting credit: label plus the Deployo wordmark. */
.deployed {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.75rem;
  margin-left: auto;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.deployed:hover {
  border-color: rgba(255, 182, 72, 0.5);
}

.deployed__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.deployed__logo {
  width: auto;
  height: 22px;
}

.footer__fine {
  margin-top: 1.75rem;
  color: #8a7d95;
  font-size: 0.8rem;
}

/* --- Legal pages ----------------------------------------------------------------------- */

.legal {
  width: min(44rem, 100% - 2.5rem);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

.legal h1 {
  margin-bottom: 2rem;
  font-size: clamp(2.6rem, 6vw, 4rem);
}

.legal h2 {
  margin: 2.5rem 0 0.8rem;
  font-size: 1.9rem;
}

.legal p,
.legal address {
  margin-bottom: 1rem;
  color: #cdc2d6;
  font-style: normal;
}

.legal a {
  color: var(--amber);
}

.legal h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.4rem;
}

.legal strong {
  color: var(--text);
}

.legal dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 2rem;
  margin: 2rem 0 0;
}

.legal dt {
  color: var(--muted);
}

.legal dd {
  margin: 0;
}

@media (max-width: 480px) {
  .legal dl {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .legal dd {
    margin-bottom: 0.9rem;
  }
}

/* --- Scroll-in reveals (only when site.js switches them on) ------------------------------ */

.has-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
}

/* The transition lives on the visible state only, so nothing fades out when the page loads. */
.has-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.has-reveal :is(.steps, .cards) > .reveal.is-visible:nth-child(3n + 2) {
  transition-delay: 0.09s;
}

.has-reveal :is(.steps, .cards) > .reveal.is-visible:nth-child(3n) {
  transition-delay: 0.18s;
}
