/* =========================================================
   TASTE OF HOME — Sombe Storytelling Page
   Palette: background #FFF8F0, primary #7B4F2C,
            accent #E18C3A, leaf green #5B8A4D, text #2D2D2D
   Type: Playfair Display (headings) / Inter (body)
   ========================================================= */

:root {
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --primary: #7B4F2C;
  --accent: #E18C3A;
  --leaf: #5B8A4D;
  --text: #2D2D2D;
  --text-soft: #5c5449;
  --border: rgba(123, 79, 44, 0.14);
  --shadow-sm: 0 2px 10px rgba(45, 45, 45, 0.06);
  --shadow-md: 0 10px 30px rgba(123, 79, 44, 0.12);
  --shadow-lg: 0 25px 60px rgba(123, 79, 44, 0.18);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --ease: cubic-bezier(.22,1,.36,1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 76px;
}

[data-theme="dark"] {
  --bg: #221A12;
  --surface: #2c2118;
  --primary: #E8B98A;
  --accent: #F0A75A;
  --leaf: #86C171;
  --text: #F5EEE3;
  --text-soft: #cbbfad;
  --border: rgba(245, 238, 227, 0.12);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 25px 60px rgba(0,0,0,0.45);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--primary); }
p { margin: 0 0 1em; color: var(--text-soft); }
button { font-family: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.loader.is-hidden { opacity: 0; visibility: hidden; }
.loader-leaf { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--leaf), var(--accent));
  z-index: 2001;
  transition: width .1s linear;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav {
  height: var(--header-h);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
  display: flex; align-items: center; gap: 28px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem;
  color: var(--primary);
  margin-right: auto;
}
.nav-logo-mark { display: inline-flex; transition: transform .4s var(--ease); }
.nav-logo:hover .nav-logo-mark { transform: rotate(-12deg) scale(1.1); }

.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: .95rem; font-weight: 500;
  color: var(--text);
  border-radius: 999px;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--primary); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  transition: transform .3s var(--ease), background .25s var(--ease);
}
.theme-toggle:hover { transform: rotate(15deg); }
.theme-toggle svg { display: block; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  border: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-primary svg { transition: transform .3s var(--ease); }
.btn-primary:hover svg { transform: translateY(3px); }

.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-md); }
.btn-accent:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ---------- Eyebrow / section titles ---------- */
.eyebrow {
  font-size: .8rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--leaf);
  margin-bottom: .8em;
}
.section-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.section-lead {
  max-width: 620px; margin: 0 auto 3rem;
  font-size: 1.08rem;
}
.center { text-align: center; margin-left: auto; margin-right: auto; }

.section { padding: clamp(70px, 10vw, 130px) 0; position: relative; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 140px 24px 80px;
  background:
    radial-gradient(ellipse at 20% 15%, color-mix(in srgb, var(--leaf) 14%, transparent), transparent 55%),
    radial-gradient(ellipse at 85% 80%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--bg);
}
.hero-inner { max-width: 760px; position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(3rem, 9vw, 6rem);
  margin-bottom: .3em;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-soft);
  max-width: 560px; margin: 0 auto 2.2em;
}

.hero-leaves { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.leaf {
  position: absolute;
  width: 26px; height: 34px;
  background: color-mix(in srgb, var(--leaf) 55%, transparent);
  border-radius: 0 100% 0 100%;
  opacity: .5;
  animation: float 14s ease-in-out infinite;
}
.leaf-1 { top: 15%; left: 10%; animation-duration: 16s; }
.leaf-2 { top: 60%; left: 6%; width: 18px; height: 24px; animation-duration: 12s; animation-delay: -3s; }
.leaf-3 { top: 22%; right: 12%; animation-duration: 18s; animation-delay: -6s; }
.leaf-4 { top: 70%; right: 8%; width: 20px; height: 28px; animation-duration: 13s; animation-delay: -1s; }
.leaf-5 { top: 45%; left: 48%; width: 16px; height: 22px; opacity: .3; animation-duration: 20s; animation-delay: -8s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-40px) rotate(18deg); }
}

.scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  color: var(--primary);
  animation: bob 2s ease-in-out infinite;
  z-index: 2;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.hero .reveal { transition-delay: .1s; }
.hero .reveal:nth-child(2) { transition-delay: .25s; }
.hero .reveal:nth-child(3) { transition-delay: .4s; }
.hero .reveal:nth-child(4) { transition-delay: .55s; }

/* ---------- Story ---------- */
.story-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.story-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/5;
  object-fit: cover;
}
.story-copy h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--primary);
  border-left: 3px solid var(--accent);
  padding-left: 22px;
  margin: 1.6em 0 0;
}

/* ---------- Feels like home cards ---------- */
.feels-like-home { background: var(--surface); }
.feel-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 3rem;
}
.feel-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 38px 30px;
  text-align: center;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.feel-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.feel-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--leaf) 14%, transparent);
  color: var(--leaf);
  margin-bottom: 1.2em;
}
.feel-card h3 { font-size: 1.3rem; margin-bottom: .4em; }
.feel-card p { font-size: .96rem; margin: 0; }

/* ---------- Ingredients (leaf-shaped flip cards — signature element) ---------- */
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 26px;
  margin-top: 2.5rem;
}
.ingredient-card {
  perspective: 1200px;
  height: 210px;
}
.ingredient-card-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform .7s var(--ease);
  transform-style: preserve-3d;
}
.ingredient-card:hover .ingredient-card-inner,
.ingredient-card:focus-visible .ingredient-card-inner {
  transform: rotateY(180deg);
}
.ingredient-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 20px;
  /* torn-leaf silhouette — the page's signature motif */
  clip-path: path('M95 0 C150 20 190 70 185 120 C180 175 130 210 95 210 C55 210 5 175 3 118 C1 65 40 15 95 0 Z');
  box-shadow: var(--shadow-sm);
}
.ingredient-front {
  background: var(--surface);
  border: 1px solid var(--border);
}
.ingredient-back {
  background: var(--leaf);
  color: #fff;
  transform: rotateY(180deg);
}
.ingredient-back p { color: rgba(255,255,255,.92); font-size: .92rem; margin: 0; }
.ingredient-emoji { font-size: 2rem; margin-bottom: .3em; }
.ingredient-front h3 { font-size: 1.05rem; margin: 0; }
.optional-tag {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  margin-top: .3em;
}

.print-row { margin-top: 1.6rem; margin-bottom: -1rem; }
.btn-print {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: .88rem; font-weight: 600;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.btn-print:hover { background: var(--bg); transform: translateY(-2px); }

/* ---------- Timeline (pestle-and-mortar rhythm) ---------- */
.timeline {
  position: relative;
  max-width: 640px;
  margin: 3rem auto 0;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline::after {
  content: '';
  position: absolute; left: 11px; top: 6px;
  width: 2px;
  background: var(--leaf);
  height: var(--tl-progress, 0%);
  transition: height .2s linear;
}
.timeline-step {
  position: relative;
  padding-bottom: 46px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -40px; top: 2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--leaf);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.timeline-step.is-visible .timeline-marker {
  background: var(--leaf);
  transform: scale(1.1);
}
.timeline-content h3 { font-size: 1.25rem; margin-bottom: .25em; }
.timeline-content p { margin: 0; }

/* ---------- Gallery ---------- */
.gallery-grid {
  columns: 3 220px;
  column-gap: 20px;
  margin-top: 2.5rem;
}
.gallery-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 20px;
  border: none;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.08); }

.lightbox {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(20, 14, 8, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: fadeIn .3s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: min(900px, 90vw);
  max-height: 82vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.24); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- Culture ---------- */
.culture { background: var(--surface); }
.culture-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.culture-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/5;
  object-fit: cover;
}
.culture-copy h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

/* ---------- Regions ---------- */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 2.5rem;
}
.region-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 28px 26px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.region-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.region-card h3 { font-size: 1.15rem; margin-bottom: .4em; }
.region-card p { font-size: .95rem; margin: 0; }

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
  background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--leaf) 10%, var(--bg)));
}
.cta-inner h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .1em; }
.cta-question {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--accent);
  margin-bottom: 1.6em;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: #fff;
  padding: 44px 0;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
}
.footer-social { display: flex; gap: 14px; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.footer-social a:hover { background: rgba(255,255,255,.24); transform: translateY(-3px); }
.footer-copy { font-size: .85rem; color: rgba(255,255,255,.75); margin: 0; width: 100%; text-align: center; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .25s var(--ease);
  z-index: 900;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); }
.back-to-top[hidden] { display: none; }

/* ---------- Reduced motion ---------- */
@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;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .story-grid, .culture-grid { grid-template-columns: 1fr; }
  .culture-media { order: -1; }
  .feel-cards { grid-template-columns: 1fr; }
  .gallery-grid { columns: 2 200px; }
}

@media (max-width: 760px) {
  .nav-menu {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 24px;
    gap: 4px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .nav-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-link { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .gallery-grid { columns: 1 100%; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
  .hero { padding-top: 120px; }
  .btn { width: 100%; justify-content: center; }
}

/* ---------- Print (used by the "Print Recipe" button) ---------- */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    position: absolute; left: 0; top: 0; width: 100%;
    padding-left: 20px;
  }
  .timeline::before, .timeline::after, .timeline-marker { display: none; }
}
