/* CHAWY: พื้นครีม ตัวหนังสือน้ำตาลเข้ม ซุ้มโค้ง และเขียวไผ่เป็นสีเน้น */
:root {
  --cream: #FAF3E8;
  --cream-deep: #F5E6D3;
  --brown: #3B2A20;
  --brown-soft: #6B5647;
  --bamboo: #6F8237;
  --bamboo-dark: #4F6126;
  --sage: #DFE4BF;
  --rule: rgba(59, 42, 32, .28);
  --on-brown: #FAF3E8;
  --brown-fill: #7E6050; /* น้ำตาลอ่อนสำหรับปุ่ม ไอคอน และฟุตเตอร์ ตัวอักษรยังใช้ --brown */

  --font-display: Kanit, 'IBM Plex Sans Thai', sans-serif;
  --font-body: 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-script: 'Cormorant Garamond', Georgia, serif;

  --max: clamp(1200px, 90vw, 1760px);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  background: var(--cream);
  color: var(--brown);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--cream);
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--bamboo-dark); outline-offset: 3px; border-radius: 8px; }
/* จอคอม: กันทางเดินข้างเนื้อหาให้แมวมาสคอต จะได้เห็นเต็มตัวและไม่บังข้อความ */
@media (min-width: 1041px) {
  :root {
    --gutter-l: 112px;
    --gutter-r: 112px;
  }
}
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.icon { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* หัวเว็บ: โลโก้ซ้าย เมนูอยู่มุมขวา บนสุดเป็นลิงก์เรียง เลื่อนลงแล้วยุบเป็นปุ่มสามขีด */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin-inline: auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, var(--gutter-r)) 0 max(16px, var(--gutter-l));
  min-height: 58px;
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { font: 700 24px/1 var(--font-display); letter-spacing: .03em; }
.head-right { position: fixed; z-index: 60; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, calc((100vw - var(--max)) / 2 + var(--gutter-r))); height: 44px; display: flex; align-items: center; justify-content: flex-end; }
.menu-panel { display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; align-items: center; gap: 26px; font: 400 17px/1 var(--font-display); }
.site-nav a { padding: 10px 2px; border-bottom: 2px solid transparent; transition: border-color .2s, color .2s; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--bamboo); }
.lang-toggle { display: flex; align-items: center; gap: 8px; font: 500 15px/1 var(--font-display); letter-spacing: .08em; }
.lang-toggle i { font-style: normal; opacity: .4; }
.lang-toggle b { font-weight: 700; }
.lang-toggle a { padding: 8px 2px; color: var(--brown-soft); border-bottom: 1.5px solid transparent; transition: color .2s, border-color .2s; }
.lang-toggle a:hover, .lang-toggle a:focus-visible { color: var(--brown); border-bottom-color: var(--bamboo); }
.menu-btn { display: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brown-fill); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; box-shadow: 0 6px 18px rgba(59, 42, 32, .22); transition: transform .25s var(--ease), background-color .2s; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--on-brown); transition: transform .25s var(--ease), opacity .2s; }
.menu-btn:hover { background: #513B2D; }
.menu-btn:focus-visible { outline: 3px solid var(--bamboo-dark); outline-offset: 3px; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* ยุบเมนู: เลื่อนลงแล้ว หรือจอแคบ */
.is-scrolled .menu-btn { display: flex; }
.is-scrolled .menu-panel {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px;
  flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 18px 16px;
  background: var(--cream); border: 1px solid var(--rule); border-radius: 22px; box-shadow: 0 18px 40px rgba(59, 42, 32, .22);
}
.is-scrolled.menu-open .menu-panel { display: flex; }
.is-scrolled .site-nav { flex-direction: column; align-items: stretch; gap: 0; font-size: 19px; }
.is-scrolled .site-nav a { padding: 11px 4px; border-bottom: 1px solid var(--rule); }
.is-scrolled .lang-toggle { padding-top: 10px; justify-content: flex-start; }

/* ฮีโร่ */
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 37fr) minmax(0, 63fr); align-items: start; padding-block: 8px 0; }
.hero-copy { position: relative; z-index: 3; padding-top: 44px; min-height: 620px; }
.hero h1 { font-weight: 700; font-size: clamp(56px, 7.2vw, 92px); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
html[lang="en"] .hero h1 { font-size: clamp(46px, 5.4vw, 72px); }
.hero h1 .mark { position: relative; display: inline-block; }
.hero h1 .mark::after {
  content: "";
  position: absolute;
  left: 42%;
  right: 2%;
  bottom: -2px;
  height: 7px;
  border-radius: 99px;
  background: var(--bamboo);
  transform: rotate(-2deg);
}
.shake-lines { position: absolute; left: 300px; top: 18px; width: 52px; height: 44px; fill: none; stroke: var(--bamboo); stroke-width: 4; stroke-linecap: round; }
.tagline { font: italic 500 30px/1.2 var(--font-script); margin-top: 18px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin-top: 24px;
  padding: 0 26px 0 34px;
  border-radius: 999px;
  background: var(--brown-fill);
  color: var(--on-brown);
  font: 400 21px var(--font-display);
  transition: transform .3s var(--ease), background-color .2s;
}
.cta:hover { background: #513B2D; transform: translateY(-2px); }
.cta:active { transform: scale(.98); }
.cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mascot { position: absolute; left: var(--gutter-l); bottom: 0; width: 320px; height: auto; z-index: 2; }
.cube { position: absolute; left: calc(var(--gutter-l) + 302px); bottom: 170px; width: 40px; height: 40px; z-index: 3; }
.arch {
  position: relative;
  margin-left: -28px;
  aspect-ratio: 1 / .85;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  background: #F4D9B7;
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }

/* หัวข้อแบบมีเส้น */
.rule-title { display: flex; align-items: center; gap: 28px; font-weight: 600; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.3; text-align: center; }
.rule-title::before, .rule-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* หมวดหมู่ */
.categories { padding-block: 44px 64px; }
.cat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 32px; padding: 4px; list-style: none; }
.cat { display: block; text-align: center; }
.cat-pic {
  position: relative;
  display: block;
  aspect-ratio: 1 / .96;
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
  background: var(--cream-deep);
}
.cat-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.cat:hover .cat-pic img { transform: scale(1.04); }
.cat b { display: block; margin-top: 14px; font: 500 21px/1.3 var(--font-display); }
.cat-note { display: block; margin-top: 2px; color: var(--brown-soft); font-size: 14px; }
.soon { display: inline-block; margin-top: 4px; padding: 0 12px; border-radius: 99px; background: var(--sage); color: var(--bamboo-dark); font: 500 13px/1.7 var(--font-display); }

/* ทรายแมว + คอลเลกชัน */
.showcase { padding-block: 16px 40px; }
.showcase .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.litter-col { position: relative; padding-top: 44px; display: flex; }
.peek { position: absolute; right: 34px; top: calc(44px - 92px); z-index: 3; width: 140px; height: 92px; pointer-events: none; }
.peek-head { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.peek-paw { position: absolute; top: 62px; width: 38px; height: auto; }
.peek-paw.left { left: -6px; transform: scaleX(-1) rotate(-4deg); }
.peek-paw.right { right: -6px; transform: rotate(-4deg); }
.litter {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 54%) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 24px 32px 0 28px;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(115deg, #CBD49F 0%, var(--sage) 46%, #E6E8CB 100%);
}
.litter .leaves { position: absolute; left: -24px; top: -20px; width: 250px; height: 300px; fill: #5D7238; opacity: .28; filter: blur(2px); }
.litter-bag { position: relative; align-self: end; width: 100%; height: auto; max-width: 340px; margin-inline: auto; filter: drop-shadow(0 14px 18px rgba(59, 42, 32, .28)); }
.litter-text { position: relative; padding-bottom: 24px; }
.litter-text .soon { margin: 0 0 10px; background: var(--brown-fill); color: var(--on-brown); }
.litter h2 { font-weight: 600; font-size: clamp(28px, 2.7vw, 34px); line-height: 1.3; }
.litter h2::after { content: ""; display: block; width: 62px; height: 4px; margin-top: 14px; border-radius: 9px; background: var(--bamboo); }
.litter p { margin-top: 14px; font-size: 18px; line-height: 1.6; }
.arrow-dot { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bamboo); color: var(--on-brown); }
.arrow-dot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }


/* รู้จัก CHAWY */
.about { padding-block: 8px 72px; }

/* ท้ายเว็บ */
.site-foot { background: var(--brown-fill); color: var(--on-brown); padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.site-foot .wrap { display: flex; align-items: center; gap: 24px; }
.site-foot .wrap::before, .site-foot .wrap::after { content: ""; flex: 1; height: 1px; background: rgba(250, 243, 232, .35); }
.foot-brand { display: flex; align-items: center; gap: 8px; font: 600 19px var(--font-display); letter-spacing: .03em; }
.foot-brand img { width: 34px; height: 34px; object-fit: cover; object-position: 50% 36%; filter: invert(1); mix-blend-mode: screen; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media (max-width: 1100px) {
  .hero-copy { min-height: 540px; }
  .mascot { width: 250px; }
  .cube { left: calc(var(--gutter-l) + 232px); bottom: 134px; width: 32px; height: 32px; }
  .shake-lines { left: 232px; }
  .tagline { font-size: 25px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand img { width: 38px; height: 38px; }
  .head-right { right: max(16px, var(--gutter-r)); }
  .menu-btn { display: flex; }
  .menu-panel {
    display: none; position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px;
    flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 18px 16px;
    background: var(--cream); border: 1px solid var(--rule); border-radius: 22px; box-shadow: 0 18px 40px rgba(59, 42, 32, .22);
  }
  .menu-open .menu-panel { display: flex; }
  .site-nav { flex-direction: column; align-items: stretch; gap: 0; font-size: 19px; }
  .site-nav a { padding: 11px 4px; border-bottom: 1px solid var(--rule); }
  .lang-toggle { padding-top: 10px; justify-content: flex-start; }
  .brand span { font-size: 21px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { min-height: 0; padding-top: 16px; }
  .hero h1 { font-size: clamp(54px, 16vw, 72px); }
  html[lang="en"] .hero h1 { font-size: clamp(44px, 13vw, 60px); }
  .shake-lines { left: 226px; top: -8px; width: 40px; height: 34px; }
  .tagline { font-size: 21px; margin-top: 12px; }
  .cta { font-size: 19px; min-height: 50px; margin-top: 18px; }
  .arch { margin: 24px 0 0; }
  .mascot { left: auto; right: var(--gutter-r); top: 196px; bottom: auto; width: 118px; transform: scaleX(-1); }
  .cube { display: none; }
  .categories { padding-block: 36px 40px; }
  .rule-title { gap: 14px; }
  .cat-row {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gutter-l) * -1) calc(var(--gutter-r) * -1);
    padding: 4px var(--gutter-r) 8px var(--gutter-l);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-left: var(--gutter-l);
    scrollbar-width: none;
  }
  .cat-row::-webkit-scrollbar { display: none; }
  .cat-row li { flex: 0 0 132px; scroll-snap-align: start; }
  .cat b { font-size: 17px; margin-top: 10px; }
  .litter { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 0; }
  .litter-text { order: -1; padding-bottom: 0; }
  .litter-bag { max-width: 250px; }
  /* ตัวหนังสืออยู่ซ้าย จึงย้ายลายใบไม้ไปมุมขวาบนและทำให้จางลง ไม่ให้ทับตัวอักษร */
  .litter .leaves { left: auto; right: -56px; top: -28px; width: 200px; height: 240px; opacity: .2; transform: scaleX(-1); }
}
