/* ============================================================
   PACIFIC AGRO CHEMICAL — "ซองฟอยล์" / The Foil Panel
   Direction contract lives in DESIGN.md (seed 543f6d9f, direction 4/7)
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --pac-green:       #0B7A45;
  --pac-green-deep:  #065C33;
  --pac-leaf:        #15A05C;
  --pac-gold:        #F2B705;
  --pac-gold-light:  #FFD75E;
  --pac-ink:         #16281E;
  --pac-cream:       #FBF8F0;
  --pac-line:        #06C755;

  --foil-jinin: #E8A317;
  --foil-jumbo: #D6246E;
  --foil-bic:   #C9A227;

  /* Metallic foils. Every stop is contrast-clamped against the ink that
     sits on it, so text can ride the foil directly and still clear 4.5:1
     at the WORST stop — measured, not eyeballed:
       brand / pink  carry white ink -> lightest stop capped
       gold  / champ carry --pac-ink -> darkest stop capped
     Widen these ranges and the sunlight legibility promise breaks. */
  --foil-brand: linear-gradient(105deg, #044C2A 0%, #0A7040 26%, #0C8048 46%, #0A7040 66%, #065C33 86%, #044C2A 100%);
  --foil-gold:  linear-gradient(105deg, #C98A0A 0%, #F2B705 20%, #FFE7A0 38%, #E8A317 58%, #CE8F0C 78%, #F2B705 100%);
  --foil-pink:  linear-gradient(105deg, #96155A 0%, #C41F66 22%, #D6246E 40%, #C41F66 60%, #A81A5F 80%, #D6246E 100%);
  --foil-champ: linear-gradient(105deg, #B4901F 0%, #C9A227 22%, #F0DFA0 40%, #C9A227 60%, #BE9821 80%, #D9B846 100%);

  --seal-dark: rgba(0, 0, 0, .30);

  --step: clamp(1rem, 0.6rem + 1.4vw, 1.6rem);
  --gutter: clamp(1.15rem, 0.4rem + 3vw, 3.5rem);
  --measure: 68ch;

  --shadow-lift: 0 10px 26px -8px rgba(6, 40, 24, .38);
  --shadow-plate: 0 4px 14px -4px rgba(6, 40, 24, .28);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--pac-cream);
  color: var(--pac-ink);
  font-family: "Sarabun", system-ui, -apple-system, sans-serif;
  /* body floor: 17px mobile / 18px desktop — sunlight, 50+ readers */
  font-size: clamp(1.0625rem, 1rem + 0.28vw, 1.125rem);
  line-height: 1.72;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.18;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; max-width: var(--measure); }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--pac-ink);
  outline-offset: 3px;
  border-radius: 2px;
}
.foil :focus-visible, .panel--dark :focus-visible { outline-color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--pac-ink); color: #fff; padding: .9rem 1.4rem; font-weight: 700;
}
.skip:focus { left: .5rem; top: .5rem; }

/* anchor targets must clear the sticky header */
section[id], div[id] { scroll-margin-top: clamp(74px, 8vw, 92px); }

.wrap { width: min(1180px, 100% - var(--gutter) * 2); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   SIGNATURE 1 — the crimped seal edge
   Foil sachets are sealed with fine parallel ridges, not a zigzag.
   ============================================================ */
.crimp {
  height: clamp(14px, 2.4vw, 22px);
  background-image: repeating-linear-gradient(
    90deg,
    var(--seal-dark) 0 2px,
    transparent 2px 3px,
    rgba(255,255,255,.22) 3px 4px,
    transparent 4px 7px
  );
  background-color: inherit;
  flex: none;
}
.crimp--onfoil { background-color: transparent; }

/* ============================================================
   SIGNATURE 2 — tear notches
   ============================================================ */
.notch {
  position: absolute; top: 0; width: 22px; height: 13px;
  background: var(--pac-cream);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 3;
}
.notch--l { left: clamp(14px, 5vw, 56px); }
.notch--r { right: clamp(14px, 5vw, 56px); }

/* ============================================================
   panels
   ============================================================ */
.panel { position: relative; display: flex; flex-direction: column; }
.panel__body { padding-block: clamp(2.6rem, 1.2rem + 5vw, 5.5rem); }

.foil { color: #fff; }
.foil--brand { background-image: var(--foil-brand); background-color: var(--pac-green); }
.foil--gold  { background-image: var(--foil-gold);  background-color: var(--foil-jinin); color: var(--pac-ink); }
.foil--pink  { background-image: var(--foil-pink);  background-color: var(--foil-jumbo); }
.foil--champ { background-image: var(--foil-champ); background-color: var(--foil-bic); color: var(--pac-ink); }

.panel--dark { background: var(--pac-green-deep); color: #fff; }
.panel--cream { background: var(--pac-cream); }
.panel--white { background: #fff; }

/* ============================================================
   SIGNATURE 3 — the flat plate.
   HARD RULE (DESIGN.md): no body text sits on travelling foil.
   ============================================================ */
.plate {
  background: var(--pac-cream);
  color: var(--pac-ink);
  padding: clamp(1.4rem, .8rem + 2.4vw, 2.6rem);
  box-shadow: var(--shadow-plate);
}
.plate--white { background: #fff; }
.plate--ink { background: var(--pac-ink); color: #fff; }
.plate--tight { padding: clamp(1.1rem, .7rem + 1.6vw, 1.7rem); }

/* ============================================================
   display lettering — outlined caps with a hard offset shadow,
   lifted from the sachet titles
   ============================================================ */
.sachet-type {
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-shadow:
    3px 3px 0 var(--st-shadow, rgba(6, 40, 24, .55)),
    5px 5px 0 var(--st-shadow2, rgba(6, 40, 24, .22));
  -webkit-text-stroke: 1px var(--st-stroke, transparent);
  paint-order: stroke fill;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--pac-green-deep);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.site-header__in {
  display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.2rem);
  padding-block: .6rem;
}
.brandmark { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; min-width: 0; padding-block: .35rem; }
.brandmark img { width: clamp(38px, 8vw, 50px); height: auto; flex: none; }
.brandmark b {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: clamp(.95rem, .78rem + .7vw, 1.22rem); line-height: 1.15; display: block;
}
.brandmark span {
  display: block; font-size: .74rem; letter-spacing: .09em;
  color: var(--pac-gold-light); font-weight: 600;
}
.site-header nav { margin-left: auto; display: none; gap: clamp(.8rem, 1.6vw, 1.7rem); }
.site-header nav a { text-decoration: none; font-weight: 600; padding: .5rem .1rem; }
.site-header nav a:hover { color: var(--pac-gold-light); }
@media (min-width: 900px) { .site-header nav { display: flex; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 54px;                 /* ≥48px tap target, gloved/wet hands */
  padding: .85rem 1.7rem;
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 700; font-size: 1.075rem;
  text-decoration: none; border: 0; cursor: pointer;
  border-radius: 3px;
  transition: transform .16s cubic-bezier(.2,.8,.3,1), box-shadow .16s ease, background-color .16s ease;
  box-shadow: 0 4px 0 rgba(0,0,0,.28), var(--shadow-lift);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.28), var(--shadow-lift); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.btn--line { background: var(--pac-line); color: #06331a; }
.btn--call { background: var(--pac-ink); color: #fff; }
.btn--gold { background: var(--pac-gold); color: var(--pac-ink); }
.btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn--ghost:hover { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 2px currentColor; }
.btn--block { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ---------- hero ---------- */
.hero__body { padding-block: clamp(2.8rem, 1rem + 8vw, 6.5rem); }
.hero__grid { display: grid; gap: clamp(1.8rem, 4vw, 3.4rem); align-items: center; }
@media (min-width: 940px) { .hero__grid { grid-template-columns: 1.15fr .85fr; } }

.hero__kicker {
  display: inline-block;
  background: var(--pac-gold); color: var(--pac-ink);
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: clamp(.9rem, .84rem + .3vw, 1.02rem);
  padding: .4rem 1rem; margin-bottom: 1.3rem;
  box-shadow: 3px 3px 0 rgba(6,40,24,.5);
}
.hero h1 {
  font-size: clamp(2.7rem, 1.4rem + 7.4vw, 5.9rem);
  color: #fff;
  --st-shadow: rgba(3, 30, 17, .72);
  --st-shadow2: rgba(3, 30, 17, .3);
  margin-bottom: .55em;
}
.hero h1 em { font-style: normal; color: var(--pac-gold-light); display: block; }
.hero__lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); font-weight: 500; max-width: 34ch; }

.hero__emblem { width: clamp(84px, 18vw, 128px); margin-bottom: 1.4rem; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }

/* hero side: the three foils as physical chips */
.foilstack { display: grid; gap: .75rem; }
.foilchip {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .95rem 1.15rem;
  text-decoration: none; color: var(--pac-ink);
  box-shadow: var(--shadow-lift);
  border-radius: 3px;
  transition: transform .18s cubic-bezier(.2,.8,.3,1);
}
.foilchip:hover { transform: translateX(6px); }
@media (prefers-reduced-motion: reduce) { .foilchip { transition: none; } .foilchip:hover { transform: none; } }
.foilchip--gold  { background-image: var(--foil-gold); }
.foilchip--pink  { background-image: var(--foil-pink); color: #fff; }
.foilchip--champ { background-image: var(--foil-champ); }
.foilchip__step {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: 1.5rem; width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  background: rgba(0,0,0,.72); color: #fff; border-radius: 50%;
  flex: none;
}
.foilchip__name {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.42rem); line-height: 1.15;
  display: block;
  text-shadow: 2px 2px 0 rgba(255,255,255,.4);
}
.foilchip--pink .foilchip__name { text-shadow: 2px 2px 0 rgba(0,0,0,.35); }
.foilchip__job { display: block; font-size: .96rem; font-weight: 600; }
.foilchip__arrow { font-size: 1.5rem; font-weight: 700; }

/* ---------- section heads ---------- */
.sec-head { margin-bottom: clamp(1.6rem, 1rem + 2vw, 2.8rem); }
.sec-head h2 { font-size: clamp(1.8rem, 1.15rem + 2.7vw, 3.1rem); margin-bottom: .45em; }
.sec-head p { font-size: 1.08rem; }

/* ---------- SIGNATURE 4 — bullet dots, as printed on the packs ---------- */
.dots { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.dots li { display: grid; grid-template-columns: auto 1fr; gap: .85rem; align-items: start; }
.dots li::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  background: var(--dot, var(--pac-leaf)); margin-top: .55em;
  box-shadow: 0 0 0 3px rgba(255,255,255,.55);
}

/* ---------- SIGNATURE 5 — the rate bar ---------- */
.ratebar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem;
  background: var(--pac-ink); color: #fff;
  padding: 1.05rem clamp(1rem, .6rem + 1.6vw, 1.7rem);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-plate);
}
.ratebar__label {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: 1.02rem; color: var(--pac-gold-light); letter-spacing: .01em;
  flex: none;
}
.ratebar__value {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.35rem); line-height: 1.1;
}
.ratebar__value b { color: var(--pac-gold); font-weight: 700; }

/* ---------- SIGNATURE 6 — timing rail ---------- */
.rail { display: grid; gap: 1rem; }
@media (min-width: 820px) { .rail { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; } }
.rail__item { position: relative; display: flex; flex-direction: column; }
.rail__stage {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: .95rem; letter-spacing: .04em;
  background: var(--pac-ink); color: #fff;
  padding: .5rem 1rem; align-self: start;
}
.rail__foil { padding: 1.5rem 1.35rem 1.7rem; flex: 1; }
.rail__foil h3 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  margin-bottom: .35em;
  text-shadow: 2px 2px 0 rgba(255,255,255,.42);
}
.rail__foil--pink h3 { text-shadow: 2px 2px 0 rgba(0,0,0,.32); }
.rail__foil .en {
  display: block; font-size: .92rem; font-weight: 700; letter-spacing: .1em;
  opacity: .8; margin-bottom: .9rem;
}
.rail__when { font-weight: 600; font-size: 1.02rem; margin: 0; }

/* ---------- problem strip ---------- */
.fears { display: grid; gap: 1.1rem; }
@media (min-width: 780px) { .fears { grid-template-columns: repeat(3, 1fr); } }
.fear { border-top: 5px solid var(--pac-gold); padding-top: 1.1rem; }
.fear h3 { font-size: 1.3rem; margin-bottom: .4em; }
.fear p { font-size: 1.02rem; margin: 0; }

/* ---------- product blocks ---------- */
.prod__grid { display: grid; gap: clamp(1.6rem, 1rem + 3vw, 3.2rem); align-items: start; }
@media (min-width: 900px) { .prod__grid { grid-template-columns: .92fr 1.08fr; } }
.prod__shot {
  background: rgba(255,255,255,.9);
  padding: clamp(.9rem, .5rem + 1.4vw, 1.5rem);
  box-shadow: var(--shadow-lift);
}
.prod__shot img { width: 100%; }
.prod h2 {
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem);
  margin-bottom: .1em;
}
.prod .en {
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700;
  font-size: clamp(1rem, .9rem + .5vw, 1.25rem); letter-spacing: .14em;
  display: block; margin-bottom: 1.2rem;
}
.prod__type {
  font-weight: 600; font-size: 1.04rem;
  padding: .6rem 0 1.1rem;
}
.specs { width: 100%; border-collapse: collapse; margin: 1.4rem 0 0; font-size: 1rem; }
.specs th, .specs td { text-align: start; padding: .72rem .6rem; border-bottom: 1px solid rgba(22,40,30,.18); vertical-align: top; }
.specs th { font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700; width: 38%; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* ---------- SIGNATURE 7 — statutory plate ---------- */
.statutory {
  text-align: center;
  background: #fff;
  border: 2px solid rgba(22,40,30,.24);
  padding: 1.15rem clamp(1rem, .6rem + 1.6vw, 2rem);
  margin-top: 1.6rem;
  font-size: .96rem;            /* ≥15px floor */
  line-height: 1.62;
  color: #4a2545;
  font-weight: 500;
}
.statutory p { max-width: none; margin: 0; }
.statutory strong { display: block; font-family: "IBM Plex Sans Thai", sans-serif; color: var(--pac-ink); margin-bottom: .3rem; }

/* ---------- dealer / contact ---------- */
.cols { display: grid; gap: clamp(1.4rem, 1rem + 2.6vw, 3rem); }
@media (min-width: 860px) { .cols--2 { grid-template-columns: 1fr 1fr; } }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
/* standalone links get a real tap target — readers here are 50+, one-handed, outdoors */
.contact-list a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px;
  display: inline-flex; align-items: center; min-height: 44px; }
.contact-list dt { font-weight: 700; font-family: "IBM Plex Sans Thai", sans-serif; }

.benefit { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.benefit li { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; font-size: 1.05rem; }
.benefit li::before {
  content: "✓"; font-weight: 700; font-size: 1.15rem;
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  background: var(--pac-gold); color: var(--pac-ink); border-radius: 50%; flex: none;
}

/* ---------- footer ---------- */
.site-footer { background: var(--pac-green-deep); color: #fff; }
.site-footer a { color: var(--pac-gold-light); }
.site-footer__in { padding-block: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); }
.site-footer__grid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .site-footer__grid { grid-template-columns: 1.2fr 1fr 1fr; } }
.site-footer h3 { font-size: 1.12rem; margin-bottom: .8rem; color: var(--pac-gold-light); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer p, .site-footer li { font-size: 1rem; }
.legal { border-top: 1px solid rgba(255,255,255,.22); margin-top: 2.2rem; padding-top: 1.3rem; font-size: .92rem; opacity: .85; }

/* ---------- sticky mobile action bar ---------- */
.actionbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--pac-ink);
  box-shadow: 0 -6px 20px -6px rgba(0,0,0,.45);
  padding-bottom: env(safe-area-inset-bottom);
}
.actionbar a {
  min-height: 60px; display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: "IBM Plex Sans Thai", sans-serif; font-weight: 700; font-size: 1.08rem;
  text-decoration: none;
}
.actionbar a:first-child { background: var(--pac-line); color: #06331a; }
.actionbar a:last-child { background: var(--pac-gold); color: var(--pac-ink); }
@media (min-width: 900px) { .actionbar { display: none; } }
@media (max-width: 899px) { body { padding-bottom: 60px; } }

/* ============================================================
   MOTION — one authored moment: a product sachet tears open.
   Scoped to the three product panels only, where the gesture means
   something. Deliberately cheap: clip-path + opacity, no blur and no
   filter — the audience is on budget Android handsets in a field.
   The start state still shows the top third, so a stalled scroll
   timeline degrades to "slightly cropped", never to "blank".
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .tear {
    animation: tear-open linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
    will-change: clip-path;
  }
  @keyframes tear-open {
    from { clip-path: inset(0 0 68% 0); opacity: .45; }
    to   { clip-path: inset(0 0 0 0);   opacity: 1; }
  }
}
