/* ============================================================
   ZEN BOWL — shared.css  (the shared design system)
   Loaded by EVERY page (index, order, account, rewards, privacy).
   Design tokens, base/reset, header & language switcher, buttons, forms,
   keyframes, shared page chrome (§17b), responsive base, reduced-motion.
   Page-specific styles live in landing/order/account/rewards/legal.css.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Palette */
  --maroon:        #7B2D26;
  --maroon-dark:   #5C1F1A;
  --maroon-tint:   #F4E7E4;
  --sage:          #8A9B7C;
  --sage-dark:     #566149;  /* text-safe sage: ≥4.5:1 on off-white, beige, sage-light */
  --sage-light:    #E4EADD;
  --beige:         #EAE0CF;
  --off-white:     #FAF7F1;
  --charcoal:      #2E2B28;
  --charcoal-soft: #5B5650;
  --wood:          #B08968;
  --wood-dark:     #7E5C3F;  /* text-safe wood: ≥4.5:1 on white and beige */
  --white:         #FFFFFF;

  /* Type. The CJK faces sit AFTER the Latin faces: font fallback is
     per-glyph, so Latin text keeps Inter/Cormorant while Chinese
     characters (e.g. bilingual menu lines) render in Noto SC. */
  --font-display: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Chinese: same design, CJK-capable fonts (Noto pairs with the Latin faces).
   i18n.js sets <html lang="zh-CN"> when 中文 is selected. */
:root[lang^="zh"] {
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", "Cormorant Garamond", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Inter", system-ui, sans-serif;
}

:root {
  --step-hero: clamp(2.5rem, 6vw, 4.5rem);
  --step-h2: clamp(1.9rem, 4vw, 2.75rem);
  --step-h3: clamp(1.25rem, 2.5vw, 1.5rem);

  /* System */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 6px 24px rgba(46, 43, 40, .08);
  --shadow-card-hover: 0 14px 34px rgba(46, 43, 40, .13);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur: .6s;
  --container: 1120px;
  --header-h: 4.25rem;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Make the `hidden` attribute win even on elements that set their own
   display (e.g. .btn is inline-flex). Used for section visibility toggles. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--off-white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--charcoal);
}

p { margin: 0 0 var(--space-2); }
a { color: var(--maroon); }
ul { padding: 0; margin: 0; }

:focus-visible {
  outline: 3px solid var(--maroon);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Keyboard skip link — parked off-screen until it receives focus. */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--maroon); color: #fff; font-weight: 600;
  padding: .6rem 1.1rem; border-radius: 0 0 10px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

.section { padding-block: var(--space-6); }
.section--beige { background: var(--beige); }
.section--sage { background: var(--sage-light); }

.section-eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: var(--space-1);
}

.section-title {
  font-size: var(--step-h2);
  margin-bottom: var(--space-3);
}

/* ---------- 3. Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}

.site-header.is-scrolled,
.nav-open .site-header {
  background: rgba(250, 247, 241, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 18px rgba(46, 43, 40, .08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--maroon);
}

/* Hand-drawn "Zen Bowl" wordmark (brand-kit lettering, traced as vector
   strokes). The <svg> carries fill:none + stroke:currentColor, so `color`
   is the single knob for tint and paths only declare their stroke-width. */
.wordmark {
  display: block;
  color: var(--maroon);
  height: auto;
}
.wordmark--brand { height: 1.55rem; width: auto; }

.logo-mark { color: var(--maroon); }
.logo-mark--small { width: 2.1rem; height: auto; flex: none; }

/* Nav list (desktop) */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
}

.site-nav__link {
  position: relative;
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 500;
  font-size: .95rem;
  padding-block: .35rem;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--maroon);
  transform: scaleX(0);
  transition: transform .3s var(--ease-out);
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }

/* Language switcher (EN | FR | 中文) */
.lang-switch {
  display: flex;
  gap: .2rem;
  align-items: center;
}

.lang-switch__btn {
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--charcoal-soft);
  padding: .3rem .55rem;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.lang-switch__btn:hover { color: var(--maroon); }

.lang-switch__btn.is-active {
  background: var(--maroon-tint);
  color: var(--maroon);
  border-color: rgba(123, 45, 38, .25);
}

/* The maroon "Order" button lives in the top bar at EVERY width and on every
   page, next to the menu button — ordering is the one thing the site is for, so
   it is never more than one tap away and never scrolls out of reach.
   Selector is parent-scoped so it beats the generic .btn display rule. */
.site-header__mobile-actions { display: flex; align-items: center; gap: .6rem; }
/* Not parent-scoped: the same button sits in .site-header__mobile-actions on the
   landing page, in .page-header-actions on account/rewards, and in .legal-nav on
   privacy. Doubling the class keeps it ahead of the base .btn padding. */
.header-order-cta.header-order-cta {
  display: inline-flex;
  padding: .45rem 1.05rem;
  font-size: .85rem;
  white-space: nowrap;
  flex: none;
}
@media (max-width: 400px) {
  .header-order-cta.header-order-cta { padding: .4rem .8rem; font-size: .8rem; }
}

/* Hamburger — shown at EVERY width and on every page: it opens the site-wide
   side drawer (js/nav.js), which is the only navigation the order / account /
   rewards pages have. On the landing page at desktop width the horizontal
   .site-nav sits alongside it for the in-page section links. */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%; height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: transform .3s var(--ease-out), opacity .2s ease;
}

.nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 12. Forms ---------- */
.form { text-align: left; }

.form__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
}

.form__row .form__input { flex: 1 1 220px; }

.form__field { margin-bottom: var(--space-2); }

.form__field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .3rem;
}

.form__input {
  width: 100%;
  font: inherit;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid rgba(46, 43, 40, .18);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}

/* Mouse focus keeps the soft sage glow; keyboard focus additionally gets
   the global 3px maroon :focus-visible outline (never suppressed). */
.form__input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(138, 155, 124, .25);
}

.form__input[aria-invalid="true"] { border-color: var(--maroon); }

textarea.form__input { resize: vertical; min-height: 7rem; }

.consent {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin-top: var(--space-2);
  font-size: .82rem;
  color: var(--charcoal-soft);
  line-height: 1.55;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 1.05rem; height: 1.05rem;
  margin-top: .15rem;
  accent-color: var(--maroon);
  cursor: pointer;
}

.consent input[aria-invalid="true"] {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

.form-status {
  min-height: 1.4rem;
  margin: var(--space-2) 0 0;
  font-size: .9rem;
  font-weight: 500;
}

.form.is-success .form-status { color: #3E6B3A; }
.form.is-error .form-status { color: var(--maroon); }

/* Button spinner (shown while submitting) */
.btn__spinner {
  display: none;
  width: 1em; height: 1em;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.form.is-loading .btn__spinner { display: inline-block; }
.form.is-loading button[type="submit"] { pointer-events: none; opacity: .75; }

/* ---------- 13. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: .8rem 1.7rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out),
              background-color .25s ease, color .25s ease, border-color .25s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(46, 43, 40, .14); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }

.btn--primary {
  background: var(--maroon);
  color: var(--off-white);
}

.btn--primary:hover { background: var(--maroon-dark); }

.btn--ghost {
  background: transparent;
  color: var(--maroon);
  border-color: var(--maroon);
}

.btn--ghost:hover { background: var(--maroon-tint); }

.btn--small { padding: .55rem 1.2rem; font-size: .88rem; }


.btn--platform {
  background: var(--white);
  color: var(--charcoal);
  border-color: rgba(46, 43, 40, .18);
  position: relative;
}

.btn--platform:hover { border-color: var(--maroon); color: var(--maroon); }

.btn--platform-primary {
  background: var(--maroon);
  color: var(--off-white);
  border-color: var(--maroon);
}

.btn--platform-primary:hover { background: var(--maroon-dark); color: var(--off-white); }

/* Coming-soon state (applied by JS from config).
   Explicit muted colors rather than element opacity, so the badge and
   label text keep readable contrast. */
.is-coming-soon { cursor: not-allowed; }

.is-coming-soon:hover { transform: none; box-shadow: none; }

.btn--platform.is-coming-soon {
  background: transparent;
  color: var(--charcoal-soft);
  border-style: dashed;
  border-color: rgba(46, 43, 40, .3);
}

.btn--platform-primary.is-coming-soon {
  background: var(--maroon-tint);
  color: var(--maroon-dark);
  border-color: transparent;
}

.social-link.is-coming-soon { opacity: .62; }

.badge-soon {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--beige);
  color: var(--charcoal-soft);
  border-radius: var(--radius-pill);
  padding: .18rem .55rem;
}


/* ---------- 15. Keyframes ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }

@keyframes fade-up {
  to { opacity: 1; transform: none; }
}

@keyframes tick {
  0% { transform: translateY(-.45em); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes float {
  from { transform: translateY(-10px) rotate(-3deg); }
  to   { transform: translateY(12px) rotate(4deg); }
}

@keyframes steam-drift {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50%      { opacity: .75; transform: translateY(-7px); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50%      { transform: translateY(6px) rotate(45deg); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 16. Responsive ---------- */

/* Mobile nav (below 900px) */
@media (max-width: 899.98px) {
  /* The horizontal nav is desktop-only. Below this width its links live in the
     side drawer instead (js/nav.js reads them out of here on open), so there is
     one menu rather than a dropdown on the landing page and nothing elsewhere. */
  .site-nav { display: none; }
}

/* Very narrow screens (e.g. Galaxy Fold, 280px): countdown wraps to 2x2 */
@media (max-width: 359.98px) {
  .countdown__grid { grid-template-columns: repeat(2, minmax(4.2rem, 5.5rem)); }
}

@media (min-width: 640px) {
  .visit__grid { grid-template-columns: 1.2fr 1fr; align-items: stretch; }
  .menu__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .story__inner { grid-template-columns: 1fr 1.2fr; }
  .contact__grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
  .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
  .site-footer__nav { flex-direction: row; flex-wrap: wrap; gap: var(--space-2); align-content: start; }
}

@media (min-width: 1100px) {
  .menu__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 16b. Side drawer (site-wide menu, built by js/nav.js) ---------- */
.nav-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(46, 43, 40, .45);
  opacity: 0;
  transition: opacity .3s var(--ease-out);
}
.nav-open .nav-scrim { opacity: 1; }

.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(20rem, 84vw);
  display: flex; flex-direction: column;
  background: var(--off-white);
  border-left: 1px solid var(--beige);
  box-shadow: -10px 0 40px rgba(46, 43, 40, .18);
  transform: translateX(100%);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .32s var(--ease-out), visibility 0s .32s;
}
.nav-open .nav-drawer {
  transform: none;
  visibility: visible;
  transition: transform .32s var(--ease-out), visibility 0s 0s;
}
/* Lock the page behind the drawer so a scroll gesture moves the menu, not the page. */
.nav-open, .nav-open body { overflow: hidden; }

.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--beige);
}
.nav-drawer__title {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--maroon);
}
.nav-drawer__close {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-size: 1.9rem; line-height: 1; color: var(--charcoal-soft);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.nav-drawer__close:hover { color: var(--maroon); }

.nav-drawer__nav { display: flex; flex-direction: column; padding: var(--space-2) 0; }
.nav-drawer__link {
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem var(--space-3);
  text-decoration: none; color: var(--charcoal); font-weight: 500; font-size: 1.02rem;
  border-left: 3px solid transparent;
}
.nav-drawer__link:hover { background: var(--sage-light); color: var(--maroon); }
.nav-drawer__link.is-current {
  border-left-color: var(--maroon); color: var(--maroon); font-weight: 600;
  background: var(--maroon-tint);
}
.nav-drawer__mark { color: var(--sage-dark); font-size: 1.05rem; flex: none; width: 1.2rem; text-align: center; }
.nav-drawer__link.is-current .nav-drawer__mark { color: var(--maroon); }

/* In-page section links (landing page only) */
.nav-drawer__sections { border-top: 1px solid var(--beige); padding: var(--space-2) 0; }
.nav-drawer__subhead {
  margin: 0 0 .2rem; padding: 0 var(--space-3);
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--charcoal-soft);
}
.nav-drawer__sublink {
  display: block; padding: .55rem var(--space-3) .55rem calc(var(--space-3) + 2rem);
  text-decoration: none; color: var(--charcoal-soft); font-size: .95rem;
}
.nav-drawer__sublink:hover { color: var(--maroon); background: var(--sage-light); }

.nav-drawer__foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--beige);
}
.nav-drawer__legal { font-size: .8rem; color: var(--charcoal-soft); text-decoration: none; }
.nav-drawer__legal:hover { color: var(--maroon); }

/* ---------- 17. Print ---------- */
@media print {
  .nav-drawer, .nav-scrim { display: none; }
  .site-header, .hero__decor, .hero__scroll-hint, .nav-toggle { display: none; }
  .hero { min-height: auto; }
  body { background: #fff; }
}

/* ---------- 17b. Shared page chrome (order/account/rewards/privacy) ----------
   The dark footer + the header action cluster every non-landing page uses.
   ONE definition: these used to live copy-pasted (and drifting) in three page
   files, and /privacy — which loads none of them — shipped an unstyled footer. */
.page-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.page-back { font-size: .9rem; font-weight: 500; color: var(--charcoal-soft); text-decoration: none; white-space: nowrap; }
.page-back:hover { color: var(--maroon); }
.page-footer { flex-shrink: 0; background: var(--charcoal); color: var(--beige); padding: var(--space-3) 0; }
.page-footer__legal { font-size: .8rem; color: rgba(234, 224, 207, .6); margin: 0; }
.page-footer__allergen { font-size: .8rem; color: rgba(234, 224, 207, .75); line-height: 1.6; margin: 0 0 .6rem; }
@media (max-width: 560px) {
  .page-header-actions { gap: .5rem; }
  .page-back { font-size: .82rem; }
}

/* ---------- 18. Reduced motion (keep last IN THIS FILE) ----------
   The `*` sweep below is the only CROSS-FILE guarantee: page CSS files load
   AFTER shared.css, so any selector-level override written here is dead the
   moment a page file re-declares the same selector. The rule for page files:
   each one ends with its OWN `prefers-reduced-motion` block for its own
   animated selectors (see the end of landing/order/account/rewards.css).
   animation-delay matters as much as duration — a clamped animation that
   still waits 2.4s leaves reduced-motion visitors staring at a blank hero. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }
}
