/* Palette follows Buddhist colour symbolism: gold (enlightenment),
   vermilion/朱红 (sacred, protective — one of the five Buddhas), and
   saffron (monk robes, renunciation). No greens. */
:root {
  --bg: #f8f2e7;
  --bg-2: #f1e5d5;
  --surface: #fffaf1;
  --surface-glass: rgba(255, 250, 241, 0.72);
  --ink: #2b1f18;
  --muted: #6d5a4a;
  --line: rgba(43, 31, 24, 0.16);
  --vermilion: #9d2b20;
  --vermilion-bright: #c0442f;
  --saffron: #c8701c;
  --gold: #b8892a;
  --gold-soft: rgba(184, 137, 40, 0.16);
  --coral: #a8382a;
  --shadow: 0 30px 80px rgba(70, 45, 25, 0.18);
  --radius: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110e;
    --bg-2: #100b09;
    --surface: #241b16;
    --surface-glass: rgba(36, 27, 22, 0.66);
    --ink: #f6ece0;
    --muted: #b8a595;
    --line: rgba(246, 236, 224, 0.14);
    --vermilion: #e0705c;
    --vermilion-bright: #ef8a72;
    --saffron: #e79a4d;
    --gold: #e6b95c;
    --gold-soft: rgba(230, 185, 92, 0.16);
    --coral: #e0705c;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
  color: var(--ink);
  font-family: "Iowan Old Style", Cambria, Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Ambient aurora that drifts slowly behind everything. */
.aurora {
  position: fixed;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38rem 30rem at 16% 8%, rgba(184, 137, 40, 0.22), transparent 60%),
    radial-gradient(34rem 30rem at 86% 4%, rgba(157, 43, 32, 0.2), transparent 60%),
    radial-gradient(40rem 34rem at 70% 92%, rgba(200, 112, 28, 0.14), transparent 62%);
  animation: aurora-drift 60s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.08); }
}

::selection {
  background: rgba(184, 137, 40, 0.32);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 76%, white);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 48px);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--vermilion), var(--gold));
  color: #fffaf1;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(157, 43, 32, 0.3);
}

.brand-word {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-word em {
  font-style: normal;
  color: var(--gold);
  margin-left: 4px;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 6px;
}

.site-nav-item {
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 200ms ease, background-color 200ms ease;
}

.site-nav-item:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--vermilion) 10%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
}

@media (max-width: 560px) {
  .header-actions .btn-sm {
    display: none;
  }
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }
}

.lang-switch select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}

/* --- Hero --- */
main {
  display: block;
}

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 110px) clamp(20px, 6vw, 32px) 40px;
  text-align: center;
}

.kicker {
  margin: 0 0 14px;
  color: var(--vermilion);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.couplet {
  margin: 0 auto 22px;
  max-width: 30rem;
  color: var(--gold);
  font-size: clamp(1rem, 3.4vw, 1.35rem);
  letter-spacing: 0.12em;
  font-weight: 600;
}

.hero-sub {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.6;
}

.hero-orb {
  display: grid;
  place-items: center;
  margin: 34px 0 10px;
}

.orb {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 250, 241, 0.95), transparent 58%),
    radial-gradient(circle, color-mix(in srgb, var(--vermilion) 60%, transparent), color-mix(in srgb, var(--gold) 34%, transparent));
  box-shadow: 0 0 46px rgba(157, 43, 32, 0.32), 0 0 110px rgba(184, 137, 40, 0.22);
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.86); opacity: 0.84; }
  50% { transform: scale(1.12); opacity: 1; }
}

.phrase-rotator {
  margin: 8px auto 30px;
  max-width: 32rem;
  min-height: 84px;
  padding: 0 16px;
  border: 0;
}

.phrase-zh {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 4.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  transition: opacity 700ms ease;
}

.phrase-gloss {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  line-height: 1.5;
  transition: opacity 700ms ease;
}

.phrase-rotator.fade .phrase-zh,
.phrase-rotator.fade .phrase-gloss {
  opacity: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.btn-primary {
  color: #fffaf1;
  background: linear-gradient(135deg, var(--vermilion), var(--vermilion-bright));
  box-shadow: 0 14px 30px rgba(157, 43, 32, 0.32);
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.btn-lg {
  min-height: 58px;
  padding: 0 40px;
  font-size: 1.08rem;
}

@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: 0 18px 40px rgba(157, 43, 32, 0.4); }
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* --- Sections --- */
section {
  padding: clamp(40px, 8vw, 90px) clamp(20px, 6vw, 32px);
  max-width: 1080px;
  margin: 0 auto;
}

.section-eyebrow {
  margin: 0 0 10px;
  text-align: center;
  color: var(--vermilion);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-sub {
  margin: 0 auto 34px;
  max-width: 34rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* --- Gates --- */
.gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.gate-card {
  position: relative;
  padding: 26px 22px;
  border-radius: var(--radius);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

@media (hover: hover) {
  .gate-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 34px 90px rgba(52, 44, 31, 0.2);
  }
}

.gate-icon {
  font-size: 2rem;
  line-height: 1;
}

.gate-zh {
  margin: 14px 0 2px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.gate-name {
  margin: 0 0 10px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vermilion);
}

.gate-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.gate-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}

.gate-badge.soon {
  color: var(--gold);
  background: var(--gold-soft);
}

.gate-badge.now {
  color: var(--vermilion);
  background: color-mix(in srgb, var(--vermilion) 14%, transparent);
}

/* --- Steps --- */
.step-list {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.step-list li {
  counter-increment: step;
  padding: 24px 22px 24px 60px;
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 22px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vermilion), var(--gold));
  color: #fffaf1;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 700;
}

.step-list h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.step-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Merit + Ethics bands --- */
.merit-inner,
.ethics-inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: 34px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.merit-inner {
  background: linear-gradient(150deg, color-mix(in srgb, var(--vermilion) 12%, var(--surface)), var(--surface));
}

.ethics-inner {
  background: var(--surface);
  border-left: 4px solid var(--gold);
}

.merit-body,
.ethics-body {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* --- Phrase wall --- */
.phrase-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.phrase-chip {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--surface-glass);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}

.phrase-chip .zh {
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.phrase-chip .gloss {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* --- Final CTA + footer --- */
.final-cta {
  text-align: center;
  padding-top: 10px;
}

.site-footer {
  text-align: center;
  padding: 40px 20px 56px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}

.footer-blessing {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 1.1rem;
  font-style: italic;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
