:root {
  --ink: #0d1029;
  --night: #151a3d;
  --dusk: #222a63;
  --sea: #3d4ea3;
  --sky: #6f7fd6;
  --lilac: #b7a8e6;
  --robe: #7b4a2d;
  --robe-dark: #4b2c1b;
  --fur: #e3893b;
  --cream: #f6ecdc;
  --cream-dim: #d9cdbb;
  --gold: #f3c66f;
  --jade: #59e0a8;
  --text: #ece6f5;
  --muted: #b3acd0;
  --radius: 22px;
  --shadow: 0 30px 60px -25px rgba(5, 6, 25, 0.75);
  --display: "Cormorant Garamond", Georgia, serif;
  --brush: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  --body: "Outfit", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; overflow-x: hidden; overflow-x: clip; }
body {
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(111, 127, 214, 0.35), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(183, 168, 230, 0.16), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--ink) 100%);
  background-color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* painterly grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
strong { color: var(--gold); font-weight: 600; }
em { font-style: italic; }

#motes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
main, .footer, .nav { position: relative; z-index: 2; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }

.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lilac); font-weight: 600; margin-bottom: 14px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; color: var(--cream); }
h2 { font-size: clamp(2.4rem, 5.5vw, 4rem); margin-bottom: 14px; }
h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 12px; }
.sub { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin-inline: auto; }
.section-head { margin-bottom: 56px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: 1rem;
  padding: 15px 28px; border-radius: 999px; border: 0; cursor: pointer;
  color: #2a1508;
  background: linear-gradient(135deg, #ffd88a 0%, var(--fur) 100%);
  box-shadow: 0 10px 30px -10px rgba(243, 160, 70, 0.7), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(243, 160, 70, 0.85), inset 0 1px 0 rgba(255,255,255,0.5); filter: saturate(1.1); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .nav a:focus-visible, .master:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-ghost {
  color: var(--cream); background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(246, 236, 220, 0.3);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1px rgba(246, 236, 220, 0.6); }
.btn-small { padding: 10px 20px; font-size: 0.92rem; }
.btn-big { padding: 18px 38px; font-size: 1.1rem; margin-top: 48px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100% - 1180px) / 2));
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
/* blur lives on a pseudo-element so it doesn't trap the fixed mobile menu */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(13, 16, 41, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(183, 168, 230, 0.15);
  opacity: 0; transition: opacity .3s ease;
}
.nav.scrolled::before { opacity: 1; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--cream); }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(243, 198, 111, 0.6); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { font-size: 0.95rem; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--cream); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 0 90px; overflow: hidden;
}
.hero-glyph {
  position: absolute; right: -4vw; top: 50%; transform: translateY(-50%);
  font-family: var(--brush); font-size: clamp(12rem, 34vw, 30rem); line-height: 1;
  color: rgba(183, 168, 230, 0.06); pointer-events: none; user-select: none; white-space: nowrap;
}
.hero-inner {
  position: relative; z-index: 1;
  width: min(1180px, 100% - 32px); margin-inline: auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(3.4rem, 9vw, 7.2rem); letter-spacing: -0.01em; }
.hero h1 em { color: var(--fur); font-style: italic; }
.ticker { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--gold); font-weight: 700; margin: 6px 0 22px; }
.ticker span { color: var(--muted); font-family: var(--body); font-size: 1rem; font-weight: 500; letter-spacing: 0.08em; margin-left: 8px; }
.lede { font-size: 1.15rem; color: var(--text); max-width: 540px; opacity: 0.92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.hero-art { position: relative; display: grid; place-items: center; }
.halo {
  position: absolute; width: 112%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 198, 111, 0.28) 0%, rgba(111, 127, 214, 0.18) 40%, transparent 68%);
  filter: blur(10px); animation: breathe 7s ease-in-out infinite;
}
.master {
  position: relative; border: 0; background: none; cursor: pointer; padding: 0;
  width: min(480px, 100%); aspect-ratio: 1; border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}
.master img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(246, 236, 220, 0.08), 0 0 0 14px rgba(243, 198, 111, 0.12), var(--shadow);
  transition: transform .35s ease;
}
.master:hover img { transform: scale(1.02) rotate(-1deg); }
.master.bow img { animation: bow .7s ease; }
.hint { margin-top: 18px; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); opacity: 0.7; }

.bubble {
  position: absolute; pointer-events: none; z-index: 5;
  font-family: var(--brush); font-size: 2.4rem; color: var(--cream);
  background: rgba(75, 44, 27, 0.92); border: 1px solid rgba(243, 198, 111, 0.5);
  padding: 4px 18px 6px; border-radius: 18px;
  animation: pop 1.6s ease-out forwards; white-space: nowrap;
}
.bubble small { font-family: var(--display); font-size: 1.1rem; margin-left: 8px; color: var(--gold); font-style: italic; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border-radius: 14px; box-shadow: inset 0 0 0 2px rgba(246,236,220,0.35); }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cream); animation: cue 1.8s ease-in-out infinite; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid rgba(183, 168, 230, 0.18);
  background: linear-gradient(90deg, rgba(123, 74, 45, 0.35), rgba(61, 78, 163, 0.35));
  padding: 16px 0; transform: rotate(-1.2deg); margin: 0 -10px;
}
.marquee-track { display: flex; gap: 38px; width: max-content; animation: marquee 32s linear infinite; align-items: center; }
.marquee span { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.12em; color: var(--cream); }
.marquee b { font-family: var(--brush); font-weight: 400; font-size: 1.8rem; color: var(--gold); }

/* ---------- legend ---------- */
.legend { padding: 140px 0 120px; }
.big-text { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--text); opacity: 0.9; margin-top: 22px; text-align: center; }
.big-text em { color: var(--lilac); }

/* ---------- scrolls ---------- */
.scrolls { padding: 60px 0 120px; }
.chapters { list-style: none; display: grid; gap: 110px; }
.chapter { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
.chapter:nth-child(even) .chapter-art { order: 2; }
.chapter-art {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: zoom-in;
  box-shadow: var(--shadow), 0 0 0 1px rgba(246, 236, 220, 0.12);
  transform: rotate(-0.8deg); transition: transform .5s ease;
}
.chapter:nth-child(even) .chapter-art { transform: rotate(0.8deg); }
.chapter-art:hover { transform: rotate(0) scale(1.015); }
.chapter-art img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.chapter-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 60px rgba(13, 16, 41, 0.45); pointer-events: none; }
.chapter-text { position: relative; }
.num {
  position: absolute; top: -118px; left: -6px; z-index: -1;
  font-family: var(--brush); font-size: 8rem; line-height: 1; color: rgba(243, 198, 111, 0.16);
}
.chapter-label { font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--fur); font-weight: 600; margin-bottom: 10px; }
.chapter-text p:not(.chapter-label) { color: var(--text); opacity: 0.88; font-size: 1.08rem; }
.chapter-text em { color: var(--lilac); }

/* ---------- teachings ---------- */
.teachings { padding: 120px 0; background: linear-gradient(180deg, transparent, rgba(75, 44, 27, 0.18) 40%, transparent); }
.oracle { display: grid; justify-items: center; gap: 30px; margin-bottom: 90px; }
.scroll-paper {
  position: relative; width: min(680px, 100%); min-height: 220px;
  padding: 56px 48px 40px; border-radius: 6px;
  color: #3a2414; text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, #fbf3e4 0%, #efe0c4 70%, #e2cca6 100%);
  box-shadow: var(--shadow), inset 0 0 40px rgba(123, 74, 45, 0.25);
}
.scroll-paper::before, .scroll-paper::after {
  content: ""; position: absolute; left: -14px; right: -14px; height: 18px; border-radius: 10px;
  background: linear-gradient(180deg, #8a5a37, #4b2c1b); box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.scroll-paper::before { top: -9px; }
.scroll-paper::after { bottom: -9px; }
.seal {
  position: absolute; right: 22px; bottom: 22px; font-family: var(--brush); font-size: 1.15rem;
  color: #fff3e2; background: #b8342a; padding: 6px 8px; border-radius: 4px; transform: rotate(-6deg); opacity: 0.9;
  writing-mode: vertical-rl;
}
.teaching { font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.25; transition: opacity .35s ease, transform .35s ease; }
.teaching.fade { opacity: 0; transform: translateY(8px); }
.teaching-sign { margin-top: 18px; font-size: 0.82rem; letter-spacing: 0.26em; text-transform: uppercase; color: #8a5a37; font-weight: 600; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.principle {
  padding: 34px 30px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(61, 78, 163, 0.25), rgba(21, 26, 61, 0.6));
  box-shadow: inset 0 0 0 1px rgba(183, 168, 230, 0.16);
}
.p-glyph { display: block; font-family: var(--brush); font-size: 3.4rem; color: var(--gold); line-height: 1; margin-bottom: 18px; }
.principle p { color: var(--muted); }

/* ---------- token ---------- */
.token { padding: 120px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat {
  padding: 30px 24px; border-radius: var(--radius); text-align: center;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(246, 236, 220, 0.12);
}
.stat-label { display: block; font-size: 0.78rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.2rem); color: var(--cream); overflow-wrap: anywhere; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.badges li {
  padding: 9px 18px; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  color: var(--jade); background: rgba(89, 224, 168, 0.08); box-shadow: inset 0 0 0 1px rgba(89, 224, 168, 0.3);
}

/* ---------- buy ---------- */
.buy { padding: 110px 0 140px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step {
  position: relative; padding: 34px 26px 30px; border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(123, 74, 45, 0.32), rgba(21, 26, 61, 0.55));
  box-shadow: inset 0 0 0 1px rgba(243, 198, 111, 0.16);
}
.step-num { display: block; font-family: var(--display); font-weight: 700; font-size: 2.6rem; color: var(--fur); line-height: 1; margin-bottom: 16px; }
.step h3 { font-size: 1.6rem; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* ---------- footer ---------- */
.footer { padding: 60px 0 40px; border-top: 1px solid rgba(183, 168, 230, 0.15); background: rgba(8, 10, 28, 0.6); }
.footer-inner { display: grid; gap: 22px; justify-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 14px; text-align: left; }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; }
.footer-title { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--cream); line-height: 1.1; }
.footer-glyph { color: var(--muted); font-size: 0.92rem; }
.disclaimer { max-width: 720px; font-size: 0.85rem; color: var(--muted); opacity: 0.8; }
.copy { font-size: 0.8rem; color: var(--muted); opacity: 0.6; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(8, 10, 28, 0.92); backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; width: auto; border-radius: 14px; box-shadow: var(--shadow); }
.lightbox-close { position: absolute; top: 16px; right: 20px; font-size: 2.4rem; color: var(--cream); background: none; border: 0; cursor: pointer; line-height: 1; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- keyframes ---------- */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes bow { 0% { transform: rotate(0); } 40% { transform: rotate(-4deg) translateY(10px) scale(0.98); } 100% { transform: rotate(0); } }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-copy { order: 2; }
  .hero-art { order: 1; }
  .master { width: min(340px, 78vw); }
  .lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero { padding-top: 100px; }
  .chapter { grid-template-columns: 1fr; gap: 30px; }
  .chapter:nth-child(even) .chapter-art { order: 0; }
  .chapters { gap: 80px; }
  .num { top: -14px; left: auto; right: 0; font-size: 5.5rem; }
  .stats, .steps { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { gap: 12px; }
  .nav-links {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw);
    flex-direction: column; gap: 6px; padding: 96px 28px 28px; margin: 0;
    background: rgba(13, 16, 41, 0.97); box-shadow: -20px 0 50px rgba(0,0,0,0.45);
    transform: translateX(100%); transition: transform .35s ease;
  }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 1.2rem; padding: 10px 0; color: var(--cream); }
  .nav .btn-small { margin-left: auto; }
  .nav-toggle {
    display: grid; gap: 6px; place-content: center; width: 44px; height: 44px; border-radius: 12px;
    border: 0; background: rgba(255,255,255,0.07); cursor: pointer; z-index: 2;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--cream); border-radius: 2px; transition: transform .3s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  .stats, .steps { grid-template-columns: 1fr; }
  .scroll-paper { padding: 48px 26px 54px; }
  .legend { padding: 100px 0 80px; }
  .hint { display: none; }
  .btn-big { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
