/* Kalory — Bespoke Botanical & Culinary Design System (Zero External Fonts) */

:root {
  /* Calm Kalory Botanical Palette (Alabaster + Porcelain + Deep Forest + Lime) */
  --bg: #f6f7f2;
  --bg-soft: #eef2e7;
  --porcelain: #ffffff;
  --apricot: #e7efe1;
  --apricot-soft: #f2f6ec;
  --forest: #0e2418;
  --forest-2: #163323;
  --forest-accent: #1b5e36;

  --ink: #13221a;
  --ink-2: #415247;
  --muted: #66756b;
  --olive: #1b5e36;
  --olive-soft: #e6f2e8;
  --lime: #cff964;
  --lime-ink: #12240a;

  --line: rgb(20 36 27 / 0.068);
  --line-strong: rgb(20 36 27 / 0.11);
  --forest-line: rgb(246 247 242 / 0.14);
  --shadow-card: 0 12px 30px -20px rgb(16 34 23 / 0.15), 0 1px 2px rgb(16 34 23 / 0.04);
  --shadow-lift: 0 20px 44px -24px rgb(16 34 23 / 0.22), 0 2px 6px rgb(16 34 23 / 0.05);

  /* Macro Nutrient Inks (matching Kalory Nutrition Receipt) */
  --c-pro: #d95b48;
  --c-carb: #d68b27;
  --c-fat: #477ed0;
  --c-fib: #2b8550;

  /* Progressive OKLCH refinement */
  --bg: oklch(0.974 0.008 118);
  --bg-soft: oklch(0.952 0.015 122);
  --porcelain: oklch(1 0 0);
  --ink: oklch(0.225 0.025 152);
  --ink-2: oklch(0.415 0.022 150);
  --muted: oklch(0.545 0.018 148);
  --olive: oklch(0.435 0.105 148);
  --lime: oklch(0.935 0.185 122);

  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, "Noto Serif", Georgia, "Hiragino Mincho ProN", "Songti SC", "Batang", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Hiragino Sans", "PingFang SC", "Apple SD Gothic Neo", "Noto Sans Arabic", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.25, 0.9, 0.35, 1);

  --gutter: clamp(16px, 3.8vw, 40px);
  --wrap: 1200px;
  --banner-h: 58px;
  --hdr-h: 60px;
  --top-offset: calc(var(--banner-h) + var(--hdr-h));
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 744px) {
  :root {
    --banner-h: 0px;
  }
}

html.banner-dismissed {
  --banner-h: 0px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-offset) + 20px);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--porcelain);
  font-size: 13px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   1. Native iOS Top Install Bar (.smart-banner)
   ========================================================================== */
.smart-banner {
  position: sticky;
  top: 0;
  z-index: 95;
  height: var(--banner-h);
  background: #eaefe2;
  background: color-mix(in srgb, var(--porcelain) 92%, var(--bg-soft));
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}

html.banner-dismissed .smart-banner {
  display: none;
}

@media (min-width: 744px) {
  .smart-banner {
    display: none;
  }
}

.smart-banner__in {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.smart-banner__close {
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.smart-banner__close:hover {
  background: var(--line);
  color: var(--ink);
}

.smart-banner__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(20 33 25 / 0.12), 0 0 0 1px rgb(20 33 25 / 0.08);
}

.smart-banner__meta {
  min-width: 0;
  flex: 1;
}

.smart-banner__title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-banner__sub {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-banner__stars {
  color: #dc8a1e;
  letter-spacing: -0.04em;
}

.smart-banner__btn {
  flex: none;
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--lime);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease-out), opacity 0.2s;
}
.smart-banner__btn:hover { opacity: 0.92; }
.smart-banner__btn:active { transform: scale(0.97); }

/* ==========================================================================
   2. Botanical Top Navigation (.hdr) — Clean Wordmark + Nav + 13-Lang Switcher
   ========================================================================== */
.hdr {
  position: sticky;
  top: var(--banner-h);
  z-index: 85;
  height: var(--hdr-h);
  background: color-mix(in srgb, var(--bg) 96%, #ffffff);
  border-bottom: 1px solid var(--line-strong);
}

.hdr__in {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.024em;
  color: var(--ink);
  flex: none;
}

.hdr__nav {
  display: none;
  align-items: center;
  gap: clamp(18px, 2.4vw, 30px);
}

.hdr__nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 540;
  color: var(--ink-2);
  white-space: nowrap;
  position: relative;
  transition: color 0.18s ease;
}
.hdr__nav a:hover,
.hdr__nav a[aria-current="page"] {
  color: var(--ink);
}
.hdr__nav a[aria-current="page"] {
  font-weight: 650;
}
.hdr__nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--olive);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 5px;
  background: #e4edd8;
  color: #235514;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

@media (min-width: 744px) {
  .hdr__nav { display: inline-flex; }
}

.hdr__end {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hdr__mobile-links {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hdr__mobile-links::-webkit-scrollbar { display: none; }

.hdr__mobile-blog,
.hdr__mobile-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 580;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--porcelain);
  white-space: nowrap;
}
.hdr__mobile-blog[aria-current="page"],
.hdr__mobile-links a[aria-current="page"] {
  background: var(--ink);
  color: var(--lime);
  border-color: var(--ink);
}
.hdr__mobile-links a[aria-current="page"] .nav-badge {
  background: rgb(207 249 100 / 0.18);
  color: var(--lime);
}

@media (min-width: 744px) {
  .hdr__mobile-blog,
  .hdr__mobile-links { display: none; }
}

@media (max-width: 743px) {
  :root {
    --hdr-h: 92px;
  }
  .hdr {
    height: auto;
    padding: 8px 0;
  }
  .hdr__in {
    height: auto;
    flex-wrap: wrap;
    row-gap: 7px;
  }
  .hdr .brand {
    order: 1;
    margin-inline-end: auto;
  }
  .hdr__end {
    display: contents;
  }
  .hdr .lang-switch {
    order: 2;
  }
  .hdr__mobile-links {
    order: 3;
    flex: 1 0 100%;
    padding-top: 7px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
  }
  .hdr__mobile-links a {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* Language Switcher */
.lang-switch {
  position: relative;
  flex: none;
}

.lang-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--porcelain);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.lang-btn:hover { border-color: var(--ink-2); }
.lang-btn svg { width: 14px; height: 14px; color: var(--muted); }

.lang-pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  width: min(260px, calc(100vw - 2 * var(--gutter)));
  padding: 8px;
  border-radius: 16px;
  background: var(--porcelain);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 48px -16px rgb(20 33 25 / 0.24);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  z-index: 120;
}

.lang-pop a {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.lang-pop a:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.lang-pop a[aria-current="true"] {
  background: var(--ink);
  color: var(--lime);
  font-weight: 600;
}

/* ==========================================================================
   2b. Soft Non-Redirecting Language Suggestion Pill (.soft-lang)
   ========================================================================== */
.soft-lang {
  position: fixed;
  bottom: calc(14px + var(--sab));
  inset-inline-end: 14px;
  z-index: 90;
  max-width: min(370px, calc(100vw - 28px));
  border-radius: 999px;
  background: var(--porcelain);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lift);
}

@media (max-height: 780px) and (min-width: 744px) {
  .soft-lang__in {
    padding: 6px 8px 6px 12px;
    font-size: 12px;
  }
}

.soft-lang__in {
  padding: 8px 10px 8px 14px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.soft-lang__globe {
  width: 16px;
  height: 16px;
  color: var(--olive);
  flex: none;
}

.soft-lang__msg {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-weight: 540;
  line-height: 1.3;
}

.soft-lang__cta {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--lime);
  font-size: 12px;
  font-weight: 660;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-out);
}
.soft-lang__cta:hover { transform: translateY(-1px); }

.soft-lang__close {
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.soft-lang__close svg { width: 14px; height: 14px; }
.soft-lang__close:hover { background: var(--line); }

.store-badge {
  display: inline-block;
  line-height: 0;
  transition: transform 0.22s var(--ease-out);
}
.store-badge:hover { transform: translateY(-1px); }
.store-badge img {
  height: 48px;
  width: auto;
}

/* ==========================================================================
   3. Section Eyebrows, Headings & Compositor-Only Reveal
   ========================================================================== */
.eyebrow-tag {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.sec-h2 {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 24ch;
  text-wrap: balance;
}

.sec-sub {
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.56;
  color: var(--ink-2);
  max-width: 58ch;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    transition: opacity 0.6s var(--ease-soft), transform 0.7s var(--ease-out);
  }
  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   4. Footer (.ftr + compact 13-language bar)
   ========================================================================== */
.ftr {
  padding: 48px 0 calc(42px + var(--sab));
  border-top: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  font-size: 13.5px;
}

.ftr__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.ftr__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--ink-2);
  font-weight: 520;
}
.ftr__links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ftr__langs {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.ftr__langs a {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--porcelain);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 540;
  transition: border-color 0.18s, color 0.18s, background-color 0.18s;
}
.ftr__langs a:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
.ftr__langs a[aria-current="page"],
.ftr__langs a[aria-current="true"] {
  background: var(--ink);
  color: var(--lime);
  border-color: var(--ink);
  font-weight: 640;
}

.ftr__note {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 76ch;
}
