/* =========================================================
   ThaiMaePloy.com — Custom stylesheet
   Design language: Thai market spice-label aesthetic
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,500&family=Work+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --crimson: #B5262B;
  --crimson-dark: #7E1A1E;
  --crimson-light: #E8474C;
  --turmeric: #E0A039;
  --turmeric-dark: #B87C22;
  --galangal: #5C7A4C;
  --galangal-dark: #3F5636;
  --chili: #F1631E;
  --chili-dark: #C94F16;
  --cream: #FBF3E1;
  --cream-dark: #F1E2C1;
  --paper: #FFFCF5;
  --ink: #2A2016;
  --ink-soft: #55493A;
  --clay: #8B4226;
  --line: rgba(42,32,22,0.14);
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: 'Work Sans', sans-serif;
  background-color: var(--cream);
  color: var(--ink);
}

.font-display{ font-family: 'Fraunces', serif; }
.font-mono{ font-family: 'IBM Plex Mono', monospace; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Focus states ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible{
  outline: 3px solid var(--chili);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Texture backdrop ---------- */
.grain-bg{
  background-image:
    radial-gradient(circle at 1px 1px, rgba(42,32,22,0.055) 1px, transparent 0);
  background-size: 22px 22px;
}

.stamp-ring{
  border: 1.5px dashed rgba(42,32,22,0.35);
}

/* ---------- Eyebrow label ---------- */
.eyebrow{
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---------- Torn / scalloped divider ---------- */
.scallop-divider{
  height: 22px;
  width: 100%;
  background:
    radial-gradient(circle at 11px -6px, transparent 12px, var(--paper) 12.5px) 0 0/24px 24px repeat-x;
}
.scallop-divider.flip{
  transform: rotate(180deg);
}

/* ---------- Nav ---------- */
.nav-link{
  position: relative;
  font-weight: 500;
}
.nav-link::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-4px;
  height:2px;
  background: var(--chili);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover::after, .nav-link:focus-visible::after{
  transform: scaleX(1);
}

/* ---------- Buttons ---------- */
.btn-shop{
  background: var(--chili);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--chili-dark), 0 10px 24px -8px rgba(241,99,30,0.55);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-shop:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--chili-dark), 0 14px 28px -8px rgba(241,99,30,0.6);
}
.btn-shop:active{
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--chili-dark);
}

.btn-outline{
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}
.btn-outline:hover{
  background: var(--ink);
  color: var(--cream);
}

/* ---------- Product label card (signature element) ---------- */
.label-card{
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  position: relative;
  box-shadow: 0 1px 0 rgba(42,32,22,0.05), 0 18px 30px -22px rgba(42,32,22,0.5);
}
.label-card::before{
  content:"";
  position:absolute;
  inset: 8px;
  border: 1px dashed rgba(42,32,22,0.22);
  border-radius: 3px;
  pointer-events: none;
}
.label-card .stamp{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

/* ---------- Spice gauge (signature interactive element) ---------- */
.spice-gauge{
  display:flex;
  align-items:center;
  gap: 6px;
}
.spice-gauge .chili-icon{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--line);
}
.spice-gauge .chili-icon.filled{
  color: var(--chili);
}
.gauge-track{
  position: relative;
  width: 100%;
  height: 10px;
  background: var(--cream-dark);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.gauge-fill{
  position:absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--turmeric), var(--chili));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.gauge-track.in-view .gauge-fill{
  width: var(--fill, 40%);
}

/* ---------- Tabs ---------- */
.paste-tab{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.paste-tab[aria-selected="true"]{
  color: var(--crimson-dark);
  border-color: var(--chili);
  background: var(--paper);
}
.paste-panel{ display:none; }
.paste-panel.active{ display:block; }

/* ---------- FAQ accordion ---------- */
.faq-item summary{
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-plus{
  transition: transform .25s ease;
}
.faq-item[open] .faq-plus{
  transform: rotate(45deg);
}
.faq-item{
  border-bottom: 1px solid var(--line);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Marquee ---------- */
.marquee-track{
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
@media (prefers-reduced-motion: reduce){
  .marquee-track{ animation: none; }
}
@keyframes marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ---------- Ingredient chip ---------- */
.chip{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

/* ---------- Hero blob ---------- */
.hero-glow{
  background: radial-gradient(closest-side, rgba(241,99,30,0.28), rgba(241,99,30,0) 70%);
}

/* ---------- Scrollbar for table ---------- */
.table-scroll::-webkit-scrollbar{ height: 8px; }
.table-scroll::-webkit-scrollbar-thumb{ background: var(--clay); border-radius: 999px; }

/* ---------- Back to top ---------- */
#backToTop{
  transition: opacity .25s ease, transform .25s ease;
}

/* ---------- Nutrition-style box ---------- */
.nutri-box{
  font-family: 'IBM Plex Mono', monospace;
  border: 2px solid var(--ink);
}
.nutri-box .row{
  border-top: 1px solid var(--line);
}
