/* Little Eye — site.css
 *
 * Brand tokens, dark-mode mapping, and the component vocabulary used by
 * every page. See docs/plans/2026-05-19-littleeye-web-design.md §6.
 */

:root {
  /* Brand palette */
  --cyan: #22CEF4;
  --cyan-deep: #0EA5C7;
  --ink: #0B2A33;
  --paper: #F2F9FC;
  --white: #FFFFFF;

  /* Semantic roles (swapped in dark mode) */
  --canvas: var(--paper);
  --on-canvas: var(--ink);
  --muted: #4A6B75;
  --card-bg: var(--white);
  --card-border: rgb(11 42 51 / 0.08);
  --link: var(--cyan-deep);
  --link-hover: var(--cyan);

  /* Default per-detector accent (overridden by .detector-page) */
  --accent: var(--cyan-deep);

  /* Type */
  --font-display: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shape */
  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgb(11 42 51 / 0.06), 0 8px 24px rgb(11 42 51 / 0.08);
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: var(--ink);
    --on-canvas: var(--paper);
    --muted: #94B2BB;
    --card-bg: #102C36;
    --card-border: rgb(255 255 255 / 0.08);
    --link: var(--cyan);
    --link-hover: var(--cyan-deep);
  }
}

/* Self-hosted fonts (subsetted Latin builds). */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  font-family: var(--font-display);
  color: var(--on-canvas);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body {
  line-height: 1.55;
  font-weight: 500;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
:where(h1, h2, h3, h4) { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-weight: 900; font-size: clamp(2rem, 4vw + 0.5rem, 3.25rem); }
h2 { font-weight: 700; font-size: clamp(1.5rem, 2vw + 0.75rem, 2rem); }
h3 { font-weight: 700; font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); }
ul, ol { padding-left: 1.25em; }
hr { border: 0; border-top: 1px solid var(--card-border); margin: 2rem 0; }

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

/* Header + footer */
.site-header,
.site-footer {
  padding-block: 1rem;
  border-bottom: 1px solid var(--card-border);
}
.site-footer {
  border-top: 1px solid var(--card-border);
  border-bottom: 0;
  padding-block: 1.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-header > .container,
.site-footer > .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--on-canvas);
  font-weight: 900;
  font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--on-canvas); font-weight: 700; }
.site-nav a:hover { color: var(--link); }

/* Hero */
.hero {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2rem, 6vw, 4rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.hero__lede {
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.25rem);
  color: var(--muted);
  max-width: 52ch;
}
.hero__art {
  display: flex;
  justify-content: center;
}
.hero__art img { width: min(320px, 90%); }

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 2px 4px rgb(11 42 51 / 0.08), 0 14px 32px rgb(11 42 51 / 0.12);
}
.card__title { font-weight: 700; font-size: 1.1rem; }
.card__summary { color: var(--muted); font-size: 0.95rem; }
.card--accent {
  border-left: 3px solid var(--accent);
}

/* Grids */
.group-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.detector-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* Pills (outlined — echoes the app's pivot pill style) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.pill:hover {
  background: var(--accent);
  color: var(--card-bg);
  text-decoration: none;
}

/* Code blocks */
.code {
  position: relative;
  display: block;
  background: rgb(11 42 51 / 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}
@media (prefers-color-scheme: dark) {
  .code { background: rgb(255 255 255 / 0.04); }
}
.code__copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--on-canvas);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.code:hover .code__copy,
.code:focus-within .code__copy,
.code__copy:focus-visible { opacity: 1; }
.code__copy:hover { color: var(--link); }

/* Platform badges (macOS-only / iOS-only marker on detector cards
   and on per-detector page H1s). Reserved gray rather than a brand
   accent because the absence of one is the default — the badge is
   a constraint marker, not a feature. */
.badge {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15em 0.55em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}
h1 .badge { font-size: 0.45em; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-block: 1rem 0.5rem;
  padding: 0;
  list-style: none;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.35rem; }
.breadcrumb li + li::before { content: "/"; color: var(--muted); }
.breadcrumb a { color: var(--link); }
.breadcrumb [aria-current="page"] { color: var(--on-canvas); font-weight: 700; }

/* Per-detector accent: H1 underline + example block left border */
.detector-page { --accent: var(--cyan-deep); }
.detector-page h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 0.6rem;
  background: var(--accent);
  border-radius: 2px;
}
.detector-page .example {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  margin-block: 1rem;
}

/* Utility */
.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
