/* DaletN: the shared base. Fonts, colour and type tokens, the type roles
   both directions use, the header and footer, and the reduced-motion rule.
   Every page loads it first; horizon.css or instrument.css follows. */

/* ---------- Fonts ----------
   Self-hosted, SIL Open Font License 1.1; the licences are in
   /static/fonts/. Literata is variable (opsz 7-72, wght 200-900). */

@font-face {
  font-family: "Literata";
  src: url("/static/fonts/literata-roman-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/static/fonts/literata-italic-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallbacks: local Georgia scaled to Literata's advance
   widths and line metrics, so the swap to Literata does not reflow text.
   Measured in headless Chrome 154 on macOS, 2026-09-30: Literata's ascent
   is 1.18 and its descent 0.31 of the font size. It sets 5.96% wider than
   Georgia at text sizes (opsz auto, weight 380) and 2.58% wider at display
   settings (opsz 72, weight 360); its italic sets 2.28% narrower at text
   sizes and 4.45% narrower at display settings. size-adjust scales the
   overrides too, so each override is the metric divided by size-adjust.
   With these faces a 34rem paragraph at 18px sets to the same height as
   Literata, and widths agree within 0.25%. Where Georgia is not installed
   these faces do not load, and the stack falls through to serif. */

@font-face {
  font-family: "Literata Fallback";
  src: local("Georgia");
  font-style: normal;
  size-adjust: 105.96%;
  ascent-override: 111.36%;
  descent-override: 29.26%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Literata Fallback";
  src: local("Georgia Italic");
  font-style: italic;
  size-adjust: 97.72%;
  ascent-override: 120.75%;
  descent-override: 31.72%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Literata Display Fallback";
  src: local("Georgia");
  font-style: normal;
  size-adjust: 102.58%;
  ascent-override: 115.03%;
  descent-override: 30.22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Literata Display Fallback";
  src: local("Georgia Italic");
  font-style: italic;
  size-adjust: 95.55%;
  ascent-override: 123.5%;
  descent-override: 32.44%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  /* The brand kit's theme/palette.css, by name. */
  --dn-void: #04070F;
  --dn-navy: #0C1732;
  --dn-steel: #4E7FAA;
  --dn-ice: #C6E4FB;
  --dn-plasma: #EAF2FA;
  --dn-plum: #2E1F38;
  --dn-rust: #3A1E16;
  --dn-ring: #FFF1D0;
  --dn-gold: #ECBF77;
  --dn-orange: #CA7845;
  --dn-brick: #8A3E2A;
  --dn-maroon: #4E1C15;
  /* The kit README's steel for ".ai" on dark. */
  --dn-steel-on-dark: #8DB4D4;

  /* Roles. Contrast on void: text 17.8:1, text-soft 10.7:1, label 11.8:1. */
  --text: var(--dn-plasma);
  --text-soft: #B7BEC6;
  --label: var(--dn-gold);
  --hairline: rgba(198, 228, 251, 0.14);
  --focus: var(--dn-gold);

  /* Type. Display is the kit's wordmark setting: Literata, opsz 72,
     weight 360, letter-spacing 0.012em. */
  --font-display: "Literata", "Literata Display Fallback", Georgia, serif;
  --font-text: "Literata", "Literata Fallback", Georgia, serif;
  --font-label: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(2.35rem, 1.1rem + 3.9vw, 4.75rem);
  --fs-h2: clamp(1.9rem, 1.2rem + 2.1vw, 3rem);
  --fs-lead: clamp(1.13rem, 1rem + 0.45vw, 1.4rem);
  --fs-body: clamp(1.03rem, 0.98rem + 0.2vw, 1.16rem);
  --fs-label: 0.75rem;

  --gutter: clamp(16px, 5.5vw, 88px);
  --measure: 34rem;

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  background: var(--dn-void);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--dn-void);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 380;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* The footer sits at the bottom of a short page. */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

img, svg, canvas { display: block; max-width: 100%; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: var(--dn-steel); color: var(--dn-plasma); }

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

/* A page's backdrop (layout.Shell.Backdrop) paints under these. */
main, .site-footer { position: relative; z-index: 1; }

/* ---------- Type roles ---------- */

.display {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-weight: 360;
  letter-spacing: 0.012em;
  line-height: 1.04;
  text-wrap: balance;
}

.label {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--label);
}

.line { display: inline; }

/* A section heading on every page: display type, with the site's one
   ornament above it, a small gold ring. */
.heading {
  font-size: var(--fs-h2);
  margin-bottom: 1.4rem;
}
.heading::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  margin-bottom: 1.4rem;
  border: 1px solid var(--dn-gold);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(236, 191, 119, 0.55), inset 0 0 4px rgba(255, 241, 208, 0.4);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  min-height: 72px;
  padding: 12px var(--gutter);
  background: var(--dn-void);
  border-bottom: 1px solid var(--hairline);
}

.site-header__logo { display: block; flex: none; border-radius: 4px; }
.site-header__logo img { width: auto; height: 32px; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-soft);
  transition: color 0.25s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.14em;
  bottom: 2px;
  height: 1px;
  background: var(--dn-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--dn-gold); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); opacity: 0.6; }

/* ---------- Footer ---------- */

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px 48px;
  padding: 44px var(--gutter) 48px;
  border-top: 1px solid var(--hairline);
  background: var(--dn-void);
}
.site-footer__logo { display: block; border-radius: 4px; }
.site-footer__logo img { width: auto; height: 24px; }
.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer__nav a,
.site-footer__meta p {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  color: var(--text-soft);
}
.site-footer__nav a {
  display: inline-block;
  padding: 6px 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-footer__nav a:hover { color: var(--dn-ring); }
.site-footer__meta { text-align: right; }
.site-footer__meta p { letter-spacing: 0.08em; }

/* ---------- Links from the deck ---------- */

.more {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 6px 0;
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dn-ring);
  border-bottom: 1px solid rgba(236, 191, 119, 0.5);
  transition: border-color 0.3s ease;
}
.more::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.more:hover { border-color: var(--dn-gold); }
.more:hover::after { width: 30px; }

.action {
  display: inline-flex;
  align-items: center;
  padding: 0.6em 1.3em 0.65em;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.55rem);
  font-weight: 380;
  letter-spacing: 0.012em;
  text-decoration: none;
  color: var(--dn-ring);
  border: 1px solid rgba(236, 191, 119, 0.6);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(236, 191, 119, 0.14), inset 0 0 18px rgba(236, 191, 119, 0.08);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}
.action:hover {
  border-color: var(--dn-gold);
  box-shadow: 0 0 36px rgba(236, 191, 119, 0.32), inset 0 0 18px rgba(236, 191, 119, 0.14);
}

/* ---------- Items from the deck (Horizon pages) ---------- */

.item { padding-top: 1.1rem; border-top: 1px solid var(--hairline); }
.item__title {
  font-family: var(--font-text);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
}
.item__title a { text-decoration: none; }
.item__title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--dn-gold);
  text-underline-offset: 4px;
}
.item__detail { margin-top: 0.5rem; color: var(--text-soft); }

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
  .site-header { padding-top: 10px; padding-bottom: 4px; gap: 2px 16px; }
  .site-header__logo img { height: 28px; }
  .site-nav { width: 100%; }
  .site-nav ul,
  .site-footer__nav ul { justify-content: space-between; gap: 0 12px; }
  .site-nav a,
  .site-footer__nav a { letter-spacing: 0.06em; }

  .site-footer { grid-template-columns: 1fr; gap: 20px; }
  .site-footer__meta { text-align: left; }
}

@media (max-width: 400px) {
  .site-nav ul,
  .site-footer__nav ul { gap: 0 8px; }
  .site-nav a,
  .site-footer__nav a { letter-spacing: 0.03em; }
}

/* ---------- Motion ----------
   With reduced motion, every animation and transition on every page stops,
   in the shared base and in the direction stylesheets alike. Scripts check
   the same media query themselves. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
