/* ────────────────────────────────────────────────────────────
   RAMAX — custom styles beyond Tailwind utilities
   ──────────────────────────────────────────────────────────── */

:root {
  --cream:   #F5E6C8;
  --surface: #EDD9B0;
  --ink:     #1A1410;
  --flame:   #E8804A;
  --stamp:   #C0392B;
  --mustard: #F4D03F;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Geist as fallback monosystem-aware fix in case Fontshare fails */
@supports not (font-variation-settings: normal) {
  body { font-family: 'Inter', system-ui, sans-serif; }
}

/* Scrollbar — quiet on cream */
::-webkit-scrollbar       { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: rgba(26,20,16,0.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,20,16,0.4); }

/* Selection already handled via Tailwind selection: utilities */

/* ───── Hero pill (inline-image inside H1) ───── */
.hero-pill {
  width: clamp(56px, 8vw, 140px);
  height: clamp(28px, 4.4vw, 68px);
  vertical-align: -0.16em;
  filter: contrast(1.05) saturate(1.1);
  box-shadow: 0 8px 24px -8px rgba(26,20,16,0.4), inset 0 0 0 2px rgba(245,230,200,0.6);
}

/* Reveal-up base state — animated by GSAP */
.reveal-up { opacity: 0; transform: translateY(24px); }

/* Hero word tokens — staggered in by GSAP */
.hero-word { opacity: 0; transform: translateY(40px); }

/* Story scrub-reveal — every word starts faded */
.story-paragraph .story-word {
  opacity: 0.12;
  transition: opacity 0.2s linear;
  display: inline-block;
  margin-right: 0.18em;
}

/* Grain overlay used in hero + sauces + footer */
.grain-overlay {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* Hero scroll cue line pulse */
.scroll-cue-line {
  background: linear-gradient(to bottom, rgba(26,20,16,0.45), rgba(26,20,16,0));
  animation: cuePulse 2.4s ease-in-out infinite;
}
.scroll-cue-line--cream {
  background: linear-gradient(to bottom, rgba(245,230,200,0.7), rgba(245,230,200,0));
}
@keyframes cuePulse {
  0%, 100% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50%      { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
}

/* Hero text shadows — keep H1 + sub crisp over busy taco/flames image */
.hero-h1-shadow {
  text-shadow:
    0 1px 2px rgba(0,0,0,0.45),
    0 6px 24px rgba(0,0,0,0.55),
    0 14px 60px rgba(0,0,0,0.45);
}
.hero-sub-shadow {
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* ───── Bento card base ───── */
.bento-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1), box-shadow 0.5s cubic-bezier(0.4,0,0.2,1);
}
.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -16px rgba(26,20,16,0.35);
}
.bento-card .bento-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.02);
  transition: transform 0.9s cubic-bezier(0.2,0,0.2,1), filter 0.9s ease;
  filter: contrast(1.08) saturate(1.12) brightness(0.85);
  will-change: transform;
}
.bento-card:hover .bento-photo { transform: scale(1.10); filter: contrast(1.05) saturate(1.2) brightness(0.78); }
.bento-card .bento-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,20,16,0.92) 0%, rgba(26,20,16,0.45) 45%, rgba(26,20,16,0.05) 75%, transparent 100%);
  z-index: 1;
}
.bento-card .bento-body {
  position: absolute; inset: 0;
  padding: clamp(14px, 2.4vw, 26px);
  z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--cream);
}
.bento-card .bento-name {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 900; letter-spacing: -0.045em;
  line-height: 0.92;
  font-size: clamp(1.25rem, 2.4vw, 2.4rem);
  text-wrap: balance;
}
.bento-card .bento-price {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 900; letter-spacing: -0.04em;
  color: var(--flame);
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  line-height: 1;
}
.bento-card .bento-chip {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.18em;
  background: rgba(245,230,200,0.18);
  border: 1px solid rgba(245,230,200,0.3);
  backdrop-filter: blur(8px);
  color: var(--cream);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.bento-card .bento-tag {
  position: absolute;
  top: clamp(14px, 2.4vw, 26px);
  right: clamp(14px, 2.4vw, 26px);
  z-index: 3;
  background: var(--flame);
  color: white;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 6px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* Bento span helpers — for Tailwind v3 CDN safelist */
.bento-2x2 { grid-column: span 2; grid-row: span 2; }
.bento-2x1 { grid-column: span 2; grid-row: span 1; }
.bento-1x2 { grid-column: span 1; grid-row: span 2; }
.bento-1x1 { grid-column: span 1; grid-row: span 1; }
@media (max-width: 767px) {
  .bento-2x2 { grid-column: span 2; grid-row: span 2; }
  .bento-2x1 { grid-column: span 2; grid-row: span 1; }
  .bento-1x2 { grid-column: span 1; grid-row: span 2; }
}

/* ───── Sauces accordion ───── */
.sauce-slice {
  position: relative;
  flex: 1;
  min-height: 90px;
  border-radius: 1.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: flex 0.7s cubic-bezier(0.4,0,0.2,1);
}
.sauce-slice .sauce-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.35;
  filter: contrast(1.1) saturate(1.2);
  transition: opacity 0.7s ease;
}
.sauce-slice .sauce-tint {
  position: absolute; inset: 0;
  mix-blend-mode: multiply;
  transition: opacity 0.7s ease;
}
.sauce-slice .sauce-content {
  position: absolute; inset: 0;
  padding: clamp(16px, 2.5vw, 32px);
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--cream);
  z-index: 2;
}
.sauce-slice .sauce-vert-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  text-transform: uppercase;
  align-self: flex-start;
  transition: opacity 0.4s ease;
}
.sauce-slice .sauce-horiz {
  position: absolute; left: clamp(16px, 2.5vw, 32px); right: clamp(16px, 2.5vw, 32px); bottom: clamp(16px, 2.5vw, 32px);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
.sauce-slice.is-active { flex: 4; }
.sauce-slice.is-active .sauce-bg { opacity: 0.7; }
.sauce-slice.is-active .sauce-vert-name { opacity: 0; }
.sauce-slice.is-active .sauce-horiz { opacity: 1; transform: translateY(0); }
@media (max-width: 767px) {
  .sauce-slice { flex: 1 1 auto; min-height: 110px; }
  .sauce-slice.is-active { flex: 0 0 auto; min-height: 280px; }
  .sauce-slice .sauce-vert-name { writing-mode: horizontal-tb; transform: none; }
}

/* ───── Process card stack ───── */
.process-card {
  position: sticky;
  border-radius: 2rem;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(26,20,16,0.4);
  border: 1px solid rgba(26,20,16,0.06);
}
.process-card .process-photo {
  background-size: cover; background-position: center;
  filter: contrast(1.05) saturate(1.1);
}

/* ───── FAQ ───── */
.faq-item {
  border-bottom: 1px solid rgba(26,20,16,0.15);
}
.faq-trigger {
  width: 100%;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.75rem 0;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(1.15rem, 2.1vw, 1.65rem);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  transition: color 0.3s;
}
.faq-trigger:hover { color: var(--flame); }
.faq-trigger .faq-icon {
  flex: 0 0 auto;
  width: 2.25rem; height: 2.25rem;
  border-radius: 999px;
  background: var(--ink); color: var(--cream);
  display: grid; place-items: center;
  transition: transform 0.4s ease, background 0.3s;
  font-size: 0.8rem;
}
.faq-item.open .faq-trigger .faq-icon { transform: rotate(45deg); background: var(--flame); }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.6s ease, padding 0.4s ease;
  opacity: 0;
  font-size: 1rem; line-height: 1.6;
  color: rgba(26,20,16,0.7);
  padding-bottom: 0;
}
.faq-item.open .faq-answer { max-height: 240px; opacity: 1; padding-bottom: 1.5rem; }

/* ───── Insta tile ───── */
.insta-tile {
  position: relative; overflow: hidden; border-radius: 0.75rem;
  background: var(--surface);
  aspect-ratio: 1 / 1;
}
.insta-tile .insta-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 0.9s cubic-bezier(0.2,0,0.2,1), filter 0.5s ease;
  filter: contrast(1.05) saturate(1.1);
}
.insta-tile:hover .insta-photo { transform: scale(1.08); filter: contrast(1.05) saturate(1.2) brightness(0.7); }
.insta-tile .insta-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,20,16,0.85), transparent 60%);
  opacity: 0; transition: opacity 0.4s ease;
  display: flex; align-items: flex-end; padding: 1rem;
  z-index: 2;
}
.insta-tile:hover .insta-overlay { opacity: 1; }
.insta-tile .insta-caption {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 500;
  color: var(--cream);
  font-size: 0.85rem; line-height: 1.3;
}

/* Hide page loader once GSAP fires */
body.loaded #loader { opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }

/* Loader letters */
.loader-letter {
  opacity: 0;
  transform: translateY(28px);
  animation: loaderIn 0.5s ease forwards;
}
.loader-letter:nth-child(1) { animation-delay: 0.05s; }
.loader-letter:nth-child(2) { animation-delay: 0.12s; }
.loader-letter:nth-child(3) { animation-delay: 0.19s; }
.loader-letter:nth-child(4) { animation-delay: 0.26s; }
.loader-letter:nth-child(5) { animation-delay: 0.33s; }
@keyframes loaderIn { to { opacity: 1; transform: translateY(0); } }

/* Modal: simple show/hide */
#cateringModal.show { display: flex; animation: modalFade 0.4s ease both; }
#cateringModal.show #cateringDialog { animation: dialogIn 0.5s cubic-bezier(0.2,0.8,0.2,1) both; }
@keyframes modalFade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogIn   { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Toast */
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* Mobile nav open */
#mobileNav.open { transform: translateX(0); }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal-up, .hero-word { opacity: 1 !important; transform: none !important; }
  .story-paragraph .story-word { opacity: 1 !important; }
}
