/* SENEX design tokens v1 (docs/DESIGN-TOKENS.md in Corvus and Pictor). Dark only. */
:root {
  color-scheme: dark;
  --ground: #0d1117;
  --chrome: #11161d;
  --card: #151a22;
  --raised: #1b2330;
  --line: #2a3340;
  --line-strong: #3a4a63;
  --text: #e6eaf0;
  --muted: #a1abb8;
  --accent: #8fb4ff;
  --accent-hover: #a9c5ff;
  --glow: rgb(143 180 255 / 0.18);
  --r-card: 12px;
  --r-button: 8px;
  --r-key: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 16px;
}

@media (min-width: 720px) {
  :root { --gutter: 24px; }
}

@media (prefers-contrast: more) {
  :root { --line: #3a4a63; }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { margin: 0 0 0.5em; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.5vw + 1rem, 4rem); }
h2 { font-size: clamp(1.4rem, 1.2vw + 1rem, 1.75rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; }

.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 88px); }
.lead { max-width: 42ch; color: var(--muted); font-size: clamp(1.1rem, 0.6vw + 1rem, 1.3rem); }
.eyebrow { margin-bottom: 12px; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

.skip {
  position: absolute;
  top: 12px;
  left: -9999px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--ground);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 16px; }

/* Header: a floating bar over the page. */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  width: min(1072px, calc(100% - 2 * var(--gutter)));
  margin: 12px auto 0;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: rgb(17 22 29 / 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-decoration: none;
}
.wordmark svg { width: 16px; height: 16px; color: var(--accent); }
.site-header ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-header li a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--r-button);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}
.site-header li a:hover, .site-header li a[aria-current="page"] { background: var(--raised); color: var(--text); }

/* Night-sky band, drawn by tools/art.py; it runs up behind the header. */
.sky {
  margin-top: -128px;
  padding: 220px 0 clamp(150px, 16vw, 230px);
  background: var(--ground) url("/assets/sky.svg") center bottom / cover no-repeat;
}
.sky .wrap { text-shadow: 0 0 6px var(--ground), 0 1px 18px rgb(13 17 23 / 0.7); }
.sky .lead { color: #c9d1dc; }
.sky + .section { padding-top: 16px; }

[id] { scroll-margin-top: 96px; }

/* Section heads: a lead sentence, then a muted follow-on. */
.head { max-width: 30ch; margin-bottom: 32px; }

/* Cards */
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: radial-gradient(120% 120% at 0% 0%, rgb(143 180 255 / 0.06), transparent 55%), var(--card);
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
ul.grid { padding: 0; list-style: none; }
.grid h3 { margin-bottom: 6px; }
.grid p:last-child { margin-bottom: 0; }

.app-card { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 20px; transition: border-color 0.15s; }
.app-card:hover { border-color: var(--line-strong); }
.app-card:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-card h3 { font-size: 1.4rem; margin-bottom: 0; }
.app-card h3 a { color: var(--text); text-decoration: none; }
.app-card h3 a:focus-visible { outline: none; }
.app-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card .constellation { margin-bottom: 10px; color: var(--muted); font-size: 15px; }
.icon { filter: drop-shadow(0 10px 28px var(--glow)); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge {
  padding: 1px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--ground);
  font-size: 13px;
  font-weight: 600;
}
.badge.quiet { border-color: var(--line); background: none; color: var(--muted); }

/* App pages */
.app-hero { position: relative; padding-top: clamp(56px, 8vw, 104px); }
.app-hero .icon { width: 128px; margin-bottom: 28px; }
.app-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--gutter) - 120px);
  z-index: -1;
  width: 420px;
  height: 420px;
  background: radial-gradient(closest-side, var(--glow), transparent);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 28px 0 16px; }
.meta { color: var(--muted); font-size: 15px; }

.button {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--r-button);
  background: var(--accent);
  color: var(--ground);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--ground); }
.button.quiet { border-color: var(--line-strong); background: none; color: var(--text); }
.button.quiet:hover { background: var(--raised); }

.shot { position: relative; isolation: isolate; margin: 0; }
.shot::before {
  content: "";
  position: absolute;
  inset: 8% 12% auto;
  z-index: -1;
  height: 70%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(30px);
}
.shot img { border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: 0 30px 80px -24px rgb(0 0 0 / 0.7); }
.shot figcaption { margin-top: 12px; color: var(--muted); font-size: 15px; }

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-key);
  background: var(--raised);
  color: var(--text);
  font: 600 0.82em/1.4 var(--font);
  text-align: center;
}

code, pre { font-family: var(--mono); font-size: 0.88em; }
pre {
  margin: 0 0 1em;
  padding: 16px 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--chrome);
  line-height: 1.7;
}
:not(pre) > code { padding: 0.1em 0.35em; border-radius: var(--r-key); background: var(--raised); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 12px; }
}

/* Text pages */
.page { padding-top: clamp(48px, 7vw, 88px); }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.release { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--line); }
.release h2 { margin: 0; }
.release time { display: block; margin-bottom: 16px; color: var(--muted); }

/* Footer */
.site-footer { margin-top: clamp(64px, 9vw, 112px); padding: 48px 0 32px; border-top: 1px solid var(--line); background: var(--chrome); font-size: 15px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr repeat(3, 1fr); }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
.site-footer h2 { margin-bottom: 12px; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 6px; }
.site-footer nav a { color: var(--text); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer .wordmark { margin-bottom: 12px; }
.copyright { margin: 40px auto 0; color: var(--muted); font-size: 14px; }

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