/* --------------------------------------------------------------------------
   Header — transparent over the hero, glass once scrolled
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6em 1em;
  background: var(--paper);
  border: 1px solid var(--bdr2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: top 150ms ease;
}
.skip-link:focus-visible {
  top: 1rem;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-block: 0.9rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 400ms ease, border-color 400ms ease, padding 300ms ease;
}
.site-head.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--bdr);
  padding-block: 0.65rem;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-head.scrolled {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--bright);
}
.brand:hover {
  color: var(--bright);
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--bdr2);
  box-shadow: 0 0 22px var(--logo-glow);
}
.brand b {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand b em {
  font-style: normal;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem 1.9rem;
  flex-wrap: wrap;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.35rem;
  position: relative;
  transition: color 300ms ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 300ms ease;
}
.site-nav a:hover {
  color: var(--accent);
}
.site-nav a:hover::after {
  width: 100%;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
}
.site-nav a[aria-current="page"]::after {
  width: 100%;
}

.theme-cycle {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bdr2);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 200ms ease, transform 200ms ease;
}
.theme-cycle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(20deg);
}
.theme-cycle svg {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------------
   Buttons, chips, badges
   -------------------------------------------------------------------------- */
/* EVERY edge and ring on a .btn is drawn as the element's own background with
   the fill laid over it in ::before — never as a border, an outline, or an
   inset shadow. All three are rectangles, and .btn's clip-path cuts two
   chamfers out of that rectangle: the line simply stopped at each diagonal
   and the button read as a broken box. Background and fill share the clip, so
   the boundary follows the shape the whole way round.

   ::before takes `clip-path: inherit`, so it wears whatever shape the button
   wears — including the game page's smaller 11px chamfer — and the width of
   the edge is set by `inset` alone. Nothing to keep in sync. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.9em;
  border: none;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  transition: transform 300ms ease, box-shadow 300ms ease, background 300ms ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;                       /* behind the label, above the edge */
  clip-path: inherit;
  transition: inset 150ms ease, background 300ms ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--btn-bg);         /* only ever seen as the focus ring */
  color: var(--btn-fg);              /* daylight 5.89, was 4.99 */
}
.btn-primary::before {
  background: linear-gradient(135deg, var(--btn-bg), var(--accent-dark));
}
.btn-primary:hover {
  color: var(--btn-fg);
  box-shadow: 0 8px 35px var(--glow);   /* was a cyan halo in every theme */
}

.btn-quiet {
  background: var(--edge);           /* the boundary itself */
  color: var(--bright);
}
.btn-quiet::before {
  inset: 1px;
  background: var(--field-bg);
}
.btn-quiet:hover {
  color: var(--bright);
  background: var(--field-bdr-hover);
}
.btn-quiet:hover::before {
  background: color-mix(in srgb, var(--field-bg) 92%, var(--accent));
}

/* The ring is the edge grown thicker, so it follows the chamfers too — an
   outline or an inset shadow would be cut away at both diagonals, on every
   button on the site. MUST sit after the hover rules: same specificity
   (0,2,0), so source order is what decides a focused-and-hovered button. */
.btn:focus-visible {
  outline: none;
  background: var(--accent);
}
/* an accent ring on an accent-filled button would be invisible */
.btn-primary:focus-visible {
  background: var(--bright);
}
.btn:focus-visible::before {
  inset: 3px;
}

/* Tints MIXED from the accent, never written as literal cyan. A hardcoded
   rgba cannot follow a theme: on the cream page these stayed electric blue
   washes carrying rust text. See the same fix on .badge-plat. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.32em 0.85em;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  white-space: nowrap;
}
.chip-logic {
  color: var(--accent-ink);
}
.chip-arcade {
  color: var(--accent-2-ink);
  border-color: color-mix(in srgb, var(--accent-2) 32%, transparent);
  background: color-mix(in srgb, var(--accent-2) 9%, transparent);
}

.badge {
  padding: 0.28em 0.7em;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--badge-fg); /* measured AA on every badge fill, every theme */
}
.badge-live {
  background: var(--green);
}
.badge-new {
  background: var(--pink);
}
.badge-soon {
  background: var(--purple);
}
/* The only badge that is an outline rather than a fill, so its colours must
   be MIXED FROM THE ACCENT, not written down. Hardcoded `rgba(0, 229, 255,
   …)` meant this one chip stayed electric cyan when every other theme token
   moved: on the cream page it was a pale cyan wash carrying rust text, the
   single out-of-palette element on the support board. */
.badge-plat {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.platform-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-block: 1.6rem 0.4rem;
}

/* ---------------- the header on a narrow screen ----------------
   MEASURED, not guessed. At a 390px viewport `.site-head .wrap` is 331px, the
   brand alone is 258px and the nav's five links total 249px before gaps, so
   the brand and the nav cannot share a row and `flex-wrap` drops the nav
   underneath. That much is fine and intended. What is not is that with the
   stock 1.9rem column gap the nav needs 371px and wraps a SECOND time, so the
   header stands at 156px below 492px wide and 118px below 776px, against the
   68px it is on a desktop.

   Tightening the gap and the tracking gets the five links onto one row: at the
   narrowest width the site supports they need 270px against the 288px there is.
   Nothing here changes the FONT SIZE — the links keep their 0.35rem padding-block
   and so stay above the 24px AA target floor.

   Letter-spacing is the part that scales badly with length: at 0.16em it adds
   most of a character's width every six, which is why it comes down with the
   gap rather than the size coming down instead. */
@media (max-width: 49rem) {
  /* The theme control is INSIDE the nav in the markup — the header is copied
     across nine files and moving it would be nine edits — so it is lifted out
     of the flow to the brand's row instead. That is what buys the nav a whole
     row to itself, and `width: 100%` then makes the two-row header
     deterministic rather than a consequence of how wide five words happen to
     be. The brand comes down from 0.92rem so its tail clears the control. */
  .site-head .wrap { position: relative; }
  .brand b { font-size: 0.86rem; }
  .site-nav { gap: 0.3rem 0.8rem; width: 100%; }
  .site-nav a { letter-spacing: 0.1em; }
  .theme-cycle { position: absolute; top: 2px; right: 0; }
}
