/* Aira website, shared by every page: fonts, tokens, type, buttons, the nav, the footer and demo media.
   Page layouts live in each page's own <style>. DESIGN.md explains the system.
   Pages link this (and site.js) as ?v=N: bump N on every change, or browsers keep showing a cached copy. */

/* Funnel Display for headings, Funnel Sans for text, Martian Mono for code and labels.
   All SIL OFL 1.1 (fonts/OFL-*.txt), variable, Latin subset. */
@font-face {
  font-family: "Funnel Display";
  src: url("fonts/funnel-display-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Funnel Sans";
  src: url("fonts/funnel-sans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens: the app's dark theme (src/styles.css). Card and agent hues come from its project palette,
   hsl(n × 15° 72% 60%) (src/lib/identity.ts). */
:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #0f0f11;
  --elev: #16161a;
  --hover: #1c1c21;
  --border: #222227;
  --border-strong: #34343c;
  --border-hover: #4a4a55;
  --ring: #2a2a31;
  --ink: #f3f3f6;
  --text: #e6e6ea;
  --soft: #c9c9d1;
  --prose: #b8b8c1;
  --dim: #9a9aa3;
  --accent: #6aa8ff;
  --green: #3fcf6e;
  --amber: #e6b450;
  --red: #ff6b6b;
  --accent-hover: #8bbcff;
  --on-accent: #06101f;
  --nav: #0e0e10;
  --display: "Funnel Display", "Funnel Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* Type: small 14px · body 16–17px · lead 18–21px · title 22px · h2 34–56px · h1 44–92px. */
  --text-sm: 0.875rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(1rem, 0.95rem + 0.25vw, 1.0625rem) / 1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--display); text-wrap: balance; }
h1, h2 { font-weight: 620; line-height: 1.04; letter-spacing: -0.02em; }
h3 { font-weight: 600; letter-spacing: -0.005em; }
code, pre { font-family: var(--mono); font-stretch: 87.5%; }
code { font-size: 0.82em; }
pre code { font-size: inherit; }
b, strong { font-weight: 650; color: var(--ink); }
kbd {
  display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 0.4em; vertical-align: 0.05em;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--elev);
  color: var(--ink); font: 500 var(--text-sm) / 1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; /* macOS keycap glyphs (⌘ ⌥ ⌃ ⏎) */
}
kbd + kbd { margin-left: 0.2rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: fixed; top: 1rem; left: 1rem; z-index: 3; padding: 0.5rem 0.9rem;
  border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }
.wrap { width: min(100% - 2.5rem, 74rem); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 3rem; padding: 0 1.3rem;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--elev); color: var(--ink);
  text-decoration: none; font: 600 1rem / 1 var(--font); white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.btn:hover { background: var(--hover); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { height: 2.375rem; padding: 0 0.95rem; border-radius: 8px; }

/* ---------- nav: clear at the top of the page, frosted glass once it scrolls (site.js sets .scrolled) ---------- */
.nav {
  position: fixed; top: 0.75rem; left: 50%; z-index: 2; translate: -50% 0;
  width: min(100% - 1.5rem, 66rem); display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1.75rem);
  padding: 0.4rem 0.45rem 0.4rem 1rem; border: 1px solid transparent; border-radius: 14px;
  transition: background-color 0.35s, border-color 0.35s, box-shadow 0.35s, backdrop-filter 0.35s, -webkit-backdrop-filter 0.35s;
}
.nav.scrolled {
  background: rgb(14 14 16 / 0.72); border-color: rgb(255 255 255 / 0.09);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 12px 32px -16px rgb(0 0 0 / 0.7);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav.scrolled { background: var(--nav); border-color: var(--border-strong); }
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; font: 650 1.2rem / 1 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.nav .links { display: flex; gap: clamp(0.9rem, 2.4vw, 2rem); margin-inline: auto; }
.nav .links a, .nav .gh { color: var(--soft); text-decoration: none; transition: color 0.2s; }
.nav .links a { position: relative; padding-block: 0.4rem; }
.nav .links a:hover, .nav .gh:hover, .nav .links a[aria-current="page"] { color: var(--ink); }
.nav .links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: -0.1rem; width: 0.3rem; height: 0.3rem; translate: -50% 0;
  border-radius: 50%; background: var(--accent);
}
.nav .gh { display: inline-grid; place-items: center; width: 2.375rem; height: 2.375rem; border-radius: 8px; }
.nav .gh svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }

/* ---------- sub-page header ---------- */
.page-head { position: relative; isolation: isolate; padding: clamp(8rem, 15vw, 10.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.page-head::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; pointer-events: none;
  background: radial-gradient(50% 75% at 50% 0%, hsl(var(--h, 210) 72% 60% / 0.16), transparent 72%);
}
.page-head h1 { font-size: clamp(2.6rem, 1.5rem + 4.2vw, 4.75rem); }
.page-head .lead { max-width: 42rem; margin: 1.25rem 0 0; font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem); line-height: 1.6; color: var(--prose); }

/* ---------- demo media ---------- */
/* A still under a muted loop that plays only while in view, with a visible pause button (WCAG 2.2.2). */
.clip { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: #000; }
.clip img, .clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip video { opacity: 0; transition: opacity 0.4s; }
.clip.on video { opacity: 1; }
.clip-btn {
  position: absolute; right: 0.6rem; bottom: 0.6rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 1px solid rgb(255 255 255 / 0.22); border-radius: 50%; background: rgb(10 10 12 / 0.86); color: var(--ink); cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.clip-btn:hover { background: rgb(28 28 33 / 0.95); border-color: rgb(255 255 255 / 0.4); }
.clip-btn svg { width: 0.95rem; height: 0.95rem; fill: currentColor; }
.clip-btn[data-state="playing"] .i-play, .clip-btn[data-state="paused"] .i-pause { display: none; }
.shot { margin: 0; }
/* Plain media, no ring: dialog and popover crops bring their own border and shadow. */
.shot img { border-radius: var(--radius); }

/* ---------- code block with copy ---------- */
.code { text-align: left; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #0c0c0e; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 0.55rem 0.45rem 1.25rem; border-bottom: 1px solid var(--border); font: 400 0.8125rem var(--mono); font-stretch: 87.5%; color: var(--dim); }
.code pre { margin: 0; padding: 1.1rem 1.25rem 1.25rem; overflow-x: auto; font-size: 0.8125rem; line-height: 1.85; color: var(--text); }
.code pre:focus-visible { outline-offset: -2px; border-radius: 0 0 var(--radius) var(--radius); }
.code pre .prompt { color: var(--accent); user-select: none; }
.copy-btn {
  height: 2rem; padding: 0 0.75rem; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--elev);
  color: var(--soft); font: 600 var(--text-sm) var(--font); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.copy-btn:hover { color: var(--ink); border-color: var(--border-hover); }

/* ---------- footer ---------- */
.foot { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem 2.5rem; padding-block: 2rem 3rem; border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--dim); }
.foot .brand { font-size: 1.05rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 0.5rem 1.5rem; }
.foot nav a { color: var(--soft); text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot p { grid-column: 1 / -1; margin: 0; max-width: 70ch; }

@media (max-width: 640px) {
  .nav .btn { display: none; }
  .nav { padding-left: 0.8rem; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot nav { justify-content: start; }
}
@media (max-width: 370px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
