/*
 * Cha Don coming-soon site. Token variables (colours, type scale, radius,
 * elevation, the :lang() font stacks and leading) come from
 * packages/ui-tokens/tokens.css: scripts/build.mjs copies it to assets/tokens.css
 * in the published folder, and every page loads it before this file. Do not
 * define token variables here.
 * Signboard palette is provisional until the official brand file arrives.
 */

:root {
  /* Landing layout only; not a shared token. */
  --gutter: clamp(16px, 4vw, 64px);
}

/* Only the active locale's copy is shown. Without JavaScript, zh-Hant shows. */
html:not([data-locale='zh-Hans']):not([data-locale='en']) [data-l]:not([data-l='zh-Hant']),
html[data-locale='zh-Hans'] [data-l]:not([data-l='zh-Hans']),
html[data-locale='en'] [data-l]:not([data-l='en']) {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 100% 0, #fbe3b8 0, transparent 30rem), var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  overflow-x: hidden;
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  line-height: var(--lh-heading);
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}
img,
svg {
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 99;
  left: 1rem;
  top: -5rem;
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0.5rem 1rem;
  border-radius: var(--r-md);
  background: var(--navy-900);
  color: var(--n-0);
}
.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-height: 4.5rem;
  padding: 0.5rem var(--gutter);
  border-bottom: 1px solid rgba(20, 30, 79, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  padding: 0.125rem 0.25rem;
  margin-left: -0.25rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-sm);
}
.brand img {
  display: block;
  width: auto;
  height: 48px;
}

.language-toggle {
  display: flex;
  flex: 0 0 auto;
  margin-inline-start: auto;
  padding: 2px;
  background: var(--surface-sunken);
  border-radius: var(--r-sm);
}
.language-toggle[hidden] {
  display: none;
}
.language-toggle button {
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-cjk);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.language-toggle button:lang(en) {
  font-family: var(--font-latin);
}
.language-toggle button:lang(zh-Hans) {
  font-family: 'Noto Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.language-toggle button[aria-pressed='true'] {
  background: var(--surface);
  border-color: var(--text-2);
  color: var(--text);
  font-weight: 600;
}
.language-toggle button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */

main {
  flex: 1 0 auto;
}
main:focus {
  /* Focus lands here from the skip link; the content itself needs no ring. */
  outline: none;
}
.page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4.5rem) 0 4rem;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 0.9rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--ribbon-600);
  color: var(--n-0);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.eyebrow:lang(en) {
  text-transform: uppercase;
}

/* ---------- Home ---------- */

.landing {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.hero-logo {
  display: block;
  width: auto;
  height: clamp(96px, 16vw, 128px);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.12;
}
.hero h1:lang(en) {
  letter-spacing: -0.03em;
}
/* Chinese headline phrases wrap only at the <wbr> between them, never mid-phrase
   (so 即將推出 cannot leave 出 alone on a line). */
.hero h1 .nowrap {
  white-space: nowrap;
}
.hero .lead {
  margin-top: 1rem;
  color: var(--text-2);
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 36em;
}
.notice {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--sign-500);
  border-radius: var(--r-sm);
  background: var(--cream-200);
  max-width: 36em;
}
.hero-actions {
  margin-top: 1.25rem;
}
/* Secondary control that is not available yet: muted, disabled look in the
   shared theme tokens, same intent as Admin Web's disabled secondary button.
   It has no href and no handler; native disabled, aria-disabled and
   tabindex="-1" in the markup. The rules below cover both the native and ARIA
   disabled states so the browser's default disabled styling never shows. */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.btn-secondary:disabled,
.btn-secondary:disabled:hover,
.btn-secondary:disabled:active,
.btn-secondary[aria-disabled='true'],
.btn-secondary[aria-disabled='true']:hover,
.btn-secondary[aria-disabled='true']:active {
  border-color: var(--line-strong);
  background: var(--surface-sunken);
  color: var(--text-2);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}
.orb {
  position: absolute;
  border-radius: 50%;
}
.orb.one {
  width: 280px;
  height: 280px;
  top: 0;
  right: 0;
  background: var(--cream-200);
}
.orb.two {
  width: 200px;
  height: 200px;
  bottom: 0;
  left: 0;
  background: var(--ribbon-100);
}
.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(340px, 90%);
  aspect-ratio: 1.58;
  padding: 1.5rem;
  border: 3px solid var(--cream-200);
  border-radius: 28px;
  background: linear-gradient(160deg, var(--sign-400), var(--sign-500));
  color: var(--navy-900);
  box-shadow: 0 30px 65px rgba(16, 35, 63, 0.28);
  transform: rotate(-4deg);
}
.member-card .card-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.member-card .card-brand small {
  display: block;
  font-family: var(--font-latin);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--ribbon-600);
}
.member-card .card-label {
  margin-top: auto;
  font-weight: 600;
}
.member-card .qr {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 76px;
  height: 76px;
  padding: 6px;
  border-radius: 10px;
  background: var(--cream-50);
}

.features {
  margin-top: clamp(3rem, 8vw, 5rem);
}
.features h2,
.apps h2 {
  font-size: var(--fs-xl);
  margin-bottom: 1.25rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.panel {
  padding: 1.5rem;
  border: 1px solid rgba(20, 30, 79, 0.1);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--e-2);
}
.panel h3 {
  font-size: var(--fs-lg);
  margin-bottom: 0.5rem;
}
.panel p {
  color: var(--text-2);
}
.step {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--cream-100);
  font-family: var(--font-latin);
  font-weight: 700;
}
.wallet {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  background: var(--navy-900);
  color: var(--cream-100);
}
.wallet h2 {
  font-size: var(--fs-xl);
  margin-bottom: 0.5rem;
}
.wallet p {
  color: var(--navy-200);
}
.wallet-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--sign-400), var(--sign-500));
}
.apps {
  margin-top: 1.5rem;
}
.apps h2 {
  margin-bottom: 0.5rem;
}
.badge-soon {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px dashed var(--navy-600);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* ---------- Text pages ---------- */

.doc {
  max-width: 760px;
  margin-inline: auto;
}
.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}
.doc h2 {
  font-size: var(--fs-xl);
  margin-bottom: 0.5rem;
}
.doc section + section {
  margin-top: 1.75rem;
}
.doc p + p {
  margin-top: 0.75rem;
}
.doc .meta {
  margin-top: 2rem;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
/* Inline links in running text still get a 44px tap target, like footer links. */
.inline-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  min-width: var(--target-min);
  padding: 0 0.25rem;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.site-note {
  margin-top: 2.5rem;
  background: var(--cream-100);
  box-shadow: none;
}
.site-note h2 {
  font-size: var(--fs-lg);
}
.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.75rem 1.5rem;
  margin: 1.5rem 0 0;
}
.details dt {
  font-weight: 600;
}
.details dd {
  margin: 0;
}

/* Keep a phone number or email address on one line. */
a[href^='tel:'],
a[href^='mailto:'] {
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--cream-100);
  font-size: var(--fs-sm);
}
.footer-inner {
  display: grid;
  gap: 1rem;
  width: min(1120px, 100%);
  margin: 0 auto;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  padding: 0 0.6rem;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.footer-nav a[aria-current='page'] {
  color: var(--text);
  text-decoration: none;
  background: var(--cream-200);
}
.footer-brand {
  font-weight: 700;
}
.footer-facts {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
}
/* The confirmed shop address: same English text in every locale (no data-l),
   so it stays visible without JavaScript. Not italic, and it wraps rather
   than overflowing on narrow screens. */
.footer-address {
  margin: 0;
  color: var(--text-2);
  font-style: normal;
  overflow-wrap: anywhere;
}

/* ---------- Small screens ---------- */

@media (max-width: 800px) {
  .landing {
    grid-template-columns: 1fr;
  }
  .hero-art {
    min-height: 280px;
  }
  .orb.one {
    width: 200px;
    height: 200px;
  }
  .orb.two {
    width: 140px;
    height: 140px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .wallet {
    grid-template-columns: 1fr;
  }
  .details {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .details dd + dt {
    margin-top: 0.75rem;
  }
  .member-card {
    padding: 1.1rem;
  }
  .member-card .qr {
    width: 60px;
    height: 60px;
  }
}

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