/* Real Date Bar — design tokens & base styles */

:root {
  /* Palette: cream (default) */
  --bg: #F1E7D0;
  --bg-soft: #EADFC4;
  --bg-deep: #E4D5B1;
  --ink: #2E1F12;
  --ink-soft: #5C4632;
  --ink-mute: #8A745A;
  --tan: #C49A6C;
  --accent: #A86628;
  --accent-deep: #7E4717;
  --line: rgba(46, 31, 18, 0.14);
  --line-strong: rgba(46, 31, 18, 0.28);
  --paper: #FAF3E2;
  --leaf: #6B7A4A;

  /* Type */
  --display: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Geometry */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 24px;
}

/* Palette variants applied via [data-palette] */
[data-palette="cocoa"] {
  --bg: #2A1B0F;
  --bg-soft: #36240F;
  --bg-deep: #1F140A;
  --ink: #F1E7D0;
  --ink-soft: #D7C29A;
  --ink-mute: #A38566;
  --tan: #C49A6C;
  --accent: #E0A766;
  --accent-deep: #C28948;
  --line: rgba(241, 231, 208, 0.14);
  --line-strong: rgba(241, 231, 208, 0.32);
  --paper: #3A2814;
}
[data-palette="forest"] {
  --bg: #EDE7D2;
  --bg-soft: #DCD8BD;
  --bg-deep: #C9C7A2;
  --ink: #1F2A1A;
  --ink-soft: #3D4A35;
  --ink-mute: #6E7B5F;
  --tan: #8FA070;
  --accent: #4A6B33;
  --accent-deep: #2E4720;
  --line: rgba(31, 42, 26, 0.16);
  --paper: #F6F2DF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--ink-mute);
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.diamond::before {
  width: 8px;
  height: 8px;
  background: var(--tan);
  transform: rotate(45deg);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 7.4vw, 116px); }
h2 { font-size: clamp(36px, 5vw, 72px); }
h3 { font-size: clamp(22px, 2.2vw, 34px); }

p { margin: 0; text-wrap: pretty; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .15s ease, background .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* Placeholder image — striped pattern + monospace caption */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(46,31,18,0.06) 0 8px,
      rgba(46,31,18,0.0) 8px 16px),
    var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink-mute);
}
.ph .ph-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 4px;
}
.ph .ph-cap {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
  padding: 0 24px;
  max-width: 80%;
}

/* Section spacing */
section { padding: clamp(60px, 9vw, 120px) 0; }
section.tight { padding: clamp(40px, 6vw, 80px) 0; }

/* Hairline divider */
.rule { height: 1px; background: var(--line-strong); width: 100%; }

/* Tag chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
}
.chip .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

/* Number callout */
.num {
  font-family: var(--display);
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

/* Marquee */
.marquee {
  border-block: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
}
.marquee-track {
  display: flex;
  gap: 56px;
  padding: 18px 0;
  animation: scroll 38s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.marquee-track span {
  font-family: var(--display);
  font-style: italic;
  font-size: 28px;
  letter-spacing: 0.01em;
}
.marquee-track .sep {
  font-style: normal;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.3em;
  align-self: center;
  color: var(--tan);
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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

/* utility */
.center { text-align: center; }
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.serif { font-family: var(--display); }
.mono { font-family: var(--mono); }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }

/* Grid helpers */
.grid { display: grid; gap: 24px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }


/* ─────────────────────────────────────────────────────────────────────────────
   CART, CHECKOUT, CONFIRMATION — animations + responsive layout
   ───────────────────────────────────────────────────────────────────────────── */

@keyframes rdbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes rdbSlideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes rdbScaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* Checkout grid stacks on narrow screens (order summary above form) */
@media (max-width: 860px) {
  .checkout-grid {
    grid-template-columns: 1fr !important;
  }
  .checkout-summary {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .checkout-card {
    border-radius: 0 !important;
    max-height: 100% !important;
  }
}

/* Phone-specific cart polish */
@media (max-width: 640px) {
  /* On the narrowest screens, "Order" text is redundant — show the cart icon only */
  .nav-order-btn { display: none !important; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE FIXES
   The JSX uses many inline `gridTemplateColumns: '1.4fr 1fr'` etc. that won't
   collapse without CSS overrides. We use `!important` to defeat inline styles
   and target sections by their id so we don't catch grids that should stay.
   ───────────────────────────────────────────────────────────────────────────── */

/* TABLET (≤ 900px) — collapse 2-column section layouts */
@media (max-width: 900px) {
  /* Stack any direct multi-col grid inside a section .wrap */
  #top      > .wrap > div[style*="grid-template-columns"],
  #product  > .wrap > div[style*="grid-template-columns"]:not([style*="repeat(4"]),
  #nutrition > .wrap > div[style*="grid-template-columns"],
  #order    > .wrap > div[style*="grid-template-columns"],
  #pickup   > .wrap > div[style*="grid-template-columns"],
  #payment  > .wrap > div[style*="grid-template-columns"],
  #founder  > .wrap > div[style*="grid-template-columns"],
  #faq      > .wrap > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: clamp(28px, 5vw, 48px) !important;
    align-items: start !important;
  }

  /* Hero (split variant) — un-fix min-height so stacked block isn't huge */
  #top > .wrap > div[style*="min-height"] {
    min-height: auto !important;
  }

  /* Hero editorial: the BarShot sits in a flex container next to the text.
     Center it once stacked and cap its width so it doesn't dominate. */
  #top > .wrap > div > div:last-child {
    justify-content: center !important;
  }
  #top .ph {
    max-width: 420px;
    margin: 0 auto;
  }

  /* ProductShowcase inner grid (left photo / right stacked photos) */
  #product > .wrap > div > div[style*="grid-template-rows"] {
    grid-template-rows: auto auto !important;
  }

  /* Spec table: 4-col → 2-col, and flip borders */
  #product > .wrap > div[style*="repeat(4"] {
    grid-template-columns: 1fr 1fr !important;
  }
  #product > .wrap > div[style*="repeat(4"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #product > .wrap > div[style*="repeat(4"] > div:nth-child(odd) {
    border-right: 1px solid var(--line) !important;
  }
  #product > .wrap > div[style*="repeat(4"] > div:nth-last-child(-n+2) {
    border-bottom: none !important;
  }

  /* Comparison rows: 3-col → label on top, two stacked rows below */
  #why .wrap [style*="grid-template-columns: 1.2fr 1.4fr 1.4fr"],
  #why .wrap [style*="grid-template-columns:1.2fr 1.4fr 1.4fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 20px !important;
  }
  /* Hide the comparison column-header row — labels make no sense once stacked */
  #why .wrap > div > div:first-child[style*="grid-template-columns"] {
    display: none !important;
  }
  /* Add a small "vs" prefix to the gel value so it's clear which is which */
  #why .wrap > div > div:not(:first-child)[style*="grid-template-columns"] > div:nth-child(2)::before {
    content: "Gel: ";
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tan);
    display: block;
    margin-bottom: 4px;
  }
  #why .wrap > div > div:not(:first-child)[style*="grid-template-columns"] > div:nth-child(3)::before {
    content: "Real Date Bar: ";
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tan);
    display: block;
    margin-bottom: 4px;
  }

  /* Founder photo: kill `position: sticky` and let it sit naturally */
  #founder > .wrap > div > div[style*="sticky"],
  #founder > .wrap > div > div[style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
    aspect-ratio: 4/5 !important;
    min-height: 320px !important;
    max-height: 480px !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto 8px !important;
  }
  /* Founder stats: 3-col → 1-col with bottom borders instead of right */
  #founder .wrap [style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  #founder .wrap [style*="repeat(3"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #founder .wrap [style*="repeat(3"] > div:last-child {
    border-bottom: none !important;
  }

  /* OrderForm step list (40px gutter + content) — keep 2-col, fine */
  /* Pack chooser (1fr 1fr 1fr) — keep, fine on mobile */

  /* PickupMap iframe min-height shrink */
  #pickup > .wrap > div > div:first-child {
    min-height: 320px !important;
  }
  #pickup iframe { min-height: 320px !important; }

  /* Footer 4-col → 2-col */
  footer .wrap > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
}

/* MOBILE NAV (≤ 760px) — desktop link row becomes hamburger-driven drawer */
@media (max-width: 760px) {
  /* Show the hamburger toggle (JSX renders it display:none by default) */
  .nav-menu-btn {
    display: inline-flex !important;
  }
  /* Hide the inline link row by default; turn it into a drop-down drawer when open */
  header > .wrap > nav.nav-links {
    display: none !important;
    position: absolute !important;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line-strong);
    flex-direction: column !important;
    gap: 0 !important;
    padding: 6px 0 !important;
    box-shadow: 0 12px 30px rgba(46, 31, 18, 0.08);
  }
  header.is-menu-open > .wrap > nav.nav-links {
    display: flex !important;
  }
  header > .wrap > nav.nav-links > a {
    padding: 16px var(--gutter) !important;
    border-bottom: 1px solid var(--line);
    font-size: 16px !important;
    color: var(--ink) !important;
  }
  header > .wrap > nav.nav-links > a:last-child {
    border-bottom: none !important;
  }
  /* Header wrap anchors the absolutely-positioned drawer */
  header > .wrap {
    position: relative;
  }
}

/* PHONE (≤ 640px) — collapse single-row utility strips, shrink type */
@media (max-width: 640px) {
  header > .wrap {
    padding: 14px 0 !important;
  }
  header .btn { padding: 10px 16px !important; font-size: 13px; }

  /* Hero type scale: clamp() upper limits aren't enough on narrow screens */
  h1 { font-size: clamp(40px, 11vw, 64px) !important; }
  h2 { font-size: clamp(30px, 8.5vw, 48px) !important; }
  h3 { font-size: clamp(20px, 5.5vw, 26px) !important; }

  /* Number callout (Pillars "02", Pricing "$22", etc.) */
  .num { font-size: clamp(56px, 16vw, 88px) !important; }

  /* Section padding shrink */
  section { padding: clamp(40px, 11vw, 64px) 0 !important; }

  /* Marquee — bring text down and tighten gaps */
  .marquee-track { gap: 28px !important; padding: 12px 0 !important; }
  .marquee-track span { font-size: 18px !important; }
  .marquee-track .sep { font-size: 11px !important; letter-spacing: .2em !important; }

  /* Pricing tier cards: drop the artificial 380px min so they shrink */
  #pricing .grid > div { min-height: auto !important; }
  /* Pricing "$22" number — shrink so it fits on narrow phones */
  #pricing .num { font-size: clamp(56px, 18vw, 84px) !important; }

  /* OrderForm totals row: stack price block and button instead of side-by-side */
  #order form > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
  #order form > div:last-child > button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Founder pull-quote — drop from 26px serif to something readable */
  #founder p[style*="font-size: 26px"] { font-size: 20px !important; line-height: 1.35 !important; }

  /* Pillars — kill right-borders, add bottom rules instead */
  #pillars .grid.cols-3 > div {
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--line-strong) !important;
  }
  #pillars .grid.cols-3 > div:first-child {
    border-top: 1px solid var(--line-strong) !important;
  }
  #pillars .grid.cols-3 > div:last-child {
    border-bottom: 1px solid var(--line-strong) !important;
  }

  /* Footer 2-col → 1-col on phones */
  footer .wrap > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  /* Footer copyright row */
  footer .wrap > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* Reviews modal name/role grid */
  #reviews [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Comparison body text shrink */
  #why .wrap [style*="grid-template-columns"] > div[style*="font-size: 22px"],
  #why .wrap [style*="grid-template-columns"] > div[style*="font-size:22px"] {
    font-size: 17px !important;
  }

  /* Tighten BarShot min height on small phones */
  .ph { min-height: 220px !important; }
}

/* NARROW PHONE (≤ 380px) — final squeeze */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  h1 { font-size: 36px !important; }
  h2 { font-size: 28px !important; }
  .marquee-track span { font-size: 16px !important; }
}
