/* ============================================================
   TOHAR FOODS — "The Ledger" design system
   A heritage provision-store ledger, ink-stamped for purity.
   ============================================================ */

:root {
  /* ---- Color tokens ---- */
  --paper:        #EDE3CC;  /* aged ledger paper, main background */
  --paper-light:  #F7F2E4;  /* lighter card/paper surface */
  --paper-dark:   #E2D5B8;  /* recessed paper (inputs, dividers bg) */
  --ink:          #26221A;  /* near-black warm charcoal, primary text */
  --ink-soft:     #55503F;  /* secondary text, ledger annotations */
  --sindoor:      #7A1F2B;  /* deep maroon — stamps, primary accent */
  --sindoor-dark: #5E1721;
  --turmeric:     #B9781F;  /* muted gold — secondary accent */
  --turmeric-soft:#E4C583;
  --leaf:         #48583A;  /* muted green — natural/trust cues */
  --clay:         #A8532E;  /* terracotta — tertiary accent */
  --whatsapp:     #2E7D57;  /* desaturated, on-brand whatsapp green */
  --whatsapp-dark:#245F42;
  --line:         rgba(38, 34, 26, 0.16);
  --line-strong:  rgba(38, 34, 26, 0.28);

  /* ---- Type ---- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Work Sans', -apple-system, sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  /* ---- Scale ---- */
  --container: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--sindoor); color: var(--paper-light); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* subtle ledger paper grain, applied once to body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 34px, var(--line) 34px, var(--line) 35px);
  mask-image: linear-gradient(to bottom, black, transparent 320px);
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--sindoor);
  outline-offset: 3px;
}

/* ---------------- Eyebrow / ledger labels ---------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sindoor);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--sindoor);
  display: inline-block;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper-light);
  border-bottom: 1px solid var(--line-strong);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.wordmark .tm { font-family: var(--font-mono); font-size: 11px; color: var(--sindoor); align-self: flex-start; }
.wordmark span.sub { color: var(--sindoor); font-style: italic; font-weight: 400; }

.nav-links {
  display: flex;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%; right: 50%; bottom: 0;
  height: 1px;
  background: var(--sindoor);
  transition: left 0.22s ease, right 0.22s ease;
}
.nav-links a:hover { color: var(--sindoor); }
.nav-links a:hover::after { left: 0; right: 0; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.96); }
.btn-primary { background: var(--sindoor); color: var(--paper-light); }
.btn-primary:hover { background: var(--sindoor-dark); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; width: 100%; justify-content: center; }
.btn-whatsapp:hover { background: var(--whatsapp-dark); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------------- Ink stamp ---------------- */
.stamp {
  --stamp-color: var(--sindoor);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp-color);
  border: 1.5px solid var(--stamp-color);
  border-radius: 50%;
  width: 84px;
  height: 84px;
  text-align: center;
  line-height: 1.25;
  padding: 6px;
  transform: rotate(-8deg);
  position: relative;
  mix-blend-mode: multiply;
  opacity: 0.92;
}
.stamp::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid var(--stamp-color);
  border-radius: 50%;
  opacity: 0.35;
}
.stamp.stamp-sm { width: 62px; height: 62px; font-size: 9px; padding: 4px; }

/* Stamp-down reveal: the badge "thunks" into place after its card settles */
.stamp { transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease; }
.reveal .stamp { transform: rotate(-32deg) scale(0.35); opacity: 0; }
.reveal.in .stamp { transform: rotate(-8deg) scale(1); opacity: 0.92; transition-delay: 0.22s; }
@media (prefers-reduced-motion: reduce) {
  .reveal .stamp, .reveal.in .stamp { transform: rotate(-8deg) scale(1); opacity: 0.92; transition: none; }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('assets/images/hero-bg.webp') center/cover no-repeat;
  z-index: -2;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(38,34,26,0.74) 0%, rgba(38,34,26,0.58) 38%, rgba(38,34,26,0.32) 68%, rgba(38,34,26,0.18) 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 90px 0 70px; color: var(--paper-light); }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--turmeric-soft);
  border: 1px solid rgba(228, 197, 131, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 28px;
}
.hero h1 {
  color: var(--paper-light);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  max-width: 780px;
  letter-spacing: -0.01em;
}
.hero .hindi-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--turmeric-soft);
  font-size: clamp(18px, 2vw, 24px);
  margin: 20px 0 22px;
}
.hero p.lede {
  max-width: 520px;
  font-size: 17px;
  color: rgba(247, 242, 228, 0.86);
  margin-bottom: 38px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Staged entrance on load */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badge, .hero h1, .hero .hindi-line, .hero p.lede, .hero-actions {
  opacity: 0;
  animation: riseIn 0.7s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.hero-badge  { animation-delay: 0.05s; }
.hero h1     { animation-delay: 0.16s; }
.hero .hindi-line { animation-delay: 0.32s; }
.hero p.lede { animation-delay: 0.42s; }
.hero-actions { animation-delay: 0.52s; }
@media (prefers-reduced-motion: reduce) {
  .hero-badge, .hero h1, .hero .hindi-line, .hero p.lede, .hero-actions {
    opacity: 1; animation: none;
  }
}

/* ---------------- Section shell ---------------- */
section { position: relative; z-index: 1; }
.section { padding: 96px 0; }
.section-border-top { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow { justify-content: center; }
.section-head .eyebrow::before { display: none; }
.section-head .eyebrow::after {
  content: '';
  width: 22px; height: 1px; background: var(--sindoor); display: inline-block;
}
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-top: 14px; line-height: 1.12; }
.section-head .dek { font-family: var(--font-display); font-style: italic; color: var(--sindoor); font-size: 19px; margin-top: 14px; }

/* ---------------- Story ---------------- */
#story { overflow: hidden; }
#story .wrap { position: relative; z-index: 1; }
#story::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 400px;
  line-height: 1;
  color: var(--sindoor);
  opacity: 0.075;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
.story-body { max-width: 700px; margin: 0 auto; text-align: center; }
.story-body p { color: var(--ink-soft); font-size: 17px; margin-bottom: 20px; }
.story-body strong { color: var(--ink); }
.story-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--sindoor);
  margin: 36px 0 0;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 560px;
  margin: 56px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
.stat { text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .num { font-family: var(--font-display); font-size: 38px; color: var(--sindoor); }
.stat .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }

/* ---------------- Products ---------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.product-card {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.product-grid .product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(38, 34, 26, 0.14);
  border-color: var(--line-strong);
}
.product-photo {
  position: relative;
  aspect-ratio: 4 / 3.1;
  background: var(--paper-dark);
  overflow: hidden;
}
.product-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.product-card:hover .product-photo img { transform: scale(1.07); }
.product-card .stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--paper-light);
  z-index: 2;
}
.product-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-size: 21px; margin-bottom: 8px; }
.product-body p.desc { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 18px; flex: 1; }
.qty-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 9px;
}
.qty-row { display: flex; gap: 8px; margin-bottom: 16px; }
.qty-btn {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 6px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.12s ease;
}
.qty-btn:hover { border-color: var(--ink); color: var(--ink); }
.qty-btn:active { transform: scale(0.95); }
.qty-btn.active { background: var(--ink); border-color: var(--ink); color: var(--paper-light); }

/* perforated stub edge between photo and body */
.product-body::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 1.5px dashed var(--line-strong);
}

/* the "odd" last card in a 3-col grid spans + centers gracefully */
.product-grid > .product-card:last-child:nth-child(3n+1) {
  grid-column: 2 / 3;
}

/* ---------------- Why Us ---------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.why-item {
  background: var(--paper);
  padding: 40px 32px;
}
.why-item .stamp-sm-wrap { margin-bottom: 18px; }
.why-item h3 { font-size: 18px; margin-bottom: 10px; }
.why-item p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* ---------------- CTA banner ---------------- */
.cta-banner {
  background: var(--ink);
  color: var(--paper-light);
  text-align: center;
  padding: 88px 0;
}
.cta-banner h2 { color: var(--paper-light); font-size: clamp(30px, 4.4vw, 50px); max-width: 680px; margin: 0 auto; line-height: 1.12; }
.cta-banner p { color: rgba(247,242,228,0.7); margin: 18px 0 34px; font-size: 16px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-banner .btn-outline { border-color: rgba(247,242,228,0.35); color: var(--paper-light); }
.cta-banner .btn-outline:hover { border-color: var(--paper-light); }

/* ---------------- Contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-item { display: flex; gap: 16px; margin-bottom: 26px; }
.contact-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.contact-icon svg { width: 19px; height: 19px; color: var(--sindoor); }
.contact-item h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px; font-weight: 500;}
.contact-item p, .contact-item a { font-size: 16px; text-decoration: none; color: var(--ink); }
.map-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%; min-height: 320px; }
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; filter: sepia(12%) saturate(85%); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--paper-dark); border-top: 1px solid var(--line-strong); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 56px; }
.footer-brand .wordmark { margin-bottom: 14px; }
.footer-brand p { color: var(--ink-soft); font-size: 14.5px; max-width: 280px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sindoor); margin-bottom: 18px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 11px; }
.footer-col a { text-decoration: none; color: var(--ink-soft); font-size: 14.5px; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.footer-bottom .hindi { font-family: var(--font-display); font-style: italic; }

/* ---------------- Floating WhatsApp ---------------- */
.float-wa {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 58px; height: 58px;
  background: var(--whatsapp);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(38,34,26,0.28);
  z-index: 50;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.float-wa:hover { transform: scale(1.06); }
.float-wa svg { width: 28px; height: 28px; color: #fff; }

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

/* ================= Responsive ================= */
@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid > .product-card:last-child:nth-child(3n+1) { grid-column: auto; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links, .header-actions .btn-outline { display: none; }
  .nav-toggle { display: block; }
  .site-header.open .nav-links {
    display: flex;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--paper-light);
    border-bottom: 1px solid var(--line-strong);
    flex-direction: column;
    padding: 20px 28px 28px;
    gap: 18px;
  }
  .hero { min-height: 560px; }
  .hero-inner { padding: 64px 0 50px; }
  .product-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; gap: 18px; }
  .stat { border-left: none; border-top: 1px solid var(--line); padding-top: 18px; }
  .stat:first-child { border-top: none; padding-top: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .section { padding: 64px 0; }
  .cta-banner { padding: 64px 0; }
}
