/*
 * Shared styling for warpnexus.app/updates.
 *
 * Same tokens as the landing page so the two read as one site, but linked
 * rather than inlined: index.html carries its typefaces as base64 @font-face
 * blocks, and copying ~70KB of that into every update note would make each one
 * heavier than the news it carries. These pages pull the same two faces from
 * Google Fonts with real fallbacks, and share the landing page's `wn-theme`
 * localStorage key so a reader's light/dark choice follows them across.
 */

:root {
  --bg: #08090b;
  --surface: #0f1319;
  --surface-raised: #151b23;
  --border: #28303b;
  --border-subtle: #1a2028;
  --ink: #e7ecf1;
  --ink-secondary: #8c97a3;
  --ink-tertiary: #5a636e;
  --gold: #c79a2e;
  --gold-subtle: #c79a2e22;
  --ink-on-gold: #14100a;
  --primary: #4e7fa6;
  --primary-bright: #7fb2d9;
  --up: #c98a6a;
  --down: #7ba86f;

  --font-head: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-label: "Rajdhani", "Avenir Next Condensed", "Segoe UI", sans-serif;
  --shell: 820px;
  --gutter: clamp(20px, 5vw, 40px);
}

:root[data-theme="light"] {
  --bg: #d8dce0;
  --surface: #e5e8eb;
  --surface-raised: #cdd3d9;
  --border: #aeb6bf;
  --border-subtle: #c4cbd2;
  --ink: #171c22;
  --ink-secondary: #49525c;
  --ink-tertiary: #6e7883;
  --gold: #8a6d1a;
  --gold-subtle: #8a6d1a22;
  --ink-on-gold: #f7f4ea;
  --primary: #2e5e8c;
  --primary-bright: #4e7fa6;
  --up: #8c4a2f;
  --down: #3b6b39;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #d8dce0;
    --surface: #e5e8eb;
    --surface-raised: #cdd3d9;
    --border: #aeb6bf;
    --border-subtle: #c4cbd2;
    --ink: #171c22;
    --ink-secondary: #49525c;
    --ink-tertiary: #6e7883;
    --gold: #8a6d1a;
    --gold-subtle: #8a6d1a22;
    --ink-on-gold: #f7f4ea;
    --primary: #2e5e8c;
    --primary-bright: #4e7fa6;
    --up: #8c4a2f;
    --down: #3b6b39;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- chrome ---- */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brandmark {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.topbar nav {
  display: flex;
  gap: 18px;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.topbar nav a {
  color: var(--ink-secondary);
  text-decoration: none;
}
.topbar nav a:hover,
.topbar nav a:focus-visible {
  color: var(--gold);
}

/* ---- masthead ---- */
header.page {
  padding: 44px 0 30px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--gold);
  display: block;
  margin-bottom: 10px;
}
h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.1;
  margin: 0 0 14px;
  text-wrap: balance;
}
.standfirst {
  color: var(--ink-secondary);
  font-size: 19px;
  margin: 0;
}

/* Points/datasheet currency, the pair the app shows on Profile. */
.currency {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 14px;
}
.currency span {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 11px;
  color: var(--ink-secondary);
}
.currency b {
  color: var(--ink);
  font-weight: 700;
}

/* ---- body ---- */
main {
  padding-bottom: 60px;
}
section.block {
  padding: 34px 0;
  border-bottom: 1px solid var(--border-subtle);
}
section.block:last-of-type {
  border-bottom: 0;
}
h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 6px;
  text-wrap: balance;
}
h3 {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--gold);
  margin: 26px 0 8px;
}
p {
  margin: 0 0 14px;
}
ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
li {
  margin-bottom: 7px;
}
li::marker {
  color: var(--ink-tertiary);
}
strong {
  color: var(--ink);
}
a {
  color: var(--primary-bright);
}

/* ---- points table ---- */
.scroller {
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 0 0 16px;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
th {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--ink-secondary);
  background: var(--surface);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.n {
  text-align: right;
  white-space: nowrap;
}
.up {
  color: var(--up);
  font-weight: 700;
}
.down {
  color: var(--down);
  font-weight: 700;
}

/*
 * A table whose cells are sentences rather than numbers. The rules above are
 * built for the points table — nowrap cells and a min-width, so digits stay in
 * their columns and the whole thing scrolls sideways if it must. Applied to
 * prose that is exactly wrong: it cut every description off mid-word and asked
 * the reader to drag a paragraph into view. So cells wrap, and below the width
 * where two columns stop being readable the rows stack, with the unit name
 * reading as a heading over its own text.
 */
.scroller.prose {
  overflow-x: visible;
  border: 0;
}
.prose table {
  min-width: 0;
}
.prose th,
.prose td {
  white-space: normal;
}
.prose td:first-child {
  width: 30%;
}

@media (max-width: 620px) {
  .prose thead {
    display: none;
  }
  .prose table,
  .prose tbody,
  .prose tr,
  .prose td {
    display: block;
    width: auto;
  }
  .prose tr {
    border-bottom: 1px solid var(--border-subtle);
    padding: 4px 0 12px;
  }
  .prose tr:last-child {
    border-bottom: 0;
  }
  .prose td {
    border-bottom: 0;
    padding: 2px 0;
  }
  .prose td:first-child {
    width: auto;
    font-family: var(--font-label);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 14px;
    color: var(--gold);
  }
}

.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  background: var(--surface);
  padding: 14px 18px;
  margin: 0 0 16px;
  color: var(--ink-secondary);
}
.note strong {
  color: var(--ink);
}

/* ---- index listing ---- */
.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entries li {
  margin: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.entries a {
  display: block;
  padding: 22px 0;
  text-decoration: none;
  color: inherit;
}
.entries a:hover h2,
.entries a:focus-visible h2 {
  color: var(--gold);
}
.entries time {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ink-tertiary);
  display: block;
  margin-bottom: 4px;
}
.entries p {
  color: var(--ink-secondary);
  margin: 0;
}

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 26px 0 44px;
  font-size: 14px;
  color: var(--ink-tertiary);
  line-height: 1.6;
}
footer p {
  margin: 0 0 10px;
}
footer .brand {
  font-family: var(--font-head);
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
}

.backlink {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
}
.backlink:hover,
.backlink:focus-visible {
  text-decoration: underline;
}

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