:root {
  --ink: #17222c;
  --muted: #586672;
  --paper: #fbfaf5;
  --surface: #ffffff;
  --surface-soft: #f0f4ef;
  --line: #d6ded8;
  --primary: #275d54;
  --primary-dark: #173f39;
  --accent: #d9a441;
  --accent-soft: #f8edcf;
  --focus: #1f6feb;
  --shadow: 0 18px 50px rgba(23, 34, 44, 0.08);
  --radius: 18px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--primary);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(214, 222, 216, 0.9);
  background: rgba(251, 250, 245, 0.95);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 68px;
  margin-inline: auto;
  gap: 1rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  margin-right: 0.45rem;
  border-radius: 50% 50% 45% 55%;
  background: var(--accent);
  transform: rotate(-18deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.site-nav a {
  text-decoration: none;
}

.nav-cta {
  padding: 0.52rem 0.78rem;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
}

.nav-cta:hover {
  color: #fff;
  background: var(--primary-dark);
}

main {
  min-height: 70vh;
}

.container {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.narrow {
  width: min(calc(100% - 2rem), 820px);
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.4rem, 8vw, 7rem) 0 clamp(2.5rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 78% 16%, rgba(217, 164, 65, 0.2), transparent 25rem),
    linear-gradient(145deg, #f4f7ef, #fbfaf5 55%);
}

.hero::after {
  position: absolute;
  right: -8rem;
  bottom: -8rem;
  width: 23rem;
  height: 23rem;
  border: 1px solid rgba(39, 93, 84, 0.2);
  border-radius: 42% 58% 62% 38%;
  content: "";
  transform: rotate(22deg);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: end;
  gap: 2rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 18ch;
  margin-bottom: 1rem;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.45rem, 7vw, 5.1rem);
  font-weight: 650;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

h3 {
  margin-bottom: 0.5rem;
  font-size: 1.18rem;
}

.lede {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.26rem);
}

.hero-actions,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.68rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  color: white;
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--primary-dark);
  background: transparent;
}

.button-secondary:hover {
  color: white;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 2rem;
}

.stat {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.stat strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.stat span {
  color: var(--muted);
  font-size: 0.84rem;
}

.section {
  padding: clamp(2.8rem, 7vw, 5.5rem) 0;
}

.section-soft {
  border-block: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 1rem;
}

.card {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card p:last-child {
  margin-bottom: 0;
}

.card-kicker {
  margin: 0 0 0.55rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.source-note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  color: #4a412f;
  font-size: 0.92rem;
}

.source-note p {
  margin: 0.25rem 0;
}

.breadcrumbs {
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  gap: 0.45rem;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 0.45rem;
  content: "/";
  color: #96a19a;
}

.nutrition-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.6rem 0;
}

.nutrition-summary .metric {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.metric-value {
  display: block;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 850;
  line-height: 1.05;
}

.metric-label {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 1rem;
  color: var(--muted);
  text-align: left;
}

th,
td {
  padding: 0.78rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

thead th {
  position: sticky;
  z-index: 2;
  top: 67px;
  color: #fff;
  background: var(--ink);
  font-size: 0.78rem;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f6f8f5;
}

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

.sort-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  font-weight: 800;
}

.sort-button::after {
  margin-left: 0.35rem;
  content: "↕";
  opacity: 0.65;
}

th[aria-sort="ascending"] .sort-button::after {
  content: "↑";
}

th[aria-sort="descending"] .sort-button::after {
  content: "↓";
}

.prose {
  color: #293640;
}

.prose > * + * {
  margin-top: 1.2rem;
}

.prose h2 {
  margin-top: 2.8rem;
}

.prose h3 {
  margin-top: 2rem;
}

.prose p,
.prose li {
  max-width: 74ch;
}

.prose li + li {
  margin-top: 0.55rem;
}

.callout {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

details {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.calculator-layout {
  display: grid;
  gap: 1.2rem;
}

.calculator-panel {
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.calculator-panel fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.calculator-panel fieldset + fieldset {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.calculator-panel legend {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
  font-weight: 850;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  font-size: 0.78rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 54px;
  padding: 0.78rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  gap: 0.6rem;
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background: #edf5f2;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.option-card input {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.12rem 0 0;
  accent-color: var(--primary);
}

.option-card strong,
.option-card small {
  display: block;
}

.option-card small {
  margin-top: 0.12rem;
  color: var(--muted);
  line-height: 1.35;
}

.totals-panel {
  align-self: start;
  padding: 1.2rem;
  border-radius: var(--radius);
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.totals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.total-box {
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.total-box:first-child {
  grid-column: span 2;
}

.total-box strong {
  display: block;
  font-size: 1.45rem;
}

.total-box span {
  color: #cbd5d0;
  font-size: 0.78rem;
}

.selected-list {
  margin: 1rem 0;
  padding-left: 1.1rem;
  color: #dbe3df;
  font-size: 0.9rem;
}

.reset-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: white;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.reset-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.compliance {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  background: #eef1ec;
  color: #4e5b54;
  font-size: 0.86rem;
}

.compliance p {
  margin: 0.25rem 0;
}

.site-footer {
  padding: 1.7rem 0;
  color: #c7d1cc;
  background: var(--ink);
  font-size: 0.85rem;
}

.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-footer a {
  color: white;
}

.page-index {
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
  list-style: none;
}

.page-index li {
  break-inside: avoid;
  padding: 0.42rem 0;
  border-bottom: 1px dotted var(--line);
}

@media (min-width: 700px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  }

  .stat-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nutrition-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .option-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .calculator-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .totals-panel {
    position: sticky;
    top: 88px;
  }
}

@media (max-width: 680px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.7rem);
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 0.6rem;
  }

  .page-index {
    columns: 1;
  }

  thead th {
    top: 67px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
