/* Pixellect — shared tokens, base elements, buttons, and the legal/support pages.
   Palette: the warm Pixellect artwork. Unlit tiles are violet; lit tiles run
   crimson → ember → gold, with a white-hot core. */
/* Fonts are self-hosted (SIL Open Font License, see assets/fonts/OFL-*.txt). */
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("assets/fonts/mona-sans-latin.v4.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("assets/fonts/mona-sans-latin-ext.v4.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/geist-mono-latin.v6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/geist-mono-latin-ext.v6.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  --void: #0a0612;
  --plum: #120a1c;
  --plum-2: #1a1027;
  --plum-3: #241635;
  --indigo: #34237a;
  --crimson: #ff3d5a;
  --ember: #ff7a1c;
  --gold: #ffcf3a;
  --flare: #fff3a6;
  --pearl: #fbf4ee;

  --text: #f6efe9;
  --muted: #b8abc3;
  --faint: #7e7190;
  --line: rgba(232, 208, 255, 0.1);
  --line-strong: rgba(232, 208, 255, 0.2);

  --glow: linear-gradient(95deg, #ff4d7a 0%, #ff7a1c 42%, #ffcf3a 78%, #fff3a6 100%);
  --glow-soft: linear-gradient(95deg, rgba(255, 77, 122, 0.9), rgba(255, 122, 28, 0.9) 50%, rgba(255, 207, 58, 0.9));

  --font-display: "Mona Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Mona Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1280px;
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  background: var(--void);
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

::selection { background: rgba(255, 122, 28, 0.42); color: #fff; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pearl);
  color: var(--void);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- type primitives ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ember);
  box-shadow: 0 0 10px 1px rgba(255, 122, 28, 0.8);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 118%;
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.glow-text {
  background: var(--glow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- buttons ---------- */
.button {
  --button-bg: var(--pearl);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg);
  color: #140a1c;
  font: 600 16px/1 var(--font-body);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 10px 30px -12px rgba(255, 122, 28, 0.55);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 0 0 5px rgba(255, 207, 58, 0.14),
    0 18px 50px -12px rgba(255, 122, 28, 0.85);
}
.button:active { transform: translateY(0) scale(0.985); }
.button svg { width: 16px; height: 16px; flex: none; }

.button--ghost {
  --button-bg: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}
.button--ghost:hover {
  --button-bg: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 207, 58, 0.45) inset;
}

.button--small { min-height: 40px; padding: 0 18px; font-size: 14px; }

.button__stack { display: grid; gap: 3px; text-align: left; }
.button__stack small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.62;
}

/* ---------- atmosphere shared by all pages ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* =====================================================================
   Legal, support, and changelog pages
   ===================================================================== */
.legal-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}
.legal-shell::before {
  content: "";
  position: absolute;
  inset: -20vh -10vw auto;
  height: 90vh;
  z-index: -1;
  background:
    radial-gradient(55% 60% at 78% 18%, rgba(255, 122, 28, 0.26), transparent 70%),
    radial-gradient(45% 55% at 58% 0%, rgba(255, 61, 90, 0.24), transparent 70%),
    radial-gradient(60% 70% at 22% 10%, rgba(80, 45, 170, 0.4), transparent 72%);
  filter: blur(10px);
}
.legal-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(232, 208, 255, 0.07) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 55vh);
  mask-image: linear-gradient(180deg, #000, transparent 55vh);
}

.legal-frame {
  width: min(100% - 2 * var(--gutter), 1080px);
  margin: 0 auto;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 24px 0;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: 18px;
}
.legal-brand img { width: 36px; height: 36px; border-radius: 9px; }
.legal-brand span { display: grid; line-height: 1.1; }
.legal-brand small {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0.02em;
}

.legal-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.legal-nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.legal-nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.legal-nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.legal-nav-links .legal-nav-cta {
  margin-left: 6px;
  padding: 9px 16px;
  background: var(--pearl);
  color: #140a1c;
  font-weight: 600;
}
.legal-nav-links .legal-nav-cta:hover { background: #fff; color: #140a1c; }

.legal-main {
  max-width: 780px;
  padding: clamp(48px, 9vw, 110px) 0 96px;
}
.legal-main--wide { max-width: 1080px; }

.legal-kicker {
  margin: 0 0 20px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6.4vw, 76px);
  font-stretch: 118%;
  font-weight: 640;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.legal-lede {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
}

.legal-meta {
  margin: 20px 0 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 13px;
}

.legal-rule {
  height: 1px;
  margin: 48px 0;
  background: linear-gradient(90deg, rgba(255, 122, 28, 0.6), rgba(232, 208, 255, 0.12) 40%, transparent);
}

.legal-content { color: #ddd2e2; }
.legal-content--wide { max-width: none; }
.legal-content h2 {
  margin: 56px 0 14px;
  color: var(--text);
  font-size: 26px;
  font-stretch: 112%;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  margin: 32px 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 620;
}
.legal-content p, .legal-content li { line-height: 1.72; }
.legal-content p { margin: 0 0 16px; }
.legal-content ul, .legal-content ol { margin: 0 0 18px; padding-left: 22px; }
.legal-content li { margin-bottom: 8px; }
.legal-content li::marker { color: var(--ember); }
.legal-content strong { color: var(--text); font-weight: 620; }
.legal-content a, .legal-lede a, .changelog-source a, .contact-value a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(255, 207, 58, 0.4);
  text-underline-offset: 3px;
}
.legal-content a:hover, .changelog-source a:hover, .contact-value a:hover { text-decoration-color: var(--gold); }
.legal-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.legal-table-wrap {
  margin: 24px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 10, 28, 0.7);
}
.legal-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.legal-table th, .legal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.legal-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-table tr:last-child td { border-bottom: 0; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 48px;
}
.contact-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 10, 28, 0.72);
}
.contact-card--wide { grid-column: 1 / -1; }
.contact-label {
  margin: 0 0 12px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-value { margin: 0; font-size: 19px; font-weight: 560; line-height: 1.45; }
.contact-card--wide .contact-value { font-size: clamp(22px, 3vw, 30px); font-stretch: 110%; letter-spacing: -0.02em; }
.contact-value small { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; font-weight: 400; font-stretch: 100%; letter-spacing: 0; }

.changelog-source { margin: 16px 0 0; color: var(--faint); font-size: 14px; }
.release-list { display: grid; gap: 16px; }
.release-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 10, 28, 0.72);
}
.release-card:first-child {
  border-color: rgba(255, 122, 28, 0.35);
  box-shadow: 0 30px 80px -50px rgba(255, 122, 28, 0.7);
}
.release-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}
.release-version { margin: 0; font-size: 24px; font-stretch: 112%; font-weight: 640; letter-spacing: -0.02em; }
.release-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--glow);
  color: #1a0b12;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 4px;
}
.release-meta { margin: 6px 0 0; color: var(--faint); font-family: var(--font-mono); font-size: 13px; }
.release-notes-link { color: var(--muted); font-size: 14px; text-decoration: none; }
.release-notes-link:hover { color: var(--gold); }
.release-notes { margin-top: 18px; color: #ddd2e2; }
.release-notes ul { margin: 0; padding-left: 20px; }
.release-notes li { margin-bottom: 6px; }
.release-notes li::marker { color: var(--ember); }

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}
.legal-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legal-footer-links a { color: var(--muted); text-decoration: none; }
.legal-footer-links a:hover { color: var(--text); }

@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
  .legal-nav-links { gap: 2px; }
  .legal-nav-links a { padding: 7px 10px; }
}
