/* ─────────────────────────────────────────────────────────────
   Stackwell Solutions — Slant Cut design system, shared base.
   Source of truth: claude.ai/design "Stackwell Website" project
   (Brand Book v1.0). Four laws: 11° skew · hard corners + 1.5px
   ink outlines · broken frame (opening at the top-left vertex) ·
   progress drains.

   This file carries the STRUCTURAL tokens (skew, spacing, easing, hairline,
   the always-dark stage) and the primitives. The COLOUR PALETTE is NOT here:
   assets/site.css owns it, because the site themes from the visitor's own
   choice (assets/theme.js → data-theme) rather than from the OS. Page layout
   lives in assets/site.css as well.

   The structural tokens still mirror apps/studio-backoffice/src/index.css.
   The palette deliberately no longer does — if you sync this file from the
   studio again, do not bring the colour block back with it.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'JetBrains Mono';
  src: url(fonts/jetbrainsmono-var.woff2) format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --stage: #16171A;          /* the stage is dark in BOTH themes */
  --active: #5FB8D8;

  --hair: 1.5px;
  --skew: skewX(-11deg);
  --unskew: skewX(11deg);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;

  --measure: 68ch;
  --max: 1280px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, 'Space Mono', Menlo, monospace;
  font-size: 14px;
  line-height: 1.75;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--interactive-strong); }
a:hover { color: var(--ink); }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--on-ink);
  padding: var(--s1) var(--s2); z-index: 100;
}
.skip:focus { left: var(--s2); top: var(--s2); }

:focus-visible {
  outline: 2px solid var(--interactive-strong);
  outline-offset: 3px;
}

h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }

.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: var(--muted);
}

.num { font-variant-numeric: tabular-nums; }

/* ── buttons — the one ink fill ──────────────────────── */
.btn {
  display: inline-block;
  transform: var(--skew);
  background: var(--ink);
  color: var(--on-ink);
  border: var(--hair) solid var(--ink);
  padding: 9px 22px;
  font: inherit; font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background 140ms var(--ease), transform 90ms var(--ease);
}
.btn > i { display: block; transform: var(--unskew); font-style: normal; }
.btn:hover { background: var(--ink-soft); color: var(--on-ink); }
.btn:active { transform: var(--skew) translate(2px, 2px); }
.btn.sec { background: transparent; color: var(--ink); }
.btn.sec:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.btn.inv { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn.inv:hover { background: var(--surface); color: var(--ink); }
.btn.lg { padding: 13px 30px; font-size: 12px; }

/* ── skewed ink banner ───────────────────────────────── */
.banner {
  display: inline-block; transform: var(--skew);
  background: var(--ink); color: var(--on-ink);
  padding: 7px 20px 7px 22px;
}
.banner h2 { font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.banner > * { transform: none; }

/* ── brand mark (the Diagonal) ───────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 26px; height: 26px; display: block; }
.brand b { font-size: 12px; letter-spacing: .18em; }
.ink { fill: var(--ink); }
/* outline modules of the mark — always resolve to the page's ink */
.io { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: miter; stroke-linecap: butt; }

/* ── the broken frame ────────────────────────────────── */
.framed {
  border: var(--hair) solid var(--ink);
  background: var(--surface);
  position: relative;
}
.framed::before {
  content: ""; position: absolute;
  top: calc(var(--hair) * -1 - 1px); left: -2px;
  width: 22px; height: 5px;
  background: var(--paper);
}

/* ── hard offset shadow (never soft) ─────────────────── */
.stamped { box-shadow: 6px 6px 0 var(--ink); }

/* ── wire diagrams ───────────────────────────────────── */
.wire {
  fill: none; stroke: var(--ink); stroke-width: 1.8;
  stroke-linecap: butt; stroke-linejoin: miter;
}
.wire.dash { stroke: var(--track); stroke-dasharray: 4 4; }

/* ── game tile primitives ────────────────────────────── */
.tile {
  display: flex; flex-direction: column;
  border: var(--hair) solid var(--ink);
  background: var(--surface);
  padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  transition: transform 140ms var(--ease);
}
button.tile { -webkit-appearance: none; appearance: none; }
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(0); }
.tile-art {
  position: relative; display: block;
  aspect-ratio: 3 / 4;
  background: var(--stage);
  overflow: hidden;
  border-bottom: var(--hair) solid var(--ink);
}
.tile-bg, .tile-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 320ms var(--ease);
}
.tile:hover .tile-bg, .tile:hover .tile-cover { transform: scale(1.04); }
.tile-bg-blur { filter: blur(22px) saturate(1.3) brightness(0.5); transform: scale(1.25); }
.tile:hover .tile-bg-blur { transform: scale(1.3); }
.tile-logo {
  position: absolute; left: 8%; right: 8%; top: 7%;
  width: 84%; max-height: 34%;
  object-fit: contain; object-position: top center;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.5));
}
.tile-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(22,23,26,.34);
  opacity: 0; transition: opacity 140ms var(--ease);
}
.tile:hover .tile-play, .tile:focus-visible .tile-play { opacity: 1; }
.tile-play svg {
  width: 30px; height: 30px;
  fill: none; stroke: #F1EDE4; stroke-width: 2; stroke-linejoin: miter;
  transform: var(--skew);
}
.tile-play em {
  font-style: normal; font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: #F1EDE4;
}
.tile-meta {
  padding: var(--s2);
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface);
}
.tile-meta b { font-size: 12.5px; color: var(--ink); }
.tile-meta > span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ── the drain (progress drains) ─────────────────────── */
.well-fill {
  fill: var(--active);
  transform-box: fill-box;
  transform-origin: bottom;
  animation: drain 3.6s var(--ease) infinite;
}
@keyframes drain {
  0%, 8%   { transform: scaleY(1); }
  55%, 62% { transform: scaleY(0); }
  100%     { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .well-fill { animation: none; transform: scaleY(.45); }
}
