/* EyeRest design tokens (default variant), vendored from the canonical brand
   source qte77/qte77/brand/DESIGN.md. Reference tokens, never a raw hex, never a
   blue accent. `prefers-color-scheme` flips light/dark; values re-resolve from
   the matching block. */

/* -- Fonts: self-hosted Inter + JetBrains Mono (latin woff2).
   Fetched on demand into assets/fonts/ via `make graph-fonts`; if absent, the
   font-family stacks fall back to system-ui gracefully. -- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("assets/fonts/Inter-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

:root {
  --bg: #ece8d8;
  --surface: #e2dec8;
  --border: #c8c4b0;
  --text: #2c2818;
  --text-muted: #686040;
  --primary: #7a6010;
  --primary-on: #ece8d8;
  color-scheme: light;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --unit: 8px;
  --container: 768px;
}

/* Dark palette — explicit `data-theme="dark"`, or the OS preference unless the
   user has explicitly chosen a mode. The block is duplicated by necessity: a
   media-query selector can't be grouped with a plain one. No-JS users (no
   data-theme attr) still get OS-driven dark via the second block. */
:root[data-theme="dark"] {
  --bg: #1c1a14;
  --surface: #242018;
  --border: #383428;
  --text: #d8d0b8;
  --text-muted: #a89878;
  --primary: #c8a858;
  --primary-on: #1c1a14;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #1c1a14;
    --surface: #242018;
    --border: #383428;
    --text: #d8d0b8;
    --text-muted: #a89878;
    --primary: #c8a858;
    --primary-on: #1c1a14;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(var(--unit) * 6) calc(var(--unit) * 3);
}

/* -- Header -- */
.masthead {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 2);
  margin-bottom: calc(var(--unit) * 2);
}
.masthead img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
}
#theme {
  margin-left: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.tagline {
  color: var(--text-muted);
  margin-bottom: calc(var(--unit) * 4);
}

/* -- Prose -- */
h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: calc(var(--unit) * 5) 0 calc(var(--unit) * 2);
}
h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: calc(var(--unit) * 3) 0 var(--unit);
}
p {
  margin-bottom: calc(var(--unit) * 2);
}
a {
  color: var(--primary);
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-thickness: 2px;
}
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
}

/* -- Primary actions -- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--unit) * 1.5);
  margin: calc(var(--unit) * 3) 0 calc(var(--unit) * 2);
}
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-on);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* -- Contents grid (cards) -- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: calc(var(--unit) * 2);
  margin-top: calc(var(--unit) * 2);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: var(--primary);
}
.card .name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.card .desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* -- Footer -- */
.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: calc(var(--unit) * 5) 0 calc(var(--unit) * 3);
}
footer {
  color: var(--text-muted);
  font-size: 0.875rem;
}
