
:root {
  --bg: #f4efe6;
  --bg-2: #fffaf2;
  --ink: #1f1812;
  --muted: #6a5f54;
  --line: #d8cec0;
  --accent: #9c4a28;
  --accent-2: #2f5d50;
  --warn: #8a4b16;
  --warn-bg: #f1dfc6;
  --chip: #efe6d8;
  --shadow: 0 10px 30px rgba(40, 28, 16, 0.06);
  --radius: 18px;
  --max: 980px;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, #ebe1d2 0%, transparent 36%),
    linear-gradient(180deg, #efe8dc, var(--bg) 28%);
  font-family: var(--serif);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(244, 239, 230, 0.92);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  padding: 0.85rem 0;
}
.brand {
  font-family: var(--serif); font-size: 1.35rem; color: var(--ink);
  text-decoration: none; letter-spacing: -0.02em; font-weight: 600;
}
.brand span { color: var(--accent); }
nav {
  display: flex; flex-wrap: wrap; gap: 0.55rem 0.9rem;
  font-family: var(--sans); font-size: 0.92rem;
}
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); }
.menu-toggle {
  display: none; font-family: var(--sans); border: 1px solid var(--line);
  background: var(--bg-2); border-radius: 999px; padding: 0.35rem 0.8rem;
}
.hero {
  padding: 3.2rem 0 2rem;
}
.hero .kicker {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; color: var(--muted); margin: 0 0 0.6rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08;
  margin: 0 0 0.8rem; letter-spacing: -0.03em; font-weight: 600;
  max-width: 14ch;
}
.hero .lede {
  font-size: 1.12rem; color: var(--muted); max-width: 38rem; margin: 0 0 1.4rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-size: 0.92rem;
  border-radius: 999px; padding: 0.55rem 1rem; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); text-decoration: none;
}
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  margin: 2rem 0 0;
}
.stat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.4rem; font-family: var(--sans); }
.stat span { color: var(--muted); font-size: 0.88rem; font-family: var(--sans); }
.panel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.panel h2, .entity-main h2 {
  font-size: 1.15rem; margin: 0 0 0.7rem; letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 0.72rem;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.18rem 0.55rem; background: var(--chip); margin-right: 0.25rem;
}
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #e0c49a; }
.badge.layer-ingredient { background: #e5ebe2; }
.badge.layer-preparation { background: #f3e3cc; }
.badge.layer-component { background: #f0d7c8; }
.badge.layer-dish { background: #edd6db; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.card {
  display: block; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 0.9rem 1rem; text-decoration: none; color: inherit;
}
.card:hover { border-color: #b9aa97; }
.card strong { display: block; margin-bottom: 0.2rem; }
.card .meta { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; justify-content: space-between;
}
.list li:last-child { border-bottom: 0; }
.search-box {
  width: 100%; font: 1rem var(--sans); padding: 0.75rem 1rem;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
}
.entity-hero { padding: 2rem 0 0.5rem; }
.entity-hero h1 {
  margin: 0.35rem 0 0.5rem; font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}
.path {
  font-family: var(--sans); font-size: 0.78rem; color: var(--muted); word-break: break-word;
}
.warn-box {
  background: var(--warn-bg); border-left: 3px solid var(--accent);
  padding: 0.75rem 0.9rem; color: var(--warn); margin: 0.6rem 0 0.9rem;
}
.site-footer {
  margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-family: var(--sans); font-size: 0.88rem;
}
.graph-frame {
  width: 100%; min-height: 78vh; border: 1px solid var(--line);
  border-radius: var(--radius); background: #14110e;
}
.columns-2 {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem;
}
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .columns-2 { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  nav {
    display: none; width: 100%; flex-direction: column;
    padding-bottom: 0.8rem;
  }
  nav.open { display: flex; }
  .site-header .bar { flex-wrap: wrap; }
}
details.tree {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.75rem;
  background: #fff; margin: 0.35rem 0;
}
details.tree > summary {
  cursor: pointer; font-family: var(--sans); list-style: none;
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; align-items: baseline;
}
details.tree > summary::-webkit-details-marker { display: none; }
details.tree > summary::before { content: "▸ "; color: var(--muted); }
details.tree[open] > summary::before { content: "▾ "; }
.tree-children { margin: 0.4rem 0 0.2rem 0.85rem; }
.toggle-row {
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center;
  justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 0.92rem;
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.toggle-switch button {
  font: inherit; border: 0; background: transparent; padding: 0.28rem 0.7rem; cursor: pointer;
  color: var(--muted);
}
.toggle-switch button.on { background: var(--ink); color: var(--bg); }
.recipe-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 820px) {
  .recipe-cols { grid-template-columns: 1fr; }
}
