/* Skydrop: Hold the Beacon - support and policy pages on pernox.co.uk.
   Hand-written, no frameworks, no web fonts, no external requests.
   Colours are custom properties: light by default, dark under prefers-color-scheme (screens only; print is always light). */

:root {
  color-scheme: light dark;

  /* Page (light: a pale dawn) */
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --text: #1a2232;
  --muted: #4a5466;
  --border: #d8d0c3;
  --link: #8a4b00;          /* deep amber, 6:1 on --bg */
  --link-hover: #6b3a00;
  --beacon: #00687d;        /* deep beacon cyan, used sparingly */
  --focus: #00687d;
  --amber: #ffb347;         /* decoration only on light backgrounds */
  --mark: rgba(255, 179, 71, 0.22);

  /* Header and footer band (dusk in both themes) */
  --band-bg: #121a2a;
  --band-bg-2: #2a1622;
  --band-text: #f1f4f8;
  --band-muted: #b9c2d0;
  --band-link: #ffb347;
  --band-focus: #6fe8ff;

  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media screen and (prefers-color-scheme: dark) {
  :root {
    /* Page (dark: deep slate night) */
    --bg: #0e1522;
    --surface: #141d2d;
    --surface-2: #1a2537;
    --text: #e6ebf2;
    --muted: #a8b3c5;
    --border: #2b374b;
    --link: #ffb347;          /* the game's amber, 10:1 on --bg */
    --link-hover: #ffd08a;
    --beacon: #6fe8ff;        /* the Beacon's cyan */
    --focus: #6fe8ff;
    --amber: #ffb347;
    --mark: rgba(255, 179, 71, 0.16);

    --band-bg: #0a101b;
    --band-bg-2: #24121c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  /* Keeps the footer at the bottom on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

/* One measure for header, content and footer: about 70 characters at the body size.
   Set in rem so the smaller footer text doesn't make its column narrower. */
.wrap {
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: content-box;
}

/* Skip link and screen-reader-only text */
.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  background: var(--band-link);
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 0.5rem;
}

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

/* Focus is always visible */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.band :focus-visible {
  outline-color: var(--band-focus);
}

/* Header */
.band {
  background: var(--band-bg);
  background-image: linear-gradient(100deg, var(--band-bg) 55%, var(--band-bg-2));
  color: var(--band-text);
}

.site-header {
  border-bottom: 3px solid var(--amber);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-block: 0.625rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--band-text);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.375rem;
  color: var(--band-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--band-text);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--band-link);
  font-weight: 600;
}

/* Content */
main {
  flex: 1 0 auto;
  width: calc(100% - 2rem);   /* .wrap adds 1rem padding each side */
  padding-block: 2rem 3rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.875rem;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 1.375rem;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
}

h2,
h3,
[id] {
  scroll-margin-top: 1rem;
}

p,
ul,
ol,
dl,
blockquote,
address {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.375rem;
}

li + li {
  margin-top: 0.375rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 650;
}

.updated {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.lede {
  font-size: 1.125rem;
}

/* In-game labels and paths, e.g. Settings › Privacy */
.ui {
  font-weight: 600;
  white-space: normal;
}

code,
.code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--surface-2);
}

blockquote {
  margin-inline: 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--beacon);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Summary box at the top of long pages */
.summary {
  margin: 0 0 2rem;
  padding: 1rem 1.125rem 0.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1.125rem;
}

/* Notes and callouts */
.note {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--mark);
}

/* Table of contents */
.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.toc ol {
  margin: 0 0 0.5rem;
  padding-left: 1.5rem;
  font-size: 0.9375rem;
}

.toc li + li {
  margin-top: 0.125rem;
}

@media (min-width: 40rem) {
  .toc ol {
    columns: 2;
    column-gap: 2rem;
  }

  .toc li {
    break-inside: avoid;
  }
}

/* Hub page links */
.cards {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.cards li + li {
  margin-top: 0;
}

.cards a {
  display: block;
  height: 100%;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--link);
}

.cards strong {
  display: block;
  color: var(--link);
  font-size: 1.125rem;
}

.cards span {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Contact details */
.contact {
  margin: 0 0 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.375rem 1rem;
  margin: 0;
}

.contact dt {
  color: var(--muted);
}

.contact dd {
  margin: 0;
}

address {
  font-style: normal;
}

.contact address {
  margin: 0;
}

/* Tables scroll inside their own box on narrow screens */
.table-wrap {
  position: relative;       /* keeps visually hidden text inside the scroll box */
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

caption {
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
}

th,
td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody + tbody tr:first-child th,
tbody + tbody tr:first-child td {
  border-top: 1px solid var(--border);
}

thead th {
  background: var(--surface-2);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

tbody th {
  font-weight: 500;
}

.group th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sub th {
  padding-left: 2rem;
  color: var(--muted);
}

.sub td {
  color: var(--muted);
}

.wide table {
  min-width: 36rem;
}

.wide tbody th {
  white-space: nowrap;
}

.mid table {
  min-width: 28rem;
}

/* Footer */
.site-footer {
  border-top: 3px solid var(--amber);
  font-size: 0.9375rem;
}

.footer-inner {
  padding-block: 1.75rem 2.25rem;
}

.site-footer p {
  margin: 0 0 0.75rem;
  color: var(--band-muted);
}

.site-footer .made {
  color: var(--band-text);
  font-weight: 650;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--band-link);
}

.site-footer a:hover {
  color: var(--band-text);
}

/* Larger screens */
@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Motion only when the visitor hasn't asked for less */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .cards a {
    transition: color 0.15s ease, border-color 0.15s ease;
  }
}

/* High-contrast and forced-colour modes keep borders and focus */
@media (forced-colors: active) {
  .band,
  .summary,
  .toc,
  .table-wrap,
  .contact,
  .cards a {
    border: 1px solid CanvasText;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  .band {
    background: none;
    color: #000;
  }

  .site-nav,
  .skip {
    display: none;
  }

  .site-footer p,
  .site-footer .made,
  .brand {
    color: #000;
  }

  a,
  .site-footer a {
    color: #000;
  }

  .table-wrap {
    overflow: visible;
  }
}
