/* NutriScan Pro — Apple product-page design system */
:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #86868b;
  --line: #d2d2d7;
  --line-soft: rgba(0,0,0,.08);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --fill: rgba(0,0,0,.04);
  --fill-hover: rgba(0,0,0,.06);
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav — Apple sticky bar (HARDCODED colors so per-page :root overrides can't
   change the nav; keeps the top bar identical on EVERY page) */
.anav {
  position: sticky; top: 0; z-index: 100;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(251,251,253,.72) !important;
  border-bottom: 1px solid rgba(0,0,0,.08) !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
}
.anav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 6px 22px;
  min-height: 52px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
}
.anav-brand {
  font-size: 17px !important; font-weight: 600 !important; color: #1d1d1f !important;
  letter-spacing: -.01em; text-decoration: none;
}
.anav-brand:hover { text-decoration: none; opacity: .8; }
.anav-links {
  display: flex; flex-wrap: wrap; gap: 4px 2px;
  list-style: none; align-items: center; margin: 0; padding: 0;
}
.anav-links a {
  font-size: 13px !important; font-weight: 400 !important; color: #6e6e73 !important;
  padding: 6px 13px; border-radius: 980px;
  text-decoration: none; border: 0; background: transparent;
  transition: background .15s, color .15s;
}
.anav-links a:hover { color: #1d1d1f !important; background: rgba(0,0,0,.05); text-decoration: none; }
/* ACTIVE (current page) turns blue — whichever page you're on, that item is blue */
.anav-links a.active {
  background: #0071e3 !important; color: #fff !important; font-weight: 500 !important;
}
/* 3D behaves like every other link (blue only when it IS the current page) */
.anav-cta {
  font-size: 13px !important; font-weight: 400 !important;
  background: transparent !important; color: #6e6e73 !important;
  padding: 6px 13px !important; border-radius: 980px !important;
}
.anav-cta:hover { background: rgba(0,0,0,.05) !important; color: #1d1d1f !important; }
.anav-cta.active { background: #0071e3 !important; color: #fff !important; font-weight: 500 !important; }

/* Hero — full-width band; content is centered text */
.hero {
  text-align: center;
  padding: 72px 22px 40px;
  max-width: none;
  margin: 0;
}
.hero .eyebrow {
  font-size: 17px; font-weight: 600; color: var(--blue);
  margin-bottom: 10px; letter-spacing: -.01em;
}
.hero h1 {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 16px;
}
.hero .lead {
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 400;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 400;
  padding: 12px 22px; border-radius: var(--radius-pill);
  border: none; cursor: pointer; text-decoration: none !important;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; text-decoration: none !important; }
.btn-primary { background: var(--blue); color: #fff !important; }
.btn-secondary { background: transparent; color: var(--blue) !important; }
.btn-secondary::after { content: " ›"; }

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 22px;
}
.section-tight { padding: 28px 22px; }
.section-head {
  text-align: center;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}
.section-head p {
  font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 auto;
}

/* Cards / tiles */
.tile {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tile-pad { padding: 28px 26px; }
.tile h3 {
  font-size: 21px; font-weight: 600; letter-spacing: -.015em;
  margin-bottom: 8px;
}
.tile p, .tile li { font-size: 14px; color: var(--muted); line-height: 1.45; }
.tile ul { padding-left: 18px; }
.tile li { margin-bottom: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Feature accordion — AirPods style */
.feature-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  align-items: stretch;
  min-height: 560px;
}
@media (max-width: 900px) {
  .feature-layout { grid-template-columns: 1fr; min-height: auto; }
}
.feature-list { display: flex; flex-direction: column; gap: 8px; }
.feature-item {
  background: #f5f5f7;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.feature-item.open {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.feature-item button.head {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-family: inherit; color: var(--ink);
}
.feature-item .plus {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.06);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 400; color: var(--muted); flex-shrink: 0;
}
.feature-item.open .plus { background: var(--blue); color: #fff; }
.feature-item .label { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.feature-item .body {
  display: none;
  padding: 0 16px 16px 48px;
  font-size: 14px; color: var(--muted); line-height: 1.45;
}
.feature-item.open .body { display: block; }
.feature-stage {
  background: #fff;
  border-radius: var(--radius);
  min-height: 480px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.feature-stage canvas, .feature-stage #c {
  width: 100% !important; height: 100% !important;
  min-height: 480px;
}

/* Formula pill */
.pill {
  display: inline-block;
  background: #f5f5f7;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  line-height: 1.45;
}
.pill em { font-style: normal; color: var(--blue); font-weight: 600; }

/* Tables */
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th, .atable td {
  text-align: left; padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.atable th { color: var(--muted); font-weight: 600; font-size: 12px; }
.atable td { color: var(--ink); }

/* Footer */
.afoot {
  text-align: center;
  padding: 40px 22px 60px;
  color: var(--subtle);
  font-size: 12px;
}
.afoot a { color: var(--muted); }

/* Content pages body padding */
.page-body { padding-bottom: 40px; }

/* User flow / docs: light cards on gray bg */
.doc-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.doc-card h2 {
  font-size: 24px; font-weight: 600; letter-spacing: -.02em;
  margin-bottom: 12px;
}
.doc-card h3 {
  font-size: 17px; font-weight: 600; margin: 16px 0 8px;
}
.doc-card p, .doc-card li { font-size: 14px; color: var(--muted); line-height: 1.5; }
.doc-card ul { padding-left: 18px; }
.doc-card li { margin-bottom: 4px; }
.doc-card strong { color: var(--ink); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
  font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: #f5f5f7; color: var(--muted);
}

/* ---- smooth page-to-page slide (cross-document View Transitions) ---- */
/* Replaces the janky native trackpad-swipe jump with an animated horizontal
   slide on every same-origin navigation, including browser back/forward. */
@view-transition { navigation: auto; }
::view-transition-old(root){ animation: pg-out .30s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(root){ animation: pg-in  .30s cubic-bezier(.4,0,.2,1) both; }
@keyframes pg-out{ to   { transform: translateX(-2.5%); opacity: 0; } }
@keyframes pg-in { from { transform: translateX(3.5%);  opacity: 0; } }
@media (prefers-reduced-motion: reduce){ @view-transition { navigation: none; } }

/* edge prev/next chevrons for sequential paging */
.pageflip{
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; color: #1d1d1f;
  background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.10);
  backdrop-filter: blur(8px); cursor: pointer; z-index: 900;
  padding: 0 0 3px; transition: background .15s, opacity .15s; opacity: .55;
}
.pageflip:hover{ background: #fff; opacity: 1; }
.pageflip:disabled{ opacity: 0; pointer-events: none; }
.pageflip-prev{ left: 14px; }
.pageflip-next{ right: 14px; }
@media (max-width: 720px){ .pageflip{ display: none; } }

/* ---- grouped nav dropdowns (5 top-level items) ---- */
.anav-grp { position: relative; }
.anav-top {
  font: inherit; font-size: 13px !important; font-weight: 400; color: #6e6e73;
  background: transparent; border: 0; padding: 6px 13px; border-radius: 980px;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  transition: background .15s, color .15s;
}
.anav-top .car { display: inline-flex; align-items: center; margin-left: 1px;
  opacity: .6; transition: transform .2s ease, opacity .15s; }
.anav-grp:hover .anav-top .car { opacity: 1; }
/* button highlight follows the JS .open state (not raw :hover) so it can't get
   out of sync with the menu; the button's own :hover still gives a light bg */
.anav-top:hover { color: #1d1d1f; background: rgba(0,0,0,.05); }
.anav-grp.open .anav-top { color: #1d1d1f; background: rgba(0,0,0,.05); }
.anav-grp.open .anav-top .car { transform: rotate(180deg); opacity: 1; }
.anav-grp.cur .anav-top { background: #0071e3; color: #fff; font-weight: 500; }
.anav-grp.cur .anav-top:hover { background: #0071e3; }
.anav-grp.cur .anav-top .car { opacity: .95; }
.anav-drop {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-5px);
  min-width: 178px; padding: 6px; margin: 0; list-style: none;
  background: rgba(251,251,253,.96);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(0,0,0,.08); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,.14);
  opacity: 0; visibility: hidden; transition: opacity .16s, transform .16s; z-index: 300;
}
/* transparent bridge fills the visual gap so moving cursor button->menu never
   crosses a dead zone (belt-and-suspenders with the JS close-delay) */
.anav-drop::before {
  content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.anav-grp.open .anav-drop {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(8px);
}
.anav-drop li { margin: 0; }
.anav-drop a {
  display: block; padding: 8px 14px; border-radius: 9px;
  font-size: 13px !important; color: #1d1d1f !important; text-decoration: none;
  background: transparent; white-space: nowrap;
}
.anav-drop a:hover { background: rgba(0,113,227,.08); color: #0071e3 !important; }
.anav-drop a.active { background: #0071e3 !important; color: #fff !important; }

/* Contact nav item — utility link, subtly set apart from the 5 content groups */
html{scroll-behavior:smooth}
.anav-links .anav-contact{font-size:13px !important;font-weight:400;color:#6e6e73 !important;
  padding:6px 15px;border-radius:980px;text-decoration:none;border:1px solid rgba(0,0,0,.14);
  margin-left:4px;transition:background .15s,color .15s,border-color .15s;}
.anav-links .anav-contact:hover{color:#1d1d1f !important;background:rgba(0,0,0,.05);border-color:rgba(0,0,0,.22)}
.anav-links .anav-contact.active{background:#0071e3 !important;color:#fff !important;border-color:#0071e3;font-weight:500}
