/* Astrarchy policy site. Colours from the art bible palette (art/ART-BIBLE.md section 3):
   Void #05070D, Deep Navy #0B1426, Abyss Blue #13223D, Slate #2A3A52, Starlight #F2F4F8,
   Solar Gold #F2B544, Ion Cyan #4FD6E8, Graphite #4A525E, Ceramic Ivory #D9D3C5.
   No images, fonts or scripts: system type, light and dark from the device setting. */

:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --bg-deep: #ebe7dc;
  --surface: #ffffff;
  --text: #0b1426;
  --muted: #4a525e;
  --hairline: rgba(11, 20, 38, 0.12);
  --accent: #9a6a12;
  --accent-soft: rgba(242, 181, 68, 0.22);
  --link: #0b6b7c;
  --link-hover: #0b1426;
  --header-bg: #0b1426;
  --header-text: #f2f4f8;
  --header-muted: #b9c2d3;
  --header-rule: #f2b544;
  --banner-bg: #f2b544;
  --banner-text: #05070d;
  --mark-bg: rgba(242, 181, 68, 0.35);
  --mark-text: #3d2a05;
  --code-bg: rgba(11, 20, 38, 0.06);
  --gutter: 16px;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #05070d;
    --bg-deep: #0b1426;
    --surface: rgba(255, 255, 255, 0.04);
    --text: #e9edf5;
    --muted: #9ea8bc;
    --hairline: rgba(242, 244, 248, 0.12);
    --accent: #f2b544;
    --accent-soft: rgba(242, 181, 68, 0.14);
    --link: #4fd6e8;
    --link-hover: #f2f4f8;
    --header-bg: #0b1426;
    --header-text: #f2f4f8;
    --header-muted: #9ea8bc;
    --header-rule: #f2b544;
    --banner-bg: #f2b544;
    --banner-text: #05070d;
    --mark-bg: rgba(242, 181, 68, 0.28);
    --mark-text: #ffe7b5;
    --code-bg: rgba(242, 244, 248, 0.08);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg) 0, var(--bg) 60%, var(--bg-deep) 100%) fixed;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

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

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

.bar {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Draft banner: removed by the build only with --approved. */
.draft-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.4;
  padding: 10px var(--gutter);
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Header */
.site-header {
  background:
    radial-gradient(120% 140% at 100% 0, rgba(79, 214, 232, 0.16), transparent 55%),
    radial-gradient(90% 120% at 0 100%, rgba(242, 181, 68, 0.12), transparent 60%),
    var(--header-bg);
  color: var(--header-text);
  border-bottom: 2px solid var(--header-rule);
}

.site-header .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.wordmark {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.wordmark:hover {
  color: var(--header-rule);
}

.site-nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--header-text);
  border-bottom-color: var(--header-rule);
}

/* Page */
.page {
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
}

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

h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem);
  margin: 0 0 6px;
  font-weight: 700;
}

h2 {
  font-size: 1.3125rem;
  margin: 2.2em 0 0.6em;
  padding-top: 0.9em;
  border-top: 1px solid var(--hairline);
}

h3 {
  margin: 1.8em 0 0.5em;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.875rem;
}

h2[id],
h3[id] {
  scroll-margin-top: 64px;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

li::marker {
  color: var(--accent);
}

strong {
  font-weight: 650;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 2em 0;
}

blockquote {
  margin: 1.2em 0;
  padding: 0.8em 1em;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

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

mark.placeholder {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0.05em 0.3em;
  border-radius: 4px;
  font-size: 0.9375em;
}

.doc-header {
  margin-bottom: 24px;
}

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

/* Contents */
.toc {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 18px 6px;
  margin: 0 0 8px;
  font-size: 0.9375rem;
}

.toc-title {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  columns: 2 14rem;
  column-gap: 24px;
  margin: 0 0 8px;
}

.toc li {
  break-inside: avoid;
  margin: 0 0 0.3em;
}

/* Tables: a grid on wide screens, stacked label and value pairs on phones. */
.table {
  margin: 0 0 1.2em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}

th {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

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

td:first-child {
  font-weight: 600;
}

@media (max-width: 40rem) {
  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table {
    border: 0;
    background: transparent;
  }

  tr {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 4px 0;
  }

  td {
    border-bottom: 0;
    padding: 6px 12px;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }

  td:empty {
    display: none;
  }
}

/* Index */
.hero {
  padding: 8px 0 12px;
}

.hero h1 {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tagline {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 0.6em;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

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

.card {
  display: block;
  height: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease;
}

.card:hover {
  border-color: var(--accent);
  color: var(--text);
}

.card-title {
  display: block;
  font-weight: 700;
  color: var(--link);
  margin-bottom: 4px;
}

.card-text {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.875rem;
  padding: 18px 0 28px;
}

.site-footer p {
  margin: 0 0 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
