/* =========================================================================
   SIBO Plate - Stylesheet  ·  "Fresh Green · Modern Wellbeing"
   Self-contained: self-hosted variable font (Nunito Sans), no external CDNs.
   ========================================================================= */

/* ----------------------------- Fonts ----------------------------- */
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------- Design tokens ----------------------------- */
:root {
  /* Fresh green surfaces (light) */
  --bg:            #f1f8f3;
  --bg-alt:        #e1eee4;
  --surface:       #ffffff;
  --surface-2:     #edf6ef;
  --header-bg:     #b7d7c0;
  --ink:           #17251c;
  --ink-soft:      #4d6455;
  --ink-faint:     #7e9b88;
  --border:        #cfe3d4;
  --border-strong: #b4d2bd;

  /* Primary = fresh emerald */
  --primary:       #177a50;
  --primary-deep:  #0d603b;
  --primary-soft:  #d9ecde;

  /* Accent = vivid mint-emerald (CTAs / highlights) */
  --accent:        #268d60;
  --accent-deep:   #16704a;
  --accent-soft:   #d8efe0;

  /* Traffic lights (clean, accessible) */
  --green:         #238454;  --green-bg: #dcefe3;  --green-ink: #155f3c;
  --yellow:        #c8920c;  --yellow-bg:#fbf0d2;  --yellow-ink:#855f08;
  --red:           #e0524e;  --red-bg:   #fde6e5;  --red-ink:   #b1352f;

  /* Shape + depth */
  --radius:        15px;
  --radius-sm:     11px;
  --radius-lg:     22px;
  --shadow-sm:     0 1px 2px rgba(19,73,50,.05), 0 4px 16px rgba(19,73,50,.06);
  --shadow-md:     0 8px 26px rgba(15,82,55,.09), 0 18px 44px rgba(15,82,55,.07);
  --shadow-lg:     0 28px 70px rgba(11,62,42,.18);

  --maxw:          1180px;
  --header-h:      70px;

  /* --serif kept as the variable name, now a clean sans for a modern look */
  --serif: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sans:  "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease:  cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg:            #0e1613;
  --bg-alt:        #0a1210;
  --surface:       #16211c;
  --surface-2:     #1d2a24;
  --header-bg:     #070d0b;
  --ink:           #e9f2ec;
  --ink-soft:      #a6bbb0;
  --ink-faint:     #74907f;
  --border:        #25342c;
  --border-strong: #324339;

  --primary:       #34d399;
  --primary-deep:  #6ee7b7;
  --primary-soft:  #112a20;

  --accent:        #2dd4a4;
  --accent-deep:   #5fe9c2;
  --accent-soft:   #0f2a20;

  --green: #3ecf86; --green-bg: #122a1d; --green-ink: #84e3b0;
  --yellow:#e0b04a; --yellow-bg:#2c2410; --yellow-ink:#f0cd80;
  --red:   #f0726e; --red-bg:   #341a1a; --red-ink:  #f4a6a2;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 10px 28px rgba(0,0,0,.5);
  --shadow-lg: 0 28px 70px rgba(0,0,0,.65);
}

/* ----------------------------- Base ----------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 14px); }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg);
  line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.12; margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }
/* ----------------------------- Abbreviation tips ----------------------------- */
.abbr-term {
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 76%, transparent);
  cursor: help;
  text-decoration: none;
  text-underline-offset: 3px;
}
.abbr-term:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.abbr-tooltip {
  position: fixed;
  z-index: 220;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 64%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.42;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.abbr-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.abbr-tooltip[hidden] { display: none; }

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--header-bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-strong);
}
.header-inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 900; font-size: 1.08rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { font-family: var(--sans); font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.brand-mark { font-size: 1.35rem; }
.main-nav { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); font-weight: 600; font-size: .88rem; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.main-nav a:hover { color: var(--primary-deep); background: var(--primary-soft); text-decoration: none; }
.main-nav a.is-active, .main-nav a[aria-current="page"] { color: var(--primary-deep); background: var(--primary-soft); font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: 1.1rem; cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.icon-btn:active { transform: scale(.93); }
.nav-toggle { display: none; }

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 9vw, 120px) 24px clamp(44px, 6vw, 84px);
  background:
    radial-gradient(1200px 520px at 82% -6%, var(--accent-soft), transparent 58%),
    radial-gradient(1000px 560px at 4% 10%, var(--primary-soft), transparent 56%);
}
.hero-content { position: relative; max-width: var(--maxw); margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; font-weight: 800; color: var(--accent-deep); margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.7rem); font-weight: 800; max-width: 15ch; letter-spacing: -.035em; }
.hero h1 .accent { color: var(--primary); }
.lede { margin-top: 24px; max-width: 56ch; font-size: clamp(1.08rem, 2vw, 1.32rem); color: var(--ink-soft); }
.lede strong { color: var(--ink); font-weight: 700; }
.hero-cta { margin-top: 32px; display: flex; gap: 13px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem; font-family: var(--sans); cursor: pointer; border: 1.5px solid transparent; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); }

.hero-stats { display: flex; gap: clamp(22px, 5vw, 56px); margin: 44px 0 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; color: var(--primary-deep); }
.hero-stats dd { margin: 2px 0 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 700; }

/* ----------------------------- Disclaimer ----------------------------- */
.disclaimer {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 22px; display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); position: relative; z-index: 2;
  width: calc(100% - 48px); margin-top: -8px;
}
.disclaimer-icon { font-size: 1.25rem; }
.disclaimer p { font-size: .92rem; color: var(--ink-soft); }
.disclaimer strong { color: var(--ink); }

/* ----------------------------- SIBO introduction ----------------------------- */
.section.sibo-intro { padding-top: clamp(28px, 3vw, 44px); padding-bottom: clamp(38px, 4vw, 56px); }
.sibo-intro-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(380px, 520px); gap: clamp(34px, 5vw, 68px); align-items: center; }
.sibo-intro-copy { max-width: 58ch; }
.sibo-intro h2 { font-size: clamp(2rem, 4vw, 3.05rem); font-weight: 800; letter-spacing: -.03em; }
.sibo-intro p { color: var(--ink-soft); font-size: 1.03rem; }
.sibo-intro .sibo-summary { margin-top: 18px; color: var(--ink); font-size: 1.13rem; line-height: 1.7; }
.sibo-intro p + p { margin-top: 15px; }
.sibo-learn { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--primary-deep); font-weight: 800; }
.sibo-learn span { font-size: 1.25rem; line-height: 1; transition: transform .18s var(--ease); }
.sibo-learn:hover { text-decoration: none; }
.sibo-learn:hover span { transform: translateX(4px); }
.sibo-visual { width: 100%; max-width: 520px; justify-self: end; align-self: center; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.sibo-visual img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; }
/* ----------------------------- Sections ----------------------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(58px, 8vw, 100px) 24px; }
.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 42px; }
.kicker { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-size: .73rem; font-weight: 800; color: var(--accent-deep); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; }
.section-sub { margin-top: 14px; max-width: 60ch; color: var(--ink-soft); font-size: 1.08rem; }

/* ----------------------------- At a glance ----------------------------- */
.glance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.glance-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.glance-eat   { border-top: 5px solid var(--green); }
.glance-avoid { border-top: 5px solid var(--red); }
.glance-panel h3 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 18px; }
.glance-badge { font-family: var(--sans); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 11px; border-radius: 999px; }
.glance-badge.eat   { background: var(--green-bg); color: var(--green-ink); }
.glance-badge.avoid { background: var(--red-bg);  color: var(--red-ink); }
.glance-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.glance-list li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; font-size: .94rem; }
.glance-list .g-group { font-weight: 800; color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.glance-list .g-items { color: var(--ink-soft); }

.principles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.principle { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.principle:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.principle-icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--accent-soft); margin-bottom: 14px; }
.principle h3 { font-size: 1.08rem; margin-bottom: 7px; }
.principle p { font-size: .92rem; color: var(--ink-soft); }

/* ----------------------------- Quick links (home) ----------------------------- */
.quicklinks-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.quicklink-card { display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); color: var(--ink); transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.quicklink-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); text-decoration: none; }
.quicklink-card .ql-icon { font-size: 1.9rem; }
.quicklink-card h3 { font-size: 1.18rem; margin: 12px 0 6px; }
.quicklink-card p { font-size: .92rem; color: var(--ink-soft); }
.quicklink-card .ql-go { margin-top: 14px; font-size: .85rem; font-weight: 800; color: var(--accent-deep); }

/* ----------------------------- Food explorer ----------------------------- */
.explorer-controls { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.search-wrap { position: relative; flex: 1 1 300px; max-width: 460px; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); opacity: .55; font-size: .95rem; }
#foodSearch {
  width: 100%; padding: 15px 18px 15px 46px; border: 1.5px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 1rem; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
#foodSearch:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 17px; border-radius: 999px; font-weight: 700; font-size: .88rem; font-family: inherit; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .18s var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip-status.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.status-filters .chip { min-height: 40px; padding: 9px 14px; border-color: transparent; }
.status-filters .chip-status[data-status="green"] { --status-color: var(--green); --status-bg: var(--green-bg); --status-ink: var(--green-ink); }
.status-filters .chip-status[data-status="yellow"] { --status-color: #c96d16; --status-bg: #fff0dc; --status-ink: #8a4b08; }
[data-theme="dark"] .status-filters .chip-status[data-status="yellow"] { --status-color: #efa14a; --status-bg: #30200d; --status-ink: #ffd191; }
.status-filters .chip-status[data-status="red"] { --status-color: var(--red); --status-bg: var(--red-bg); --status-ink: var(--red-ink); }
.status-filters .chip-status:not([data-status="all"]) { background: var(--status-bg); border-color: color-mix(in srgb, var(--status-color) 38%, transparent); color: var(--status-ink); }
.status-filters .dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--status-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 18%, transparent); }
.status-filters .chip-status:hover { border-color: var(--status-color, var(--accent)); color: var(--status-ink, var(--accent-deep)); transform: translateY(-1px); }
.status-filters .chip-status.is-active { background: var(--status-color, var(--ink)); border-color: var(--status-color, var(--ink)); color: #fff; box-shadow: 0 3px 8px color-mix(in srgb, var(--status-color, var(--ink)) 28%, transparent); }
.status-filters .chip-status.is-active .dot { background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.cat-filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: .86rem; font-family: inherit; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .18s var(--ease); }
.cat-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.cat-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.cat-ico img { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; display: block; }
.cat-ico .cat-emoji { display: none; }
.cat-ico.noimg img { display: none; }
.cat-ico.noimg .cat-emoji { display: inline; }

/* ----------------------------- Brand logo ----------------------------- */
.brand-mark { display: inline-flex; align-items: center; }
.brand-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; box-shadow: var(--shadow-sm); }
.brand-mark .brand-emoji { display: none; }
.brand-mark.noimg .brand-logo { display: none; }
.brand-mark.noimg .brand-emoji { display: inline; }
.footer-mark { vertical-align: middle; }
.footer-mark .brand-logo { width: 26px; height: 26px; }

/* ----------------------------- Cuisine icon ----------------------------- */
.cuisine-ico { position: relative; width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.cuisine-ico img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }
.cuisine-ico .cuisine-emoji { display: none; }
.cuisine-ico.noimg img { display: none; }
.cuisine-ico.noimg .cuisine-emoji { display: inline; font-size: 1.95rem; }

/* ----------------------------- A Week's Food (horizontal scroll strip) ----------------------------- */
.week-track {
  display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; padding: 6px 0 16px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.week-track::-webkit-scrollbar { height: 8px; }
.week-track::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.week-track::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
.week-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.day-card { flex: 0 0 clamp(258px, 80vw, 296px); scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.day-name { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--accent-soft); color: var(--accent-deep); }
.day-meals { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.day-meal { display: flex; gap: 12px; align-items: flex-start; }
.day-meal .meal-emoji { font-size: 1.5rem; flex: none; line-height: 1.2; }
.day-meal-text { display: flex; flex-direction: column; gap: 1px; }
.meal-slot-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.meal-title { font-weight: 700; font-size: .98rem; }
.meal-detail { font-size: .86rem; color: var(--ink-soft); }
.result-count { font-size: .86rem; color: var(--ink-faint); margin-bottom: 18px; font-weight: 700; }

.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 15px; }
.food-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: transform .16s var(--ease), box-shadow .16s; }
.food-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.food-card.s-green  { border-left-color: var(--green); }
.food-card.s-yellow { border-left-color: var(--yellow); }
.food-card.s-red    { border-left-color: var(--red); }
.food-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.food-name { font-weight: 700; font-size: 1rem; color: var(--ink); }
.food-badge { flex: none; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; margin-top: 2px; }
.s-green  .food-badge { background: var(--green-bg);  color: var(--green-ink); }
.s-yellow .food-badge { background: var(--yellow-bg); color: var(--yellow-ink); }
.s-red    .food-badge { background: var(--red-bg);    color: var(--red-ink); }
.food-note { font-size: .85rem; color: var(--ink-soft); }
.food-instead { margin-top: 9px; font-size: .82rem; color: var(--green-ink); background: var(--green-bg); border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.food-instead b { font-weight: 800; }
.no-results { text-align: center; padding: 44px; color: var(--ink-faint); font-size: 1.05rem; }

/* ----------------------------- Swaps ----------------------------- */
.swap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: stretch; }
.swap-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.swap-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.swap-head { display: flex; align-items: center; gap: 13px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.swap-emoji { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; }
.swap-head h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; }
.swap-body { display: flex; flex-direction: column; flex: 1; padding: 17px 19px 19px; }
.swap-tag { display: inline-flex; align-items: center; gap: 7px; font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-family: var(--sans); }
.swap-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .6rem; }
.swap-tag.skip { color: var(--red-ink); }
.swap-tag.skip .swap-mark { background: var(--red-bg); color: var(--red-ink); }
.swap-tag.pick { color: var(--green-ink); }
.swap-tag.pick .swap-mark { background: var(--green-bg); color: var(--green-ink); }
.swap-why { margin-top: 9px; font-size: .89rem; color: var(--ink-soft); line-height: 1.5; }
.swap-connector { display: flex; align-items: center; gap: 11px; margin-top: auto; margin-bottom: 15px; padding-top: 15px; }
.swap-connector::before, .swap-connector::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.swap-connector span { flex: none; display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent); font-weight: 800; font-size: .92rem; box-shadow: var(--shadow-sm); }
.swap-pick { background: var(--green-bg); border: 1px solid color-mix(in srgb, var(--green) 24%, transparent); border-radius: var(--radius-sm); padding: 14px 16px; }
.swap-eat { margin-top: 9px; font-family: var(--serif); font-weight: 700; color: var(--green-ink); font-size: 1.04rem; line-height: 1.28; }
.swap-how { margin-top: 6px; font-size: .87rem; color: var(--ink-soft); line-height: 1.5; }

/* ----------------------------- Snacks ----------------------------- */
.snack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 15px; }
.snack-card { display: flex; gap: 13px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 17px; box-shadow: var(--shadow-sm); transition: transform .16s var(--ease), box-shadow .16s; }
.snack-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.snack-emoji { font-size: 1.6rem; line-height: 1; flex: none; }
.snack-name { font-weight: 700; font-size: .98rem; }
.snack-note { font-size: .84rem; color: var(--ink-soft); margin-top: 3px; }

/* ----------------------------- Meal timeline ----------------------------- */
.meal-timeline { display: grid; gap: 14px; }
.meal-row { display: grid; grid-template-columns: 168px 1fr; gap: 24px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow-sm); }
.meal-slot { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--accent-deep); }
.meal-slot .meal-emoji { font-size: 1.4rem; }
.meal-main h3 { font-size: 1.18rem; margin-bottom: 5px; }
.meal-main p { font-size: .94rem; color: var(--ink-soft); }
.meal-alt { margin-top: 8px; font-size: .85rem; color: var(--ink-faint); font-style: italic; }

/* ----------------------------- Recipes ----------------------------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(284px, 1fr)); gap: 18px; }
.recipe-card { text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; box-shadow: var(--shadow-sm); font-family: inherit; display: flex; flex-direction: column; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.recipe-thumb { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; }
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-thumb .recipe-emoji { display: none; font-size: 2.8rem; }
.recipe-thumb.noimg img { display: none; }
.recipe-thumb.noimg .recipe-emoji { display: block; }
.recipe-card-body { padding: 16px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.recipe-emoji { font-size: 2.1rem; }
.recipe-card h3 { font-size: 1.2rem; margin: 4px 0 6px; }
.recipe-tagline { font-size: .9rem; color: var(--ink-soft); }
.recipe-meta { display: flex; gap: 14px; margin-top: auto; padding-top: 14px; font-size: .8rem; color: var(--ink-faint); font-weight: 700; }
.recipe-meta span { display: inline-flex; align-items: center; gap: 5px; }
.recipe-open { margin-top: 12px; font-size: .85rem; font-weight: 800; color: var(--accent-deep); }

/* ----------------------------- Modal ----------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,22,16,.55); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.modal-card { position: relative; background: var(--surface); border-radius: var(--radius-lg); max-width: 660px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 38px; animation: pop .28s var(--ease); }
.modal-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; transition: background .2s, transform .15s; }
.modal-close:hover { background: var(--border); transform: rotate(90deg); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-emoji { font-size: 2.8rem; }
.modal-figure { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; display: flex; align-items: center; justify-content: center; }
.modal-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-figure .modal-emoji { display: none; }
.modal-figure.noimg { aspect-ratio: auto; background: none; margin-bottom: 6px; }
.modal-figure.noimg .modal-emoji { display: block; }
.modal-card h2 { font-size: 1.8rem; margin: 10px 0 6px; }
.modal-tagline { color: var(--ink-soft); font-size: 1.02rem; }
.modal-meta { display: flex; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.modal-meta .pill { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; font-size: .82rem; padding: 6px 14px; border-radius: 999px; }
.modal-why { background: var(--surface-2); border-radius: var(--radius-sm); padding: 15px 17px; font-size: .92rem; color: var(--ink-soft); margin-bottom: 24px; }
.modal-why strong { color: var(--ink); }
.modal-section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--accent-deep); margin: 0 0 13px; font-family: var(--sans); }
.modal-ingredients { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; }
.modal-ingredients li { padding-left: 26px; position: relative; font-size: .95rem; }
.modal-ingredients li::before { content: "•"; position: absolute; left: 8px; color: var(--accent); font-weight: 800; }
.modal-steps { padding-left: 0; margin: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.modal-steps li { position: relative; padding-left: 44px; font-size: .96rem; counter-increment: step; }
.modal-steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 800; font-family: var(--sans); }
.modal-safety { margin-top: 24px; background: var(--yellow-bg); border: 1px solid var(--yellow); border-radius: var(--radius-sm); padding: 15px 17px; font-size: .88rem; color: var(--yellow-ink); }

/* ----------------------------- Cuisine ----------------------------- */
.cuisine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.cuisine-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), box-shadow .18s; }
.cuisine-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cuisine-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cuisine-emoji { font-size: 1.95rem; }
.cuisine-head h3 { font-size: 1.25rem; }
.verdict { font-family: var(--sans); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 5px 11px; border-radius: 999px; margin-left: auto; }
.verdict.best   { background: var(--green-bg); color: var(--green-ink); }
.verdict.ok     { background: var(--yellow-bg); color: var(--yellow-ink); }
.verdict.tricky { background: var(--red-bg); color: var(--red-ink); }
.cuisine-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.cuisine-list-label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.cuisine-list-label.order { color: var(--green-ink); }
.cuisine-list-label.skip  { color: var(--red-ink); }
.cuisine-list li { font-size: .9rem; color: var(--ink-soft); padding-left: 24px; position: relative; }
.cuisine-list.order li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 800; }
.cuisine-list.skip li::before  { content: "✕"; position: absolute; left: 4px; color: var(--red); font-weight: 800; }
.cuisine-divider { border: none; border-top: 1px dashed var(--border-strong); margin: 16px 0; }

/* ----------------------------- Phases (journey) ----------------------------- */
.phase-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 36px; }
.phase-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); overflow: hidden; }
.phase-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.phase-card.p-red::before    { background: var(--red); }
.phase-card.p-yellow::before { background: var(--yellow); }
.phase-card.p-green::before  { background: var(--green); }
.phase-num { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--border-strong); }
.phase-card h3 { font-size: 1.3rem; margin: 8px 0 4px; }
.phase-duration { display: inline-block; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-deep); margin-bottom: 12px; }
.phase-card p { font-size: .93rem; color: var(--ink-soft); }

/* ----------------------------- FAQ ----------------------------- */
.faq-extra { display: grid; gap: 11px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.faq-item h3 { font-size: 1.02rem; }
.faq-item p { margin: 10px 0 0; font-size: .94rem; color: var(--ink-soft); }

/* ----------------------------- Tips ----------------------------- */
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tip-card { display: flex; gap: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.tip-emoji { font-size: 1.7rem; flex: none; }
.tip-card h3 { font-size: 1.06rem; margin-bottom: 5px; }
.tip-card p { font-size: .9rem; color: var(--ink-soft); }

/* ----------------------------- Sources ----------------------------- */
.source-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 11px; }
.source-list li a { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px 17px; color: var(--ink); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .15s; }
.source-list li a:hover { border-color: var(--accent); transform: translateX(3px); text-decoration: none; }
.source-list li a::before { content: "🔗"; font-size: .95rem; }

/* ----------------------------- Footer ----------------------------- */
.site-footer { background: var(--ink); color: var(--bg); padding: 56px 24px; margin-top: 16px; }
[data-theme="dark"] .site-footer { background: #08100d; color: var(--ink); }
[data-theme="dark"] .footer-meta a { color: var(--ink); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: grid; justify-items: center; text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-size: 1.08rem; margin-bottom: 14px; }
.footer-note { max-width: 62ch; margin: 0 auto; font-size: .9rem; opacity: .85; }
.footer-meta { margin-top: 20px; }
.footer-meta a { color: var(--bg); font-weight: 700; opacity: .9; }
.footer-credit { margin: 12px 0 0; font-size: .72rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; opacity: .72; }

/* ----------------------------- Reveal animation ----------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .reveal { opacity: 1; transform: none; transition: none; } }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 1000px) {
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
  .quicklinks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; box-shadow: var(--shadow-md); transform: translateY(-135%); transition: transform .3s var(--ease); margin-left: 0; }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 13px 12px; font-size: 1rem; }
  .nav-toggle { display: grid; }
  .sibo-intro-grid { grid-template-columns: 1fr; gap: 30px; }
  .sibo-intro-copy { max-width: 64ch; }
  .sibo-visual { max-width: none; justify-self: stretch; }
  .meal-row { grid-template-columns: 1fr; gap: 10px; }
  .phase-track { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .glance-grid { grid-template-columns: 1fr; }
  .quicklinks-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .principles-grid { grid-template-columns: 1fr; }
  .explorer-controls { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; flex: none; width: 100%; }
  .status-filters .chip { flex: 1 1 118px; justify-content: center; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .modal-card { padding: 26px 20px; }
  .glance-list li { grid-template-columns: 1fr; gap: 2px; }
  .footer-inner { min-height: 0; padding-bottom: 28px; }

}

/* ----------------------------- Print ----------------------------- */
@media print {
  .site-header, .hero-cta, .header-actions, .explorer-controls, .cat-filters, .nav-toggle, .site-footer, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .section, .section-alt { background: #fff; page-break-inside: avoid; }
  .card, .food-card, .swap-card, .cuisine-card, .glance-panel, .phase-card { box-shadow: none; border: 1px solid #ccc; }
}
