:root {
  --bg: #faf9f7;
  --panel: #ffffff;
  --text: #141414;
  --text-muted: #5c5c5c;
  --border: #e7e3df;
  --accent: #a35a0a;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --panel: #f2f2f2;
    --text: #f2f2f2;
    --text-muted: #a3a3a3;
    --border: #262626;
    --accent: #e0932a;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav nav a::after { transition: none; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.wordmark { font-weight: 600; text-decoration: none; }

.nav nav { display: flex; gap: 1.5rem; }

.nav nav a {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  padding-bottom: 0.2rem;
  transition: color 0.2s ease;
}

.nav nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav nav a:hover { color: var(--accent); }
.nav nav a:hover::after { right: 0; }

.nav nav a[aria-current="page"] { color: var(--accent); }
.nav nav a[aria-current="page"]::after { right: 0; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.nav nav a:focus-visible { color: var(--accent); }
.nav nav a:focus-visible::after { right: 0; }

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
  padding: 1.5rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero h1 em {
  font-style: italic;
  line-height: 1.15;
  padding-bottom: 0.15em;
  display: inline-block;
}

.hero p {
  max-width: 42ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.hero-art {
  width: 100%;
  max-width: 560px;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .hero-art img { filter: invert(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hero-art { animation-delay: 0.08s; }
  .hero p { animation-delay: 0.14s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.stack-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.stack-section h2 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.page-section {
  border-top: none;
  padding-top: 2.5rem;
}

.page-section h1 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.section-lede {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 1.5rem;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty-state p { margin: 0; }

.empty-state .empty-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.recipe-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.recipe-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recipe-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.recipe-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { color: var(--accent); }

.recipe-meta {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.recipe-meta a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recipe-body {
  max-width: 760px;
}

.recipe-body h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.recipe-body h2:first-child { margin-top: 0; }

.recipe-body ul,
.recipe-body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.recipe-body li { margin-bottom: 0.4rem; }

.recipe-note {
  border-left: 2px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.recipe-source {
  max-width: 760px;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ref-section h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 1rem;
}

.ref-section:first-of-type h2 { margin-top: 0; }

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.jump-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.jump-nav a:hover { color: var(--accent); }

.table-wrap { overflow-x: auto; }

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.ref-table th,
.ref-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ref-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .nav { padding: 1rem; }
  main { padding: 0 1rem; }
}
