/* ==========================================================================
   Kamari public site (quest1792105462)
   The original site's theme (soft tinted background, translucent cards,
   pill buttons, Outfit + JetBrains Mono), adapted to ~/.claude/ux-guidelines.md:
   - ONE accent, used only for links and the primary button.
   - Every text/background pair is at least 7:1 in both themes; the pairs are
     measured by tests/unit/test_www_design_rules.py, so change a colour there
     and here together. Muted text and accent were adjusted from the original
     (light #4a5c6a/#10658f, dark #9db1c1/#4fb3e8) and the background glows
     halved, so text reaches 7:1 even where the glow is strongest.
   - Fixed type scale 16 / 20 / 28 / 40 px; spacing on an 8 px grid.
   - Fonts are served from this site (SIL Open Font License, see fonts/),
     so the page loads nothing from other sites.
   - Palette: :root (light), OS dark preference unless the visitor pinned
     light, and an explicit dark choice.
   ========================================================================== */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/outfit-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --background: #f7fafc;
  --surface: #e7eef5;
  --text: #0f1c26;
  --text-muted: #384650;
  --border: #b3c4d1;
  --accent: #0c4968;
  --on-accent: #ffffff;
  --code-background: #e3ebf2;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.94);
  --shadow-soft: 0 14px 34px rgba(15, 44, 68, 0.10);
  --ambient-1: rgba(23, 121, 186, 0.07);
  --ambient-2: rgba(8, 145, 168, 0.06);
  --font-text: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --size-body: 16px;
  --size-h3: 20px;
  --size-h2: 28px;
  --size-h1: 40px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --radius: 16px;
  --radius-small: 8px;
  --content-width: 1100px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0a1016;
    --surface: #131e28;
    --text: #e9f2f8;
    --text-muted: #aebfcc;
    --border: #2f4658;
    --accent: #78c5ed;
    --on-accent: #05161f;
    --code-background: #16232f;
    --card: rgba(19, 30, 40, 0.66);
    --card-strong: rgba(19, 30, 40, 0.92);
    --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.46);
    --ambient-1: rgba(79, 179, 232, 0.07);
    --ambient-2: rgba(34, 211, 238, 0.055);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --background: #0a1016;
  --surface: #131e28;
  --text: #e9f2f8;
  --text-muted: #aebfcc;
  --border: #2f4658;
  --accent: #78c5ed;
  --on-accent: #05161f;
  --code-background: #16232f;
  --card: rgba(19, 30, 40, 0.66);
  --card-strong: rgba(19, 30, 40, 0.92);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.46);
  --ambient-1: rgba(79, 179, 232, 0.07);
  --ambient-2: rgba(34, 211, 238, 0.055);
  color-scheme: dark;
}

/* --------------------------------------------------------------- base --- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--size-body);
  line-height: 1.5;
  background-color: var(--background);
  background-image:
    radial-gradient(58rem 40rem at 12% -6%, var(--ambient-1), transparent 62%),
    radial-gradient(52rem 38rem at 92% 18%, var(--ambient-2), transparent 60%),
    linear-gradient(152deg, var(--background) 0%, var(--surface) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 var(--space-2); font-weight: 700; }
h1 { font-size: var(--size-h1); font-weight: 800; }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); font-weight: 600; }

p, li { max-width: 70ch; }
p { margin: 0 0 var(--space-2); }

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

code, pre, kbd { font-family: var(--font-code); font-size: var(--size-body); font-weight: 500; }

code {
  color: var(--text);
  background: var(--code-background);
  border-radius: 6px;
  padding: 0 6px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: var(--space-2);
  margin: 0 0 var(--space-2);
  overflow-x: auto;
  line-height: 1.6;
}

pre code { background: none; padding: 0; overflow-wrap: normal; }

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

:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -64px;
  padding: var(--space-1) var(--space-2);
  background: var(--background);
  color: var(--accent);
  border-radius: var(--radius-small);
  z-index: 10;
}
.skip-link:focus { top: var(--space-2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------- page frame --- */

.frame {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.site-header .frame {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  padding-top: var(--space-3);
  padding-bottom: var(--space-1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: var(--size-h3);
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover { background: var(--card); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  background: var(--card-strong);
  border: 1px solid var(--border);
  font-weight: 700;
}

.theme-button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-2);
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.theme-button:hover { background: var(--card-strong); }

main { display: block; }

section { padding: var(--space-8) 0 0; }
section:last-of-type { padding-bottom: var(--space-8); }

.lede { font-size: var(--size-h3); color: var(--text-muted); }

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

/* --------------------------------------------------------------- hero --- */

.hero { padding-top: var(--space-6); }
.hero h1, .hero .lede { text-align: center; margin-left: auto; margin-right: auto; }
.hero h1 { max-width: 20ch; }
.hero .lede { max-width: 60ch; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.button-primary:hover { text-decoration: underline; }

.link-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
}

.trust-line { text-align: center; color: var(--text-muted); margin: 0 auto var(--space-4); max-width: none; }

.screenshot {
  margin: 0 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
}

figure { margin: 0 0 var(--space-4); }
.screenshot img { margin: 0 auto; }
figcaption { color: var(--text-muted); max-width: 70ch; }

/* ------------------------------------------------------------- blocks --- */

.blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.blocks > div, .facts li, .plugin, .next-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.blocks > div { padding: var(--space-3); }
.blocks h3 { margin-bottom: var(--space-1); }
.blocks p { color: var(--text-muted); margin: 0; }

.steps { list-style: none; margin: var(--space-3) 0 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; margin-bottom: var(--space-6); max-width: none; }
.steps > li > h3::before { content: counter(step) ". "; }

.facts { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
.facts li { padding: var(--space-2) var(--space-3); max-width: none; color: var(--text-muted); }
.facts strong { font-size: var(--size-h3); }

.plain-list { padding-left: var(--space-3); }
.plain-list li { margin-bottom: var(--space-1); }

table { border-collapse: collapse; width: 100%; margin: 0 0 var(--space-3); }
.table-scroll {
  overflow-x: auto;
  margin: 0 0 var(--space-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-2);
}
.table-scroll table { margin: 0; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: var(--space-1) var(--space-2) var(--space-1) 0; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
th { font-weight: 700; }

.next-step { margin-top: var(--space-8); padding: var(--space-3); }
.next-step p { margin: 0; }

.copy-wrap { position: relative; }
.copy-button {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  min-height: 44px;
  min-width: 64px;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.copy-wrap pre { padding-right: 96px; }

/* ------------------------------------------------------------ plugins --- */

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
}

.filters label { display: block; font-weight: 600; margin-bottom: 4px; }

.filters input, .filters select, .filters button {
  width: 100%;
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0 var(--space-1);
}

.filters button { cursor: pointer; border-radius: 999px; font-weight: 500; }

.filters[hidden], .theme-button[hidden] { display: none; }

.plugin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--space-2); }

.plugin { padding: var(--space-2) var(--space-3) var(--space-1); max-width: none; }

.plugin[hidden] { display: none; }
.plugin h2 { font-size: var(--size-h3); margin-bottom: 4px; }
.plugin-meta { color: var(--text-muted); margin-bottom: var(--space-1); }

details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.tools { list-style: none; margin: 0; padding: 0; }
.tool { border-top: 1px solid var(--border); padding: var(--space-1) 0; max-width: none; }
.tool p { margin: 4px 0 0; color: var(--text-muted); }
.tool-name { font-weight: 700; }

.effect {
  display: inline-block;
  padding: 0 var(--space-1);
  border: 1px solid var(--text);
  border-radius: 999px;
  font-weight: 600;
}
.effect-write { background: var(--text); color: var(--background); }
.effect-read { background: var(--background); color: var(--text); }

.tool.is-match { border-left: 3px solid var(--text); padding-left: var(--space-1); }

/* ---------------------------------------------------------- changelog --- */

.timeline { list-style: none; margin: 0; padding: var(--space-1) 0 var(--space-1) var(--space-3); border-left: 2px dashed var(--border); }
.timeline > li { position: relative; padding: 0 0 var(--space-4) var(--space-1); max-width: none; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 5px var(--surface);
}
.timeline h2 { font-size: var(--size-body); font-family: var(--font-code); color: var(--text-muted); letter-spacing: 0.05em; }
.timeline ul { list-style: none; padding: 0; margin: 0; }
.timeline ul li { margin-bottom: var(--space-2); }
.timeline h3 { font-size: var(--size-body); font-weight: 600; margin-bottom: 4px; }
.timeline p { color: var(--text-muted); }

/* ------------------------------------------------------------- footer --- */

.site-footer { border-top: 1px solid var(--border); margin-top: var(--space-8); padding: var(--space-4) 0 var(--space-6); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; grid-template-columns: 1fr; gap: 0 var(--space-4); }
.site-footer li { min-height: 44px; display: flex; align-items: center; max-width: none; }
.site-footer p { color: var(--text-muted); }

/* --------------------------------------------------------- wide screens --- */

@media (min-width: 768px) {
  .blocks { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
  .site-footer ul { grid-template-columns: repeat(2, 1fr); }
  section { padding-top: var(--space-12); }
}

@media (min-width: 1024px) {
  .facts { grid-template-columns: repeat(3, 1fr); }
  .plugin-list { grid-template-columns: repeat(2, 1fr); align-items: start; }
}

@media (max-width: 520px) {
  h1 { font-size: var(--size-h2); }
  h2 { font-size: var(--size-h3); }
  .hero { padding-top: var(--space-4); }
  .brand img { width: 32px; height: 32px; border-radius: 9px; }
  .timeline { padding-left: var(--space-2); }
  .timeline > li::before { left: -23px; }
}
