:root {
  /* Light warm base — cream / peach wash */
  --bg: #fffbf7;
  --bg-gradient: linear-gradient(
    155deg,
    #fffdfb 0%,
    #fff5eb 22%,
    #ffeedd 45%,
    #fff0e5 68%,
    #faf6f2 88%,
    #fff9f4 100%
  );
  --dot-pattern: radial-gradient(rgba(160, 100, 60, 0.07) 1px, transparent 1px);
  --dot-size: 22px;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 250, 245, 0.95);
  --border: rgba(100, 65, 45, 0.12);
  --border-strong: rgba(180, 100, 55, 0.28);
  --text: #4a3428;
  --muted: #7a6558;
  --accent: #ff7a5c;
  --accent-2: #c084fc;
  --accent-soft: rgba(255, 122, 92, 0.18);
  --success: #3d9e55;
  --shadow: 0 20px 48px rgba(60, 40, 30, 0.08);
  --shadow-warm: 0 16px 36px rgba(180, 100, 60, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --rail-width: min(380px, 42vw);
}

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

html {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-size: 100% 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  background-color: transparent;
  background-image: var(--dot-pattern);
  background-size: var(--dot-size) var(--dot-size);
  background-attachment: fixed;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.top-bar-logo {
  justify-self: center;
  grid-column: 2;
}

.top-bar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.back-feed-link {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem 0.35rem 0;
  margin-left: -0.15rem;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.back-feed-link--icon {
  justify-self: start;
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  margin-left: -0.35rem;
  font-size: 0;
}

.back-feed-link--icon svg {
  display: block;
}

.back-feed-link:hover {
  color: var(--text);
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

a.logo-link {
  text-decoration: none;
  color: inherit;
}

a.logo-link:hover {
  color: var(--text);
}

.cart-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cart-trigger:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.cart-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0 0.75rem 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  min-height: 0;
}

.video-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  max-height: min(85dvh, 780px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d060f;
  box-shadow: var(--shadow), var(--shadow-warm), 0 0 0 1px rgba(180, 100, 60, 0.15);
}

.video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 38%,
    rgba(0, 0, 0, 0.5) 72%,
    rgba(0, 0, 0, 0.88) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

/* Top-right: clears recipe title + bottom CTA; thumb-friendly on vertical video */
.ingredient-popup {
  position: absolute;
  top: max(10%, env(safe-area-inset-top));
  right: 0.65rem;
  left: auto;
  margin-left: 0;
  max-width: min(260px, calc(100% - 1.3rem));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: 14px;
  background: rgba(38, 28, 52, 0.88);
  border: 1px solid rgba(255, 180, 160, 0.18);
  box-shadow: 0 12px 32px rgba(20, 8, 35, 0.4);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  transform-origin: top right;
  contain: layout style;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.ingredient-popup.is-enter {
  animation: popup-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ingredient-popup.is-exit {
  animation: popup-out 0.22s ease forwards;
}

.ingredient-popup:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

/* No opacity keyframes — only transform — so the card never flashes “empty” for a full paint cycle */
@keyframes popup-in {
  from {
    transform: translateX(12px) scale(0.96);
  }
  to {
    transform: translateX(0) scale(1);
  }
}

@keyframes popup-out {
  to {
    opacity: 0;
    transform: translateX(10px) scale(0.97);
  }
}

.ingredient-popup-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #3d2f48;
  transition: opacity 0.12s ease;
}

.ingredient-popup-text {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.96);
}

.ingredient-popup-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffd4c4;
}

.ingredient-popup-name {
  margin: 0.1rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ingredient-popup-price {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.btn-add-mini {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-mini:hover {
  filter: brightness(1.08);
}

.btn-add-mini:active {
  transform: scale(0.96);
}

.video-meta {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 5.1rem;
  z-index: 3;
  max-width: calc(100% - 1.8rem);
  pointer-events: none;
}

.recipe-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fffaf5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 0, 0, 0.55);
}

.recipe-author {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.recipe-blurb {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  line-height: 1.38;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-macros {
  margin: 0.3rem 0 0;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.video-actions {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 1rem;
  z-index: 3;
}

.action-pill {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(255, 245, 235, 0.98), rgba(255, 220, 200, 0.95));
  color: #3d1f28;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(40, 15, 35, 0.25);
}

.action-pill:active {
  transform: scale(0.98);
}

.shop-rail {
  width: var(--rail-width);
  flex-shrink: 0;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(85dvh, 780px);
  overflow: hidden;
  align-self: flex-start;
  box-shadow: var(--shadow), var(--shadow-warm);
}

.shop-rail-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.shop-rail-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.product-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  padding-bottom: 0.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.product-card.is-cue-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.product-card.is-highlight,
.product-card.is-pulse {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  animation: card-pop 0.45s ease;
}

.product-card.is-cue-active.is-pulse {
  animation: card-pop 0.45s ease;
}

@keyframes card-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #3d2f48;
}

.product-body {
  min-width: 0;
}

.product-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.product-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.product-price {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
}

.product-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.btn-link-open {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-link-open:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(255, 122, 92, 0.45);
  color: #c44a32;
}

.btn-link-open:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-add {
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add:hover {
  filter: brightness(1.08);
}

.btn-add:active {
  transform: scale(0.96);
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.cart-drawer:not([hidden]) {
  pointer-events: auto;
}

.cart-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 45, 38, 0.35);
  backdrop-filter: blur(6px);
}

.cart-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: rgba(255, 252, 248, 0.97);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow), -8px 0 32px rgba(90, 60, 40, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.cart-drawer:not([hidden]) .cart-drawer-panel {
  transform: translateX(0);
}

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
}

.cart-drawer-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1rem;
  flex: 1;
  overflow-y: auto;
}

.cart-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-line .product-thumb {
  width: 44px;
  height: 44px;
}

.cart-line-info {
  min-width: 0;
}

.cart-line-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.cart-qty-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover {
  background: rgba(255, 200, 180, 0.35);
  border-color: var(--border-strong);
}

.cart-qty-btn[data-inc]:hover {
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.cart-line-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.cart-line-recipe {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.12rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-line-qty {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.cart-line-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  min-width: 4rem;
}

.cart-line-price {
  font-weight: 700;
  font-size: 0.875rem;
  text-align: right;
  align-self: center;
  min-width: 3.25rem;
}

.cart-line-shop {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.cart-line-shop:hover {
  text-decoration: underline;
}

.cart-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  flex: 1;
}

.cart-footer {
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 250, 245, 0.98);
}

.cart-footer-hint {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.btn-primary {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #e85d4a 0%, #ff8a5c 45%, #f0a060 100%);
  color: #fffaf8;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(180, 70, 50, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  z-index: 200;
  max-width: calc(100% - 2rem);
  text-align: center;
}

/* Mobile: rail below video, full width */
@media (max-width: 768px) {
  :root {
    --rail-width: 100%;
  }

  .main {
    flex-direction: column;
    align-items: stretch;
    padding: 0 0.65rem 1rem;
  }

  .video-shell {
    max-width: none;
    width: 100%;
    /* Taller, closer to full-screen feel; show full frame like native fullscreen (no crop) */
    max-height: min(72dvh, 700px);
    border-radius: var(--radius-sm);
  }

  .video {
    object-fit: contain;
    object-position: center center;
  }

  /* Soften bottom scrim: title was fighting a very black band; keep read legibility on .recipe-title */
  .video-gradient {
    background: linear-gradient(
      180deg,
      transparent 32%,
      rgba(0, 0, 0, 0.28) 68%,
      rgba(0, 0, 0, 0.52) 100%
    );
  }

  .shop-rail {
    max-height: min(48dvh, 420px);
    min-height: 0;
    margin-top: 0.65rem;
  }

  .product-list {
    max-height: none;
  }
}

/* Short viewports (e.g. split-screen, small phone): keep video readable without snap breakpoints — fluid caps only */
@media (max-width: 768px) and (max-height: 560px) {
  .video-shell {
    max-height: min(50dvh, 440px);
  }

  .shop-rail {
    max-height: min(40dvh, 360px);
  }
}

/* ——— Feed (link-in-bio grid) ——— */

body.feed-page {
  overflow-x: hidden;
}

.feed-app {
  min-height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 0.65rem 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
}

.feed-brand .logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.feed-nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-nav-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.feed-nav-link:hover {
  color: var(--text);
  background: rgba(255, 180, 140, 0.1);
}

.feed-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

.feed-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 220, 200, 0.9), rgba(255, 180, 140, 0.45));
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-warm);
}

.feed-avatar-inner {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c45c2e;
}

.feed-profile-text {
  min-width: 0;
}

.feed-handle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feed-bio {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.feed-tabs {
  display: flex;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 0.65rem;
}

.feed-tab {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.5rem 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}

.feed-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.feed-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.feed-cell {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.feed-cell--empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.feed-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
}

.feed-tile-media {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #1a1410;
  overflow: hidden;
  /* Avoid passive scroll quirks; child <a> still receives navigations. */
  touch-action: manipulation;
  isolation: isolate;
}

/* Raster tile image shows until the video has a decoded frame (iOS: video is an opaque black layer before then). */
.feed-tile-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.feed-tile-media--frame-ready .feed-tile-img {
  opacity: 0;
  pointer-events: none;
}

.feed-tile-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.feed-tile-media--frame-ready .feed-tile-video {
  opacity: 1;
  pointer-events: auto;
}

.feed-tile-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

.feed-tile-play {
  position: absolute;
  z-index: 2;
  bottom: 0.35rem;
  right: 0.35rem;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.feed-tile-title {
  margin: 0;
  padding: 0.35rem 0.25rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-tile:hover .feed-tile-title {
  color: var(--text);
}

@media (min-width: 480px) {
  .feed-tile-title {
    font-size: 0.7rem;
    padding: 0.4rem 0.3rem 0.2rem;
  }
}

/* ——— Marketing (home) ——— */

body.marketing-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body.marketing-page .site-header .logo {
  font-size: 1.3rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav-link:hover {
  color: var(--text);
  background: rgba(255, 160, 120, 0.15);
}

.site-nav-link--accent {
  color: #c45c2e;
}

.site-nav-link[aria-current="page"] {
  color: var(--text);
}

.marketing-main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2.75rem 1.35rem 4.5rem;
  padding-bottom: max(4.5rem, 6vh);
  width: 100%;
}

.marketing-main--narrow {
  max-width: 720px;
}

.hero {
  max-width: 700px;
  margin-bottom: 4rem;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c45c2e;
}

.hero-title {
  margin: 0;
  font-size: clamp(3.15rem, 6.8vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.hero-lede {
  margin: 1.25rem 0 0;
  font-size: clamp(1.08rem, 2.2vw, 1.22rem);
  line-height: 1.62;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin-top: 2.25rem;
}

.hero-cta-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-marketing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    filter 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn-marketing--primary {
  background: linear-gradient(135deg, #ff7a5c 0%, #ffa060 45%, #b87fcf 100%);
  color: #fffaf8;
  border: none;
  box-shadow: 0 8px 28px rgba(120, 50, 80, 0.28);
}

.btn-marketing--primary:hover {
  filter: brightness(1.07);
}

/* Header CTA — full pill, larger than default text link */
.btn-marketing--nav {
  padding: 0.65rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 26px rgba(120, 50, 80, 0.3);
}

.btn-marketing--nav:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Feed + post: compact waitlist (same form URL as marketing site via config.js) */
.btn-waitlist-sm.btn-marketing {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow: 0 4px 16px rgba(120, 50, 80, 0.22);
}

.btn-waitlist-sm.btn-marketing:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

@media (max-width: 360px) {
  .btn-waitlist-sm.btn-marketing {
    padding: 0.35rem 0.55rem;
    font-size: 0.6875rem;
  }
}

/* Waitlist CTA: full phrase + shorter label (word is in .waitlist-cta__* per page) */
.waitlist-cta__short {
  display: none;
}
@media (max-width: 480px) {
  body:not(.page-post) .waitlist-cta__long {
    display: none;
  }
  body:not(.page-post) .waitlist-cta__short {
    display: inline;
  }
}
/* Recipe post: more chrome in the bar — use short link text on tablet & phone */
@media (max-width: 768px) {
  body.page-post .waitlist-cta__long {
    display: none;
  }
  body.page-post .waitlist-cta__short {
    display: inline;
  }
}

/* Recipe post: keep logo and actions from colliding (waitlist + saved) */
@media (max-width: 520px) {
  body.page-post .top-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.25rem 0.3rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  body.page-post .back-feed-link--icon {
    margin-left: -0.2rem;
    padding: 0.35rem;
  }
  body.page-post .top-bar-logo {
    min-width: 0;
  }
  body.page-post a.top-bar-logo.logo {
    font-size: 0.95rem;
  }
  body.page-post .top-bar-actions {
    flex-shrink: 0;
    max-width: 100%;
  }
  body.page-post .cart-label {
    display: none;
  }
  body.page-post .cart-trigger {
    padding: 0.4rem 0.55rem;
  }
}

/* Primary hero + bottom CTA — largest */
.btn-marketing--xl {
  padding: 1.2rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 3.55rem;
  box-shadow:
    0 12px 40px rgba(120, 50, 80, 0.38),
    0 0 0 1px rgba(255, 200, 180, 0.2),
    0 4px 0 rgba(180, 70, 90, 0.15);
}

.btn-marketing--xl:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 16px 48px rgba(120, 50, 80, 0.42),
    0 0 0 1px rgba(255, 210, 190, 0.28),
    0 5px 0 rgba(180, 70, 90, 0.18);
}

@media (max-width: 520px) {
  .hero-cta .btn-marketing--xl {
    width: 100%;
    justify-content: center;
  }
}

.cta-final .btn-marketing--xl {
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.btn-marketing--ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-marketing--ghost:hover {
  background: rgba(255, 240, 228, 0.95);
  border-color: rgba(200, 120, 70, 0.35);
}

.btn-marketing--disabled,
.btn-marketing--disabled:hover {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.btn-marketing--block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-marketing--large {
  padding: 0.95rem 1.9rem;
  font-size: 1.025rem;
  font-weight: 700;
  box-shadow: 0 10px 32px rgba(120, 50, 80, 0.32);
}

.social-proof {
  margin: 3.5rem 0 4.5rem;
  text-align: center;
}

.social-proof-label {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.social-proof-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-strong);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.feature-strip {
  margin-bottom: 4.5rem;
  padding: 3.5rem 0;
}

.section-heading--center {
  text-align: center;
  margin-bottom: 2rem;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 700px) {
  .feature-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.feature-item {
  text-align: center;
}

.feature-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.feature-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 700;
}

.feature-copy {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.6;
  color: var(--muted);
}

.section-heading {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-heading--small {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.section-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.cta-final {
  margin: 4rem 0 0;
  padding: 3.5rem 2rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 235, 220, 0.65), rgba(255, 245, 235, 0.9));
  border: 1px solid var(--border-strong);
  text-align: center;
}

.cta-final-inner {
  max-width: 600px;
  margin: 0 auto;
}

.cta-final-title {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 3.8vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cta-final-copy {
  margin: 0 0 2rem;
  font-size: clamp(1.02rem, 2vw, 1.12rem);
  line-height: 1.62;
  color: var(--muted);
}

.page-title {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-lede {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.back-home {
  margin: 0;
  font-size: 0.9rem;
}

.back-home a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.back-home a:hover {
  color: var(--text);
}

.site-footer {
  margin-top: auto;
  padding: 3.25rem 1.25rem 2rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  background: transparent;
}

.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.footer-legal {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(90, 70, 58, 0.55);
  width: 100%;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  max-width: 320px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ingredient-popup.is-enter,
  .ingredient-popup.is-exit {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .btn-marketing--nav:hover,
  .btn-marketing--xl:hover {
    transform: none !important;
  }
}
