/* Site tokens layered on the brand tokens in assets/brand.css */
:root {
  --surface: #FBF8F3;
  --surface-2: #EAE3D7;
  --line: #D9D0C2;
  --muted: #6B6358;
  --meter-track: #E4DCCF;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #1E1A15;
    --surface-2: #29241D;
    --line: #342E26;
    --muted: #A39A8C;
    --meter-track: #2E2820;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #1E1A15;
  --surface-2: #29241D;
  --line: #342E26;
  --muted: #A39A8C;
  --meter-track: #2E2820;
  color-scheme: dark;
}

/* Logo swap follows the same theme rules */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--kindling-bg);
  color: var(--kindling-fg);
  font-family: var(--kindling-font-display);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
code { font-family: var(--font-mono); font-size: 0.9em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--kindling-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; }
.brand .logo { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: 8px; color: var(--muted);
}
.nav a:hover { color: var(--kindling-fg); background: var(--surface-2); }
.theme-toggle {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--kindling-accent); }
@media (max-width: 560px) {
  .nav a[href="#method"] { display: none; }
  .brand .logo { height: 28px; }
}

/* Hero */
.hero { padding-top: 72px; padding-bottom: 56px; }
.kicker {
  font-family: var(--font-mono); font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--kindling-accent); margin: 0 0 20px;
}
h1 {
  font-size: clamp(40px, 7vw, 76px); line-height: 1.02; font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 24px; max-width: 14ch;
}
.ember { color: var(--kindling-accent); }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 60ch; margin: 0 0 40px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.hero-stats div {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px;
  background: var(--surface); min-width: 160px;
}
.hero-stats dt { font-size: 13px; color: var(--muted); }
.hero-stats dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 26px; font-weight: 500; }
.hero-stats dd small { font-size: 14px; color: var(--muted); margin-left: 4px; }

/* Section heads and filters */
h2 { font-size: 28px; letter-spacing: -0.01em; margin: 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 24px 0; border-top: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 14px var(--kindling-font-display); padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--kindling-fg); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--kindling-fg); color: var(--kindling-bg); border-color: var(--kindling-fg); }
.chip .count { font-family: var(--font-mono); font-size: 12px; opacity: 0.7; margin-left: 6px; }

/* Grid of recipe cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 20px; padding-bottom: 72px; }
.status { color: var(--muted); }

/* Each card spans 9 rows of the parent grid and shares them (subgrid), so the
   same section starts at the same height in every card on a row. */
.card {
  display: grid; grid-row: span 9; grid-template-rows: subgrid; row-gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; min-width: 0;
}
@supports not (grid-template-rows: subgrid) {
  .card { display: flex; flex-direction: column; }
}
.card[hidden] { display: none; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-hw { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card h3 { font-size: 26px; line-height: 1.15; margin: 6px 0 0; letter-spacing: -0.01em; }
.card h3 .variant {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; vertical-align: middle;
  color: var(--kindling-accent); border: 1px solid currentColor; border-radius: 6px;
  padding: 2px 7px; margin-left: 8px;
}
.card-summary { color: var(--muted); margin: 0; font-size: 15px; }
.source {
  flex: none; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.source.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--kindling-accent); margin-right: 6px; vertical-align: 1px;
}

/* Config tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab {
  font: 500 14px var(--kindling-font-display); padding: 6px 12px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab .n { font-family: var(--font-mono); font-size: 12px; opacity: 0.75; margin-left: 4px; }
.tab[aria-selected="true"] { background: var(--kindling-bg); color: var(--kindling-fg); box-shadow: 0 1px 0 var(--line); }

/* Metrics */
.sec h4 {
  margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted);
  display: flex; justify-content: space-between;
}
.sec h4 span { font-family: var(--font-mono); font-size: 12px; }
.meter-row { display: grid; grid-template-columns: 92px 1fr 88px; align-items: center; gap: 12px; margin-bottom: 8px; }
.meter-row .label { font-size: 14px; }
.meter-row .value { font-family: var(--font-mono); font-size: 14px; text-align: right; white-space: nowrap; }
.meter-row .value small { color: var(--muted); font-size: 11px; margin-left: 2px; }
.meter { height: 8px; border-radius: 99px; background: var(--meter-track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--kindling-accent); transition: width 0.4s ease; }
.meter.soft i { background: var(--kindling-accent-soft); }
.meter-row.na .label, .meter-row.na .value { color: var(--muted); opacity: 0.6; }

.load-chart { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.load-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.load-chart .bar i { width: 100%; max-width: 44px; background: var(--kindling-accent); border-radius: 4px 4px 0 0; transition: height 0.4s ease; }
.load-chart .bar b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.load-chart .bar span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.load-chart .bar.na b { color: var(--muted); opacity: 0.6; }
.load-chart .bar.na i { height: 2px; background: var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0; }
.stats div { background: var(--surface); padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--font-mono); font-size: 17px; }

.sec-extra { display: grid; gap: 10px; align-content: start; }
.quality { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.quality li { font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
.quality li b { font-family: var(--font-mono); font-weight: 500; margin-left: 6px; }
.notes { font-size: 13px; color: var(--muted); margin: 0; }

.card-foot {
  align-self: end; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 16px; border-top: 1px solid var(--line);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.foot-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.foot-right .stars { font-family: var(--font-mono); }
.cta {
  text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 8px;
  background: var(--kindling-accent); color: var(--kindling-ink);
}
.cta:hover { filter: brightness(1.08); }

/* Method */
.method { padding-top: 24px; padding-bottom: 80px; border-top: 1px solid var(--line); }
.method h2 { margin-bottom: 24px; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 28px; }
.method h3 { font-size: 17px; margin: 0 0 6px; }
.method h3::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--kindling-accent); margin-right: 10px; }
.method p { color: var(--muted); margin: 0; font-size: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-row { display: flex; align-items: center; gap: 14px; height: 72px; font-size: 14px; color: var(--muted); }
.footer-row a { margin-left: auto; text-decoration: none; }
.footer-row a:hover { color: var(--kindling-accent); }

@media (max-width: 480px) {
  .card { padding: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .meter-row { grid-template-columns: 72px 1fr 78px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
