/* ==========================================================================
   pantryrx.ai design system
   Tokens mirror the app's PRTheme: warm cream ground, brand green, serif
   display for hero moments, amber for urgency, violet for coach moments.
   ========================================================================== */

:root {
  --cream: #fcfbf7;
  --surface: #fffefb;
  --surface-2: #f5f2ec;
  --surface-3: #ece7de;
  --ink: #23262d;
  --ink-2: #51545e;
  --ink-3: #83858d;
  --line: rgba(35, 38, 45, 0.09);
  --line-strong: rgba(35, 38, 45, 0.16);
  --green: #36886c;
  --green-deep: #266b54;
  --green-900: #173f33;
  --mint: #84c7b7;
  --mint-soft: #e3f1ec;
  --gold: #f6d26b;
  --amber: #d98f2e;
  --amber-soft: #fbeed9;
  --tomato: #d4473a;
  --tomato-soft: #fbe5e2;
  --violet: #7a669e;
  --violet-soft: #ece8f4;
  --on-green: #ffffff;
  --shadow-sm: 0 1px 2px rgba(23, 63, 51, 0.06), 0 2px 8px rgba(23, 63, 51, 0.05);
  --shadow-md: 0 4px 14px rgba(23, 63, 51, 0.08), 0 18px 40px rgba(23, 63, 51, 0.08);
  --shadow-lg: 0 30px 80px rgba(23, 63, 51, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #121110;
    --surface: #1b1a18;
    --surface-2: #232120;
    --surface-3: #2e2b29;
    --ink: #f2f0eb;
    --ink-2: #bebab3;
    --ink-3: #8f8b85;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --green: #62b89f;
    --green-deep: #4fa58c;
    --green-900: #0d2a21;
    --mint-soft: #1d3029;
    --amber-soft: #3a2c19;
    --tomato-soft: #3b1f1c;
    --violet-soft: #2a2535;
    --on-green: #07140f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--green-deep); text-underline-offset: 3px; }
a:hover { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--mint); color: var(--green-900); }

h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.015em; }
.display, h1 { font-family: var(--font-display); font-weight: 600; font-variation-settings: "opsz" 144, "SOFT" 50; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); letter-spacing: -0.03em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.1rem, 1.8vw, 1.32rem); color: var(--ink-2); max-width: 60ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-deep);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: 0.92rem; }
.tm { font-size: 0.5em; vertical-align: super; font-family: var(--font-sans); font-weight: 600; margin-left: 0.04em; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--cream); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.section { padding: clamp(64px, 10vw, 128px) 0; position: relative; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.14rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand .tm { color: var(--ink-3); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.95rem; padding: 8px 12px; border-radius: 999px; transition: background 0.2s, color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-cta { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 5px auto; border-radius: 2px; transition: transform 0.3s var(--ease-out), opacity 0.2s; }
@media (max-width: 900px) {
  .nav-toggle { display: block; order: 3; margin-left: 4px; }
  .nav-cta { margin-left: auto; }
  .nav, .nav-cta .btn-ghost { display: none; }
  .site-header.menu-open .nav {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; left: 0; right: 0; top: 68px;
    background: var(--cream); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; gap: 2px;
  }
  .site-header.menu-open .nav a { padding: 12px 14px; font-size: 1.05rem; }
  .site-header.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ----- Buttons ----- */
.btn {
  --btn-bg: var(--green); --btn-fg: var(--on-green);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 650; font-size: 0.98rem; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.88rem; }
.btn-dark { --btn-bg: var(--ink); --btn-fg: var(--cream); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-soft { --btn-bg: var(--mint-soft); --btn-fg: var(--green-deep); }
.btn-danger { --btn-bg: var(--tomato); --btn-fg: #fff; }
.btn-amber { --btn-bg: var(--amber); --btn-fg: #fff; }
.btn-link { background: none; border: 0; color: var(--green-deep); font-weight: 650; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 18px 8px 14px;
  background: #0b0b0c; color: #fff; border-radius: 14px; text-decoration: none; border: 1px solid rgba(255,255,255,0.14);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.store-badge:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: 0.66rem; letter-spacing: 0.02em; opacity: 0.8; line-height: 1.1; }
.store-badge strong { display: block; font-size: 1.12rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.store-badge.is-soon { background: transparent; color: var(--ink); border: 1px dashed var(--line-strong); cursor: default; }
.store-badge.is-soon:hover { transform: none; box-shadow: none; color: var(--ink); }

/* ----- Cards & surfaces ----- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 30px); box-shadow: var(--shadow-sm);
}
.card-link { text-decoration: none; color: inherit; display: block; transition: transform 0.3s var(--ease-out), box-shadow 0.3s; }
.card-link:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 6px; }
.surface-2 { background: var(--surface-2); }
.band-green { background: linear-gradient(135deg, #173f33, #266b54 60%, #2f7a61); color: #f4faf7; }
.band-green h2, .band-green h3 { color: #fff; }
.band-green .muted, .band-green .lede { color: rgba(244, 250, 247, 0.82); }
.band-green .eyebrow { color: var(--gold); }
.icon-tile {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--mint-soft); color: var(--green-deep); margin-bottom: 16px;
}
.icon-tile svg { width: 24px; height: 24px; }

.chip, .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.pill-green { background: var(--mint-soft); color: var(--green-deep); border-color: transparent; }
.pill-amber { background: var(--amber-soft); color: #9a5b10; border-color: transparent; }
.pill-red { background: var(--tomato-soft); color: #a4302a; border-color: transparent; }
.pill-violet { background: var(--violet-soft); color: #5d4a82; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill-amber { color: #f2c07a; }
  :root:not([data-theme="light"]) .pill-red { color: #f3a39b; }
  :root:not([data-theme="light"]) .pill-violet { color: #cbbdf0; }
}

/* ----- Forms ----- */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field > label, .field-label { font-weight: 650; font-size: 0.95rem; }
.field .help { color: var(--ink-3); font-size: 0.86rem; margin: 0; }
.field .error, .errorlist { color: var(--tomato); font-size: 0.88rem; margin: 0; padding: 0; list-style: none; }
.input, .field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="number"],
.field input[type="search"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 40%, transparent); }
.field input[type="file"] { padding: 10px 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.field-row > * { min-width: 0; }
.field input[type="file"] { width: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.9rem; cursor: pointer; }
.checks label:has(input:checked) { background: var(--mint-soft); border-color: var(--green); color: var(--green-deep); }
.checks input { accent-color: var(--green); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: 8px; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.table th { text-align: left; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* ----- Messages ----- */
.messages { position: fixed; top: 80px; right: 16px; left: 16px; z-index: 60; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.message {
  pointer-events: auto; max-width: 440px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--cream);
  box-shadow: var(--shadow-lg); animation: toast-in 0.5s var(--ease-spring) both; font-size: 0.95rem;
}
.message.success { background: var(--green-deep); color: #fff; }
.message.error { background: var(--tomato); color: #fff; }
.message.warning { background: var(--amber); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(0.96); } }

/* ----- Prose (blog + legal) ----- */
.prose { font-size: 1.08rem; line-height: 1.75; max-width: 70ch; }
.prose h2 { font-size: 1.8rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.3rem; margin: 1.6em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote { margin: 1.5em 0; padding: 0.4em 1.2em; border-left: 3px solid var(--green); color: var(--ink-2); font-family: var(--font-display); font-size: 1.2rem; }
.prose img { border-radius: var(--radius-md); margin: 1.5em 0; }
.prose code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.92em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* ----- Page hero (inner pages) ----- */
.page-hero { padding: clamp(56px, 9vw, 110px) 0 clamp(32px, 5vw, 56px); position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--mint) 38%, transparent), transparent 65%); pointer-events: none; z-index: -1;
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 18ch; }
.breadcrumb { font-size: 0.88rem; color: var(--ink-3); margin-bottom: 16px; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }

/* ----- Recipe + post cards ----- */
.media-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.media-card .media { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; position: relative; }
.media-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.card-link:hover .media img { transform: scale(1.04); }
.media-card .body { padding: 18px 20px 20px; display: grid; gap: 8px; flex: 1; align-content: start; }
.media-card h3 { font-size: 1.12rem; margin: 0; }
.byline { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--mint-soft); color: var(--green-deep); display: inline-grid; place-items: center; font-weight: 700; font-size: 0.8rem; flex: none; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.8rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: 0.86rem; }

.empty { text-align: center; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-2); }

/* ----- Footer ----- */
.site-footer { background: var(--green-900); color: rgba(240, 247, 244, 0.78); padding: 72px 0 36px; margin-top: 0; }
.site-footer a { color: rgba(240, 247, 244, 0.86); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-grid h4 { color: #fff; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.95rem; }
.footer-brand .brand { color: #fff; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 48px; padding-top: 24px; font-size: 0.85rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ----- Motion ----- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--delay, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ----- Utilities ----- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 64px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.hide-sm { } @media (max-width: 640px) { .hide-sm { display: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; }
