/* Adams's Aglets: the one stylesheet.
   Brand tokens and rules: docs/brand/brand.md.
   Dark mode follows the device: Night and Paper swap, Deep royal becomes Periwinkle, Lace gold never changes. */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Brand tokens ---------- */
:root {
  --deep-royal: #1D4ED8;
  --periwinkle: #6E93FF;
  --lace-gold: #FFB627;
  --night: #12162B;
  --paper: #F7F8FC;

  /* Light mode roles */
  --bg: var(--paper);
  --text: var(--night);
  --royal: var(--deep-royal);
  --on-royal: var(--paper);        /* Paper on Deep royal */
  --muted: color-mix(in srgb, var(--text) 74%, var(--bg));
  --surface: color-mix(in srgb, var(--text) 4%, var(--bg));
  --line: color-mix(in srgb, var(--text) 14%, var(--bg));

  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Nunito", var(--font-body);

  --measure: 40rem;
  --gutter: 1rem;
  --radius: 1rem;
  --tap: 44px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --text: var(--paper);
    --royal: var(--periwinkle);
    --on-royal: var(--night);      /* Night on Periwinkle, never Paper */
  }
}

/* ---------- Base ---------- */
*, *::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: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main { flex: 1; }

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-weight: 900; font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem); margin-top: 2.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
  color: var(--royal);
  text-decoration: none;
  border-radius: 4px;
}
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
a:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.5rem 1rem;
  background: var(--royal);
  color: var(--on-royal);
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* ---------- Header ---------- */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.brand img { width: 150px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.75rem;
  font-family: var(--font-head);
  font-weight: 800;
}
.site-nav a[aria-current="page"] { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap { padding-top: 2rem; padding-bottom: 2.5rem; }
.site-footer .brand img { width: 130px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.5rem 0;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.25rem;
}
.footer-links .sep { padding: 0 0.25rem; }
.footer-links a:first-child { padding-left: 0; }
.site-footer .legal a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

/* ---------- Home ---------- */
.hero { padding: 2.5rem 0 1rem; }
.hero .wordmark { width: min(100%, 420px); min-width: 200px; margin-bottom: 1.75rem; }

/* App cards */
.cards {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  min-height: var(--tap);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.card:hover { text-decoration: none; border-color: var(--royal); }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 0.2em; }
.card img {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 22.5%;
}
.card-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--royal);
}
.card-text { display: block; margin: 0.15rem 0; }
.card-meta { display: block; color: var(--muted); font-size: 0.9375rem; }

.note { color: var(--muted); }

/* Lists with an aglet for a bullet: royal tube, lace-gold crimp band (shape only, never text). */
.aglet-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.aglet-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
}
.aglet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 1.1rem;
  height: 0.4rem;
  border-radius: 1px 2px 2px 1px;
  background:
    linear-gradient(to right, var(--lace-gold) 0 0.22rem, transparent 0.22rem),
    var(--royal);
}

/* ---------- 404 ---------- */
.untied { padding-top: 4rem; padding-bottom: 2rem; }

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