/* ─── VARIABLES ───────────────────────────────────────────────────────────── */
:root {
  --cream: #F5F0E8;
  --warm-white: #FDFBF7;
  --ink: #1C1A17;
  --ink-soft: #3D3A35;
  --ink-muted: #7A766E;
  --terracotta: #C4622D;
  --terracotta-light: #E8845A;
  --sage: #6B7C5E;
  --sage-light: #A8BA97;
  --gold: #C9982A;
  --border: #E2DAD0;
  --border-strong: #C8BEB2;
  --nav-bg: rgba(253,251,247,.97);
}

/* ─── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--warm-white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Android: prevent pull-to-refresh fighting with scroll */
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ─── READING PROGRESS ────────────────────────────────────────────────────── */
.reading-progress { position: fixed; top: 0; left: 0; z-index: 300; height: 3px; background: linear-gradient(90deg, var(--terracotta), var(--gold)); width: 0%; transition: width .1s linear; }

/* ─── HEADER ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(253,251,247,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  /* GPU layer for smooth sticky + blur */
  will-change: transform;
  transform: translateZ(0);
}
.nav-inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 1rem; }
.logo { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 500; color: var(--terracotta); letter-spacing: -.02em; white-space: nowrap; }
.logo span { color: var(--ink); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { font-size: .85rem; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--terracotta); }
.nav-search { display: flex; align-items: center; gap: .45rem; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .85rem; font-size: .82rem; color: var(--ink-muted); cursor: pointer; transition: border-color .2s; }
.nav-search:hover { border-color: var(--terracotta); }

/* ─── BREADCRUMB ──────────────────────────────────────────────────────────── */
.breadcrumb { max-width: 1140px; margin: 1rem auto 0; padding: 0 1.5rem; font-size: .78rem; color: var(--ink-muted); display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-muted); } .breadcrumb a:hover { color: var(--terracotta); } .breadcrumb span { opacity: .4; }

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-primary { display: inline-flex; align-items: center; gap: .45rem; background: var(--terracotta); color: white; border: none; border-radius: 9px; padding: .65rem 1.25rem; font-size: .88rem; font-weight: 500; cursor: pointer; transition: background .2s, transform .15s; box-shadow: 0 3px 12px rgba(196,98,45,.28); }
.btn-primary:hover { background: #b5571f; transform: translateY(-1px); }
.btn-outline { display: inline-flex; align-items: center; gap: .45rem; background: transparent; color: var(--ink-soft); border: 1.5px solid var(--border-strong); border-radius: 9px; padding: .6rem 1.25rem; font-size: .88rem; font-weight: 500; cursor: pointer; transition: all .2s; }
.btn-outline:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* ═══════════════════════════════════════════════════════════════════════════
   WOW HERO
   ═══════════════════════════════════════════════════════════════════════════ */
.hero-wow {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2A1810 0%, #5C2E0A 30%, #C4622D 65%, #E8C45A 100%);
  padding: 4rem 1.5rem 6rem;
  min-height: 520px;
  display: flex; align-items: center;
}

/* floating food decorations */
.hero-decos { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hdeco {
  position: absolute;
  left: var(--x); top: var(--y);
  font-size: var(--s, 2rem);
  opacity: .18;
  animation: floatDeco var(--dur, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  filter: blur(.5px);
}
@keyframes floatDeco {
  0%,100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-18px) rotate(8deg); }
  66% { transform: translateY(10px) rotate(-5deg); }
}

.hero-content { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; text-align: center; }

.hero-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9); font-size: .75rem; font-weight: 500;
  padding: .3rem .85rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 1.25rem; backdrop-filter: blur(8px);
}
.hero-mega-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -.04em;
  color: white; margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero-mega-title em { font-style: italic; font-weight: 400; color: #FFE0A0; }
.hero-sub { font-size: 1rem; color: rgba(255,255,255,.8); line-height: 1.7; max-width: 520px; margin: 0 auto 1.75rem; }

/* hero stats */
.hero-stats { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.hstat { display: flex; align-items: baseline; gap: .25rem; font-size: .9rem; color: rgba(255,255,255,.85); }
.hstat-num { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; color: white; line-height: 1; }
.hstat small { font-size: .72rem; color: rgba(255,255,255,.6); margin-left: .15rem; }
.hstat-sep { width: 1px; height: 24px; background: rgba(255,255,255,.25); margin: 0 .5rem; }

/* hero search */
.hero-search-wrap { max-width: 520px; margin: 0 auto; }
.hero-search-box {
  display: flex; align-items: center; gap: .65rem;
  background: rgba(253,251,247,.95); border: 2px solid rgba(255,255,255,.3);
  border-radius: 14px; padding: .75rem 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  transition: box-shadow .2s;
}
.hero-search-box:focus-within { box-shadow: 0 8px 40px rgba(0,0,0,.3); }
.hero-search-box svg { color: var(--ink-muted); flex-shrink: 0; }
.hero-search-box input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: .95rem; color: var(--ink); }
.hero-search-box input::placeholder { color: var(--ink-muted); }
.search-clear-btn { background: none; border: none; cursor: pointer; color: var(--ink-muted); font-size: .8rem; padding: .2rem .4rem; display: none; }
.search-clear-btn.visible { display: block; }

/* wave divider */
.hero-wave { position: absolute; bottom: -2px; left: 0; right: 0; line-height: 0; }
.hero-wave svg { width: 100%; height: 60px; }

/* wow entrance animations */
.wow-fade { opacity: 0; transform: translateY(28px); animation: wowIn .7s cubic-bezier(.22,1,.36,1) forwards; animation-delay: var(--d, 0s); }
@keyframes wowIn { to { opacity: 1; transform: translateY(0); } }

/* ─── SECTION LAYOUT ──────────────────────────────────────────────────────── */
.section-wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── CATEGORY SHOWCASE ───────────────────────────────────────────────────── */
.cat-showcase { padding: 2.5rem 0 1.5rem; }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; }
.section-heading { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; }
.section-sub { font-size: .82rem; color: var(--ink-muted); }

.cat-cards-scroll { display: flex; gap: .75rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .5rem; }
.cat-cards-scroll::-webkit-scrollbar { display: none; }

.cat-card {
  flex: 0 0 auto;
  width: 120px;
  background: linear-gradient(145deg, var(--c1, #C4622D), var(--c2, #8B3A0F));
  border-radius: 16px; padding: 1.1rem .75rem .85rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: .4rem; cursor: pointer;
  transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .2s;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  text-decoration: none;
}
.cat-card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.cc-emoji { font-size: 1.8rem; line-height: 1; }
.cc-name { font-size: .72rem; font-weight: 600; color: white; line-height: 1.2; letter-spacing: .01em; text-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ─── RECIPES SECTION ─────────────────────────────────────────────────────── */
.recipes-section { padding: 1.5rem 0 0; }
.recipes-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.recipes-count { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 500; }
.sort-select { background: var(--cream); border: 1.5px solid var(--border); border-radius: 8px; padding: .35rem .7rem; font-family: inherit; font-size: .82rem; color: var(--ink-soft); cursor: pointer; outline: none; }

.filter-chips-row { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .5rem; margin-bottom: 1rem; }
.filter-chips-row::-webkit-scrollbar { display: none; }
.cat-chip { white-space: nowrap; background: var(--cream); border: 1.5px solid var(--border); border-radius: 20px; padding: .32rem .85rem; font-size: .78rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: all .2s; flex-shrink: 0; }
.cat-chip:hover { border-color: var(--terracotta); color: var(--terracotta); }
.cat-chip.active { background: var(--terracotta); border-color: var(--terracotta); color: white; }

/* ─── RECIPES GRID ────────────────────────────────────────────────────────── */
.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }

/* ─── RECIPE CARD ─────────────────────────────────────────────────────────── */
.recipe-card {
  background: var(--warm-white); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: transform .22s cubic-bezier(.34,1.3,.64,1), box-shadow .22s;
  animation: cardIn .5s ease both;
  /* GPU layer for hover transform */
  will-change: transform;
  transform: translateZ(0);
}
.recipe-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 14px 40px rgba(28,26,23,.14); }
@keyframes cardIn { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:translateY(0); } }

.card-img-wrap { position: relative; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, #D4956A, #4A1C08); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.recipe-card:hover .card-img { transform: scale(1.05); }
.card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: rgba(255,255,255,.7); }
.card-cat-badge { position: absolute; top: .6rem; left: .6rem; background: rgba(253,251,247,.95); border-radius: 6px; padding: .18rem .5rem; font-size: .7rem; font-weight: 500; color: var(--ink); backdrop-filter: blur(8px); }
.card-rating-badge { position: absolute; top: .6rem; right: .6rem; background: rgba(0,0,0,.6); border-radius: 6px; padding: .18rem .5rem; font-size: .7rem; color: white; }
.card-body { padding: .9rem 1rem; }
.card-title { font-family: 'Fraunces', serif; font-size: .98rem; font-weight: 500; color: var(--ink); margin-bottom: .3rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { font-size: .78rem; color: var(--ink-muted); line-height: 1.5; margin-bottom: .7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-meta-item { display: flex; align-items: center; gap: .25rem; font-size: .75rem; color: var(--ink-muted); }
.card-difficulty { margin-left: auto; font-size: .7rem; font-weight: 500; padding: .15rem .5rem; border-radius: 5px; background: var(--cream); }
.card-difficulty.easy { color: var(--sage); } .card-difficulty.medium { color: var(--gold); } .card-difficulty.hard { color: var(--terracotta); }

/* ─── STATES ──────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; grid-column: 1/-1; }
.empty-icon { font-size: 3.5rem; margin-bottom: .75rem; }
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 1.3rem; margin-bottom: .4rem; }
.empty-state p { color: var(--ink-muted); max-width: 360px; margin: 0 auto 1.25rem; font-size: .88rem; line-height: 1.6; }
.empty-state a { color: var(--terracotta); }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--terracotta); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 1rem; }
.recipe-loading { text-align: center; padding: 4rem 2rem; color: var(--ink-muted); }
.recipe-error { text-align: center; padding: 4rem 2rem; }
.load-more-wrap { text-align: center; margin-top: 2rem; padding-bottom: 1rem; }

/* ─── CATEGORY PAGE HERO ──────────────────────────────────────────────────── */
.cat-hero {
  background: linear-gradient(135deg, #2A1810, #5C2E0A, #C4622D);
  padding: 3rem 1.5rem; text-align: center; color: white;
  position: relative; overflow: hidden;
}
.cat-hero::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 40px; background: var(--warm-white); clip-path: ellipse(60% 100% at 50% 100%); }
.cat-hero-inner { position: relative; z-index: 2; max-width: 560px; margin: 0 auto; }
.cat-hero-emoji { font-size: 3.5rem; margin-bottom: .6rem; }
.cat-hero-title { font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; margin-bottom: .6rem; }
.cat-hero-sub { font-size: .9rem; opacity: .8; line-height: 1.65; max-width: 440px; margin: 0 auto .75rem; }
.cat-hero-count { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: .25rem .85rem; font-size: .8rem; }

/* other categories links */
.other-cats { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.other-cats-title { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 500; margin-bottom: 1rem; }
.other-cats-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.other-cat-chip { background: var(--cream); border: 1.5px solid var(--border); border-radius: 20px; padding: .4rem 1rem; font-size: .82rem; font-weight: 500; color: var(--ink-soft); transition: all .2s; }
.other-cat-chip:hover { border-color: var(--terracotta); color: var(--terracotta); background: #FFF2EB; }

/* ─── RECIPE HERO ─────────────────────────────────────────────────────────── */
.recipe-hero { max-width: 1140px; margin: 1.25rem auto 0; padding: 0 1.5rem; display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.recipe-category { display: inline-flex; align-items: center; gap: .35rem; background: var(--sage-light); color: var(--ink); font-size: .72rem; font-weight: 500; padding: .22rem .7rem; border-radius: 20px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9rem; }
.recipe-title { font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1rem; }
.recipe-title em { font-style: italic; font-weight: 400; color: var(--terracotta); }
.recipe-intro { font-size: .95rem; color: var(--ink-soft); line-height: 1.7; max-width: 520px; margin-bottom: 1.4rem; }
.rating-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stars { color: var(--gold); font-size: .95rem; letter-spacing: .04em; }
.rating-val { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 600; }
.rating-count { font-size: .82rem; color: var(--ink-muted); }
.divider-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.author-chip { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--ink-soft); }
.author-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--terracotta), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: .62rem; color: white; font-weight: 600; flex-shrink: 0; }
.quick-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--cream); }
.stat-item { padding: .85rem .6rem; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-icon { font-size: 1rem; margin-bottom: .2rem; }
.stat-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin-bottom: .1rem; }
.stat-value { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 500; }
.hero-image-wrap { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4/5; background: linear-gradient(160deg, #D4956A, #4A1C08); box-shadow: 0 16px 48px rgba(28,26,23,.15); }
.hero-real-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-image-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-size: 3.5rem; }
.hero-image-placeholder p { font-family: 'Fraunces', serif; font-size: .9rem; margin-top: .4rem; }
.hero-badge { position: absolute; top: 1rem; left: 1rem; background: rgba(253,251,247,.95); border-radius: 8px; padding: .4rem .75rem; font-size: .75rem; font-weight: 500; backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(28,26,23,.06); }
.hero-badge strong { color: var(--terracotta); }

/* ─── VIDEO ───────────────────────────────────────────────────────────────── */
.section { max-width: 1140px; margin: 2.5rem auto 0; padding: 0 1.5rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: .85rem; }
.section-title { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 500; letter-spacing: -.02em; }
.section-subtitle { font-size: .82rem; color: var(--ink-muted); }
.video-container { position: relative; border-radius: 16px; overflow: hidden; background: var(--ink); aspect-ratio: 16/9; box-shadow: 0 8px 28px rgba(28,26,23,.12); }
.video-thumbnail { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.play-btn { width: 64px; height: 64px; background: rgba(253,251,247,.95); border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; transition: transform .2s, box-shadow .2s; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.play-btn:hover { transform: scale(1.1); } .play-btn svg { width: 26px; height: 26px; fill: var(--terracotta); margin-left: 4px; }
.video-title-overlay { position: absolute; bottom: .85rem; left: 1rem; color: white; z-index: 2; }
.video-title-overlay h3 { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 400; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.video-title-overlay p { font-size: .75rem; opacity: .8; margin-top: .15rem; }

/* ─── RECIPE BODY ─────────────────────────────────────────────────────────── */
.recipe-body { max-width: 1140px; margin: 2.5rem auto 0; padding: 0 1.5rem; display: grid; grid-template-columns: 320px 1fr; gap: 2.5rem; align-items: start; }
.ingredients-panel { position: sticky; top: 72px; }
.panel-card { background: var(--cream); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.panel-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 500; }
.servings-control { display: flex; align-items: center; gap: .4rem; }
.serv-count { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 600; min-width: 2.8rem; text-align: center; }
.serv-label { font-size: .75rem; color: var(--ink-muted); }
.serv-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--warm-white); cursor: pointer; font-size: .95rem; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); transition: all .15s; }
.serv-btn:hover { background: var(--terracotta); color: white; border-color: var(--terracotta); }
.serv-count { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 500; min-width: 18px; text-align: center; }
.serv-label { font-size: .75rem; color: var(--ink-muted); }
.ing-group { padding: 1rem 1.25rem; }
.ing-group-label { font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); margin-bottom: .75rem; font-weight: 500; }
.ing-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.ing-item { display: flex; align-items: center; gap: .65rem; cursor: pointer; padding: .25rem .35rem; border-radius: 7px; transition: background .15s; }
.ing-item:hover { background: rgba(196,98,45,.06); }
.ing-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); flex-shrink: 0; transition: all .15s; display: flex; align-items: center; justify-content: center; }
.ing-item.checked .ing-check { background: var(--sage); border-color: var(--sage); }
.ing-item.checked .ing-check::after { content: '✓'; color: white; font-size: .6rem; font-weight: 700; }
.ing-item.checked .ing-text { text-decoration: line-through; color: var(--ink-muted); }
.ing-amount { font-family: 'Fraunces', serif; font-weight: 500; color: var(--terracotta); font-size: .84rem; min-width: 50px; flex-shrink: 0; }
.ing-text { font-size: .84rem; color: var(--ink-soft); line-height: 1.4; }
.ing-separator { height: 1px; background: var(--border); margin: 0 1.25rem; }
.nutrition-bar { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.nutr-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.nutr-header h3 { font-size: .67rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-muted); font-weight: 500; margin: 0; white-space: nowrap; }
.nutr-per-badge { font-size: .62rem; background: var(--terracotta); color: #fff; padding: .18rem .55rem; border-radius: 20px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; flex-shrink: 0; }
.nutr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.nutr-item { text-align: center; padding: .55rem .3rem .45rem; background: var(--warm-white); border-radius: 8px; }
.nutr-calories { background: linear-gradient(135deg, #fff4ee, #ffe8d8); }
.nutr-bar-wrap { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: .35rem; overflow: hidden; }
.nutr-bar { height: 100%; border-radius: 2px; width: 0; transition: width .7s ease; }
.nutr-bar-p { background: #4caf84; }
.nutr-bar-f { background: #ff9f43; }
.nutr-bar-c { background: #5b9bd5; }
.nutr-val { font-family: 'Fraunces', serif; font-size: .92rem; font-weight: 600; color: var(--ink); }
.nutr-lbl { font-size: .58rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: .1rem; }
.nutr-note { font-size: .72rem; color: var(--ink-muted); margin-top: .65rem; text-align: center; line-height: 1.4; }

/* ─── STEPS ───────────────────────────────────────────────────────────────── */
.steps-header { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 500; letter-spacing: -.02em; margin-bottom: 1.5rem; }
.step-item { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; margin-bottom: 2rem; position: relative; }
.step-item::after { content: ''; position: absolute; left: 21px; top: 48px; width: 2px; height: calc(100% - 18px); background: var(--border); }
.step-item:last-child::after { display: none; }
.step-num { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ink); color: white; font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 500; flex-shrink: 0; position: relative; z-index: 1; transition: background .2s; }
.step-num.active { background: var(--terracotta); }
.step-title { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 500; margin-bottom: .4rem; }
.step-text { font-size: .9rem; color: var(--ink-soft); line-height: 1.75; }
.step-tip { margin-top: .65rem; background: #FFF8F0; border-left: 3px solid var(--gold); padding: .5rem .85rem; border-radius: 0 7px 7px 0; font-size: .82rem; color: var(--ink-soft); }
.step-tip strong { color: var(--gold); }
.step-timer { display: inline-flex; align-items: center; gap: .35rem; background: var(--cream); border: 1px solid var(--border); border-radius: 20px; padding: .22rem .65rem; font-size: .75rem; color: var(--ink-muted); margin-top: .45rem; }

/* ─── TIPS ────────────────────────────────────────────────────────────────── */
.tips-section { max-width: 1140px; margin: 2.5rem auto 0; padding: 0 1.5rem; }
.tips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tip-card { background: var(--cream); border: 1px solid var(--border); border-radius: 12px; padding: 1.15rem; }
.tip-icon { font-size: 1.35rem; margin-bottom: .6rem; }
.tip-title { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 500; margin-bottom: .35rem; }
.tip-text { font-size: .82rem; color: var(--ink-soft); line-height: 1.6; }

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
footer { background: var(--ink); color: rgba(255,255,255,.55); padding: 2.5rem 1.5rem; margin-top: 3rem; }
.footer-inner { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { font-family: 'Fraunces', serif; font-size: 1.2rem; color: white; display: block; margin-bottom: .4rem; }
.footer-tagline { font-size: .78rem; color: rgba(255,255,255,.4); }
.footer-col-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.35); margin-bottom: .75rem; font-weight: 500; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-links a { font-size: .82rem; color: rgba(255,255,255,.45); transition: color .2s; }
.footer-links a:hover { color: white; }
.footer-cats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem; }
.footer-cats-grid a { font-size: .82rem; color: rgba(255,255,255,.45); transition: color .2s; white-space: nowrap; }
.footer-cats-grid a:hover { color: white; }
.footer-copy { font-size: .72rem; margin-top: 1rem; }

/* ─── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity:0; transform:translateY(32px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: wowIn .5s ease both; }
.delay-1 { animation-delay: .1s; } .delay-2 { animation-delay: .2s; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV — centered floating pill, 5 equal items
   ═══════════════════════════════════════════════════════════════════════════ */
.mobile-nav { display: none; }

@media (max-width: 768px) {
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 14px;
    width: auto;
    max-width: 420px;
    margin: 0 auto;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(226,218,208,.9);
    border-radius: 28px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    align-items: end;
    box-shadow: 0 6px 24px rgba(28,26,23,.12), 0 1px 4px rgba(28,26,23,.08), inset 0 1px 0 rgba(255,255,255,.8);
    z-index: 500;
    animation: slideUp .35s cubic-bezier(.34,1.4,.64,1) both;
    /* GPU layer */
    will-change: transform;
    transform: translateZ(0);
  }

  /* each item — same column width, flex column */
  .mnav-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    gap: 2px;
    padding: 8px 4px 6px;
    background: none; border: none;
    color: var(--ink-muted);
    font-family: inherit; font-size: .58rem; font-weight: 500;
    letter-spacing: .01em; text-align: center; cursor: pointer;
    transition: color .18s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mnav-item.active, .mnav-item:active { color: var(--terracotta); }
  .mnav-item.active .mnav-svg { stroke: var(--terracotta); }
  .mnav-svg { width: 22px; height: 22px; flex-shrink: 0; transition: stroke .18s; }

  /* center AI button — floats above with circle */
  .mnav-center {
    padding-bottom: 6px;
    color: var(--ink-muted);
  }
  .mnav-center-bubble {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--terracotta), #9e4120);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; line-height: 1;
    /* lift above the bar */
    margin-top: -20px;
    margin-bottom: 2px;
    box-shadow: 0 4px 16px rgba(196,98,45,.45), 0 1px 4px rgba(196,98,45,.2);
    transition: transform .2s cubic-bezier(.34,1.5,.64,1), box-shadow .2s;
    position: relative;
  }
  /* outer glow ring */
  .mnav-center-bubble::before {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    border: 1.5px solid rgba(196,98,45,.3);
    animation: ringPulse 2s ease-in-out infinite;
  }
  @keyframes ringPulse { 0%,100% { transform:scale(1); opacity:.5; } 50% { transform:scale(1.18); opacity:0; } }
  .mnav-center:active .mnav-center-bubble { transform: scale(.88); box-shadow: 0 2px 8px rgba(196,98,45,.35); }
  .mnav-center span:last-child { font-size: .58rem; font-weight: 600; color: var(--terracotta); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI CHAT PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.chat-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(28,26,23,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  display: flex; align-items: flex-end; justify-content: center;
  will-change: opacity;
}
.chat-overlay.open { opacity: 1; pointer-events: all; }
.chat-panel {
  width: 100%; max-width: 100%;
  background: var(--warm-white);
  border-radius: 0; border: none;
  box-shadow: 0 -6px 32px rgba(28,26,23,.16);
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-height: 100vh; max-height: 100dvh;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.34,1.05,.64,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overscroll-behavior: none;
  /* GPU compositing */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.chat-overlay.open .chat-panel { transform: translateY(0); }

@media (min-width: 769px) {
  .chat-overlay { align-items: flex-end; justify-content: flex-end; padding: 1.25rem; }
  .chat-panel { border-radius: 18px; border: 1px solid var(--border); width: 400px; max-width: 400px; height: 620px; max-height: 82vh; }
  .chat-handle { display: none; }
}

.chat-handle { display: none; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.1rem .7rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-header-info { display: flex; align-items: center; gap: .65rem; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--terracotta), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; box-shadow: 0 3px 10px rgba(196,98,45,.28); }
.chat-title { font-family: 'Fraunces', serif; font-size: .95rem; font-weight: 500; }
.chat-subtitle { font-size: .72rem; color: var(--ink-muted); }
.chat-close { background: var(--cream); border: 1px solid var(--border); border-radius: 7px; padding: .32rem; cursor: pointer; color: var(--ink-soft); transition: all .15s; display: flex; align-items: center; }
.chat-close:hover { background: var(--terracotta); color: white; border-color: var(--terracotta); }

.chat-suggestions { display: flex; gap: .45rem; overflow-x: auto; padding: .65rem 1.1rem; scrollbar-width: none; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.chat-suggestions::-webkit-scrollbar { display: none; }
.sugg-chip { white-space: nowrap; background: var(--cream); border: 1.5px solid var(--border); border-radius: 20px; padding: .3rem .8rem; font-size: .75rem; font-weight: 500; color: var(--ink-soft); cursor: pointer; flex-shrink: 0; transition: all .2s; }
.sugg-chip:hover { border-color: var(--terracotta); color: var(--terracotta); }

.chat-messages { flex: 1; overflow-y: auto; padding: .85rem 1.1rem; display: flex; flex-direction: column; gap: .75rem; scroll-behavior: smooth; }
.chat-msg { display: flex; gap: .5rem; align-items: flex-start; animation: wowIn .3s ease both; }
.chat-msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--terracotta), var(--gold)); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.chat-msg.user .msg-avatar { background: linear-gradient(135deg, var(--sage), var(--sage-light)); font-size: .7rem; font-weight: 600; color: white; }
.msg-bubble { max-width: 82%; padding: .6rem .9rem; border-radius: 14px; font-size: .85rem; line-height: 1.6; color: var(--ink-soft); }
.chat-msg.assistant .msg-bubble { background: var(--cream); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; }
.chat-msg.user .msg-bubble { background: var(--terracotta); color: white; border-radius: 14px 4px 14px 14px; }

.typing-dots { display: flex; gap: 4px; align-items: center; padding: .5rem .6rem; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: typingBounce 1.4s ease infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; } .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%,60%,100% { transform:translateY(0); opacity:.4; } 30% { transform:translateY(-5px); opacity:1; } }

.chat-input-area { display: flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem .85rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input-area input { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: .6rem .9rem; font-family: inherit; font-size: .85rem; outline: none; background: var(--warm-white); color: var(--ink); transition: border-color .2s; }
.chat-input-area input:focus { border-color: var(--terracotta); }
.chat-input-area input::placeholder { color: var(--ink-muted); }
.chat-send { width: 38px; height: 38px; border-radius: 50%; background: var(--terracotta); border: none; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; transition: background .2s, transform .15s; flex-shrink: 0; box-shadow: 0 3px 10px rgba(196,98,45,.32); }
.chat-send:hover { background: #b5571f; transform: scale(1.08); }
.chat-send:disabled { background: var(--border-strong); cursor: not-allowed; transform: none; }

/* ─── MOBILE SEARCH OVERLAY ───────────────────────────────────────────────── */
.mobile-search-overlay { position: fixed; top: 0; left: 0; right: 0; z-index: 700; background: rgba(253,251,247,.98); backdrop-filter: blur(12px); padding: .85rem; transform: translateY(-100%); transition: transform .22s ease; border-bottom: 1px solid var(--border); }
.mobile-search-overlay.open { transform: translateY(0); }
.mobile-search-box { display: flex; align-items: center; gap: .65rem; background: var(--cream); border: 1.5px solid var(--border); border-radius: 12px; padding: .65rem .9rem; }
.mobile-search-box input { flex: 1; border: none; background: transparent; outline: none; font-family: inherit; font-size: .9rem; color: var(--ink); }
.mob-search-close { background: none; border: none; cursor: pointer; color: var(--ink-muted); font-size: .85rem; padding: .2rem; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) { .recipe-hero { grid-template-columns: 1fr 300px; gap: 1.5rem; } }
@media (max-width: 860px) {
  .recipe-hero { grid-template-columns: 1fr; }
  .hero-image-wrap { aspect-ratio: 3/2; order: -1; max-height: 320px; }
  .recipe-body { grid-template-columns: 1fr; }
  .ingredients-panel { position: static; }
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(3), .stat-item:nth-child(4) { border-top: 1px solid var(--border); }
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search-text { display: none; }
  .recipes-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .hero-wow { padding: 2.5rem 1rem 5rem; min-height: auto; }
  .hero-mega-title { font-size: 2.2rem; }
  .section, .recipe-body, .tips-section { padding-left: 1rem; padding-right: 1rem; }
  .recipe-hero, .section-wrap, .breadcrumb { padding-left: 1rem; padding-right: 1rem; }
  /* safe area for iPhone home bar */
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .cat-showcase .section-wrap { padding-left: 1rem; padding-right: 0; }
  .cat-cards-scroll { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 480px) {
  .recipes-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .nutr-grid { grid-template-columns: repeat(4, 1fr); }
  .nutr-bar-wrap { display: none; }
  .hstat-sep:last-of-type { display: none; }
  html { font-size: 15px; }
}

/* ─── iOS FIXES ────────────────────────────────────────────────────────────── */

/* Touch feedback — no 300ms delay on buttons/links */
button, a, .recipe-card, .cat-card, .sugg-chip, .cat-chip, .mnav-item {
  touch-action: manipulation;
}

@media (max-width: 768px) {
  /* Prevent iOS zoom on input focus — font-size must be >= 16px */
  input, textarea, select {
    font-size: 16px !important;
    -webkit-appearance: none;
  }

  /* Chat panel — full screen iOS fix */
  .chat-panel {
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  .chat-input-area {
    padding-bottom: max(.85rem, env(safe-area-inset-bottom, .85rem));
  }
  .chat-input-area input {
    padding: .65rem .9rem;
    border-radius: 24px !important;
  }
  .hero-search-box input {
    padding: .55rem 0;
  }

  /* Mobile nav safe area */
  .mobile-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 14px));
  }

  /* Smooth scrolling in chat on iOS */
  .chat-messages {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Cat scroll on iOS */
  .cat-cards-scroll,
  .filter-chips-row,
  .chat-suggestions {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent text size adjustments on rotation */
  body { -webkit-text-size-adjust: 100%; }
}

/* ─── REDUCE MOTION ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── ANDROID / LOW-END: disable heavy effects ────────────────────────────── */
/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(253,251,247,.99); }
  .mobile-nav { background: rgba(253,251,247,.99); }
  .chat-overlay { background: rgba(28,26,23,.6); }
}

/* On very small screens or devices that flag save-data */
@media (max-width: 380px) {
  .hdeco { display: none; }
  .hero-wow { padding: 2rem .85rem 4rem; }
  .hero-mega-title { font-size: 1.9rem; }
  .recipe-card { animation: none; }
}

/* ─── PRINT ─────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .mobile-nav, .chat-overlay, .reading-progress { display: none !important; }
  body { padding-bottom: 0 !important; }
  .recipe-body { grid-template-columns: 1fr !important; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: .75rem; color: #666; }
}
