/* ═══════════════════════════════════════════════════════════════════════════
   thanatide.cygnusworks.com — shared styles for every page on the site.

   Deliberately one hand-written file with no build step and no external
   requests. Fonts are system fonts on purpose: the privacy policy promises no
   third-party anything, and a Google Fonts <link> would quietly make that a
   lie on every page load.
   ═════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #05070b;
  --bg-2: #080c14;
  --panel: #0d1420;
  --panel-2: #111a29;
  --line: #1b2634;
  --line-bright: #2a3a4e;
  --text: #dbe7f2;
  --muted: #8ba0b5;
  --dim: #64798d;
  --accent: #6fb3d8;
  --accent-deep: #2c6b91;
  --accent-glow: rgba(111, 179, 216, .16);

  /* Straight out of src/data/rarity.ts — the ladder on the manual page has to
     match the colours the game actually draws, or it teaches the wrong thing. */
  --r-standard: #b9c2cc;
  --r-enhanced: #4ade80;
  --r-superior: #38bdf8;
  --r-exotic: #c084fc;
  --r-mythic: #fb923c;
  --r-blackline: #f43f5e;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --nav-h: 3.5rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* height:auto is load-bearing, not tidiness. The width/height attributes are
   there so the browser reserves the right box before the image loads (no
   layout shift), but with only max-width the attribute height is still
   honoured — so a 1200x675 shot scaled to 360px wide renders 360x675 and
   every screenshot on the page is stretched to portrait. */
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }
a:hover { color: #9fd0ec; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1.25rem; }

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: rgba(5, 7, 11, .82);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; height: 100%;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-brand {
  font-weight: 700; letter-spacing: .22em; font-size: .82rem;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.nav-brand:hover { color: #fff; }
.nav-links { display: flex; gap: 1.35rem; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: .8rem;
  letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); border-bottom-color: var(--line-bright); }
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
/* The nav is the one row on the site that cannot wrap, so it is the first thing
   to push the page sideways on a phone. Shed the gaps, then the optional words
   (.hide-sm), then the brand's tracking — in that order. */
@media (max-width: 40rem) {
  .nav-inner { gap: .9rem; }
  .nav-links { gap: .95rem; }
  .nav-links .hide-sm { display: none; }
}
@media (max-width: 26rem) {
  .nav-inner { padding: 0 .9rem; }
  .nav-brand { font-size: .74rem; letter-spacing: .14em; }
  .nav-links { gap: .75rem; }
  .nav-links a { font-size: .72rem; letter-spacing: .06em; }
  .btn-sm { padding: .5em .85em; }
}

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; font-size: .86rem;
  padding: .95em 2em; border-radius: 3px; border: 1px solid var(--line-bright);
  color: var(--text); background: var(--panel);
  transition: background .14s, border-color .14s, transform .08s, color .14s;
}
.btn:hover { background: #16212f; border-color: var(--accent); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color: var(--accent); color: #05131d; font-weight: 700;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  filter: brightness(1.12); color: #05131d;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 0 28px 0 var(--accent-glow);
}
.btn-sm { padding: .5em 1.05em; font-size: .74rem; }
.cta-row { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; align-items: center; }
.cta-row.left { justify-content: flex-start; }
.cta-note { color: var(--muted); font-size: .78rem; margin: 1rem 0 0; }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(2.6rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 130%;
  background: radial-gradient(ellipse at 50% 0%, #16283f 0%, #0a1220 34%, transparent 66%);
  pointer-events: none;
}
/* Faint horizontal banding, like a bad monitor in a bad room. Kept under 4%
   opacity — above that it moirés against the screenshots underneath it. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px);
}
.hero > * { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1px solid var(--line-bright); border-radius: 999px;
  padding: .34rem 1rem .34rem .8rem; margin: 0 0 1.5rem;
  color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(13, 20, 32, .7);
}
.dot {
  width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: ping 2.6s ease-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(111,179,216,.55); }
  70%  { box-shadow: 0 0 0 .5rem rgba(111,179,216,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,179,216,0); }
}

.brand {
  font-size: clamp(2rem, 9.5vw, 5.2rem); font-weight: 700; letter-spacing: .28em;
  margin: 0 0 .5rem; padding-left: .28em; /* optical centring against the tracking */
  line-height: 1.05;
  background: linear-gradient(180deg, #eaf6ff 18%, #4d90b8 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline {
  color: var(--muted); letter-spacing: .24em; text-transform: uppercase;
  font-size: clamp(.6rem, 1.9vw, .78rem); margin: 0 0 1.6rem;
}
.pitch {
  max-width: 40rem; margin: 0 auto 2.2rem; color: var(--text);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
}

.shot-hero {
  position: relative; margin: clamp(2rem, 5vw, 3.2rem) auto 0; max-width: 60rem;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
}
.shot-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(5,7,11,.55) 100%);
}

/* Compact hero for interior pages. */
.page-head {
  position: relative; overflow: hidden;
  padding: clamp(2.4rem, 6vw, 3.6rem) 0 clamp(1.8rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line);
}
.page-head::before {
  content: ""; position: absolute; inset: -60% -10% auto -10%; height: 200%;
  background: radial-gradient(ellipse at 50% 0%, #14243a 0%, transparent 62%);
  pointer-events: none;
}
.page-head > * { position: relative; z-index: 1; }
.page-kicker {
  color: var(--accent); font-family: var(--mono); font-size: .74rem;
  letter-spacing: .2em; text-transform: uppercase; margin: 0 0 .7rem;
}
.page-title {
  font-size: clamp(1.7rem, 5.4vw, 2.9rem); margin: 0 0 .8rem; line-height: 1.15;
  letter-spacing: -.01em; color: #fff;
}
.page-lede { color: var(--muted); max-width: 42rem; margin: 0; font-size: 1.03rem; }

/* ── sections ─────────────────────────────────────────────────────────── */
section { padding: clamp(2.8rem, 7vw, 4.5rem) 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

.sec-head { display: flex; align-items: baseline; gap: .9rem; margin: 0 0 1.8rem; }
.sec-head h2 { margin: 0; }
.sec-index {
  font-family: var(--mono); font-size: .74rem; color: var(--accent-deep);
  letter-spacing: .1em; padding-top: .1rem;
}
.sec-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

h2 {
  font-size: clamp(1.1rem, 3vw, 1.35rem); letter-spacing: .14em;
  text-transform: uppercase; margin: 0 0 1.8rem; color: #fff;
}
h3 { color: #fff; }
.note { color: var(--muted); font-size: .9rem; max-width: 42rem; }

/* ── stat strip ───────────────────────────────────────────────────────── */
.stats {
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.stat { background: var(--bg-2); padding: 1.15rem 1.1rem; text-align: center; }
.stat b {
  display: block; font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; margin-top: .3rem; color: var(--muted);
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
}

/* ── cards ────────────────────────────────────────────────────────────── */
/* min(track, 100%) rather than a bare minmax floor: below the floor a plain
   minmax() keeps the track at its minimum and pushes the whole page sideways. */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
/* Every .grid-2 on the site holds exactly four cards. At 20rem the 68rem wrap
   fits three across and orphans the fourth; 24rem forces a clean 2x2. */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); }
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel) 0%, #0a111c 100%);
  border: 1px solid var(--line); border-radius: 3px; padding: 1.3rem 1.4rem;
  transition: border-color .16s, transform .16s;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--accent-deep), transparent 65%);
  opacity: .5; transition: opacity .16s;
}
.card:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card-num {
  font-family: var(--mono); font-size: .7rem; color: var(--accent-deep);
  letter-spacing: .12em; display: block; margin-bottom: .55rem;
}
.card h3 { margin: 0 0 .45rem; font-size: .95rem; letter-spacing: .02em; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.card p + p { margin-top: .7rem; }

/* ── numbered steps ───────────────────────────────────────────────────── */
.steps { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.step { position: relative; padding: 1.4rem 1.4rem 1.4rem 0; }
.step::before {
  content: ""; position: absolute; left: 0; top: 1.85rem;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.step::after {
  content: ""; position: absolute; left: .5rem; top: 2.08rem; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-bright), transparent);
}
.step h3 { margin: 1.6rem 0 .4rem; font-size: .95rem; }
.step p { margin: 0; color: var(--muted); font-size: .89rem; padding-right: 1.2rem; }

/* ── screenshots ──────────────────────────────────────────────────────── */
.shots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.shots figure {
  margin: 0; border: 1px solid var(--line); border-radius: 3px;
  overflow: hidden; background: var(--panel); transition: border-color .16s;
}
.shots figure:hover { border-color: var(--line-bright); }
.shots img { transition: transform .4s ease; }
.shots figure:hover img { transform: scale(1.025); }
.shots figcaption { padding: .6rem .9rem; color: var(--muted); font-size: .78rem; letter-spacing: .04em; }

.plate {
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.plate figcaption { padding: .7rem 1rem; color: var(--muted); font-size: .8rem; }
figure.plate { margin: 0; }

/* ── comparison table ─────────────────────────────────────────────────── */
.compare { display: grid; gap: 0; grid-template-columns: 1fr auto auto; max-width: 40rem; }
.compare > * { padding: .62rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.compare .h {
  color: var(--muted); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; border-bottom-color: var(--line-bright);
}
.compare .c { text-align: center; font-family: var(--mono); }
.yes { color: var(--accent); }
.no { color: #4a5a6b; }

/* ── data table ───────────────────────────────────────────────────────── */
.tbl-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .88rem; }
table.data th, table.data td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data th {
  color: var(--muted); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 600; border-bottom-color: var(--line-bright); white-space: nowrap;
}
table.data td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
table.data tr:hover td { background: rgba(255,255,255,.018); }

/* ── rarity ladder ────────────────────────────────────────────────────── */
.ladder { display: grid; gap: .5rem; }
.rung {
  display: grid; grid-template-columns: 10rem 1fr auto; align-items: center; gap: 1rem;
  border: 1px solid var(--line); border-left: 3px solid var(--rung, var(--line-bright));
  border-radius: 3px; background: var(--panel); padding: .7rem .95rem;
}
.rung .rname { color: var(--rung, var(--text)); font-weight: 600; font-size: .95rem; }
.rung .rdesc { color: var(--muted); font-size: .85rem; }
.rung .rnum {
  font-family: var(--mono); font-size: .82rem; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 34rem) {
  .rung { grid-template-columns: 1fr auto; }
  .rung .rdesc { grid-column: 1 / -1; }
}

/* ── tag list ─────────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tags li {
  border: 1px solid var(--line); background: var(--panel); border-radius: 3px;
  padding: .3rem .7rem; font-size: .82rem; color: var(--text);
}
.tags li span { color: var(--dim); font-size: .74rem; }

/* ── acts / missions ──────────────────────────────────────────────────── */
.act { border-top: 1px solid var(--line); padding: 2rem 0 0; margin-top: 2rem; }
.act:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.act-head { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; margin-bottom: .5rem; }
.act-num {
  font-family: var(--mono); color: var(--accent); font-size: .76rem;
  letter-spacing: .18em; text-transform: uppercase;
}
.act-head h3 { margin: 0; font-size: 1.18rem; letter-spacing: .01em; }
.act-sub { color: var(--muted); font-size: .95rem; max-width: 44rem; margin: 0 0 1.1rem; }
.missions { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.mission {
  display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .9rem; align-items: baseline;
  background: var(--bg-2); padding: .7rem .95rem; transition: background .14s;
}
.mission:hover { background: var(--panel); }
.mission .mno { font-family: var(--mono); color: var(--dim); font-size: .8rem; }
.mission .mname { color: #fff; font-weight: 600; font-size: .93rem; }
.mission .mwhere { color: var(--muted); font-size: .84rem; text-align: right; }
@media (max-width: 34rem) {
  .mission { grid-template-columns: 2.2rem 1fr; }
  .mission .mwhere { grid-column: 2; text-align: left; }
}

/* ── callout ──────────────────────────────────────────────────────────── */
.callout {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 3px;
  padding: 1.05rem 1.25rem; margin: 1.6rem 0;
}
.callout p { margin: 0; color: var(--muted); font-size: .92rem; }
.callout p + p { margin-top: .6rem; }
.callout strong { color: #fff; }
.callout.warn { border-left-color: var(--r-mythic); }

/* ── platforms ────────────────────────────────────────────────────────── */
.plat { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.plat div { min-width: 11rem; }
.plat .name { color: #fff; font-weight: 600; font-size: .95rem; }
.plat .state { color: var(--muted); font-size: .82rem; font-family: var(--mono); }

/* ── prose (privacy policy, long text) ────────────────────────────────── */
.prose h2 { font-size: 1.05rem; margin: 2.4rem 0 .7rem; letter-spacing: .02em; text-transform: none; }
.prose h3 { font-size: .95rem; margin: 1.6rem 0 .5rem; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin: .35rem 0; }
.prose strong { color: #fff; }
.prose code { font-family: var(--mono); font-size: .88em; color: var(--muted); }

/* ── footer ───────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 2.6rem 0 3rem; color: var(--muted); font-size: .85rem; }
.foot-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 2rem; }
.foot-grid h4 {
  margin: 0 0 .6rem; color: var(--text); font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.foot-grid a { display: block; color: var(--muted); text-decoration: none; padding: .18rem 0; }
.foot-grid a:hover { color: var(--accent); }
.foot-legal { border-top: 1px solid var(--line); padding-top: 1.3rem; color: var(--dim); font-size: .8rem; }

/* ── scroll reveal ────────────────────────────────────────────────────── */
/* Gated on .js so the page is fully readable with scripting off — otherwise a
   blocked script leaves every section permanently invisible. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .dot { animation: none; }
  .shots figure:hover img { transform: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
