/* ---------------------------------------------------------------
   Self-hosted fonts. Latin subset, OFL licences alongside in fonts/.
   Absolute paths so that /404.html keeps its styles when nginx
   serves it from an arbitrary URL.
   --------------------------------------------------------------- */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-400-500-latin.woff2") format("woff2");
  font-weight: 100 700; /* variable font, wght axis */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans Extra Condensed";
  src: url("/fonts/fira-sans-extra-condensed-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans Condensed";
  src: url("/fonts/fira-sans-condensed-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fira Sans Condensed";
  src: url("/fonts/fira-sans-condensed-700-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------
   Palette. Light is the base; dark only redefines the tokens.
   Contrast against the background, measured, not assumed:
   text 16.6:1 / 15.2:1, muted 6.9:1 / 6.8:1, accent 6.4:1 / 7.0:1.
   --rule is a decorative hairline and carries no information.
   --------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --bg: #faf8f5;
  --text: #23211e;
  --muted: #5b554d;
  --accent: #a03a1e;
  --accent-strong: #7d2c15;
  --rule: #ded5c9;

  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fira Sans Extra Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --font-ui: "Fira Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;

  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --text: #ebe8e28c;
    --muted: #a39b90;
    --accent: #ef7816;
    --accent-strong: #f4a184;
    --rule: #35312c;
  }
}

/* --- Base --- */

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

body {
  margin: 0;
  padding: clamp(1.75rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;

  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/* `margin: auto` inside a flex container centres on both axes. */
.page {
  width: 100%;
  max-width: var(--measure);
  margin: auto;
}

/* --- Header --- */

.site-header {
  margin-bottom: clamp(2rem, 7vw, 3.25rem);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 12vw, 4.5rem);
  line-height: 1.03;
  /* letter-spacing: 0.002em; */
  text-wrap: balance;
}

.alias {
  margin: 0.55rem 0 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .9rem;
  /* letter-spacing: 0.16em; */
  line-height: 1.3;
  color: var(--muted);
}

/* --- Main --- */

.lead {
  margin: 0;
  font-size: .88rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.links {
  margin: clamp(1.75rem, 6vw, 2.5rem) 0 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.75rem;

  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: 0.015em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}

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

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

/* --- Footer --- */

.site-footer {
  margin-top: clamp(3rem, 10vw, 4.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
