/*
 * LYRIDIA website: the game's "Cypher" HUD look (ColonySim/Source/ColonySim/ColonyUIStyle.h, and the CyberStorm
 * Cypher theme it comes from). Graphite panels, white chamfered frames, one accent (gold unless the visitor picks
 * another swatch), uppercase mono labels, short eased motion. The frame drawings are in frames.css (generated by
 * build.py from src/frames.json).
 */

:root {
  --paper: #0e0e0f;
  --surface: #17181a;
  --raised: #222326;
  --line: #3a3c40;
  --line-strong: #7b7f85;
  --ink: #f2f2f0;
  --ink-2: #a6aab1;
  --ink-3: #8a8e94; /* the game's Ink3 (#7D8187), a touch lighter for 4.5:1 on small web text */
  --accent: #c9a45c;
  --on-accent: #0e0e0f;

  --font: 'Work Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease-back: cubic-bezier(0.2, 0.9, 0.2, 1.15);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* A faint dotted grid behind everything, like the HUD's dotted skies. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 1px 1px, rgb(242 242 240 / 0.06) 1px, transparent 1.5px) 0 0 / 24px 24px,
    radial-gradient(ellipse 80% 60% at 50% -10%, rgb(201 164 92 / 0.07), transparent 70%);
  pointer-events: none;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main { flex: 1; display: block; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.15; font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
code { font: 0.88em var(--mono); color: var(--ink); background: var(--raised); padding: 0.1em 0.35em; }
::selection { background: var(--accent); color: var(--on-accent); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--on-accent); font: 600 13px var(--mono); }
.skip:focus { top: 12px; }
.accent { color: var(--accent); }

/* ---------- type pieces ---------- */

.cy-readout {
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cy-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  font: 500 13px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.cy-kicker a { text-decoration: none; }
/* "///  TITLE" with a thin rule to the right (CySection). */
.cy-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2.4em 0 0.8em;
  font: 500 15px/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.cy-section > span { color: var(--accent); letter-spacing: 0; }
.cy-section::after { content: ""; flex: 1; height: 1px; background: var(--line); min-width: 24px; }

.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 62ch; }
.note { color: var(--ink-3); font-size: 14px; }

/* ---------- frames (Cypher's 9-slice drawings) ---------- */

.cy-card,
.cy-window,
.cy-btn,
.cy-tile-frame {
  border-style: solid;
  border-color: transparent;
}
.cy-card {
  border-width: 16px;
  border-image: var(--cy-frame) 32 fill / 16px / 0 stretch;
  transition: transform 180ms var(--ease-back);
}
.cy-window {
  border-width: 32px;
  border-image: var(--cy-window) 64 fill / 32px / 8px stretch;
  padding: 4px 8px;
}
a.cy-card:hover, .cy-card:has(> a:hover), .cy-card:focus-within {
  border-image-source: var(--cy-frame-hover);
}

.cy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-width: 14px 12px;
  border-image: var(--cy-button) 64 fill / 22px 22px / 8px stretch;
  color: var(--ink);
  font: 650 13px/1 var(--font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  transition: color 160ms ease, transform 160ms var(--ease-back);
}
.cy-btn:hover { border-image-source: var(--cy-button-hover); color: var(--accent); transform: translateY(-1px); }
.cy-btn:active { transform: translateY(1px); }
.cy-btn--solid { border-image-source: var(--cy-button-solid); color: var(--on-accent); }
.cy-btn--solid:hover { border-image-source: var(--cy-button-solid); color: var(--on-accent); filter: brightness(1.08); }
.cy-btn__n { font-family: var(--mono); color: var(--accent); letter-spacing: 0.04em; }
.cy-btn--solid .cy-btn__n { color: var(--on-accent); opacity: 0.7; }

/* A solid chamfered key (prev / next, close). */
.cy-key {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  background: var(--raised);
  color: var(--ink);
  font: 500 20px/1 var(--mono);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.cy-key:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- header (the HUD bar) ---------- */

.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(14 14 15 / 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hud__bar { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.hud__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font: 500 18px/1 var(--mono);
  letter-spacing: 0.32em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.hud__slash { color: var(--accent); letter-spacing: 0; }
.hud__tag { font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); }
.hud__nav { margin-left: auto; }
.hud__nav ul { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; padding: 0; }
.cy-tab {
  position: relative;
  display: block;
  padding: 10px 10px;
  font: 600 12px/1 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}
.cy-tab__n { font-family: var(--mono); color: var(--ink-3); margin-right: 2px; }
.cy-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-back);
}
.cy-tab:hover { color: var(--ink); }
.cy-tab:hover::after, .cy-tab[aria-current]::after { transform: none; }
.cy-tab[aria-current] { color: var(--accent); }
.cy-tab[aria-current] .cy-tab__n { color: var(--accent); }
.hud__menu { display: none; margin-left: auto; }
.hud__burger, .hud__burger::before, .hud__burger::after { display: block; width: 18px; height: 2px; background: currentColor; content: ""; transition: transform 200ms ease; }
.hud__burger { position: relative; }
.hud__burger::before { position: absolute; top: -6px; }
.hud__burger::after { position: absolute; top: 6px; }
.hud__menu[aria-expanded="true"] .hud__burger { background: transparent; }
.hud__menu[aria-expanded="true"] .hud__burger::before { transform: translateY(6px) rotate(45deg); }
.hud__menu[aria-expanded="true"] .hud__burger::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .hud__menu { display: inline-grid; }
  .hud__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }
  .hud__nav.is-open { display: block; }
  .hud__nav ul { flex-direction: column; }
  .cy-tab { padding: 14px 4px; font-size: 14px; border-bottom: 1px solid var(--line); }
  .cy-tab::after { left: 4px; right: auto; width: 40px; bottom: -1px; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(88svh, 820px);
  display: grid;
  align-items: end;
  padding: 120px 0 56px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(14 14 15 / 0.94) 0%, rgb(14 14 15 / 0.72) 38%, rgb(14 14 15 / 0.15) 75%),
    linear-gradient(0deg, var(--paper) 0%, transparent 35%),
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px);
}
.hero__inner { display: grid; gap: 28px; }
.hero__title {
  font: 500 clamp(48px, 10vw, 128px)/0.9 var(--mono);
  letter-spacing: 0.2em;
  margin-right: -0.2em;
  text-transform: uppercase;
}
.hero__pitch { font-size: clamp(19px, 2.2vw, 24px); max-width: 30ch; color: var(--ink); line-height: 1.4; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__readout { max-width: 420px; }
.readout-grid { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.readout-grid dt { font: 500 10px/1.4 var(--mono); letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }
.readout-grid dd { margin: 0; font: 500 15px/1.4 var(--mono); color: var(--ink); }
.readout-grid dd.accent { color: var(--accent); }

.seg { display: flex; gap: 3px; margin-top: 12px; }
.seg i { flex: 1; height: 8px; background: var(--line); }
.seg i.on { background: var(--accent); }

/* ---------- sections ---------- */

.band { padding: clamp(56px, 8vw, 104px) 0; }
.band--alt { background: linear-gradient(180deg, transparent, rgb(23 24 26 / 0.7) 15%, rgb(23 24 26 / 0.7) 85%, transparent); }
.band__head { display: grid; gap: 14px; margin-bottom: 36px; max-width: 760px; }
.band__head h2 { font-size: clamp(30px, 4vw, 46px); }
.page-head { width: min(100% - 2 * var(--gutter), var(--wrap)); margin: clamp(48px, 8vw, 88px) auto 40px; display: grid; gap: 16px; }
.page-head h1 { font-size: clamp(38px, 6vw, 68px); letter-spacing: -0.01em; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.feature { display: grid; align-content: start; gap: 10px; padding: 12px 10px 14px; }
.feature h3 { font-size: 21px; }
.feature p { color: var(--ink-2); font-size: 16px; }
.feature__n { font: 500 12px var(--mono); letter-spacing: 0.12em; color: var(--accent); }
.status { display: inline-block; align-self: start; justify-self: start; padding: 3px 8px; font: 600 10px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--ink-2); }
.status--live { border-color: var(--accent); color: var(--accent); }

/* The four player types, as hex units. */
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.type { display: grid; gap: 10px; justify-items: start; padding: 10px; }
.type__hex {
  width: 72px;
  aspect-ratio: 1.1547;
  display: grid;
  place-items: center;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--raised);
  color: var(--accent);
  font: 500 15px var(--mono);
  letter-spacing: 0.1em;
  position: relative;
}
.type__hex::before { content: ""; position: absolute; inset: 0; clip-path: inherit; box-shadow: inset 0 0 0 2px var(--accent); border-top: 3px solid var(--accent); }
.type h3 { font: 500 20px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; }
.type p { color: var(--ink-2); font-size: 16px; }
.type__arrow { font: 500 12px var(--mono); color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; }

/* Screenshot tiles: the slim photo frame drawn over the image. */
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tiles--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }
.tile { display: grid; gap: 10px; }
.tile__link { position: relative; display: block; overflow: hidden; background: var(--surface); }
.tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cy-slim) center / 100% 100% no-repeat;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.tile__link:hover::after, .tile__link:focus-visible::after { background-image: var(--cy-slim-hover); }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 500ms var(--ease); }
.tile__link:hover img { transform: scale(1.03); }
.tile figcaption { font-size: 14px; color: var(--ink-2); }

/* Split: text beside an image. */
.split { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: center; }
.split__text { display: grid; gap: 16px; }
.split__text h2 { font-size: clamp(28px, 3.6vw, 40px); }
.split__text h2.cy-section { font-size: 15px; margin-top: 0; }
.split__text p { color: var(--ink-2); }
.checks { list-style: none; padding: 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 26px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 12px; height: 6px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); }

/* ---------- diary ---------- */

.posts { display: grid; gap: 24px; margin-bottom: 72px; }
.post__link { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; text-decoration: none; color: inherit; align-items: center; }
.post__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post__body { display: grid; gap: 10px; }
.post__body h3 { font-size: clamp(22px, 2.6vw, 30px); }
.post__body > p:not(.cy-readout) { color: var(--ink-2); }
.post__link:hover h3 { color: var(--accent); }
.post__tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.post__tags li { padding: 3px 8px; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: var(--raised); }
@media (max-width: 760px) { .post__link { grid-template-columns: 1fr; } }

.entry { width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto 72px; }
.entry .page-head { width: 100%; }
.entry__grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.entry__toc { position: sticky; top: 88px; font-size: 14px; }
.entry__toc ol { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink-3); }
.entry__toc a { color: var(--ink-2); text-decoration: none; }
.entry__toc a:hover { color: var(--accent); }
@media (max-width: 900px) { .entry__grid { grid-template-columns: minmax(0, 1fr); } .entry__toc { position: static; } }

.prose { max-width: 760px; }
.prose > * + * { margin-top: 1em; }
.prose > .cy-section:first-child { margin-top: 0; }
.prose ul { padding-left: 1.1em; display: grid; gap: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose p, .prose li { color: #d6d8dc; }
.shot { margin: 1.6em 0; }
.shot__link { position: relative; display: block; background: var(--surface); }
.shot__link::after { content: ""; position: absolute; inset: 0; background: var(--cy-slim) center / 100% 100% no-repeat; pointer-events: none; }
.shot__link:hover::after { background-image: var(--cy-slim-hover); }
.shot figcaption { margin-top: 10px; font: 500 12px/1.5 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.shot figcaption::before { content: "// "; color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; border-top: 1px solid var(--line); padding-top: 28px; }

/* ---------- world / lore ---------- */

.timeline { list-style: none; padding: 0; display: grid; gap: 0; position: relative; max-width: 860px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 36px 56px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 15px;
  height: 13px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--accent);
}
.timeline h3 { font: 500 14px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.timeline p { color: var(--ink-2); }
.quote { font-size: clamp(22px, 3vw, 32px); line-height: 1.35; max-width: 34ch; }
.quote::before { content: "// "; color: var(--accent); font-family: var(--mono); }

/* ---------- tables, credits ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 500 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); background: var(--surface); }
tbody th { font-weight: 600; color: var(--ink); }
td { color: var(--ink-2); }
tbody tr:hover { background: rgb(34 35 38 / 0.6); }
.credits-block { margin-bottom: 48px; }
.credits-block.cy-window p { color: var(--ink-2); }
.credits-block.cy-window p + p { margin-top: 0.7em; }
.credits-block .cy-section { margin-top: 0.4em; }
.credit-list { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.credit-list li { display: grid; gap: 4px; padding: 6px; }
.credit-list__what { font: 500 22px var(--mono); letter-spacing: 0.08em; }

/* ---------- call to action ---------- */

.cta { margin: 0 auto; }
.cta__inner { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; padding: 8px 12px; }
.cta h2 { font-size: clamp(26px, 3.4vw, 38px); }
.cta p { color: var(--ink-2); }
.signup { display: grid; gap: 10px; }
.signup__row { display: flex; gap: 10px; flex-wrap: wrap; }
.field {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: rgb(14 14 15 / 0.85);
  color: var(--ink);
  font: 400 16px var(--font);
}
.field:hover { border-color: var(--ink-2); }
.field:focus { outline: none; border-color: var(--accent); }
.signup__msg { min-height: 1.5em; font: 500 13px var(--mono); color: var(--accent); }
@media (max-width: 820px) { .cta__inner { grid-template-columns: 1fr; } }

/* ---------- press ---------- */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; }
.facts dt { font: 500 12px/1.9 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; }
.downloads { list-style: none; padding: 0; display: grid; gap: 8px; }
.downloads li { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wordmark { display: grid; place-items: center; min-height: 180px; font: 500 clamp(36px, 7vw, 64px) var(--mono); letter-spacing: 0.3em; background: var(--paper); }
.wordmark--light { background: var(--ink); color: var(--paper); }

/* ---------- footer ---------- */

.foot { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 24px; }
.foot__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.foot__grid > div { display: grid; gap: 12px; align-content: start; }
.foot__small { font-size: 14px; color: var(--ink-3); max-width: 42ch; }
.foot__links { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.foot__links a { color: var(--ink-2); text-decoration: none; }
.foot__links a:hover { color: var(--accent); }
.foot__legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--ink-3); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px;
  height: 26px;
  border: 0;
  padding: 0;
  cursor: pointer;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--c);
  opacity: 0.6;
  transition: opacity 160ms ease, transform 160ms var(--ease-back);
}
.swatch:hover { opacity: 1; transform: scale(1.1); }
.swatch[aria-checked="true"] { opacity: 1; transform: scale(1.15); box-shadow: inset 0 3px 0 var(--ink); }

/* ---------- lightbox ---------- */

.lightbox { width: min(96vw, 1600px); max-width: none; max-height: 96svh; padding: 0; border: 0; background: transparent; color: var(--ink); }
.lightbox::backdrop { background: rgb(14 14 15 / 0.92); backdrop-filter: blur(4px); }
.lightbox figure { display: grid; gap: 12px; }
.lightbox img { max-height: calc(96svh - 110px); width: auto; margin: 0 auto; }
.lightbox figcaption { text-align: center; color: var(--ink-2); font-size: 15px; }
.lightbox__keys { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; }
.lightbox__count { min-width: 64px; text-align: center; }
.lightbox[open] { animation: cy-fly 320ms var(--ease-back); }

/* Windows fly in: from a little deeper, turned slightly, faded (SCyWindow's intro). */
@keyframes cy-fly {
  from { opacity: 0; transform: perspective(900px) translateZ(-60px) rotateY(-6deg); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: perspective(900px) translateZ(-40px) rotateY(-4deg); transition: opacity 420ms ease, transform 520ms var(--ease-back); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- modding guide (long technical prose) ---------- */

.prose h3 { margin-top: 1.8em; font: 600 19px/1.3 var(--font); color: var(--ink); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.prose ol { padding-left: 1.4em; display: grid; gap: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose .table-wrap { margin: 1.2em 0; }
.prose table { min-width: 560px; font-size: 14px; }
.prose td code, .prose th code { font-size: 0.86em; }
pre { overflow-x: auto; padding: 16px 18px; background: var(--surface); border-left: 2px solid var(--accent); font: 13px/1.6 var(--mono); color: var(--ink-2); }
pre code { background: none; padding: 0; font-size: inherit; }
.code-sample { background: none; border-left: 0; margin: 0; padding: 6px 10px; }
.prose--guide { max-width: 860px; font-size: 16px; }
.prose--guide code { word-break: break-word; }
.page-guide .entry__grid { grid-template-columns: 260px minmax(0, 1fr); }
.page-guide .entry__toc { max-height: calc(100svh - 110px); overflow-y: auto; }
.toc-versions { margin-top: 18px; }
.versions { list-style: none; padding: 0; margin-top: 8px; display: grid; gap: 4px; font: 500 13px var(--mono); }
.versions a { text-decoration: none; color: var(--ink-2); }
.versions a[aria-current] { color: var(--accent); }
.banner { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--ink-2); }
@media (max-width: 900px) { .page-guide .entry__grid { grid-template-columns: minmax(0, 1fr); } .page-guide .entry__toc { max-height: none; } }
