:root {
  color-scheme: light;
  --ink: #25211d;
  --muted: #6f675d;
  --paper: #f8f3eb;
  --panel: #fffaf2;
  --line: #ded4c6;
  --accent: #0f766e;
  --accent-dark: #0b4d49;
  --shadow: 0 18px 45px rgb(37 33 29 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: rgb(248 243 235 / 92%);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 750;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  min-height: calc(100vh - 72px);
}

.page-shell {
  width: min(1120px, 90vw);
  margin: 0 auto;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  color: white;
  font-weight: 750;
  text-decoration: none;
}

.home {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 4rem 0;
}

.copy {
  max-width: 760px;
}

.home h1,
.recipe-hero h1,
.detail-hero h1 {
  margin: 0.4rem 0 1rem;
  letter-spacing: 0;
}

.home h1 {
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.92;
}

.home p:not(.eyebrow),
.recipe-hero p:not(.eyebrow),
.detail-hero p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.recipe-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--line);
}

.hero-grid,
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 3rem;
  align-items: end;
}

.recipe-hero h1,
.detail-hero h1 {
  max-width: 760px;
  font-size: clamp(2.75rem, 7vw, 6.3rem);
  line-height: 0.94;
}

.hero-grid img,
.detail-hero img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 2rem 0 5rem;
}

.recipe-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.recipe-card a {
  display: grid;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.recipe-card-copy {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
}

.meta,
.recipe-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.meta span,
.recipe-card li {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 45%);
}

.recipe-card h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.recipe-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recipe-detail {
  padding: 3rem 0 5rem;
}

.back {
  display: inline-flex;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-weight: 700;
}

dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

dl div {
  min-width: 120px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.recipe-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 2rem;
  margin-top: 3rem;
}

.recipe-body section {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.recipe-body h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ingredients,
.recipe-body ol,
.recipe-body ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink);
  line-height: 1.75;
}

.ingredients span {
  display: inline-block;
  min-width: 5rem;
  color: var(--muted);
  font-weight: 750;
}

.recipe-body ol li + li,
.recipe-body ul li + li {
  margin-top: 0.7rem;
}

.prose p {
  margin: 0;
  line-height: 1.75;
}

.protein-hero {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.protein-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 2rem;
  align-items: end;
}

.protein-hero h1 {
  margin: 0.35rem 0 1rem;
  max-width: 780px;
  font-size: clamp(2.75rem, 7vw, 6.3rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.protein-hero p:not(.eyebrow),
.hero-copy p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-copy p {
  margin: 0;
}

.protein-summary {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.protein-summary span,
.protein-summary small {
  color: var(--muted);
}

.protein-summary span {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.protein-summary strong {
  font-size: 1.35rem;
  line-height: 1.25;
}

.protein-tool {
  padding: 2rem 0 5rem;
}

.target-control {
  display: grid;
  grid-template-columns: auto minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.target-control label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.target-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.target-input input {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0 0.75rem;
}

.target-input span {
  padding: 0 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.target-control p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: center;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.table-actions p {
  margin: 0;
}

.protein-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.protein-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
}

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

.protein-table th {
  background: rgb(255 255 255 / 45%);
}

.protein-table th button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
}

.protein-table th button[data-active="true"]::after {
  content: " ↑";
}

.protein-table th button[data-active="true"][data-direction="desc"]::after {
  content: " ↓";
}

.protein-table tbody tr:last-child td {
  border-bottom: 0;
}

.protein-table td span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.quality-note {
  max-width: 760px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.quality-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 760px;
}

.quality-explainer div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.quality-explainer h2 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.quality-explainer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 780px) {
  .site-header {
    min-height: 64px;
    padding-inline: 1rem;
  }

  .brand {
    font-size: 0.95rem;
  }

  .recipe-hero,
  .recipe-detail {
    padding-top: 2rem;
  }

  .hero-grid,
  .detail-hero,
  .recipe-body,
  .protein-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-grid img,
  .detail-hero img {
    aspect-ratio: 16 / 10;
  }

  .table-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .target-control {
    grid-template-columns: 1fr;
  }

  .quality-explainer {
    grid-template-columns: 1fr;
  }
}
