/* Hexbrew site. Colours are the game's own (scenes/ui/theme.gd). No external requests. */

@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1b1a1f;
  --hedge: #2c3a2a;
  --meadow: #93cf6e;
  --panel: #f3e6c4;
  --panel-light: #e3d0a0;
  --slot: #d8c594;
  --slot-line: #c9b68a;
  --border: #4a3524;
  --text: #3a2a1c;
  --muted: #6b5638;
  --link: #2f6a2a;
  --pale: #fff6e0;
  --gold: #ffd75a;
  --green: #5fa650;
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--meadow);
  color: var(--text);
  font: 500 18px/1.6 var(--font);
}

/* The meadow, pinned behind everything. A fixed layer rather than
   background-attachment: fixed, which iOS Safari ignores. */
body::before {
  content: "";
  position: fixed;
  z-index: -2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  background: var(--meadow) url("art/ground.svg") center top / max(100vw, 160vh, 1300px) auto no-repeat;
}

/* Document pages sit on the dimmed meadow the game puts behind its menus. */
.doc::after {
  content: "";
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  background: rgba(24, 34, 22, 0.74);
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }

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

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 752px; }

/* Text drawn straight onto the meadow: pale with a thick ink outline, as in the game. */
.outlined {
  color: var(--pale);
  font-weight: 700;
  text-shadow:
    0 0.09em 0 var(--ink), 0 -0.09em 0 var(--ink), 0.09em 0 0 var(--ink), -0.09em 0 0 var(--ink),
    0.065em 0.065em 0 var(--ink), -0.065em 0.065em 0 var(--ink), 0.065em -0.065em 0 var(--ink), -0.065em -0.065em 0 var(--ink);
}
@supports (paint-order: stroke) and (-webkit-text-stroke: 1px black) {
  .outlined {
    text-shadow: none;
    -webkit-text-stroke: 0.3em var(--ink);
    paint-order: stroke fill;
    stroke-linejoin: round;
  }
}
.gold { color: var(--gold); }

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 16px;
  padding-bottom: 8px;
}
.top.end { justify-content: flex-end; }

.wordmark {
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 10px 4px;
}

.nav { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 18px;
  background: var(--panel-light);
  color: var(--text);
  border: 4px solid var(--border);
  border-radius: 14px;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover, .btn:active { background: var(--border); color: var(--pale); }
.btn[aria-current="page"] { background: var(--panel); box-shadow: inset 0 -5px 0 var(--slot); }
.btn[aria-current="page"]:hover { color: var(--text); }

@media (max-width: 440px) {
  .top .wordmark { font-size: 1.4rem; }
  .top .btn { padding: 6px 12px; font-size: 1rem; }
  .top .nav { gap: 8px; }
}
@media (max-width: 350px) {
  .top .wordmark { font-size: 1.2rem; padding-left: 0; padding-right: 0; }
  .top .btn { padding: 6px 9px; }
}

/* ---------- Home: hero ---------- */

.hero { text-align: center; padding-top: 12px; }

.hero h1 {
  margin: 0;
  font-size: clamp(3.3rem, 16.5vw, 7.5rem);
  line-height: 1.05;
  letter-spacing: 0.05em;
  /* letter-spacing leaves a trailing gap; pull the word back to centre */
  margin-right: -0.05em;
}

.pitch {
  margin: 0.5em 0 0;
  font-size: clamp(1.2rem, 4.7vw, 1.75rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.035em;
  -webkit-text-stroke-width: 0.22em;
  text-wrap: balance;
}

.soon {
  margin: 0.9em 0 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.3;
  letter-spacing: 0.04em;
  -webkit-text-stroke-width: 0.24em;
}

.lineup {
  --w: clamp(44px, 12.4vw, 76px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 8px clamp(16px, 4vw, 48px);
  margin: clamp(24px, 6vw, 44px) 0 0;
}
.lineup > div { display: flex; align-items: flex-end; justify-content: center; }
.lineup img { display: block; flex: none; }
.wizards img { width: var(--w); margin-left: calc(var(--w) * -0.27); }
.wizards img:first-child { margin-left: 0; }
.slimes { gap: calc(var(--w) * 0.06); }
.slimes img { width: calc(var(--w) * 0.72); margin-bottom: calc(var(--w) * 0.06); }
.slimes img.king { width: calc(var(--w) * 1.9); margin-bottom: 0; margin-left: calc(var(--w) * -0.08); }

@media (prefers-reduced-motion: no-preference) {
  .slimes img { animation: squish 2.2s ease-in-out infinite; transform-origin: 50% 92%; }
  .slimes img:nth-child(2) { animation-delay: -0.5s; }
  .slimes img:nth-child(3) { animation-delay: -1.1s; }
  .slimes img:nth-child(4) { animation-delay: -1.6s; }
  .slimes img:nth-child(5) { animation-delay: -0.8s; }
  .slimes img.king { animation-duration: 3.2s; animation-delay: -0.3s; }
  @keyframes squish {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.05, 0.93); }
  }
}

/* ---------- Parchment ---------- */

.panel {
  background: var(--panel);
  border: 5px solid var(--border);
  border-radius: 18px;
  padding: 22px 22px;
}

.about { text-align: left; max-width: 720px; margin: clamp(24px, 5vw, 40px) auto 0; font-size: 1.08rem; }
.about p { margin: 0; }
.about p + p { margin-top: 0.7em; }
.about strong { font-weight: 700; }

.section-title {
  margin: clamp(40px, 8vw, 64px) 0 16px;
  text-align: center;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: 0.035em;
  -webkit-text-stroke-width: 0.24em;
}

/* ---------- Screenshots ---------- */

.shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shots figure {
  margin: 0;
  background: var(--panel);
  border: 5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.shots img { display: block; width: 100%; background: var(--hedge); border-bottom: 4px solid var(--border); }
.shots figcaption { padding: 9px 16px 11px; font-weight: 600; font-size: 1rem; line-height: 1.35; text-align: center; text-wrap: balance; }

/* ---------- Features ---------- */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 5px solid var(--border);
  border-radius: 18px;
  padding: 12px 16px 12px 12px;
  font-weight: 600;
  line-height: 1.35;
}
.features img {
  flex: none;
  width: 60px;
  height: 60px;
  padding: 6px;
  background: var(--slot);
  border: 3px solid var(--slot-line);
  border-radius: 12px;
  object-fit: contain;
}

@media (min-width: 760px) {
  .shots { grid-template-columns: 1fr 1fr; gap: 22px; }
  .features { grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (min-width: 1020px) {
  .features { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Document pages ---------- */

.page-wrap { position: relative; margin-top: 62px; }
.page { position: relative; padding: 26px 22px 28px; }
.page > :first-child { margin-top: 0; }
.page > :last-child { margin-bottom: 0; }

.page h1 { font-size: clamp(1.75rem, 7vw, 2.2rem); line-height: 1.15; font-weight: 700; margin: 0 0 0.25em; text-wrap: balance; }
.page h2 { font-size: 1.3rem; line-height: 1.25; font-weight: 700; margin: 1.7em 0 0.35em; padding-top: 1.1em; border-top: 3px solid var(--slot); }
.page h3 { font-size: 1.08rem; line-height: 1.3; font-weight: 700; margin: 1.25em 0 0.1em; }
.page p, .page ul { margin: 0.55em 0; }
.page h3 + p { margin-top: 0.1em; }
.page ul { padding-left: 1.3em; }
.page li { margin: 0.4em 0; padding-left: 0.15em; }
.page li::marker { color: var(--border); }
.page .lead { font-size: 1.14rem; font-weight: 600; }
.page .updated { color: var(--muted); font-size: 0.98rem; margin-top: 0; }
.page a { font-weight: 600; overflow-wrap: anywhere; }

/* A visitor from the game, peeking over the top edge of the page from behind it. */
.perch { position: absolute; right: 24px; bottom: 100%; width: 64px; margin-bottom: -20px; pointer-events: none; }
.perch.tall { width: 58px; margin-bottom: -30px; }

@media (min-width: 600px) {
  .page-wrap { margin-top: 76px; }
  .page { padding: 36px 40px 40px; }
  .perch { right: 44px; width: 80px; margin-bottom: -25px; }
  .perch.tall { width: 72px; margin-bottom: -37px; }
}

/* ---------- Footer: the hedge around the arena ---------- */

main { flex: 1 0 auto; padding-bottom: clamp(40px, 8vw, 64px); }

.foot {
  flex: none;
  background: var(--hedge);
  border-top: 6px solid var(--ink);
  color: var(--pale);
  text-align: center;
  padding: 22px 0 26px;
  font-size: 0.98rem;
}
.foot .nav { justify-content: center; flex-wrap: wrap; }
.foot p { margin: 16px 0 0; }
