/* ═══════════════════════════════════════════════════════════════
   AWESOME BEARS — Antimetal-inspired design language
   Dark-first · Oversized sans-serif · Enterprise polish
   ═══════════════════════════════════════════════════════════════ */

/* ── Icons (Lucide-style inline SVGs, see /js/icons.js) ──────── */
.kg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.kg-icon--sm { width: 0.85em; height: 0.85em; }
.kg-icon--lg { width: 1.4em;  height: 1.4em; }

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-display: 'Songti SC', 'STSong', 'Georgia', serif;
  --font-mono: 'SF Mono', 'Cascadia Mono', 'Microsoft YaHei UI', ui-monospace, monospace;

  /* Color tokens — dark-first default */
  /* Palette: metallic gold · dark bronze · starry deep blue · cream */
  /*          + fluorescent light blue as secondary accent */
  --bg:           #060d1e;                /* starry deep blue (near-black) */
  --bg-elevated:  #0c1530;                /* deeper navy */
  --bg-card:      #141424;                /* neutral dark with blue undertone */
  --bg-subtle:    rgba(232,201,107,0.04);
  --fg:           #f5efe0;                /* cream */
  --fg-strong:    #faf6ea;                /* bright cream */
  --fg-muted:     #a8a090;                /* warm muted */
  --fg-dim:       #6e665a;                /* dim bronze-gray */

  --border:       rgba(232,201,107,0.10);
  --border-strong:rgba(232,201,107,0.18);
  --border-hover: rgba(232,201,107,0.32);

  /* Metallic gold — primary accent */
  --accent:       #f0d27c;                /* light metallic gold */
  --accent-strong:#a8a090;                /* metallic gold */
  --accent-deep:  #a8a090;                /* dark bronze/brown */
  --accent-glow:  rgba(232,201,107,0.22);
  --accent-fg:    #1a1205;                /* dark for button text on gold */

  /* Fluorescent light blue — secondary accent */
  --accent-blue:       #7ae3ff;           /* fluorescent light blue */
  --accent-blue-strong:#5ccaff;           /* brighter fluorescent */
  --accent-blue-glow:  rgba(122,227,255,0.28);

  /* Starry deep blue — for aurora/atmospheric use */
  --starry-blue:  #1e3c8c;                /* starry deep blue */

  /* Layout */
  --max-w: 1280px;
  --max-w-narrow: 960px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  /* Motion */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
}


/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: hidden; /* clip horizontal overflow at the viewport (not the body) */
}

body {
  font-family: var(--font-sans);
  background: transparent;
  color: var(--fg);
  line-height: 1.5;
  letter-spacing: -0.011em;
  /* overflow-x: hidden removed — keeping it on body makes body the scroll
     container, which clips position:fixed pseudo-elements and edge text */
  min-height: 100vh;
  position: relative;
  font-feature-settings: "ss01", "cv01", "cv11";
}

/* Page-wide ambient aurora — gold + starry-blue + fluorescent-blue */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(42% 52% at 18% 18%, rgba(232,201,107,0.22) 0%, transparent 65%),   /* gold */
    radial-gradient(38% 46% at 82% 22%, rgba(122,227,255,0.16) 0%, transparent 65%),   /* fluorescent blue */
    radial-gradient(46% 54% at 72% 78%, rgba(232,201,107,0.18) 0%, transparent 68%),   /* gold */
    radial-gradient(40% 48% at 10% 68%, rgba(30,60,140,0.28)   0%, transparent 65%),   /* starry deep blue */
    radial-gradient(28% 36% at 50% 50%, rgba(255,223,150,0.08) 0%, transparent 72%);   /* pale cream */
  filter: blur(4px);
  opacity: 0.9;
  mix-blend-mode: screen;
  animation: ab-aurora 32s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ab-aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 1.5%, 0) scale(1.05); }
  100% { transform: translate3d(1.5%, -1%, 0) scale(1.03); }
}
@keyframes ab-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* Fractal-noise grain overlay — cloned from trader-bear.com */
body::after {
  content: '';
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}


@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .am-hero__title em,
  .am-stat__num em,
  .am-profile-hero__content h1 em {
    animation: none;
    background-position: 0% center;
  }
}

/* ── Twinkling star field — cloned from trader-bear.com ─────── */
.ab-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.ab-star {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: ab-twinkle var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes ab-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: var(--peak, 0.7); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ab-star { animation: none; }
}

a { color: inherit; text-decoration: none; transition: opacity .2s var(--ease); }
a:hover { opacity: 0.7; }

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

::selection { background: var(--accent-strong); color: var(--accent-fg); }

/* ── Themed checkboxes ────────────────────────────────────────
   Keep the native input in the accessibility tree and style its
   appearance in-place so labels, keyboard navigation, form values and
   screen-reader state continue to work everywhere on the site. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  inline-size: 20px;
  block-size: 20px;
  flex: 0 0 20px;
  margin: 0;
  border: 1px solid rgba(240, 210, 124, 0.5);
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 241, 183, 0.12), transparent 55%),
    linear-gradient(145deg, rgba(25, 34, 65, 0.96), rgba(10, 17, 39, 0.96));
  color: var(--accent-fg);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease),
    box-shadow .25s var(--ease), transform .16s var(--ease), opacity .2s ease;
}
input[type="checkbox"]:not(:checked):not(:disabled) {
  animation: ab-checkbox-pulse 3.2s ease-in-out infinite;
}
input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 210, 124, 0.1), 0 0 18px rgba(240, 210, 124, 0.18);
  transform: translateY(-1px);
}
input[type="checkbox"]:active:not(:disabled) { transform: scale(.92); }
input[type="checkbox"]:checked {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-blue) 100%);
  box-shadow: 0 0 0 3px rgba(122, 227, 255, 0.12), 0 0 18px rgba(122, 227, 255, 0.3);
}
input[type="checkbox"]:checked::after {
  content: "";
  inline-size: 6px;
  block-size: 11px;
  border: solid var(--accent-fg);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}
input[type="checkbox"]:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: saturate(.55);
}
label:has(> input[type="checkbox"]) { cursor: pointer; }
label:has(> input[type="checkbox"]:disabled) { cursor: not-allowed; }
@keyframes ab-checkbox-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 210, 124, 0); }
  50% { box-shadow: 0 0 0 4px rgba(240, 210, 124, 0.08), 0 0 16px rgba(240, 210, 124, 0.16); }
}
@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"]:not(:checked):not(:disabled) { animation: none; }
}

/* ── Container ──────────────────────────────────────────────── */
.am-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 900px) { .am-container { padding: 0 48px; } }

/* ── Nav ────────────────────────────────────────────────────── */
.am-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
}
.am-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 32px;
}
@media (min-width: 900px) { .am-nav__inner { padding: 27px 48px; } }

.am-nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.am-nav__brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-blue) 100%);
  box-shadow: 0 0 14px var(--accent-glow), 0 0 18px var(--accent-blue-glow);
}

.am-nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
@media (max-width: 820px) { .am-nav__links { display: none; } }
.am-nav__link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 500;
  transition: color .2s var(--ease);
}
.am-nav__link:hover { color: var(--fg-strong); opacity: 1; }
.am-nav__link.active { color: var(--fg-strong); }

.am-nav__actions { display: flex; align-items: center; gap: 10px; }

/* ── Buttons ────────────────────────────────────────────────── */
.am-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.am-btn--primary {
  background: var(--fg-strong);
  color: var(--bg);
}
.am-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255,255,255,0.18);
  opacity: 1;
}
.am-btn--ghost {
  background: transparent;
  color: var(--fg-strong);
  border-color: var(--border-strong);
}
.am-btn--ghost:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  opacity: 1;
}
.am-btn--accent {
  background: var(--accent-strong);
  color: var(--accent-fg);
}
.am-btn--accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px var(--accent-glow);
  opacity: 1;
}
.am-btn--sm { padding: 8px 16px; font-size: 0.85rem; }

/* ── Hero ───────────────────────────────────────────────────── */
.am-hero {
  padding: 120px 24px 60px;
  text-align: center;
  position: relative;
}
@media (min-width: 900px) { .am-hero { padding: 180px 48px 100px; } }

.am-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  background: var(--bg-subtle);
}
.am-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue-glow), 0 0 6px var(--accent-blue);
}

.am-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  max-width: 960px;
  margin: 0 auto 24px;
}
.am-hero__title em {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-style: normal;
  background: linear-gradient(
    100deg,
    #1a7a9a             0%,   /* sea blue */
    #81d8d0            38%,   /* Tiffany blue */
    var(--accent-blue) 68%,   /* fluorescent light blue */
    #1a7a9a            100%   /* sea blue */
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ab-shimmer 30s linear infinite;
}
.am-hero__lede {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.55;
}
.am-hero__ctas {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Section scaffolding ────────────────────────────────────── */
.am-section { padding: 80px 0; position: relative; }
@media (min-width: 900px) { .am-section { padding: 120px 0; } }

.am-section__head {
  max-width: var(--max-w-narrow);
  margin: 0 auto 56px;
  text-align: center;
}
.am-section__head--left { text-align: left; margin-left: 0; }

.am-section__eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
  margin-bottom: 16px;
}

.am-section__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  margin-bottom: 20px;
}

.am-section__lede {
  font-size: 1.08rem;
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.55;
}
.am-section__head--left .am-section__lede { margin: 0; }

/* ── Feature triptych ───────────────────────────────────────── */
.am-triptych {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
@media (min-width: 900px) { .am-triptych { grid-template-columns: repeat(3, 1fr); } }

.am-trip-cell {
  padding: 40px 32px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background .3s var(--ease);
}
.am-trip-cell:hover { background: var(--bg-elevated); }
.am-trip-cell__label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.am-trip-cell__title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
}
.am-trip-cell__body {
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Products grid ──────────────────────────────────────────── */
.am-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
@media (min-width: 760px) { .am-products { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .am-products { grid-template-columns: repeat(3, 1fr); } }

.am-product {
  background: var(--bg-card);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
  transition: background .3s var(--ease);
  min-height: 260px;
}
.am-product:hover { background: var(--bg-elevated); }
/* Ink-green variant (same lightness/saturation as bg-card / bg-elevated, hue shifted blue→green) */
.am-product--green { background: #142420; }
.am-product--green:hover { background: #0c3020; }
/* Warm-brown variant (same lightness/saturation, hue shifted blue→brown) */
.am-product--brown { background: #241c14; }
.am-product--brown:hover { background: #30200c; }
/* Ocean-blue variant (hue shifted blue→teal-blue) */
.am-product--ocean { background: #0e1e2e; }
.am-product--ocean:hover { background: #102840; }
/* Deep-purple variant (hue shifted blue→purple) */
.am-product--purple { background: #1a1428; }
.am-product--purple:hover { background: #241a38; }
/* Black/gray variant for unreleased / stealth products */
.am-product--dark { background: #111113; }
.am-product--dark:hover { background: #1c1c20; }
.am-product__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.am-product__num { color: var(--fg-muted); }
.am-product__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.68rem;
}
.am-product__status--live::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 8px var(--accent-strong);
}
.am-product__status--beta::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue), 0 0 4px var(--accent-blue-strong);
}
.am-product__status--dev::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--fg-dim);
}

.am-product__title {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--fg-strong);
}
.am-product__body {
  color: var(--fg-muted);
  line-height: 1.6;
  flex: 1;
  font-size: 0.95rem;
}
.am-product__arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-strong);
  font-weight: 500;
  font-size: 0.88rem;
  margin-top: 8px;
  transition: gap .25s var(--ease);
}
.am-product:hover .am-product__arrow { gap: 14px; opacity: 1; }

/* ── Stats row ──────────────────────────────────────────────── */
.am-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 24px;
  padding: 56px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 800px) { .am-stats { grid-template-columns: repeat(4, 1fr); } }
.am-stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg-strong);
  line-height: 1;
  margin-bottom: 10px;
  font-feature-settings: "tnum";
}
.am-stat__num em {
  font-style: normal;
  background: linear-gradient(
    100deg,
    #1a7a9a             0%,   /* sea blue */
    #81d8d0            38%,   /* Tiffany blue */
    var(--accent-blue) 68%,   /* fluorescent light blue */
    #1a7a9a            100%   /* sea blue */
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ab-shimmer 30s linear infinite;
}
.am-stat__label {
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

/* ── Final CTA ──────────────────────────────────────────────── */
.am-cta-card {
  text-align: center;
  padding: 90px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
/* Shared large-format entry card used by the home team and About careers links. */
a.am-cta-card { display: block; }
a.am-cta-card:hover { opacity: 1; border-color: var(--border-hover); }
a.am-cta-card:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 4px; }
.am-cta-card.am-team-entry { background: rgba(20, 20, 36, 0.5); }
.am-cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--accent-glow) 0%, transparent 65%),
    radial-gradient(40% 50% at 50% 100%, var(--accent-blue-glow) 0%, transparent 65%);
  pointer-events: none;
}
.am-cta-card > * { position: relative; z-index: 1; }
.am-cta-card__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.032em;
  color: var(--fg-strong);
  margin-bottom: 18px;
  line-height: 1.05;
}
.am-cta-card__lede {
  color: var(--fg-muted);
  font-size: 1.08rem;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.55;
}
.am-team-entry__avatars { display: flex; justify-content: center; margin: 0 auto 28px; }
.am-team-entry__avatars img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
  margin-left: -16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
  background: var(--bg-elevated);
  transition: margin-left .3s var(--ease), transform .3s var(--ease);
}
.am-team-entry__avatars img:first-child { margin-left: 0; }
.am-cta-card:hover .am-team-entry__avatars img { margin-left: -9px; transform: translateY(-2px); }
.am-cta-card:hover .am-team-entry__avatars img:first-child { margin-left: 0; }
.am-cta-card__title em {
  font-style: normal;
  background: linear-gradient(100deg, #1a7a9a 0%, #81d8d0 38%, var(--accent-blue) 68%, #1a7a9a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@media (max-width: 640px) {
  .am-cta-card { padding: 56px 20px; }
  .am-team-entry__avatars img { width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .am-team-entry__avatars img { transition: none; }
  .am-cta-card:hover .am-team-entry__avatars img { transform: none; }
}

/* ── Footer ─────────────────────────────────────────────────── */
.am-footer {
  padding: 56px 0 72px;
  margin-top: 80px;
}
.am-footer__programs {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 0 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.am-footer__eyebrow {
  font-family: var(--font-mono);
  color: var(--fg-dim);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.am-footer__logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, 80px);
  gap: 12px;
}
.am-footer__logo-card {
  position: relative;
  display: block;
  width: 80px;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255,255,255,0.025);
  transition: border-color .2s ease;
}
.am-footer__logo-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.am-footer__logo-card--ignite img { object-position: center 51%; }
.am-footer__logo-card--nvidia img { object-position: center; }
.am-footer__logo-card--google-cloud { background: #fff; }
.am-footer__logo-card--google-cloud img { transform: scale(1.25); }
.am-footer__logo-card--columbia img { object-position: center; }
.am-footer__logo-card--atlas img { object-position: center; }
.am-footer__logo-card--snaptrade img { object-position: center; }
.am-footer__logo-card:hover {
  border-color: var(--border-hover);
}
.am-footer__logo-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.am-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.am-footer__left {
  font-size: 0.88rem;
  color: var(--fg-dim);
}
.am-footer__links {
  display: flex;
  gap: 24px;
  font-size: 0.88rem;
  color: var(--fg-muted);
}

/* ── Scroll reveal animation ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal--stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal--stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ── Skills marquee ─────────────────────────────────────────── */
.am-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.am-marquee__track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: am-marquee 50s linear infinite;
}
@keyframes am-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.am-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--fg-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg-subtle);
}

/* ── Timeline (experience) ──────────────────────────────────── */
.am-timeline { display: flex; flex-direction: column; }
.am-timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  transition: padding-left .3s var(--ease);
}
.am-timeline__item:last-child { border-bottom: 1px solid var(--border); }
.am-timeline__item:hover { padding-left: 12px; }
.am-timeline__date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.am-timeline__body h3 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  margin-bottom: 6px;
}
.am-timeline__role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.am-timeline__body p {
  color: var(--fg-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}
@media (max-width: 800px) {
  .am-timeline__item { grid-template-columns: 1fr; gap: 10px; }
  .am-timeline__item:hover { padding-left: 0; }
}

/* ── Profile hero ───────────────────────────────────────────── */
.am-profile-hero {
  padding: 120px 24px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}
@media (min-width: 900px) {
  .am-profile-hero {
    grid-template-columns: auto 1fr;
    padding: 160px 48px 0;
    gap: 64px;
    justify-items: start;
    text-align: left;
  }
}
.am-profile-hero__avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 60px var(--accent-glow);
}
.am-profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.am-profile-hero__content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--fg-strong);
  margin-bottom: 14px;
}
.am-profile-hero__content h1 em {
  font-style: normal;
  background: linear-gradient(
    100deg,
    #1a7a9a             0%,   /* sea blue */
    #81d8d0            38%,   /* Tiffany blue */
    var(--accent-blue) 68%,   /* fluorescent light blue */
    #1a7a9a            100%   /* sea blue */
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ab-shimmer 30s linear infinite;
}
.am-profile-hero__role {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  margin-bottom: 16px;
}
.am-profile-hero__lede {
  color: var(--fg-muted);
  font-size: 1.08rem;
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 28px;
}
.am-profile-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
@media (min-width: 900px) { .am-profile-hero__ctas { justify-content: flex-start; } }

/* ── Founder card (about page) ──────────────────────────────── */
.am-founder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: var(--max-w-narrow);
  margin: 0 auto;
}

.am-founder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .3s var(--ease), transform .3s var(--ease), background .3s var(--ease);
}
.am-founder-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-3px);
}
.am-founder-card__top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.am-founder-card__avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.am-founder-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.am-founder-card__name {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.am-founder-card__role {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}
.am-founder-card__bio {
  color: var(--fg-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}
.am-founder-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.am-founder-card__link {
  color: var(--fg-strong);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .25s var(--ease);
  margin-top: 4px;
  font-size: 0.92rem;
}
.am-founder-card__link:hover { gap: 12px; opacity: 1; }

/* ── Project cards (Ray's page) ─────────────────────────────── */
.am-projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
@media (min-width: 760px) { .am-projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .am-projects { grid-template-columns: repeat(3, 1fr); } }

.am-project {
  background: var(--bg-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background .3s var(--ease);
}
.am-project:hover { background: var(--bg-elevated); }
.am-project__title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
}
.am-project__desc {
  color: var(--fg-muted);
  line-height: 1.55;
  font-size: 0.92rem;
  flex: 1;
}
.am-project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.am-project__link {
  color: var(--fg-strong);
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: gap .25s var(--ease);
}
.am-project__link:hover { gap: 12px; opacity: 1; }

/* ── Two-column "list row" (education, certs, leadership) ──── */
.am-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.am-row:last-child { border-bottom: 1px solid var(--border); }
@media (min-width: 700px) { .am-row { grid-template-columns: 260px 1fr; gap: 32px; align-items: start; } }
.am-row__label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.am-row__body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg-strong);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.am-row__body p {
  color: var(--fg-muted);
  line-height: 1.55;
  font-size: 0.93rem;
}
.am-row__tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}

/* ── i18n ───────────────────────────────────────────────────── */
[data-lang="en"] .i18n-zh { display: none !important; }
[data-lang="zh"] .i18n-en { display: none !important; }
[data-lang="zh"] body {
  font-family: var(--font-sans), 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

/* Floating menu styles are owned by /js/float-menu.js. */

/* ── Legal pages ──────────────────────────────────────────── */
.legal-body { background: #060d1e; }
.legal-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 96px;
}
.legal-hero {
  position: relative;
  max-width: 900px;
  margin-bottom: 70px;
  padding: 48px 52px 50px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 15%, rgba(122,227,255,.12), transparent 28%),
    radial-gradient(circle at 8% 100%, rgba(240,210,124,.13), transparent 35%),
    linear-gradient(145deg, rgba(20,30,53,.96), rgba(10,18,34,.95));
  box-shadow: 0 34px 90px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.045);
}
.legal-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -130px;
  border: 1px solid rgba(240,210,124,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(240,210,124,.025), 0 0 0 84px rgba(122,227,255,.018);
  pointer-events: none;
}
.legal-hero__mark {
  position: relative;
  width: 56px;
  height: 38px;
  margin-bottom: 28px;
}
.legal-hero__mark span {
  position: absolute;
  top: 4px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(240,210,124,.58);
  border-radius: 50%;
  background: rgba(240,210,124,.04);
}
.legal-hero__mark span:first-child { left: 0; }
.legal-hero__mark span:nth-child(2) { left: 22px; }
.legal-hero__mark i {
  position: absolute;
  left: 22px;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(240,210,124,.58);
}
.legal-page .entity-kicker {
  color: var(--accent);
  font: 700 .66rem/1 var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.legal-page .entity-title {
  margin: 14px 0 18px;
  color: var(--fg-strong);
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 8vw, 6.8rem);
  font-weight: 400;
  line-height: .86;
  letter-spacing: -.055em;
}
.legal-page .entity-title span {
  background: linear-gradient(110deg, var(--fg-strong) 12%, var(--accent) 50%, var(--accent-blue) 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal-page .entity-title em { font-style: normal; }
.legal-page .entity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin-bottom: 28px;
  color: var(--fg-dim);
  font: 500 .7rem/1.3 var(--font-mono);
  letter-spacing: .035em;
}
.legal-page .entity-answer {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding-left: 20px;
  border-left: 2px solid rgba(122,227,255,.46);
  color: #c9c3b7;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.72;
}
.legal-hero__chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}
.legal-hero__chips span {
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--fg-muted);
  font: 600 .68rem/1 var(--font-sans);
}
.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(34px, 6vw, 74px);
  align-items: start;
}
.legal-index {
  position: sticky;
  top: 110px;
  padding: 18px 0 0;
}
.legal-index__eyebrow {
  margin: 0 0 13px;
  color: var(--fg-dim);
  font: 700 .63rem/1 var(--font-mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}
.legal-index nav { display: flex; flex-direction: column; }
.legal-index nav a {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: var(--fg-muted);
  font-size: .74rem;
  line-height: 1.35;
  transition: color .16s, padding-left .16s;
}
.legal-index nav a span { color: var(--accent); font: 600 .6rem/1.7 var(--font-mono); }
.legal-index nav a b { font: inherit; }
.legal-index nav a:hover { padding-left: 4px; color: var(--fg-strong); opacity: 1; }
.legal-index__note {
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid rgba(122,227,255,.11);
  border-radius: 12px;
  background: rgba(122,227,255,.035);
  color: var(--fg-dim);
  font-size: .68rem;
  line-height: 1.55;
}
.legal-content { min-width: 0; }
.legal-page .entity-section {
  position: relative;
  scroll-margin-top: 110px;
  margin-bottom: 14px;
  padding: 30px 32px 31px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.legal-page .entity-section:hover {
  transform: translateY(-2px);
  border-color: rgba(240,210,124,.2);
  background: linear-gradient(145deg, rgba(255,255,255,.047), rgba(255,255,255,.018));
}
.legal-page .entity-section--featured {
  border-color: rgba(240,210,124,.18);
  background:
    radial-gradient(circle at 100% 0, rgba(240,210,124,.08), transparent 30%),
    linear-gradient(145deg, rgba(240,210,124,.045), rgba(255,255,255,.015));
}
.entity-section__number {
  position: absolute;
  top: 25px;
  right: 27px;
  color: rgba(240,210,124,.23) !important;
  font: 600 .67rem/1 var(--font-mono) !important;
  letter-spacing: .08em;
}
.legal-page .entity-section h2 {
  max-width: calc(100% - 44px);
  margin: 0 0 16px;
  color: var(--fg-strong);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.legal-page .entity-section > p:not(.entity-section__number) {
  color: #b4aea3;
  font-size: .92rem;
  line-height: 1.78;
}
.legal-page .entity-section > p + p { margin-top: 13px; }
.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 4px 0;
  color: var(--fg-dim);
  font: 500 .69rem/1.3 var(--font-mono);
}
.legal-footer div { display: flex; flex-wrap: wrap; gap: 18px; }
.legal-footer a { color: var(--fg-muted); text-decoration: underline; text-decoration-color: rgba(240,210,124,.28); text-underline-offset: 4px; }
.legal-footer a:hover { color: var(--accent); opacity: 1; }

@media (max-width: 780px) {
  .legal-page { width: min(100% - 28px, 640px); padding: 34px 0 72px; }
  .legal-hero { margin-bottom: 28px; padding: 34px 25px 31px; border-radius: 22px; }
  .legal-hero__mark { margin-bottom: 22px; }
  .legal-page .entity-title { font-size: clamp(3.25rem, 17vw, 5rem); }
  .legal-page .entity-meta { display: block; line-height: 1.7; }
  .legal-page .entity-meta span { display: block; }
  .legal-page .entity-answer { padding-left: 15px; font-size: .94rem; }
  .legal-hero__chips { margin-top: 24px; }
  .legal-layout { display: block; }
  .legal-index { position: static; margin: 0 0 18px; padding: 18px; border: 1px solid rgba(255,255,255,.07); border-radius: 16px; background: rgba(255,255,255,.018); }
  .legal-index nav { display: grid; grid-template-columns: 1fr 1fr; column-gap: 15px; }
  .legal-index__note { display: none; }
  .legal-page .entity-section { padding: 26px 21px 27px; border-radius: 16px; }
  .entity-section__number { top: 22px; right: 20px; }
  .legal-page .entity-section h2 { font-size: 1.72rem; }
  .legal-page .entity-section > p:not(.entity-section__number) { font-size: .88rem; line-height: 1.72; }
  .legal-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .legal-page { width: calc(100% - 20px); padding-top: 22px; }
  .legal-hero { padding: 29px 19px 27px; }
  .legal-hero__chips span { font-size: .61rem; }
  .legal-index nav { grid-template-columns: 1fr; }
  .legal-page .entity-section { padding-inline: 18px; }
}

/* ── In-page Auth Modal ──────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: none;
  background: rgba(4,9,20,.82);
}
.auth-modal.is-open { display: flex; }

html.auth-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
  scroll-behavior: auto;
}
/* Scroll lock stays on <html>; a fixed <body> stops the backdrop blur from rendering. */
body.auth-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.auth-modal__backdrop {
  position: fixed; inset: -2px;
  background: rgba(6, 13, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: none;
}
.auth-modal__panel {
  position: relative;
  width: 100%; max-width: 380px;
  padding: 32px 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; gap: 14px;
  animation: auth-modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes auth-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal__close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--fg-muted); font-size: 22px; line-height: 1;
  cursor: pointer; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.auth-modal__close:hover { color: var(--fg); background: rgba(255,255,255,0.06); }
.auth-modal__title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 500;
  color: var(--fg-strong);
  text-align: center;
  margin-bottom: 4px;
}
.auth-modal__error {
  padding: 9px 12px;
  background: rgba(224, 92, 92, 0.10);
  border: 1px solid rgba(224, 92, 92, 0.30);
  border-radius: 6px;
  color: #ff9a9a;
  font-family: var(--font-sans);
  font-size: 12px; line-height: 1.5;
  word-break: break-word;
}
.auth-modal__error.is-success {
  background: rgba(76, 175, 80, 0.10);
  border-color: rgba(76, 175, 80, 0.32);
  color: #9ce7aa;
}
.auth-modal__methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.auth-modal__methods button {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-modal__methods button.is-active {
  color: var(--fg-strong);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.auth-modal__methods button:focus-visible,
.auth-modal__send-code:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#authPhonePane[hidden],
#authEmailPane[hidden] { display: none; }
.auth-modal__form {
  display: flex; flex-direction: column; gap: 10px;
}
.auth-modal__phone-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: stretch;
}
.auth-modal__country {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.auth-modal__phone-row .auth-modal__input {
  border-radius: 0 8px 8px 0;
}
.auth-modal__code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
}
.auth-modal__send-code {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.auth-modal__region-note {
  margin: -2px 0 8px;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.auth-modal__send-code:hover:not(:disabled) {
  background: rgba(255,255,255,.04);
  border-color: var(--border-hover);
}
.auth-modal__send-code:disabled {
  cursor: not-allowed;
  color: var(--fg-dim);
  opacity: .58;
}
.auth-modal__input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.auth-modal__input::placeholder { color: var(--fg-dim); }
.auth-modal__input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}
.auth-modal__forgot {
  align-self: flex-end;
  font-family: var(--font-sans);
  font-size: 11px; color: var(--fg-dim);
  text-decoration: none;
  cursor: pointer;
  margin-top: -2px;
}
.auth-modal__forgot:hover { color: var(--accent); }
.auth-modal__submit {
  height: 42px; margin-top: 4px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.auth-modal__submit:hover { background: #c9a568; }
.auth-modal__submit:active { transform: scale(0.98); }
.auth-modal__submit[disabled] { pointer-events: none; }

.auth-modal__sep {
  display: flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg-dim);
  letter-spacing: 0.12em;
  margin: 4px 0;
}
.auth-modal__sep::before,
.auth-modal__sep::after {
  content: ""; flex: 1; height: 1px;
  background: var(--border);
}
.auth-modal__sep span { padding: 0 10px; }
.auth-modal__sep span::before { content: "OR"; }
[data-lang="zh"] .auth-modal__sep span::before { content: "\6216"; } /* 或, escaped so it survives a non-UTF-8 read */

.auth-modal__google {
  height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.auth-modal__google:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-hover);
}
.auth-modal__google[disabled] { opacity: 0.5; pointer-events: none; }
#authPhoneGoogle { width: 100%; }

.auth-modal__switch {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
  margin-top: 4px;
}
.auth-modal__switch a {
  color: var(--fg-muted);
  text-decoration: none;
}
.auth-modal__switch a:hover { color: var(--accent); }
.auth-modal__consent { display:flex; align-items:center; gap:8px; margin:12px 0 2px; color:var(--fg-strong); font-size:.78rem; line-height:1.45; transition:color .2s ease; }
.auth-modal__consent[hidden] { display:none; }
.auth-modal__consent input { margin-top:0; accent-color:var(--accent); }
.auth-modal__consent a { color:#a9eaff; text-decoration:underline; text-decoration-color:rgba(169,234,255,.72); text-underline-offset:2px; transition:color .2s ease, text-decoration-color .2s ease; }
.auth-modal__consent:has(input:checked) { color:var(--fg-dim); }
.auth-modal__consent:has(input:checked) a { color:var(--fg-dim); text-decoration-color:rgba(110,102,90,.7); }
.auth-modal__submit:disabled, .auth-modal__google:disabled { cursor:not-allowed; filter:grayscale(.65); opacity:.42; }

@media (max-width: 420px) {
  .auth-modal { padding: 12px; }
  .auth-modal__panel { padding: 28px 18px 20px; }
  .auth-modal__code-row { grid-template-columns: minmax(0, 1fr) 108px; }
}

/* Auth flow v3 — house glass dialog (DESIGN.md §6 tier 3, design_web.md sign-in) */
.auth-modal { background: transparent; }
.auth-modal__backdrop {
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: auth-fade-in .32s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes auth-fade-in { from { opacity: 0; } }
.auth-modal__panel {
  width: 100%; max-width: 400px;
  padding: 28px 24px 24px;
  overflow: visible;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)), rgba(13,22,48,.98);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.22);
  gap: 12px;
  animation: auth-modal-in .32s cubic-bezier(.16,1,.3,1) both;
}
.auth-modal__close {
  top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%;
  font-size: 24px; transition: color .18s cubic-bezier(.2,.8,.2,1), background .18s cubic-bezier(.2,.8,.2,1), transform .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__close:hover { background: transparent; }
.auth-modal__close:active { transform: scale(.92); }
.auth-modal__title--welcome {
  margin: 8px 44px 8px; color: var(--fg-strong);
  font-size: 22px; line-height: 1.25; letter-spacing: -.01em;
}
.auth-modal__title--welcome[hidden] { display: none; }
.auth-modal__error { border-radius: 12px; text-align: center; }
.auth-modal__stage[hidden] { display: none; }
.auth-modal__stage { display: flex; flex-direction: column; gap: 12px; animation: auth-stage-in .32s cubic-bezier(.2,.8,.2,1) both; }
.auth-modal[data-dir="forward"] .auth-modal__stage { animation-name: auth-stage-forward; }
.auth-modal[data-dir="back"] .auth-modal__stage { animation-name: auth-stage-back; }
@keyframes auth-stage-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes auth-stage-forward { from { opacity: 0; transform: translateX(32px); } }
@keyframes auth-stage-back { from { opacity: 0; transform: translateX(-32px); } }
.auth-modal__form { gap: 12px; }
.auth-modal__field-head { color: var(--fg-muted); font: 600 13px/1 var(--font-sans); }
.auth-modal__submit:focus-visible, .auth-modal__google:focus-visible,
.auth-modal__country-trigger:focus-visible, .auth-modal__country-menu button:focus-visible,
.auth-modal__resend:focus-visible, .auth-modal__back:focus-visible, .auth-modal__close:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.auth-modal__phone-row { position: relative; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; overflow: visible; }
.auth-modal__country-select { position: relative; min-width: 0; }
.auth-modal__country-trigger {
  width: 100%; height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--fg-strong); cursor: pointer;
  transition: background .18s cubic-bezier(.2,.8,.2,1), border-color .18s cubic-bezier(.2,.8,.2,1), transform .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__country-trigger[aria-expanded="true"] { background: rgba(255,255,255,.12); }
.auth-modal__country-trigger:disabled { cursor: default; opacity: .4; }
.auth-modal__country-flag { font-size: 18px; line-height: 1; }
.auth-modal__country-code { color: var(--fg-strong); font: 600 15px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.auth-modal__country-chevron { display: grid; margin-left: auto; color: var(--fg-muted); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.auth-modal__country-trigger[aria-expanded="true"] .auth-modal__country-chevron { transform: rotate(180deg); }
.auth-modal__country-menu {
  position: absolute; z-index: 25; top: calc(100% + 8px); left: 0;
  width: 248px; padding: 6px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.2); border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.04)), rgba(14,24,52,.97);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 18px 48px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2);
  transform-origin: top left; animation: auth-menu-in .22s cubic-bezier(.16,1,.3,1) both;
}
@keyframes auth-menu-in { from { opacity: 0; transform: translateY(-7px) scale(.96); } }
.auth-modal__country-menu[hidden] { display: none; }
.auth-modal__country-menu button {
  width: 100%; min-height: 44px; padding: 8px 10px; display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  border-radius: 14px; color: var(--fg-strong); text-align: left; cursor: pointer;
  transition: background .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__country-menu button span:nth-child(2) { overflow: hidden; font: 500 14px/1.2 var(--font-sans); text-overflow: ellipsis; white-space: nowrap; }
.auth-modal__country-menu button b { color: var(--fg-muted); font: 600 14px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.auth-modal__country-menu button[aria-selected="true"] { background: rgba(255,255,255,.12); }
.auth-modal__country-menu button[aria-selected="true"] span:nth-child(2) { font-weight: 700; }
.auth-modal__phone-row .auth-modal__input { border-radius: 999px; }
.auth-modal__input {
  height: 44px; padding: 0 18px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16);
  border-radius: 999px; font-family: var(--font-sans); font-size: 16px; font-weight: 500;
  font-variant-numeric: tabular-nums; transition: border-color .18s cubic-bezier(.2,.8,.2,1), background .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__input::placeholder { color: var(--fg-muted); opacity: .7; }
.auth-modal__input:focus { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.4); }
.auth-modal__input:disabled { opacity: .4; }
.auth-modal__input.is-invalid { border-color: rgba(255,154,154,.7); animation: auth-shake .4s cubic-bezier(.2,.8,.2,1); }
.auth-modal__submit {
  height: 44px; margin-top: 0; border-radius: 999px; background: linear-gradient(135deg, #f0d783, #d8af54);
  font-size: 15px; font-weight: 600; letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(216,175,84,.22);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s cubic-bezier(.2,.8,.2,1), opacity .16s;
}
.auth-modal__submit:hover { background: linear-gradient(135deg, #f0d783, #d8af54); }
.auth-modal__submit:active { transform: scale(.97); transition-duration: 60ms; }
.auth-modal__sep { margin: 4px 0; font-family: var(--font-sans); font-size: 12px; letter-spacing: .04em; color: var(--fg-muted); }
.auth-modal__sep::before, .auth-modal__sep::after { background: rgba(255,255,255,.1); }
.auth-modal__google {
  width: 100%; height: 44px; border-radius: 999px; border-color: rgba(255,255,255,.18);
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  color: var(--fg-strong); font-size: 15px; font-weight: 600; letter-spacing: 0;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__google:hover { border-color: rgba(255,255,255,.18); }
.auth-modal__google:active { transform: scale(.97); transition-duration: 60ms; }
.auth-modal__submit:disabled, .auth-modal__google:disabled { cursor: default; filter: none; opacity: .4; box-shadow: none; }
/* Mainland consent not yet ticked: methods look inactive and don't react to hover, but a tap still explains why. */
.auth-modal__submit.is-awaiting-consent, .auth-modal__google.is-awaiting-consent {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.08); color: var(--fg-muted);
  box-shadow: none; cursor: default; transform: none !important;
}
.auth-modal__google.is-awaiting-consent svg { filter: grayscale(1); opacity: .6; }
@media (hover: hover) and (pointer: fine) {
  .auth-modal__close:hover { color: var(--fg-strong); transform: scale(1.06); }
  .auth-modal__country-trigger:hover:not(:disabled) { background: rgba(255,255,255,.1); transform: scale(1.04); }
  .auth-modal__country-menu button:hover { background: rgba(255,255,255,.08); }
  .auth-modal__country-menu button[aria-selected="true"]:hover { background: rgba(255,255,255,.12); }
  .auth-modal__submit:hover:not(:disabled):not(.is-awaiting-consent) { transform: scale(1.04); box-shadow: 0 12px 34px rgba(216,175,84,.34); }
  .auth-modal__google:hover:not(:disabled):not(.is-awaiting-consent) { background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.07)); transform: scale(1.04); }
  .auth-modal__back:hover { color: var(--fg-strong); transform: scale(1.06); }
  .auth-modal__resend:hover:not(:disabled) { transform: scale(1.04); }
}
.auth-modal__consent {
  display: flex; align-items: center; gap: 10px; color: var(--fg);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.45;
}
.auth-modal__consent--gate {
  min-height: 44px; margin: 0; padding: 0 2px; justify-content: flex-start;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer;
}
.auth-modal__consent--gate[hidden] { display: none; }
.auth-modal__consent--gate.is-shaking { animation: auth-shake .4s cubic-bezier(.2,.8,.2,1); }
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); } 75% { transform: translateX(6px); } 90% { transform: translateX(-3px); }
}
.auth-modal__consent input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 0;
  border: 1.5px solid rgba(255,255,255,.4); border-radius: 6px; background: transparent;
  cursor: pointer; transition: background-color .18s cubic-bezier(.2,.8,.2,1), border-color .18s cubic-bezier(.2,.8,.2,1), transform .06s;
}
.auth-modal__consent--gate.is-shaking input:not(:checked) { border-color: #ff9a9a; }
.auth-modal__consent input:checked {
  border-color: var(--fg-strong); background-color: var(--fg-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4.2 9.2 3.1 3.1 6.5-7' fill='none' stroke='%23081529' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.auth-modal__consent input:active { transform: scale(.92); }
.auth-modal__consent input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-modal__consent a, .auth-modal__terms a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 4px; }
.auth-modal__consent-hint {
  min-height: 0; margin-top: -8px; color: #ff9a9a; font: 500 12px/1.4 var(--font-sans);
  opacity: 0; transform: translateY(-6px); transition: opacity .18s cubic-bezier(.2,.8,.2,1), transform .32s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__consent-hint:empty { display: none; }
.auth-modal__consent-hint.is-visible { opacity: 1; transform: none; }
/* The number hint keeps its line reserved so the dialog never changes height. */
#authPhoneHint, #authPhoneHint:empty { display: block; min-height: 17px; margin: -6px 0 -6px 18px; }
.auth-modal__consent--gate:not([hidden]) + #authConsentHint { display: block; min-height: 17px; margin: -12px 0 -4px 32px; }
#authPhoneHint:empty + .auth-modal__consent--gate:not([hidden]) { margin-top: -12px; }
.auth-modal__terms {
  margin: 4px 0 0; color: var(--fg-muted); text-align: center;
  font: 400 12px/1.5 var(--font-sans);
}
.auth-modal__terms[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .auth-modal__consent a:hover, .auth-modal__terms a:hover { color: var(--fg-strong); text-decoration-color: currentColor; }
}
.auth-modal__stage--code { position: relative; }
.auth-modal__back {
  position: absolute; left: 6px; top: 6px; z-index: 2; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; font-size: 18px;
  color: var(--fg-muted); cursor: pointer; transition: color .18s cubic-bezier(.2,.8,.2,1), transform .18s cubic-bezier(.2,.8,.2,1);
}
.auth-modal__verify-card {
  position: relative; padding: 24px 18px 20px; overflow: visible;
  border: 1px solid transparent; border-radius: 19px; background: rgba(255,255,255,.027);
  text-align: center; box-shadow: none;
}
.auth-modal__verify-orbit {
  position: relative; width: 54px; height: 54px; margin: 0 auto 13px; display: grid; place-items: center;
  border: 1px solid rgba(232,201,107,.35); border-radius: 50%; box-shadow: 0 0 30px rgba(232,201,107,.09);
}
.auth-modal__verify-orbit::before {
  content: ""; width: 18px; height: 28px; border: 2px solid var(--accent); border-radius: 5px;
  box-shadow: inset 0 0 10px rgba(232,201,107,.08);
}
.auth-modal__verify-orbit span {
  position: absolute; width: 6px; height: 2px; margin-top: 20px;
  border-radius: 999px; background: var(--accent);
}
.auth-modal__verify-title { color: var(--fg-strong); font: 600 16px/1.2 var(--font-sans); }
.auth-modal__verify-phone { margin: 6px 0 20px; color: var(--fg-muted); font: 600 12px/1 var(--font-mono); letter-spacing: .04em; }
.auth-modal__otp { position: relative; height: 54px; cursor: text; }
.auth-modal__otp input {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; opacity: .01;
  color: transparent; background: transparent; caret-color: transparent;
}
.auth-modal__otp input:focus { outline: none; }
.auth-modal__otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.auth-modal__otp-boxes span {
  height: 52px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; background: rgba(255,255,255,.035); color: var(--fg-strong);
  font: 700 20px/1 var(--font-mono); transition: border-color .14s, background .14s, transform .14s;
}
.auth-modal__otp-boxes span.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,201,107,.1); }
.auth-modal__otp-boxes span.is-filled { border-color: rgba(232,201,107,.42); background: rgba(232,201,107,.08); transform: translateY(-1px); }
.auth-modal__verify-status { min-height: 18px; margin-top: 12px; color: var(--fg-muted); font: 500 12px/1.5 var(--font-sans); }
.auth-modal__resend { min-height: 44px; margin-top: 0; padding: 0 14px; border: 0; background: transparent; color: var(--fg-strong); font: 600 13px/1.2 var(--font-sans); cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.auth-modal__resend:disabled { color: var(--fg-muted); cursor: default; }
.auth-modal__recaptcha { min-height: 0; }
.auth-modal__recaptcha:empty { display: none; }
.auth-modal__captcha-trigger {
  position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px;
  overflow: hidden; border: 0; opacity: 0; pointer-events: none;
}

/* Small screens: the same dialog becomes a bottom sheet. */
@media (max-width: 760px) {
  .auth-modal { align-items: flex-end; padding: 0; }
  .auth-modal__panel {
    max-width: none; padding: 28px 16px calc(24px + env(safe-area-inset-bottom));
    border-bottom: 0; border-radius: 20px 20px 0 0;
    animation-name: auth-sheet-in;
  }
  .auth-modal__panel::after {
    content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px;
    margin-left: -18px; border-radius: 999px; background: rgba(255,255,255,.28);
  }
  @keyframes auth-sheet-in { from { transform: translateY(100%); } }
  .auth-modal__country-menu { width: min(248px, calc(100vw - 32px)); }
  .auth-modal__otp-boxes { gap: 6px; }
  .auth-modal__otp-boxes span { height: 48px; border-radius: 10px; }
  .auth-modal__verify-card { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-modal__panel, .auth-modal__backdrop, .auth-modal__stage, .auth-modal__country-menu,
  .auth-modal[data-dir] .auth-modal__stage { animation: auth-fade-in .15s linear both; }
  .auth-modal__consent--gate.is-shaking, .auth-modal__input.is-invalid { animation: none; }
  .auth-modal__consent-hint { transform: none; }
  .auth-modal__panel *, .auth-modal__panel *:hover, .auth-modal__panel *:active { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .auth-modal__backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0,0,0,.8); }
  .auth-modal__panel, .auth-modal__country-menu { backdrop-filter: none; -webkit-backdrop-filter: none; background: #0c1530; }
}
@media (prefers-contrast: more) {
  .auth-modal__panel, .auth-modal__input, .auth-modal__google, .auth-modal__country-trigger { border-color: rgba(255,255,255,.5); }
}
}

.am-footer__version {
  appearance: none;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .18s ease, text-decoration-color .18s ease;
}
.am-footer__version:hover { color: var(--fg); text-decoration-color: currentColor; }
.am-footer__version:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.version-dialog {
  margin: auto;
  width: min(620px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 40px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--fg);
  background: rgba(14, 18, 31, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}
.version-dialog::backdrop { background: rgba(2, 6, 17, 0.74); backdrop-filter: blur(8px); }
.version-dialog__panel { display: flex; max-height: inherit; flex-direction: column; }
.version-dialog__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 24px 24px 18px; border-bottom: 1px solid var(--border);
}
.version-dialog__eyebrow { margin: 0 0 5px; color: var(--accent); font: 600 0.68rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.version-dialog__header h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.version-dialog__close {
  width: 44px; height: 44px; display: grid; flex: 0 0 auto; place-items: center;
  border: 1px solid var(--border); border-radius: 50%; color: var(--fg-muted);
  background: transparent; cursor: pointer;
}
.version-dialog__close:hover { color: var(--fg); border-color: var(--border-hover); background: rgba(255,255,255,.04); }
.version-dialog__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.version-dialog__close .kg-icon { width: 18px; height: 18px; }
.version-dialog__body { padding: 8px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.version-dialog__item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.version-dialog__item:last-child { border-bottom: 0; }
.version-dialog__item--current strong { color: var(--accent); }
.version-dialog__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.version-dialog__meta strong { font-family: var(--font-mono); font-size: .9rem; }
.version-dialog__meta time { color: var(--fg-dim); font: .7rem/1 var(--font-mono); }
.version-dialog__item p { margin: 8px 0 0; color: var(--fg-muted); font-size: .9rem; line-height: 1.6; }
.version-dialog-open { overflow: hidden; }

@media (max-width: 560px) {
  .version-dialog__header { padding: 20px 18px 16px; }
  .version-dialog__body { padding: 6px 18px 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .version-dialog[open] { animation: version-dialog-in .22s var(--ease-out); }
  @keyframes version-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
}


/* ── WeChat Browser Overlay (full-screen guide) ─────────────── */
.wechat-browser-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.94);
  animation: wcBrowserFadeIn 300ms ease-out;
  font-family: var(--font-sans);
  color: #fff;
  overflow: hidden;
}
.wechat-browser-overlay--closing { animation: wcBrowserFadeOut 300ms ease-out forwards; }

/* Mobile-first: vertical flex column. Arrow → text → dismiss button. */
.wechat-browser-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px 24px;
  box-sizing: border-box;
}

/* Big curved arrow pointing UP to the WeChat "⋯" menu (top-right of chrome) */
.wcbo-arrow {
  align-self: flex-end;
  width: 38vw;
  max-width: 160px;
  min-width: 110px;
  aspect-ratio: 1;
  color: #ffd24a;
  filter: drop-shadow(0 0 14px rgba(255,210,74,0.55));
  animation: wcboArrowPulse 1.6s cubic-bezier(.4,0,.2,1) infinite;
  margin-right: -8px;     /* nudge tip toward the corner */
}
.wcbo-arrow svg { width: 100%; height: 100%; display: block; }

/* Centered instructional text — sits below the arrow on mobile */
.wcbo-content {
  margin: 28px auto 0;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: wcBrowserSlideUp 400ms var(--ease) both;
}
.wcbo-title {
  font-size: 20px; font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.wcbo-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.62);
  margin: 0 0 22px;
  line-height: 1.55;
}
.wcbo-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.wcbo-steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.92);
  line-height: 1.45;
}
.wcbo-steps b {
  color: #ffd24a; font-weight: 600;
  padding: 0 2px;
}
.wcbo-step-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: #ffd24a;
  color: #000;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
}

/* Subtle dismiss link at the bottom */
.wcbo-close {
  margin-top: auto;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s, border-color .2s;
  align-self: center;
}
.wcbo-close:hover  { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.35); }
.wcbo-close:active { color: #fff; }

@keyframes wcboArrowPulse {
  0%, 100% { transform: translate(0, 0) scale(1);    opacity: 0.92; }
  50%      { transform: translate(6px, -8px) scale(1.06); opacity: 1; }
}

/* Tiny phones (very short viewports): squeeze further. */
@media (max-height: 640px) {
  .wcbo-arrow   { max-width: 130px; min-width: 90px; }
  .wcbo-content { margin-top: 18px; }
  .wcbo-title   { font-size: 18px; }
  .wcbo-desc    { margin-bottom: 16px; font-size: 12.5px; }
  .wcbo-steps   { gap: 8px; }
  .wcbo-steps li { padding: 10px 12px; font-size: 12.5px; }
  .wcbo-close   { padding: 8px 20px; font-size: 12.5px; }
}

@keyframes wcBrowserFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wcBrowserFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes wcBrowserSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wechat-browser-overlay,
  .wcbo-content,
  .wcbo-arrow,
  .wcbo-target { animation: none; }
  .wcbo-close { transition: none; }
}

/* ── Mobile (small phones, ≤480px) — tighter typography & spacing ───── */
@media (max-width: 480px) {
  .am-container { padding: 0 16px; }

  /* Hero */
  .am-hero { padding: 80px 16px 28px; }
  .am-hero__title { font-size: clamp(2rem, 8.5vw, 2.8rem); margin-bottom: 18px; }
  .am-hero__lede   { font-size: 0.95rem; margin-bottom: 28px; line-height: 1.5; }

  /* Section scaffolding */
  .am-section { padding: 56px 0; }
  .am-section__head { margin-bottom: 36px; }
  .am-section__title { font-size: clamp(1.7rem, 6.5vw, 2.2rem); margin-bottom: 14px; }
  .am-section__lede { font-size: 0.95rem; margin-bottom: 24px; line-height: 1.55; }
  .am-section__eyebrow { font-size: 0.7rem; margin-bottom: 12px; }

  /* Products grid */
  .am-product { padding: 24px 20px; min-height: 0; gap: 10px; }
  .am-product__title { font-size: 1.4rem; }
  .am-product__body  { font-size: 0.88rem; line-height: 1.55; }
  .am-product__arrow { font-size: 0.82rem; }
  .am-product__meta  { font-size: 0.66rem; gap: 8px; }

  /* Stats */
  .am-stats { padding: 36px 0; gap: 28px 20px; }
  .am-stat__num   { font-size: clamp(1.8rem, 6vw, 2.4rem); margin-bottom: 6px; }
  .am-stat__label { font-size: 0.75rem; }

  /* Footer */
  .am-footer { padding: 40px 0 56px; margin-top: 56px; }
  .am-footer__programs { width: 100%; gap: 14px; padding-bottom: 22px; margin-bottom: 22px; }
  .am-footer__logo-wall { grid-template-columns: repeat(auto-fit, 80px); gap: 8px; }
  .am-footer__logo-card { aspect-ratio: 16 / 7; }
  .am-footer__row { gap: 14px; }
  .am-footer__left, .am-footer__links { font-size: 0.78rem; }
  .am-footer__links { gap: 16px; }

  /* About / profile */
  .am-profile-hero__name  { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .am-profile-hero__lede  { font-size: 0.95rem; }
  .am-row { gap: 10px; }
  .am-row__label { font-size: 0.72rem; }

  /* Triptych / projects */
  .am-trip-cell { padding: 24px 20px; }
  .am-project   { padding: 24px 20px; }
  .am-project__title { font-size: 1.2rem; }
  .am-project__body  { font-size: 0.88rem; }

  /* Floating menu — slightly smaller */
  .float-menu__toggle { width: 44px; height: 44px; }

  /* Buttons */
  .am-btn { height: 38px; padding: 0 18px; font-size: 0.88rem; }
}

/* ============================================================
   FORM CONTROLS — STANDARD DESIGN SOP (use site-wide)
   Dark surface · gold-tinted border · ROUNDED (--radius-sm) ·
   accent focus ring · custom caret + dark popup for <select>.
   New pages MUST use .am-input / .am-select / .am-textarea
   (wrap label+control in .am-field). See docs/design-system.md.
   ============================================================ */
.am-input, .am-select, .am-textarea {
  width: 100%; box-sizing: border-box;
  height: 40px; padding: 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: inherit; font-size: 0.9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.am-textarea { height: auto; min-height: 88px; padding: 10px 14px; line-height: 1.5; resize: vertical; }
.am-input::placeholder, .am-textarea::placeholder { color: var(--fg-dim); }
.am-input:focus, .am-select:focus, .am-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.am-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa0a6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
}
/* The dropdown popup is OS-rendered — force a dark, readable option list. */
.am-select option { background-color: var(--bg-elevated); color: var(--fg); }
.am-field { display: flex; flex-direction: column; gap: 6px; }
.am-field > label, .am-field__label {
  font-size: 0.74rem; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Site-wide rounded select treatment. Native option popups remain OS-rendered. */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  min-height: 40px; padding: 0 36px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa0a6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 10px 6px;
  color: var(--fg); font: inherit; cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select option { background: var(--bg-elevated); color: var(--fg); }

/* ------------------------------------------------------------
   Custom dropdown (.am-dd) — replaces a native <select> so the
   OPEN list matches the floating menu (native <option> popups
   are OS-rendered and can't be styled). Enhance a <select> with
   enhanceSelect() (see docs/design-system.md). Mirrors .float-menu.
   ------------------------------------------------------------ */
.am-dd { position: relative; }
.am-dd__btn {
  width: 100%; box-sizing: border-box; height: 40px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--fg);
  font-family: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.am-dd__btn:hover { border-color: var(--accent); }
.am-dd.is-open .am-dd__btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.am-dd__caret { flex-shrink: 0; color: var(--fg-dim); transition: transform .2s ease; }
.am-dd.is-open .am-dd__caret { transform: rotate(180deg); }
.am-dd__menu {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(20, 20, 36, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 8px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity .2s ease, transform .22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.am-dd.is-open .am-dd__menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.am-dd__opt {
  padding: 9px 14px; border-radius: var(--radius-sm); color: var(--fg);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: color .18s, background .18s;
}
.am-dd__opt:hover { background: rgba(232, 201, 107, 0.08); }
.am-dd__opt.is-selected { color: var(--accent); background: rgba(232, 201, 107, 0.12); font-weight: 700; }
