/* =========================================================
   XIANGWAN · XIANGWAN Cat Litter
   Design System — Luxury Heritage / Editorial
   ========================================================= */

:root {
  /* Core palette — deep sage-ink, plant whites, jade greens */
  --ink:        #0E1E15;
  --charcoal:   #13291D;
  --charcoal-2: #1B3627;
  --paper:      #F1F6EC;
  --paper-2:    #E1EBD9;
  --offwhite:   #F7FBF3;
  --line:       rgba(224,238,214,0.14);
  --line-dark:  rgba(16,38,27,0.12);

  /* Accent — plant / sage palette */
  --accent:     #5C9E67;
  --accent-2:   #97BF8B;
  --jade:       #2F6E48;
  --jade-2:     #4C8A5C;
  --forest:     #1C4030;
  --cinnabar:   #A94E3A;

  /* Text */
  --t-light:    #EDF4EA;
  --t-dim:      rgba(237,244,234,0.66);
  --t-faint:    rgba(237,244,234,0.42);
  --t-dark:     #14281C;
  --t-dark-dim: rgba(20,40,28,0.62);

  /* Type */
  --serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --sans:  "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing / layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--charcoal);
  color: var(--t-light);
  line-height: 1.65;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Typographic primitives ---------- */
.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0.005em;
}
.h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: 1.02; }
.h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.08; }
.h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.12; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--t-faint);
  font-weight: 500;
}
.eyebrow.accent { color: var(--accent); }

.lede { font-size: clamp(1.02rem, 1.4vw, 1.22rem); color: var(--t-dim); max-width: 56ch; }
.muted { color: var(--t-dim); }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 11vw, 168px) 0; }
.section--tight { padding: clamp(56px, 8vw, 110px) 0; }
.center { text-align: center; }
.bg-paper { background: linear-gradient(180deg, var(--offwhite) 0%, var(--paper) 45%, var(--paper-2) 100%); color: var(--t-dark); }
.bg-paper .muted, .bg-paper .lede { color: var(--t-dark-dim); }
.bg-paper .eyebrow { color: rgba(20,40,28,0.5); }
.bg-ink { background: linear-gradient(135deg, var(--ink) 0%, var(--forest) 55%, #17392A 100%); }

.stack > * + * { margin-top: 1.1rem; }
.stack-lg > * + * { margin-top: 1.8rem; }

/* =========================================================
   Navigation
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(14,31,22,0.82);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.nav__inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.brand__logo { height: 52px; width: auto; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--serif); font-size: 1.42rem; font-weight: 600; letter-spacing: .02em; }
.brand__sub { font-size: .58rem; letter-spacing: .34em; text-transform: uppercase; color: var(--t-faint); margin-top: 4px; }

.nav__links { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.nav__links a {
  font-size: .82rem; letter-spacing: .06em; color: var(--t-dim);
  position: relative; padding: 6px 0; transition: color .3s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--accent); transition: width .35s var(--ease);
}
.nav__links a:hover { color: var(--t-light); }
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--t-light); }

.nav__right { display: flex; align-items: center; gap: 16px; }

.lang { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lang button { font-size: .68rem; letter-spacing: .08em; padding: 4px 9px; border-radius: 999px; color: var(--t-dim); transition: .3s; }
.lang button.active { background: var(--paper); color: var(--ink); }

.burger { display: none; width: 30px; height: 18px; position: relative; }
.burger span { position: absolute; left: 0; right: 0; height: 1.5px; background: var(--t-light); transition: .35s var(--ease); }
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.burger span:nth-child(3) { bottom: 0; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 99; background: var(--charcoal);
  transform: translateY(-100%); transition: transform .5s var(--ease);
  display: flex; flex-direction: column; justify-content: center; padding: var(--gutter);
}
.drawer.open { transform: translateY(0); }
.drawer a { font-family: var(--serif); font-size: 2rem; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--t-light); }
.drawer .lang { margin-top: 28px; align-self: flex-start; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
  padding: 15px 30px; border-radius: 2px; transition: .4s var(--ease);
  border: 1px solid transparent; will-change: transform;
}
.btn .arr { transition: transform .4s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--solid { background: var(--paper); color: var(--ink); }
.btn--solid:hover { background: var(--accent); }
.btn--ghost { border-color: var(--line); color: var(--t-light); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--jade); }
.btn--block { width: 100%; justify-content: center; }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(14,31,22,0.25), rgba(12,26,18,0.82) 78%),
    linear-gradient(to top, rgba(12,26,18,0.96), transparent 55%);
}
.hero__glow {
  position: absolute; z-index: 1; width: 46vmax; height: 46vmax; top: 50%; left: 50%;
  transform: translate(-50%,-54%);
  background: radial-gradient(circle, rgba(92,158,103,0.20), rgba(92,158,103,0) 62%);
  filter: blur(8px); animation: breathe 9s ease-in-out infinite; pointer-events: none;
}
@keyframes breathe { 0%,100% { opacity:.55; transform: translate(-50%,-54%) scale(1);} 50% { opacity:.9; transform: translate(-50%,-54%) scale(1.06);} }

.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.hero .eyebrow { margin-bottom: 22px; }
.hero h1 { max-width: 16ch; }
.hero .slogan { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 2rem); color: var(--t-dim); margin: 26px 0 40px; max-width: 30ch; }
.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--t-faint); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero__scroll .line { width: 1px; height: 46px; background: linear-gradient(var(--t-faint), transparent); animation: drop 2.2s ease-in-out infinite; }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 50%{ transform: scaleY(1); transform-origin: top;} 51%{ transform-origin: bottom;} 100%{ transform: scaleY(0); transform-origin: bottom;} }

/* =========================================================
   Section header
   ========================================================= */
.sec-head { max-width: 64ch; margin-bottom: clamp(40px, 6vw, 76px); }
.sec-head.center { margin-left: auto; margin-right: auto; }
.sec-head .eyebrow { display: block; margin-bottom: 18px; }
.sec-head h2 { margin-bottom: 18px; }

/* =========================================================
   Pattern / card grids
   ========================================================= */
.grid { display: grid; gap: clamp(20px, 3vw, 36px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* pattern preview card */
.pcard { position: relative; display: block; background: var(--charcoal-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; transition: transform .5s var(--ease), border-color .5s; }
.pcard:hover { transform: translateY(-6px); border-color: rgba(92,158,103,0.5); }
.pcard__img { aspect-ratio: 1/1; overflow: hidden; }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.pcard:hover .pcard__img img { transform: scale(1.08); }
.pcard__body { padding: 22px 22px 26px; }
.pcard__cat { font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.pcard__body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin-bottom: 8px; }
.pcard__body p { font-size: .9rem; color: var(--t-dim); }

/* curated product card (no price) */
.prod { position: relative; background: var(--charcoal-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; transition: .5s var(--ease); }
.prod:hover { border-color: rgba(92,158,103,0.45); }
.prod__img { aspect-ratio: 4/5; overflow: hidden; }
.prod__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.prod:hover .prod__img img { transform: scale(1.06); }
.prod__tag { position: absolute; top: 16px; left: 16px; font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; background: rgba(12,26,18,0.6); backdrop-filter: blur(6px); padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent); }
.prod__body { padding: 22px; }
.prod__body h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; }
.prod__meta { font-size: .8rem; color: var(--t-dim); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.prod__meta span { border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }

/* credential / badges */
.badge-row { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 56px); align-items: center; justify-content: center; }
.badge { text-align: center; max-width: 180px; }
.badge__mark { font-family: var(--serif); font-size: 1.8rem; color: var(--accent); border: 1px solid var(--line); width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 14px; }
.badge p { font-size: .76rem; color: var(--t-dim); letter-spacing: .04em; }

/* =========================================================
   Feature split (image + text)
   ========================================================= */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.split.rev { grid-template-columns: 1fr 1.05fr; }
.split.rev .split__media { order: 2; }
.split__media { position: relative; overflow: hidden; border-radius: 3px; }
.split__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.split__media.video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; color: var(--paper); background: rgba(12,26,18,0.3); }
.split__body .eyebrow { display: block; margin-bottom: 16px; }
.split__body h2 { margin-bottom: 20px; }

/* =========================================================
   Traceability lookup
   ========================================================= */
.trace-card { background: var(--charcoal-2); border: 1px solid var(--line); border-radius: 4px; padding: clamp(28px, 4vw, 48px); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--t-dim); }
.input, .select, textarea {
  width: 100%; background: rgba(244,239,230,0.04); border: 1px solid var(--line);
  color: var(--t-light); padding: 14px 16px; border-radius: 2px; font-family: inherit; font-size: .95rem;
  transition: border-color .3s, background .3s;
}
.input:focus, .select:focus, textarea:focus { outline: none; border-color: var(--accent); background: rgba(244,239,230,0.06); }
textarea { resize: vertical; min-height: 130px; }
::placeholder { color: var(--t-faint); }

.result { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 26px; display: none; }
.result.show { display: block; animation: fade .6s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to {opacity:1; transform:none;} }
.result__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.result__seal { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--jade); color: var(--jade); display: grid; place-items: center; font-size: .6rem; letter-spacing: .1em; }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 14px 24px; }
.dl dt { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--t-faint); padding-top: 3px; }
.dl dd { font-size: .95rem; color: var(--t-light); }
.dl dd .pill { display: inline-block; font-size: .72rem; border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; margin-right: 6px; }
.error-note { color: var(--cinnabar); font-size: .9rem; margin-top: 18px; display: none; }
.error-note.show { display: block; }

/* =========================================================
   Newsletter / footer CTA
   ========================================================= */
.newsletter { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: end; }
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe .input { flex: 1; min-width: 220px; }

/* =========================================================
   Footer
   ========================================================= */
.footer { background: var(--ink); border-top: 1px solid var(--line); padding: clamp(56px, 8vw, 96px) 0 36px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(28px, 4vw, 56px); }
.footer h4 { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--t-faint); margin-bottom: 18px; font-weight: 500; }
.footer__links a { display: block; font-size: .9rem; color: var(--t-dim); padding: 7px 0; transition: color .3s; }
.footer__links a:hover { color: var(--accent); }
.footer__brand .brand__name { font-size: 1.6rem; }
.footer__brand p { color: var(--t-dim); font-size: .88rem; margin-top: 14px; max-width: 34ch; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 64px); padding-top: 24px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--t-faint); }
.footer__social { display: flex; gap: 14px; }
.footer__social a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: .7rem; letter-spacing: .04em; transition: .3s; }
.footer__script { display: flex; gap: 18px; flex-wrap: wrap; }
.footer__script a { color: var(--t-faint); }
.footer__script a:hover { color: var(--t-dim); }
.footer__domain { color: var(--t-dim); text-decoration: none; letter-spacing: .04em; transition: .3s; }
.footer__domain:hover { color: var(--accent); }

/* =========================================================
   Cookie consent
   ========================================================= */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: rgba(14,31,22,0.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 18px var(--gutter); transform: translateY(100%); transition: transform .5s var(--ease); }
.cookie.show { transform: translateY(0); }
.cookie__inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.cookie p { font-size: .82rem; color: var(--t-dim); flex: 1; min-width: 260px; }
.cookie p a { color: var(--accent); text-decoration: underline; }
.cookie__btns { display: flex; gap: 10px; }

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* =========================================================
   Pattern detail / museum
   ========================================================= */
.detail-hero { position: relative; min-height: 78svh; display: flex; align-items: flex-end; overflow: hidden; }
.detail-hero__bg { position: absolute; inset: 0; }
.detail-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12,26,18,0.95), rgba(12,26,18,0.2) 60%, rgba(12,26,18,0.5)); }
.detail-hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) clamp(40px,6vw,70px); }
.detail-hero h1 { max-width: 18ch; }

.story-step { display: grid; grid-template-columns: 60px 1fr; gap: 18px; padding: 26px 0; border-top: 1px solid var(--line); }
.story-step .num { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); }
.story-step h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; margin-bottom: 8px; }
.story-step p { color: var(--t-dim); }

/* interactive hotspot image */
.hotimg { position: relative; border-radius: 3px; overflow: hidden; }
.hotimg img { width: 100%; }
.hot { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--paper); background: rgba(92,158,103,0.4); cursor: pointer; transform: translate(-50%,-50%); transition: .3s; }
.hot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; background: var(--paper); border-radius: 50%; }
.hot:hover, .hot.active { background: var(--accent); transform: translate(-50%,-50%) scale(1.2); }
.hot-pop { margin-top: 16px; border: 1px solid var(--line); border-radius: 3px; padding: 18px 20px; background: var(--charcoal-2); min-height: 86px; }
.hot-pop strong { color: var(--accent); font-weight: 600; }

/* breadcrumb */
.crumb { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--t-faint); margin-bottom: 22px; }
.crumb a:hover { color: var(--accent); }

/* search */
.searchbar { display: flex; gap: 10px; margin-bottom: 40px; }
.searchbar .input { flex: 1; }

/* stat */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }
.stat { border-left: 1px solid var(--line); padding-left: 20px; }
.stat .n { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--accent); line-height: 1; }
.stat .l { font-size: .78rem; color: var(--t-dim); margin-top: 8px; letter-spacing: .04em; }

/* info pill row */
.pillrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.pillrow .pill { font-size: .76rem; border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; color: var(--t-dim); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  :root { --nav-h: 64px; }
  .brand__logo { height: 44px; }
  .nav__links, .nav__right .lang { display: none; }
  .burger { display: block; }
  .split, .split.rev { grid-template-columns: 1fr; }
  .split.rev .split__media { order: 0; }
  .newsletter { grid-template-columns: 1fr; align-items: start; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 4px 0; }
  .dl dt { padding-top: 12px; }
  .dl dd { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
}
@media (max-width: 480px) {
  .hero__cta .btn { width: 100%; justify-content: center; }
  .cookie__btns { width: 100%; }
  .cookie__btns .btn { flex: 1; justify-content: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
