@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800;900&family=Caveat:wght@500;600;700&display=swap");

/* ============================================================
   Peach & Co. — Shared design system (v2, brand-book aligned)
   Nunito (EN display) + Caveat (EN script emphasis) + Noto Sans Thai (TH)
   Pulled from reference style: ribbon shadow buttons, big stats,
   color cards, mood-meter, pill buttons.
   ============================================================ */

:root {
  /* Brand palette (per Brand Book §02) */
  --peach: #efa99c;
  --blush: #f5d5d3;
  --burgundy: #480920;
  --burgundy-deep: #2c0514;
  --orange: #ec934d;
  --tan: #e7be88;
  --mint: #ceefe6;
  --butter: #fbe891;
  --cream: #fbf1ed;
  --ink: #480920;
  /* translucent cream nav surface — nav.top's background */
  --nav-surface: rgba(251, 241, 237, 0.85);

  /* Type */
  --font-en: "Nunito", "Noto Sans Thai", system-ui, sans-serif;
  --font-th: "Noto Sans Thai", "Nunito", system-ui, sans-serif;
  --font-display: "Nunito", "Noto Sans Thai", system-ui, sans-serif;
  --font-script: "Caveat", "Nunito", cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* prevent grid/flex children from forcing the layout wider than the screen */
  min-width: 0;
}
html,
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-en);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  /* clip (not hidden) prevents horizontal scroll WITHOUT breaking position:sticky */
  overflow-x: clip;
}
/* long unbreakable words (esp. space-less Thai) should wrap, never overflow */
h1,
h2,
h3,
h4,
p,
.eyebrow,
.h-display,
.h-section,
.h-sub {
  overflow-wrap: break-word;
}
.th {
  font-family: var(--font-th);
  font-weight: 400;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .wrap {
    padding: 0 20px;
  }
}

/* ───── pill, eyebrow ───── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--burgundy);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--burgundy);
  opacity: 0.65;
}

/* ───── Headline system ───── */
.h-display {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: clamp(38px, 8.5vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--burgundy);
}
.h-section {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: clamp(30px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--burgundy);
}
.h-sub {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--burgundy);
}
/* Caveat emphasis word — playful brand voice. Caveat has no Thai glyphs
   (its own fallback stack is Latin-only too), so this only applies to
   English/Latin accent words. */
.h-display em,
.h-section em,
.h-sub em {
  font-family: var(--font-script);
  font-style: normal;
  font-weight: 700;
  color: var(--peach);
  letter-spacing: 0;
  line-height: 1;
}
/* Thai accent word — mark with class="th" and it reads as normal burgundy
   text in the real Thai font instead, matching the surrounding heading's
   own weight/spacing/line-height (inherit) rather than the script/peach
   treatment above, which silently falls through to a mismatched fallback
   font for Thai script and never renders "on-brand" like it does for English. */
.h-display em.th,
.h-section em.th,
.h-sub em.th {
  font-family: var(--font-th);
  font-style: normal;
  font-weight: inherit;
  color: var(--burgundy);
  letter-spacing: inherit;
  line-height: inherit;
}
/* Ribbon highlight inside headlines */
.ribbon {
  display: inline-block;
  background: var(--peach);
  padding: 0 18px;
  border-radius: 14px;
  color: var(--burgundy);
  transform: rotate(-2deg);
}

/* ───── Buttons (shadow-shift) ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 32px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s,
    color 0.18s;
}
.btn.primary {
  background: var(--burgundy);
  color: var(--cream);
  box-shadow: 0 8px 0 0 var(--burgundy-deep);
}
.btn.primary:hover {
  transform: translateY(2px);
  box-shadow: 0 6px 0 0 var(--burgundy-deep);
}
.btn.ghost {
  background: transparent;
  color: var(--burgundy);
  border: 2px solid var(--burgundy);
}
.btn.ghost:hover {
  background: var(--burgundy);
  color: var(--cream);
}
.btn.peach {
  background: var(--peach);
  color: var(--burgundy);
  box-shadow: 0 8px 0 0 #c8867a;
}
.btn.peach:hover {
  transform: translateY(2px);
  box-shadow: 0 6px 0 0 #c8867a;
}
.btn.small {
  padding: 13px 22px;
  font-size: 14px;
}

/* ───── NAV ───── */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-surface);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(72, 9, 32, 0.08);
}
nav.top .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  max-width: 1280px;
  margin: 0 auto;
  gap: 18px;
}
@media (max-width: 640px) {
  nav.top .row {
    padding: 12px 20px;
  }
}
nav.top .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  /* small pad — the logo PNG now carries its own transparent top/bottom margin */
  padding: 3px 0;
}
nav.top .logo img {
  height: 24px;
  width: auto;
  max-width: none;
  display: block;
}
/* menu wrapper: transparent on desktop so ul + right lay out in the bar */
nav.top .menu {
  display: contents;
}
nav.top ul {
  display: flex;
  gap: 34px;
  list-style: none;
  font-weight: 700;
  font-size: 15px;
}
nav.top ul a {
  position: relative;
  transition: color 0.15s;
}
nav.top ul a:hover,
nav.top ul a[aria-current="page"] {
  color: var(--peach);
}
nav.top .right {
  display: flex;
  align-items: center;
  gap: 14px;
}
nav.top .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav.top .btn {
  white-space: nowrap;
}
/* hamburger — hidden on desktop */
nav.top .burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  flex-shrink: 0;
}
nav.top .burger span {
  display: block;
  height: 2.5px;
  width: 100%;
  border-radius: 2px;
  background: var(--burgundy);
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}
nav.top.open .burger span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
nav.top.open .burger span:nth-child(2) {
  opacity: 0;
}
nav.top.open .burger span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}
/* blurred backdrop behind the mobile drawer — hidden on desktop.
   Lives OUTSIDE nav (sibling) with z-index below the nav bar, so it blurs
   the page content only — the nav bar keeps its original colour. */
.nav-backdrop {
  display: none;
}

@media (max-width: 980px) {
  nav.top .burger {
    display: flex;
  }
  /* full-screen frosted blur sitting BEHIND the nav (z 40 < nav z 50).
     Light blush tint (on-brand) — focuses the menu via blur, not darkness. */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(245, 213, 211, 0.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    backdrop-filter: blur(10px) saturate(1.1);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }
  nav.top.open ~ .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }
  /* keep the bar its original cream when the drawer is open (no dark show-through) */
  nav.top.open {
    background: var(--cream);
  }
  /* drawer: slides down from the top bar + fades in */
  nav.top .menu {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px 20px 24px;
    background: var(--cream);
    border-bottom: 1px solid rgba(72, 9, 32, 0.1);
    box-shadow: 0 24px 32px -24px rgba(72, 9, 32, 0.4);
    transform: translateY(-18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.32s cubic-bezier(0.34, 1.28, 0.5, 1),
      opacity 0.26s ease,
      visibility 0.32s ease;
  }
  nav.top.open .menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  nav.top ul {
    flex-direction: column;
    gap: 2px;
  }
  nav.top ul a {
    display: block;
    padding: 14px 4px;
    font-size: 17px;
    border-bottom: 1px solid rgba(72, 9, 32, 0.08);
  }
}
@media (max-width: 640px) {
  nav.top .logo img {
    height: 24px;
  }
}

/* ───── .btn.nav-compact — special nav-only button variant ─────
   A dedicated compact CTA for nav.top specifically: on mobile (≤640px) the
   full-text hard-shadow CTA collided with the logo/hamburger (Fitts's Law —
   touch targets crowding each other) and the chunky "pressable" shadow felt
   too heavy for the tight nav bar. An icon-only circle was tried first and
   looked bad in practice — the label reads better than a bare icon here. So
   at ≤640px this variant: drops the brand icon + external-link icon (keeps
   the label only), goes flat (no hard-shadow — deliberately breaks from
   .btn.primary's pressable signature, which only reads well at full button
   size), shrinks padding, and swaps fill/text colour on hover instead of the
   press-down animation (there's no shadow left to compress). Desktop/tablet
   render it as a normal .btn.primary.small — nothing changes above 640px.
   Reserved for nav.top's CTA only — never use it as a general button style. */
@media (max-width: 640px) {
  .btn.nav-compact {
    padding: 8px 14px;
    box-shadow: none;
  }
  .btn.nav-compact:hover {
    transform: none;
    background: var(--peach);
    color: var(--burgundy);
    box-shadow: none;
  }
  .btn.nav-compact .brand-icon,
  .btn.nav-compact .ext {
    display: none;
  }
}

/* ───── Marquee ───── */
.marquee {
  background: var(--burgundy);
  color: var(--cream);
  overflow: hidden;
  padding: 18px 0;
}
.marquee .track {
  display: flex;
  gap: 48px;
  width: max-content;
  white-space: nowrap;
  animation: slide 38s linear infinite;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.marquee .track span {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  /* never let the global min-width:0 reset shrink the marquee copies */
  flex-shrink: 0;
}
.marquee .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--peach);
  display: inline-block;
}
@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ───── Breadcrumb ───── */
.crumbs {
  padding: 22px 0 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: capitalize;
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(72, 9, 32, 0.62);
}
.crumbs a:hover {
  color: var(--peach);
}
.crumbs .sep {
  opacity: 0.4;
}
.crumbs .current {
  color: var(--peach);
}

/* Mobile (≤640px): a single labeled "‹ Back to [parent]" link, not the full
   trail. This site's hierarchy is always shallow (2-3 levels), so the trail's
   only real job on a phone is "let me go back one level" — showing the whole
   Home › Section › Current chain (or truncating it) is more than that job
   needs. A single link beats a collapsed trail two ways: it's one bigger tap
   target (Fitts's Law) instead of several small crumb links crowded together,
   and it names the destination instead of a mute "…" (recognition over
   recall — Nielsen #6). JS (see BaseLayout.astro) hides the real trail and
   injects `.crumb-back` pointing at the last real `<a>` in the breadcrumb
   (the immediate parent — Home itself when the trail is only 2 levels deep). */
@media (max-width: 640px) {
  .crumbs a,
  .crumbs .sep,
  .crumbs .current {
    display: none;
  }
  .crumbs .crumb-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    color: rgba(72, 9, 32, 0.62);
  }
  .crumbs .crumb-back:hover {
    color: var(--peach);
  }
  .crumbs .crumb-back svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
}

/* ───── Section spacing helpers ───── */
.section {
  padding: 120px 0;
}
@media (max-width: 820px) {
  .section {
    padding: 80px 0;
  }
}

/* ───── Color section cards (4-up grid w/ rotating brand colors) ───── */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 980px) {
  .color-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .color-grid {
    grid-template-columns: 1fr;
  }
}
.color-card {
  border-radius: 32px;
  padding: 30px 28px;
  min-height: 240px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--burgundy);
  border: 1.5px solid rgba(72, 9, 32, 0.06);
}
.color-card:nth-child(4n + 1) {
  background: var(--blush);
}
.color-card:nth-child(4n + 2) {
  background: var(--mint);
}
.color-card:nth-child(4n + 3) {
  background: var(--butter);
}
.color-card:nth-child(4n + 4) {
  background: var(--tan);
}
.color-card .num {
  font-family: var(--font-script);
  font-size: 54px;
  font-weight: 700;
  line-height: 0.8;
  color: var(--burgundy);
}
.color-card h3 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-top: auto;
  line-height: 1.2;
}
.color-card .thai {
  font-size: 14px;
  line-height: 1.6;
  color: var(--burgundy);
  opacity: 0.78;
  margin-top: 10px;
}
.color-card .label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 20px;
  opacity: 0.6;
}
.color-card .blob {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  bottom: -10px;
  right: -40px;
  pointer-events: none;
}

/* ───── Mood meter (used on Home + About area) ───── */
.meter {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 32px;
  padding: 40px 36px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.meter h4 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--peach);
  margin-bottom: 24px;
}
.meter .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.meter .row:last-child {
  border-bottom: none;
}
.meter .lbl {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cream);
  flex-shrink: 0;
  min-width: 120px;
}
.meter .bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}
.meter .bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  animation: fill 1.4s cubic-bezier(0.3, 0.6, 0.3, 1) 0.2s both;
}
.meter .row:nth-child(2) .bar i {
  --w: 90%;
  background: var(--peach);
}
.meter .row:nth-child(3) .bar i {
  --w: 70%;
  background: var(--butter);
}
.meter .row:nth-child(4) .bar i {
  --w: 100%;
  background: var(--mint);
}
.meter .pct {
  font-family: var(--font-script);
  font-size: 46px;
  color: var(--peach);
  font-weight: 700;
  line-height: 1;
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .meter {
    padding: 28px 24px;
  }
  .meter .row {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 16px 0;
  }
  .meter .lbl {
    order: 1;
    font-size: 22px;
    min-width: 0;
  }
  .meter .pct {
    order: 2;
    font-size: 26px;
    min-width: 0;
    margin-left: auto;
  }
  .meter .bar {
    order: 3;
    flex: 1 1 100%;
    height: 12px;
  }
}
@keyframes fill {
  from {
    width: 0;
  }
  to {
    width: var(--w);
  }
}

/* ───── Footer (shared) ───── */
footer {
  background: var(--burgundy);
  padding: 80px 0 40px;
  color: var(--cream);
}
footer .top-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(253, 245, 238, 0.12);
  margin-bottom: 32px;
}
@media (max-width: 980px) {
  footer .top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 24px;
  }
}
@media (max-width: 640px) {
  footer {
    padding: 56px 0 28px;
  }
  footer .top-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 36px;
  }
  footer .brand p,
  footer .brand .tagline-th {
    max-width: 100%;
  }
  footer .legal {
    justify-content: flex-start;
    text-align: left;
  }
}
footer h5 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--peach);
}
footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
}
footer ul a {
  color: rgba(253, 245, 238, 0.82);
  transition: color 0.2s;
}
footer ul a:hover {
  color: var(--peach);
}
footer .brand h3 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cream);
}
footer .brand p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(253, 245, 238, 0.8);
  margin-top: 14px;
  max-width: 320px;
}
footer .brand .tagline-th {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--cream);
  opacity: 0.92;
  margin-top: 10px;
  max-width: 320px;
}
/* contact / follow column */
footer .foot-contact .follow {
  margin-top: 26px;
}
footer .contact-list a {
  display: flex;
  align-items: center;
  gap: 10px;
}
footer .contact-list .ci {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--cream);
}
footer .contact-list .ci svg {
  width: 17px;
  height: 17px;
}
footer .social {
  display: flex;
  gap: 10px;
}
footer .social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(253, 245, 238, 0.22);
  color: var(--cream);
  display: grid;
  place-items: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
footer .social a svg {
  width: 18px;
  height: 18px;
}
footer .social a:hover {
  background: var(--peach);
  border-color: var(--peach);
  color: var(--burgundy);
}
footer .legal {
  display: flex;
  align-items: center;
  padding-top: 32px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(253, 245, 238, 0.6);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 16px;
}

/* ───── Mobile: shrink + push hero decorations off-screen ─────
   On small screens the big top-right peach/butter/tan vector dominated
   the header — scale it down and nudge it further out. `section.x` raises
   specificity so this wins over each page's base rule regardless of order. */
@media (max-width: 640px) {
  section.hero::before,
  section.about-hero::before,
  section.shop-hero::before,
  section.learn-hero::before,
  section.help-hero::before {
    width: 230px;
    height: 230px;
    top: -118px;
    right: -110px;
  }
  section.hero::after,
  section.about-hero::after,
  section.shop-hero::after,
  section.learn-hero::after,
  section.help-hero::after {
    width: 160px;
    height: 160px;
    bottom: -90px;
    left: -90px;
  }
}

/* ───── Mobile: also tame the in-page section peach vectors ─────
   These decorative blobs (products/about/related/help-cta/contact, etc.)
   were 240–520px — far too dominant on a phone. Shrink them so they read
   as a subtle accent behind the content, not a scene-stealer. */
@media (max-width: 640px) {
  section.products::before,
  section.about::before,
  section.branches::before,
  section.contact-section::before,
  section.coming::before,
  section.help-cta::before,
  section.related::before,
  section.art-related::before {
    width: 240px;
    height: 240px;
    top: -140px;
  }
  section.products::after,
  section.about::after,
  section.contact-section::after,
  section.help-cta::after {
    width: 180px;
    height: 180px;
    bottom: -100px;
  }
}
