/* ============================================================
   AUNT-TEA MATCHA — Shared Stylesheet
   "Handmade premium" — warm artisanal craft meets serenity
   ============================================================ */
 
/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');
 
/* ---- Design Tokens ---- */
:root {
  /* Palette — pulled from the Aunt-Tea logo */
  --moss:        #2D3A1E;  /* deep moss — primary text */
  --moss-soft:   #45562F;  /* softened text */
  --matcha:      #5B7B3A;  /* brand primary */
  --matcha-deep: #4A6630;
  --sage:        #8FA968;  /* secondary / accents */
  --sage-light:  #B6C698;
  --cream:       #F5F2E8;  /* page background */
  --oat:         #E8E2D0;  /* cards / dividers */
  --oat-deep:    #DDD5BE;
  --clay:        #C08552;  /* warm accent (the apron tie) */
  --white-warm:  #FBFAF4;
 
  /* Type */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
 
  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;
 
  /* Other */
  --radius: 14px;
  --radius-lg: 28px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 18px 50px -24px rgba(45, 58, 30, 0.35);
  --shadow-card: 0 12px 36px -22px rgba(45, 58, 30, 0.45);
}
 
/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
 
body {
  font-family: var(--body);
  font-weight: 400;
  color: var(--moss);
  background: var(--cream);
  line-height: 1.65;
  font-size: 1.0625rem;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 400;
  background: var(--matcha); color: var(--white-warm);
  padding: 0.8rem 1.4rem; border-radius: 0 0 var(--radius) 0;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; outline: 3px solid var(--sage); outline-offset: 2px; }
 
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   WHISK-SWIRL — animated matcha-whisking motif
   Use as a loading state, hero accent, or button micro-detail.
   Markup:
     <span class="whisk-swirl" role="img" aria-label="Whisking matcha">
       <span class="ws-bowl"><span class="ws-froth"></span></span>
       <span class="ws-chasen"></span>
     </span>
   Size with --ws-size (default 64px).
   ============================================================ */
.whisk-swirl {
  --ws-size: 64px;
  position: relative;
  display: inline-block;
  width: var(--ws-size);
  height: var(--ws-size);
  flex: none;
}
/* the matcha bowl (chawan) */
.whisk-swirl .ws-bowl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, var(--sage) 0%, var(--matcha) 55%, var(--matcha-deep) 100%);
  box-shadow:
    inset 0 4px 10px -4px rgba(255,255,255,0.45),
    inset 0 -6px 12px -4px rgba(45,58,30,0.55),
    0 8px 20px -10px rgba(45,58,30,0.45);
  overflow: hidden;
}
/* the swirling froth on the surface */
.whisk-swirl .ws-froth {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(245,242,232,0) 0deg,
      rgba(245,242,232,0.85) 70deg,
      rgba(182,198,152,0.55) 150deg,
      rgba(245,242,232,0) 230deg,
      rgba(245,242,232,0.7) 320deg,
      rgba(245,242,232,0) 360deg);
  filter: blur(0.4px);
  animation: ws-swirl 2.4s linear infinite;
}
/* a soft foam highlight that pulses with the swirl */
.whisk-swirl .ws-bowl::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(251,250,244,0.9), rgba(251,250,244,0) 70%);
  animation: ws-foam 2.4s var(--ease) infinite;
}
/* the bamboo whisk (chasen) sweeping across the bowl */
.whisk-swirl .ws-chasen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12%;
  height: 64%;
  margin-left: -6%;
  margin-top: -32%;
  border-radius: 40% 40% 18% 18%;
  background: linear-gradient(var(--clay), #d9b27e);
  transform-origin: 50% 90%;
  animation: ws-whisk 0.9s ease-in-out infinite alternate;
}
/* splayed bristles at the tip */
.whisk-swirl .ws-chasen::before {
  content: "";
  position: absolute;
  left: -35%;
  bottom: -6%;
  width: 170%;
  height: 34%;
  background:
    repeating-linear-gradient(90deg,
      #e2c597 0 1.5px, rgba(226,197,151,0) 1.5px 4px);
  border-radius: 0 0 6px 6px;
}
@keyframes ws-swirl  { to { transform: rotate(360deg); } }
@keyframes ws-whisk  { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes ws-foam   { 0%,100% { opacity: 0.35; transform: scale(0.9); } 50% { opacity: 0.9; transform: scale(1.05); } }

@media (prefers-reduced-motion: reduce) {
  .whisk-swirl .ws-froth,
  .whisk-swirl .ws-bowl::after,
  .whisk-swirl .ws-chasen { animation: none; }
}

/* ============================================================
   ADD-TO-BASKET — whisk-swirl micro-feedback
   Applied by main.js: button cycles whisking → added → label.
   ============================================================ */
.btn-adding, .btn-added { pointer-events: none; }

/* Checkout hand-off (Stripe) — disabled + inline spinner while redirecting. */
.is-checkout-loading { pointer-events: none; opacity: 0.9; }
.btn-spin {
  display: inline-block; width: 1em; height: 1em;
  margin-right: 0.55em; vertical-align: -0.15em;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spin { display: none; }
}
.btn .ws-mini { --ws-size: 1.2em; vertical-align: middle; }
.btn-added {
  background: var(--matcha-deep) !important;
  border-color: var(--matcha-deep) !important;
  color: var(--white-warm) !important;
}
.btn-added .check-pop {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.2em; height: 1.2em; border-radius: 50%;
  background: var(--white-warm); color: var(--matcha-deep);
  font-size: 0.78em; font-weight: 700; line-height: 1;
  animation: check-pop 0.4s var(--ease);
}
@keyframes check-pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .btn-added .check-pop { animation: none; }
}

/* ============================================================
   CART BADGE BUMP + ICON NUDGE — fires when an item lands
   ============================================================ */
.cart-count.bump { animation: cart-bump 0.55s var(--ease); }
@keyframes cart-bump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.55); background: var(--matcha); }
  55%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.cart-btn.nudge { animation: cart-nudge 0.55s var(--ease); }
@keyframes cart-nudge {
  0%,100% { transform: translateY(0) rotate(0); }
  30%     { transform: translateY(-4px) rotate(-5deg); }
  65%     { transform: translateY(0) rotate(4deg); }
}

/* ============================================================
   PAGE TRANSITION — matcha curtain (injected by main.js)
   Sweeps up to cover on exit, sweeps up away to reveal on arrival.
   ============================================================ */
#page-fx {
  position: fixed; inset: 0; z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease);
  background: linear-gradient(160deg, var(--matcha) 0%, var(--matcha-deep) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  pointer-events: none;
}
#page-fx.is-cover  { transform: translateY(0); pointer-events: all; }
#page-fx.is-reveal { transform: translateY(-100%); transition: transform 0.62s var(--ease); }
#page-fx .pf-mark { --ws-size: 84px; filter: drop-shadow(0 12px 26px rgba(33,44,22,0.35)); }
#page-fx .pf-word {
  font-family: var(--display); color: var(--white-warm);
  font-size: 1.5rem; letter-spacing: 0.04em; text-align: center;
}
#page-fx .pf-word small {
  display: block; font-size: 0.66rem; letter-spacing: 0.32em;
  text-transform: uppercase; opacity: 0.72; margin-top: 0.35rem;
}
@media (prefers-reduced-motion: reduce) { #page-fx { display: none !important; } }
 
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--moss);
}
 
/* ---- Utility ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--matcha);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--sage);
  display: inline-block;
}
.center { text-align: center; }
.center .eyebrow::before { display: none; }
.center .eyebrow { gap: 0; }
 
/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.9rem;
  border-radius: 100px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
  text-align: center;
}
.btn-primary {
  background: var(--matcha);
  color: var(--white-warm);
  box-shadow: 0 10px 24px -12px rgba(91, 123, 58, 0.7);
}
.btn-primary:hover { background: var(--matcha-deep); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(91, 123, 58, 0.75); }
.btn-ghost {
  background: transparent;
  color: var(--moss);
  border-color: var(--oat-deep);
}
.btn-ghost:hover { background: var(--white-warm); border-color: var(--sage); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
 
/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 242, 232, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(221, 213, 190, 0.7);
  transition: box-shadow 0.3s var(--ease), opacity 0.45s var(--ease);
}
/* On pointer devices, rest the header at 40% and bring it to full on
   hover or keyboard focus. Touch devices (no hover) stay fully opaque. */
@media (hover: hover) {
  .site-header { opacity: 0.7; }
  .site-header:hover,
  .site-header:focus-within { opacity: 1; }
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 4px 12px -6px rgba(45,58,30,0.5); }
.brand .brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--moss);
  line-height: 1;
}
.brand .brand-name small {
  display: block;
  font-family: var(--body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--sage);
  text-transform: uppercase;
  margin-top: 3px;
}
.nav-links { display: flex; align-items: center; gap: 2.1rem; list-style: none; }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--moss);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--matcha);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--matcha); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
 
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--moss);
  color: var(--white-warm);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 100px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.cart-btn:hover { background: var(--matcha-deep); transform: translateY(-1px); }
.cart-btn:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
.cart-count {
  background: var(--clay);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--moss); border-radius: 2px; transition: 0.3s var(--ease); }
 
/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--moss);
  color: var(--cream);
  padding: var(--space-xl) 0 var(--space-md);
  margin-top: var(--space-xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
}
.site-footer h4 {
  color: var(--cream);
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  opacity: 0.75;
}
.footer-brand .brand-name { color: var(--cream); font-size: 1.5rem; font-family: var(--display); font-weight: 600; }
.footer-brand p { color: rgba(245,242,232,0.65); font-size: 0.95rem; margin-top: 0.8rem; max-width: 30ch; }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-list a { color: rgba(245,242,232,0.78); font-size: 0.95rem; transition: color 0.25s var(--ease); }
.footer-list a:hover { color: var(--sage-light); }
.footer-news input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(245,242,232,0.25);
  background: rgba(245,242,232,0.06);
  color: var(--cream);
  font-family: var(--body);
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
}
.footer-news input::placeholder { color: rgba(245,242,232,0.45); }
.footer-news input:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.footer-news .btn-primary { width: 100%; }
.footer-bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(245,242,232,0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: rgba(245,242,232,0.55);
  font-size: 0.85rem;
}
.footer-bottom .certs { display: flex; gap: 1.2rem; align-items: center; }
.footer-legal { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-legal a { color: rgba(245,242,232,0.78); font-size: 0.88rem; transition: color 0.25s var(--ease); }
.footer-legal a:hover { color: var(--sage-light); }
.footer-legal a[aria-current="page"] { color: var(--sage-light); }
.footer-bottom .certs span {
  border: 1px solid rgba(245,242,232,0.25);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
 
/* ============================================================
   SECTION HELPERS
   ============================================================ */
.section { padding: var(--space-xl) 0; }
.section-head { max-width: 620px; margin-bottom: var(--space-lg); }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 1rem 0 1rem; }
.section-head p { color: var(--moss-soft); font-size: 1.1rem; }
 
/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
 
/* ============================================================
   CART DRAWER
   ============================================================ */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(45, 58, 30, 0.4);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  z-index: 200;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0;
  width: min(420px, 90vw); height: 100%;
  background: var(--white-warm);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(45,58,30,0.5);
}
.cart-drawer.open { transform: none; }
.cart-drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem; border-bottom: 1px solid var(--oat);
}
.cart-drawer header h3 { font-size: 1.4rem; }
.cart-close { background: none; border: none; cursor: pointer; font-size: 1.5rem; color: var(--moss-soft); line-height: 1; padding: 4px; }
.cart-close:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.cart-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.cart-empty { text-align: center; color: var(--moss-soft); padding: 3rem 1rem; }
.cart-empty svg { margin: 0 auto 1rem; opacity: 0.4; }
.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--oat); align-items: center; }
.cart-item img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info strong { display: block; font-size: 0.95rem; font-weight: 600; }
.cart-item-info span { font-size: 0.82rem; color: var(--moss-soft); }
.cart-item-price { font-weight: 600; font-size: 0.95rem; }
.cart-remove { background: none; border: none; color: var(--clay); cursor: pointer; font-size: 0.78rem; margin-top: 4px; padding: 0; }
.cart-foot { padding: 1.5rem; border-top: 1px solid var(--oat); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.cart-foot .btn-primary { width: 100%; }
.cart-foot .ship-note { text-align: center; font-size: 0.82rem; color: var(--matcha); margin-top: 0.8rem; }
 
/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translate(-50%, 120%);
  background: var(--moss); color: var(--cream);
  padding: 0.9rem 1.5rem; border-radius: 100px;
  font-size: 0.92rem; font-weight: 500;
  box-shadow: var(--shadow-soft); z-index: 300;
  transition: transform 0.5s var(--ease);
  display: flex; align-items: center; gap: 0.6rem;
}
.toast.show { transform: translate(-50%, 0); }
 
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-news { grid-column: 1 / -1; }
}
@media (max-width: 940px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 78px; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 1.5rem 2rem;
    border-bottom: 1px solid var(--oat);
    transform: translateY(-120%);
    transition: transform 0.4s var(--ease);
    box-shadow: var(--shadow-soft);
  }
  .nav-links.open { transform: none; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--oat); width: 100%; font-size: 1.05rem; }
  .nav-links a::after { display: none; }
  .cart-btn span.label { display: none; }
}
@media (max-width: 520px) {
  :root { --space-xl: 4.5rem; --space-lg: 2.75rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
 
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
 
/* ============================================================
   AUNT-TEA HELPER — corner bubble, nudge popup, chat panel
   (markup injected by main.js)
   ============================================================ */
 
/* ---- Floating bubble ---- */
.at-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid var(--white-warm);
  background: var(--white-warm);
  cursor: pointer;
  z-index: 150;
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.3s var(--ease);
}
.at-bubble img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.at-bubble:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 22px 50px -20px rgba(45,58,30,0.6); }
.at-bubble:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
.at-bubble.hidden { opacity: 0; transform: scale(0.4); pointer-events: none; }
/* gentle pulse ring */
.at-bubble::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--sage);
  opacity: 0;
  animation: atPulse 3.4s var(--ease) infinite;
  pointer-events: none;
}
@keyframes atPulse {
  0%   { opacity: 0.55; transform: scale(1); }
  70%  { opacity: 0;    transform: scale(1.35); }
  100% { opacity: 0;    transform: scale(1.35); }
}
.at-dot {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: var(--clay);
  border: 2px solid var(--white-warm);
  border-radius: 50%;
}
 
/* shared round avatar */
.at-ava { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.at-ava.sm { width: 28px; height: 28px; }
 
/* ---- Nudge (delayed, gentle popup) ---- */
.at-nudge {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: min(300px, calc(100vw - 48px));
  background: var(--white-warm);
  border: 1px solid var(--oat);
  border-radius: 20px;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: var(--shadow-soft);
  z-index: 151;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.at-nudge.show { opacity: 1; transform: none; }
.at-nudge::after {
  content: "";
  position: absolute; right: 26px; bottom: -8px;
  width: 16px; height: 16px;
  background: var(--white-warm);
  border-right: 1px solid var(--oat);
  border-bottom: 1px solid var(--oat);
  transform: rotate(45deg);
}
.at-nudge-x {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 1.15rem; line-height: 1; color: var(--moss-soft);
  opacity: 0.55; padding: 4px; border-radius: 6px;
}
.at-nudge-x:hover { opacity: 1; }
.at-nudge-x:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.at-nudge-row { display: flex; gap: 0.8rem; align-items: flex-start; }
.at-nudge-row p { font-size: 0.92rem; line-height: 1.5; color: var(--moss-soft); margin-top: 2px; }
.at-nudge-row strong { color: var(--matcha); }
.at-nudge-btns { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.95rem; padding-left: 0.1rem; }
.btn.at-sm { padding: 0.6rem 1.15rem; font-size: 0.9rem; }
.at-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--body); font-size: 0.88rem; font-weight: 500;
  color: var(--moss-soft); text-decoration: underline; text-underline-offset: 3px;
  padding: 4px;
}
.at-link:hover { color: var(--matcha); }
.at-link:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 4px; }
 
/* ---- Chat panel ---- */
.at-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 48px));
  height: min(544px, calc(100dvh - 120px));
  background: var(--white-warm);
  border: 1px solid var(--oat);
  border-radius: 22px;
  box-shadow: 0 30px 70px -28px rgba(45,58,30,0.6);
  z-index: 160;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.at-panel.open { opacity: 1; transform: none; }
.at-panel[hidden] { display: none; }
 
.at-head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, var(--matcha), var(--matcha-deep));
  color: var(--white-warm);
}
.at-head .at-ava { border: 2px solid rgba(251,250,244,0.6); width: 38px; height: 38px; }
.at-id { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.at-id strong { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--white-warm); }
.at-status { font-size: 0.76rem; opacity: 0.85; }
.at-min {
  background: rgba(251,250,244,0.15); border: none; cursor: pointer;
  color: var(--white-warm); width: 30px; height: 30px; border-radius: 8px;
  font-size: 1.2rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background 0.25s var(--ease);
}
.at-min:hover { background: rgba(251,250,244,0.28); }
.at-min:focus-visible { outline: 2px solid var(--white-warm); outline-offset: 2px; }
 
.at-log {
  flex: 1; overflow-y: auto;
  padding: 1.1rem 1rem 0.4rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  background:
    radial-gradient(circle at 18% 0%, rgba(143,169,104,0.07), transparent 60%),
    var(--cream);
}
.at-log::-webkit-scrollbar { width: 8px; }
.at-log::-webkit-scrollbar-thumb { background: var(--oat-deep); border-radius: 8px; }
 
.at-msg { display: flex; gap: 0.5rem; align-items: flex-end; max-width: 100%; }
.at-msg.user { flex-direction: row-reverse; }
.at-bubble-msg {
  max-width: 80%;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.at-msg.aunt .at-bubble-msg {
  background: var(--white-warm);
  border: 1px solid var(--oat);
  border-bottom-left-radius: 5px;
  color: var(--moss);
}
.at-msg.user .at-bubble-msg {
  background: var(--matcha);
  color: var(--white-warm);
  border-bottom-right-radius: 5px;
}
.at-bubble-msg a { color: var(--matcha); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.at-msg.user .at-bubble-msg a { color: var(--white-warm); }
.at-bubble-msg strong { font-weight: 600; }
 
/* typing dots */
.at-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.at-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: atType 1.2s infinite ease-in-out; }
.at-typing i:nth-child(2) { animation-delay: 0.18s; }
.at-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes atType { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
 
/* in-chat join card + voucher code */
.at-join strong { display: block; font-family: var(--display); font-size: 1rem; margin-bottom: 0.2rem; }
.at-join p { font-size: 0.88rem; color: var(--moss-soft); margin-bottom: 0.6rem; }
.at-join-row { display: flex; gap: 0.45rem; }
.at-join-row input, #atJoinEmail {
  flex: 1; min-width: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--oat-deep);
  border-radius: 100px;
  font-family: var(--body); font-size: 0.88rem;
  background: var(--white-warm); color: var(--moss);
}
.at-join-row input:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.at-join-msg { font-size: 0.8rem; display: block; margin-top: 0.45rem; color: var(--matcha); }
.at-join-msg.err { color: var(--clay); }
.at-code {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  background: var(--oat); border: 1px dashed var(--sage); border-radius: 100px;
}
.at-code code { font-family: var(--body); font-weight: 600; letter-spacing: 0.08em; color: var(--matcha-deep); font-size: 0.92rem; }
.at-copy {
  background: var(--matcha); color: var(--white-warm); border: none; cursor: pointer;
  font-family: var(--body); font-size: 0.78rem; font-weight: 500;
  padding: 0.35rem 0.8rem; border-radius: 100px; transition: background 0.25s var(--ease);
}
.at-copy:hover { background: var(--matcha-deep); }
.at-copy:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
 
/* quick-reply chips */
.at-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.5rem 1rem 0.3rem; }
.at-chip {
  background: var(--white-warm);
  border: 1px solid var(--sage-light);
  color: var(--matcha-deep);
  font-family: var(--body); font-size: 0.82rem; font-weight: 500;
  padding: 0.45rem 0.85rem; border-radius: 100px; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.at-chip:hover { background: var(--sage); color: var(--white-warm); border-color: var(--sage); }
.at-chip:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
 
/* input row */
.at-input {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--oat);
  background: var(--white-warm);
}
.at-input input {
  flex: 1; min-width: 0;
  padding: 0.7rem 1rem;
  border: 1px solid var(--oat-deep);
  border-radius: 100px;
  font-family: var(--body); font-size: 0.9rem;
  background: var(--cream); color: var(--moss);
}
.at-input input:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.at-send {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--matcha); color: var(--white-warm);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.at-send:hover { background: var(--matcha-deep); transform: scale(1.06); }
.at-send:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
 
/* newsletter status (footer) */
.news-status { font-size: 0.85rem; color: rgba(245,242,232,0.6); margin-top: 0.6rem; min-height: 1.1rem; }
.news-status.ok { color: var(--sage-light); }
.news-status.ok strong { color: var(--cream); }
 
/* contact form inline validation */
.field-error { font-size: 0.82rem; color: var(--clay); margin-top: 0.35rem; min-height: 1rem; }
.contact-form input.invalid, .contact-form textarea.invalid { border-color: var(--clay); }
.btn.is-sending { opacity: 0.75; pointer-events: none; }
 
/* ---- Helper responsive ---- */
@media (max-width: 520px) {
  .at-bubble { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .at-nudge  { right: 16px; left: 16px; bottom: 86px; width: auto; }
  .at-panel  { right: 16px; left: 16px; bottom: 16px; width: auto; height: min(78dvh, 560px); }
}
 
/* callback / human-handoff card */
.at-cb-grid { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.6rem 0 0.7rem; }
.at-cb-grid input, .at-cb-grid textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--oat-deep);
  border-radius: 12px;
  font-family: var(--body); font-size: 0.88rem;
  background: var(--white-warm); color: var(--moss);
  resize: vertical;
}
.at-cb-grid input:focus-visible, .at-cb-grid textarea:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.at-callback .btn { width: 100%; }
 
/* ============================================================
   MICRO-INTERACTIONS — tactile press + click ripple
   ============================================================ */
.btn, .add-mini, .wiz-opt, .stepper-btn, .filter-pill { position: relative; overflow: hidden; }
.btn:active, .cart-btn:active, .add-mini:active, .filter-pill:active, .at-chip:active,
.stepper-btn:active, .wiz-opt:active, .at-send:active, .at-copy:active {
  transform: translateY(0) scale(0.96);
  transition: transform 0.07s var(--ease);
}
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(251, 250, 244, 0.5);
  transform: scale(0); animation: ripple 0.6s var(--ease);
  pointer-events: none;
}
.btn-ghost .ripple, .wiz-opt .ripple, .filter-pill .ripple, .stepper-btn .ripple { background: rgba(91, 123, 58, 0.20); }
@keyframes ripple { to { transform: scale(2.2); opacity: 0; } }
 
/* ============================================================
   WIZARD — shared by bundle.html & subscribe.html
   ============================================================ */
.wiz-hero { text-align: center; padding: clamp(2.5rem, 5vw, 4rem) 0 var(--space-md); }
.wiz-hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); margin: 1rem 0 0.8rem; }
.wiz-hero p { color: var(--moss-soft); font-size: 1.12rem; max-width: 54ch; margin: 0 auto; }
 
.wizard { max-width: 780px; margin: 0 auto; padding-bottom: var(--space-md); }
 
/* progress rail */
.wiz-progress { display: flex; align-items: center; max-width: 440px; margin: 0 auto var(--space-lg); }
.wiz-progress .pip {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--oat); color: var(--moss-soft);
  font-family: var(--body); font-size: 0.85rem; font-weight: 600;
  border: 1.5px solid var(--oat-deep);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.wiz-progress .seg { flex: 1; height: 2px; background: var(--oat-deep); margin: 0 0.5rem; position: relative; }
.wiz-progress .seg::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--matcha); transition: width 0.5s var(--ease); }
.wiz-progress .pip.done, .wiz-progress .pip.active { background: var(--matcha); color: var(--white-warm); border-color: var(--matcha); }
.wiz-progress .seg.done::after { width: 100%; }
 
/* steps */
.wiz-step { display: none; }
.wiz-step.active { display: block; animation: wizIn 0.5s var(--ease); }
@keyframes wizIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.wiz-step h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); text-align: center; margin-bottom: 0.5rem; }
.wiz-step .lead { text-align: center; color: var(--moss-soft); margin: 0 auto 2rem; max-width: 46ch; }
 
/* selectable option tiles */
.wiz-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wiz-opt {
  background: var(--white-warm); border: 1.5px solid var(--oat-deep);
  border-radius: var(--radius-lg); padding: 1.6rem 1.2rem; cursor: pointer; text-align: center;
  font-family: var(--body); color: var(--moss);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.wiz-opt:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--sage); }
.wiz-opt:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
.wiz-opt.selected { border-color: var(--matcha); box-shadow: 0 0 0 2px var(--matcha) inset; }
.wiz-opt .opt-emoji { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.wiz-opt img { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 0.6rem; display: block; }
.wiz-opt .opt-title { font-family: var(--display); font-size: 1.2rem; }
.wiz-opt .opt-sub { font-size: 0.84rem; color: var(--moss-soft); margin-top: 0.25rem; }
.wiz-opt .opt-price { color: var(--matcha); font-weight: 600; margin-top: 0.5rem; font-size: 0.95rem; }
 
/* gift meter (bundle) */
.gift-meter { background: var(--white-warm); border: 1px solid var(--oat); border-radius: var(--radius); padding: 1.1rem 1.3rem 1.2rem; margin-bottom: 1.6rem; }
.gm-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.92rem; color: var(--moss-soft); margin-bottom: 0.7rem; }
.gm-head strong { color: var(--moss); font-family: var(--display); font-size: 1.05rem; }
.gm-track { height: 10px; background: var(--oat); border-radius: 100px; position: relative; overflow: hidden; }
.gm-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--sage), var(--matcha)); border-radius: 100px; transition: width 0.6s var(--ease); }
.gm-marks { display: flex; margin-top: 0.6rem; }
.gm-mark { flex: 1; text-align: center; font-size: 0.76rem; color: var(--moss-soft); transition: color 0.4s var(--ease); }
.gm-mark:first-child { text-align: left; }
.gm-mark:last-child { text-align: right; }
.gm-mark .ic { display: block; font-size: 1.1rem; margin-bottom: 1px; filter: grayscale(1) opacity(0.5); transition: filter 0.4s var(--ease); }
.gm-mark.hit { color: var(--matcha); font-weight: 600; }
.gm-mark.hit .ic { filter: none; }
 
/* tone picker with steppers (bundle) */
.tone-pick { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.tone-card { background: var(--white-warm); border: 1px solid var(--oat); border-radius: var(--radius-lg); padding: 1rem 1.1rem; display: flex; gap: 0.9rem; align-items: center; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.tone-card.has { border-color: var(--sage); box-shadow: var(--shadow-card); }
.tone-card img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.tc-info { flex: 1; min-width: 0; }
.tc-info strong { font-family: var(--display); font-size: 1.1rem; display: block; line-height: 1.15; }
.tc-info span { font-size: 0.8rem; color: var(--moss-soft); display: block; margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.stepper-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--oat-deep); background: var(--white-warm); font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--moss); display: flex; align-items: center; justify-content: center; transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease); }
.stepper-btn:hover:not(:disabled) { border-color: var(--matcha); color: var(--matcha); }
.stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper-btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.stepper .qty { min-width: 1.4rem; text-align: center; font-weight: 600; font-size: 1.05rem; }
 
/* nav buttons + summary */
.wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.2rem; }
.wiz-nav .btn { min-width: 130px; }
.wiz-nav .spacer { flex: 1; }
.run-total { text-align: center; margin-top: 1.4rem; color: var(--moss-soft); font-size: 0.95rem; }
.run-total strong { font-family: var(--display); font-size: 1.4rem; color: var(--moss); }
 
.wiz-summary { background: var(--white-warm); border: 1px solid var(--oat); border-radius: var(--radius-lg); padding: 1.8rem 2rem; box-shadow: var(--shadow-card); }
.wiz-summary .row { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0; border-bottom: 1px dashed var(--oat-deep); gap: 1rem; }
.wiz-summary .row:last-child { border-bottom: none; }
.wiz-summary .row .lbl { color: var(--moss-soft); }
.wiz-summary .row .val { font-weight: 500; text-align: right; }
.wiz-summary .row.total .lbl, .wiz-summary .row.total .val { font-family: var(--display); font-size: 1.4rem; color: var(--moss); }
.summary-gift { background: var(--oat); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-top: 1.2rem; display: flex; align-items: center; gap: 0.7rem; color: var(--matcha-deep); font-weight: 500; font-size: 0.95rem; }
.summary-gift .gi { font-size: 1.3rem; }
 
@media (max-width: 520px) {
  .wiz-nav .btn { min-width: 0; flex: 1; padding-left: 1rem; padding-right: 1rem; }
  .tone-card { flex-wrap: wrap; }
}
 