/* NutriSync — Legal pages
   Long-form prose layout. Same DNA as the home (dark + lime), tuned for reading. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }

/* ---------- Layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.wrap-narrow { max-width: 1180px; margin: 0 auto; padding: 0 40px; }

/* ---------- Top nav (shared with home) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(20,20,20,0.55);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.nav.scrolled { background: rgba(20,20,20,0.85); border-bottom-color: var(--card-border-hairline); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 26px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14px; color: var(--text-secondary); transition: color .2s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #312f2f; font-weight: 700; font-size: 13px;
  padding: 11px 18px; border-radius: var(--radius-pill);
  transition: transform .15s var(--spring-subtle), background .2s;
}
.nav-cta:hover { background: var(--accent-pressed); }
.nav-cta:active { transform: scale(0.97); }

/* ---------- HERO ---------- */
.legal-hero {
  position: relative;
  padding: 200px 0 80px;
  border-bottom: 1px solid var(--card-border-hairline);
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(176,238,99,0.06), transparent 65%),
    var(--bg-primary);
}
.legal-hero .wrap { position: relative; z-index: 1; }
.legal-eyebrow {
  font-family: var(--font-sans);
  font-weight: 700; font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px; display: inline-block;
}
.legal-title {
  font-weight: 700;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.95; letter-spacing: -0.04em;
  text-wrap: balance;
  margin: 0;
}
.legal-title .accent { color: var(--accent); }
.legal-meta {
  margin-top: 36px;
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  color: var(--text-tertiary); font-size: 14px;
}
.legal-meta .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--chip-fill); border: 1px solid var(--chip-border);
  font-size: 13px; color: var(--text-secondary);
  font-family: var(--font-rounded); font-variant-numeric: tabular-nums;
}
.legal-meta .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(176,238,99,0.7); }
.legal-meta.breadcrumb {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px; color: var(--text-tertiary);
}
.legal-meta.breadcrumb a:hover { color: var(--text-primary); }
.legal-meta.breadcrumb svg { width: 12px; height: 12px; flex: 0 0 12px; opacity: 0.5; }

/* ---------- Body grid: TOC + prose ---------- */
.legal-body { padding: 80px 0 140px; }
.legal-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}

/* TOC */
.toc {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding-right: 12px;
}
.toc-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--text-quaternary);
  margin: 0 0 22px;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { display: flex; gap: 12px; padding: 9px 0; border-left: 1px solid transparent; padding-left: 14px; margin-left: -14px; transition: border-color .2s, color .2s; }
.toc li.active { border-left-color: var(--accent); }
.toc a {
  display: flex; gap: 12px; flex: 1;
  font-size: 13.5px; line-height: 1.4;
  color: var(--text-tertiary);
  transition: color .2s;
}
.toc a:hover { color: var(--text-primary); }
.toc li.active a { color: var(--text-primary); }
.toc .toc-num {
  flex: 0 0 28px;
  font-family: var(--font-rounded);
  font-weight: 700; font-size: 11px;
  color: var(--text-quaternary);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.toc li.active .toc-num { color: var(--accent); }

/* Prose */
.prose { max-width: 720px; font-size: 16px; line-height: 1.7; color: var(--text-secondary); }
.prose .intro { font-size: 19px; line-height: 1.55; color: var(--text-primary); max-width: 56ch; margin-bottom: 56px; text-wrap: pretty; }
.prose section { margin-bottom: 80px; scroll-margin-top: 110px; }
.prose section:last-child { margin-bottom: 0; }
.prose h2 {
  font-weight: 700;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.05; letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 32px 0;
  display: flex; align-items: baseline; gap: 18px;
  text-wrap: balance;
}
.prose h2 .num {
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  padding-top: 8px;
}
.prose h3 {
  font-weight: 700;
  font-size: 21px; letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 40px 0 16px;
}
.prose h4 {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  margin: 28px 0 12px;
  letter-spacing: 0;
}
.prose p { margin: 0 0 20px; text-wrap: pretty; }
.prose a.link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-stroke-30);
  transition: border-color .2s, color .2s;
}
.prose a.link:hover { color: var(--accent-pressed); border-bottom-color: var(--accent-pressed); }
.prose strong { color: var(--text-primary); font-weight: 700; }
.prose em { color: var(--text-primary); font-style: italic; }
.prose ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 12px; }
.prose ul li {
  position: relative;
  padding-left: 22px;
  line-height: 1.6;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.78em;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.85;
}
.prose ul li strong { color: var(--text-primary); }

/* Definition-style inline lead-in */
.prose .deflist { margin: 0 0 24px; display: flex; flex-direction: column; gap: 14px; }
.prose .deflist > div {
  padding-left: 22px; position: relative;
  line-height: 1.6;
}
.prose .deflist > div::before {
  content: "";
  position: absolute;
  left: 0; top: 0.78em;
  width: 10px; height: 1px;
  background: var(--accent);
}

/* Callout — important / health disclaimer */
.callout {
  margin: 36px 0;
  padding: 26px 28px;
  background: rgba(176,238,99,0.04);
  border: 1px solid rgba(176,238,99,0.20);
  border-radius: var(--radius-card);
  position: relative;
}
.callout.danger {
  background: rgba(204,51,51,0.06);
  border-color: rgba(204,51,51,0.30);
}
.callout-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.callout.danger .callout-eyebrow { color: var(--state-red); }
.callout-eyebrow svg { width: 14px; height: 14px; }
.callout p { color: var(--text-primary); font-weight: 500; font-size: 16px; margin: 0; line-height: 1.55; }
.callout p + p { margin-top: 12px; }

/* ALL-CAPS legal block — distinct style for the boilerplate */
.legal-bloc {
  margin: 28px 0;
  padding: 22px 24px;
  background: rgba(255,255,255,0.025);
  border-left: 2px solid var(--text-quaternary);
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}
.legal-bloc.emph { border-left-color: var(--accent); color: var(--text-secondary); }
.legal-bloc p { margin: 0; }
.legal-bloc p + p { margin-top: 12px; }

/* Tables (cookies) */
.prose .data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 14.5px;
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.prose .data-table th,
.prose .data-table td {
  padding: 18px 22px;
  text-align: left;
  border-bottom: 1px solid var(--card-border-hairline);
  vertical-align: top;
  line-height: 1.55;
}
.prose .data-table tr:last-child th,
.prose .data-table tr:last-child td { border-bottom: 0; }
.prose .data-table th {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.02);
  width: 200px;
}
.prose .data-table td { color: var(--text-secondary); }
.prose .data-table th .marker {
  color: var(--accent); font-family: var(--font-rounded);
  display: block; margin-bottom: 4px; font-size: 10px;
}

/* Contact card */
.contact-card {
  margin-top: 16px;
  padding: 32px;
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
}
.contact-card h4 { margin: 0 0 18px; font-size: 15px; color: var(--text-tertiary); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.contact-card .company { font-family: var(--font-rounded); font-weight: 700; font-size: 22px; color: var(--text-primary); margin-bottom: 12px; }
.contact-card .row { display: flex; gap: 16px; margin-top: 8px; font-size: 15px; color: var(--text-secondary); }
.contact-card .row .lbl { color: var(--text-quaternary); width: 80px; flex: 0 0 80px; }
.contact-card .row a { color: var(--accent); }

/* Cross-link to other legal page */
.crosslink {
  margin-top: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.crosslink-card {
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px 30px;
  transition: background .25s, border-color .25s, transform .25s var(--spring-subtle);
  display: flex; flex-direction: column; gap: 8px;
}
.crosslink-card:hover {
  background: var(--card-fill-hover);
  border-color: var(--accent-stroke-30);
  transform: translateY(-3px);
}
.crosslink-card .kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text-quaternary); }
.crosslink-card .title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.crosslink-card .title svg { width: 16px; height: 16px; color: var(--accent); transition: transform .25s var(--spring-subtle); }
.crosslink-card:hover .title svg { transform: translateX(4px); }
.crosslink-card .sub { color: var(--text-tertiary); font-size: 14px; line-height: 1.5; margin-top: 4px; }

/* ---------- FOOTER (shared) ---------- */
footer { padding: 80px 0 50px; border-top: 1px solid var(--card-border-hairline); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 80px; margin-bottom: 60px; }
.foot-brand p { color: var(--text-tertiary); font-size: 14px; line-height: 1.5; max-width: 36ch; margin-top: 18px; }
.foot-col h5 { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 22px 0; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.foot-col a { color: var(--text-secondary); font-size: 14px; transition: color .2s; }
.foot-col a:hover { color: var(--text-primary); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 32px; border-top: 1px solid var(--card-border-hairline); color: var(--text-tertiary); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .legal-hero { padding: 140px 0 60px; }
  .legal-grid { grid-template-columns: 1fr; gap: 40px; }
  .toc {
    position: relative;
    top: auto;
    max-height: none;
    padding: 24px;
    background: var(--card-fill);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
  }
  .toc ol { columns: 2; column-gap: 24px; }
  .toc li { padding: 6px 0; padding-left: 0; margin-left: 0; border-left: 0; break-inside: avoid; }
  .toc li.active a { color: var(--accent); }
  .prose h2 { font-size: 28px; flex-direction: column; gap: 6px; }
  .prose h2 .num { padding-top: 0; }
  .crosslink { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .wrap, .wrap-narrow { padding: 0 24px; }
  .nav-inner { padding: 0 24px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .legal-hero { padding: 120px 0 50px; }
  .legal-title { font-size: 44px; }
  .legal-body { padding: 50px 0 100px; }
  .prose { font-size: 15.5px; }
  .prose h2 { font-size: 26px; }
  .prose h3 { font-size: 18px; }
  .prose .intro { font-size: 17px; }
  .callout, .legal-bloc { padding: 18px 20px; }
  .toc ol { columns: 1; }
  .foot-grid { grid-template-columns: 1fr; gap: 40px; }
  .foot-bottom { flex-direction: column; gap: 14px; }
  .contact-card { padding: 24px; }
}
