/* =========================================================
   GOLDEN DOG on TON · 金狗 — Redesigned
   Crimson + radiant gold + TON blue · Chinese-prosperity vibe
   ========================================================= */

:root {
  --red-deep:   #6e0606;
  --red-dark:   #8a0a0a;
  --red-base:   #c8102e;
  --red-bright: #e31837;
  --red-glow:   #ff3838;

  --gold-pale:  #fff5b8;
  --gold-light: #ffe66d;
  --gold-base:  #ffc107;
  --gold-mid:   #e8a300;
  --gold-deep:  #b8860b;
  --gold-shadow:#7a5400;

  --ton-blue:        #0098ea;
  --ton-blue-light:  #33b1f0;
  --ton-blue-dark:   #005f8f;

  --ink:    #1a0000;
  --paper:  #fff8e6;
  --cream:  #ffe9b5;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-gold: 0 10px 40px rgba(255, 193, 7, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-deep: 0 12px 30px rgba(0, 0, 0, 0.45);

  --nav-h: 76px;

  --font-cn-brush:   "Ma Shan Zheng", "ZCOOL XiaoWei", serif;
  --font-cn-display: "ZCOOL XiaoWei", "Noto Sans SC", serif;
  --font-cn-body:    "Noto Sans SC", system-ui, sans-serif;
  --font-en-display: "Cinzel", "Russo One", "Bebas Neue", serif;
  --font-en-body:    "Inter", system-ui, sans-serif;
  --font-mono:       "JetBrains Mono", "Courier New", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en-body), var(--font-cn-body);
  color: var(--paper);
  background: var(--red-deep);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ====== Backgrounds ====== */

.bg-stage {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse at 50% 30%, #ff3838 0%, #c8102e 30%, #6e0606 75%, #2a0202 100%);
}

.bg-rays {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 45%,
      rgba(255, 215, 0, 0.18) 0deg 4deg,
      transparent 4deg 12deg
    );
  filter: blur(0.5px);
  animation: spin 80s linear infinite;
  pointer-events: none;
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Floating coin field */
.coin-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.coin-field img {
  position: absolute;
  width: var(--size, 60px);
  height: var(--size, 60px);
  opacity: 0.78;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  animation: floatCoin var(--dur, 12s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes floatCoin {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-30px) rotate(15deg); }
}

/* ====== NAVBAR ====== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(110, 6, 6, 0.92), rgba(110, 6, 6, 0.62));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.28);
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.navbar.scrolled {
  background: linear-gradient(180deg, rgba(60, 0, 0, 0.95), rgba(60, 0, 0, 0.85));
  border-bottom-color: rgba(255, 215, 0, 0.45);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  max-width: 1320px;
  margin: 0 auto;
  height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand-medal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #ff5252, #a30000);
  border: 2px solid var(--gold-base);
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  flex-shrink: 0;
}
.brand-medal::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 215, 0, 0.6) 90deg, transparent 180deg);
  filter: blur(4px);
  z-index: -1;
  animation: spin 6s linear infinite;
}
.brand-medal-char {
  font-family: var(--font-cn-brush);
  font-size: 22px;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  -webkit-text-stroke: 0.5px var(--red-deep);
  paint-order: stroke fill;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-cn {
  font-family: var(--font-cn-brush);
  font-size: 22px;
  color: var(--gold-light);
  text-shadow: 0 0 14px rgba(255, 193, 7, 0.55);
  letter-spacing: 1px;
}
.brand-en {
  font-family: var(--font-en-display);
  font-size: 11.5px;
  color: var(--cream);
  letter-spacing: 2.4px;
  font-weight: 600;
}

/* Mid: buy buttons */
.navbar-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  justify-content: center;
}
.nav-buy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper);
  letter-spacing: 0.4px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
}
.nav-buy:hover {
  transform: translateY(-2px);
  border-color: var(--gold-light);
  background: rgba(255, 193, 7, 0.12);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.35);
}
.nav-buy-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-mid));
  color: var(--ink);
  border: 1.5px solid var(--red-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.nav-buy-icon.ton-bg {
  background: linear-gradient(180deg, var(--ton-blue-light), var(--ton-blue));
  border-color: var(--gold-base);
}
.nav-buy-icon.gold-bg {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-mid));
}
.nav-buy-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Right cluster */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.social-tabs { display: flex; gap: 8px; }
.social-tab {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #34abe0, #0088cc);
  border: 2px solid var(--gold-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.25s;
}
.social-tab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 22px rgba(52, 171, 224, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.social-tab.x {
  background: linear-gradient(180deg, #2a2a2a, #000);
}
.social-tab.x:hover {
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.social-tab svg { width: 18px; height: 18px; fill: #fff; }
.social-tab.x svg { width: 16px; height: 16px; }

.lang-switch {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 999px;
  padding: 4px;
}
.lang-switch button {
  background: transparent;
  border: 0;
  color: var(--cream);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.lang-switch button:hover { color: var(--gold-light); }
.lang-switch button.active {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-mid));
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.5);
}

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(0, 0, 0, 0.85);
  color: var(--gold-light);
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 70;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Burger */
.burger {
  display: none;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--gold-base);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(60, 0, 0, 0.98), rgba(40, 0, 0, 0.98));
  border-top: 0 solid rgba(255, 215, 0, 0.35);
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease, border-top-width 0.3s ease, visibility 0s linear 0.4s;
}
.mobile-drawer.open {
  max-height: 720px;
  padding: 18px 22px 26px;
  border-top-width: 1px;
  visibility: visible;
  transition: max-height 0.4s ease, padding 0.3s ease, border-top-width 0.3s ease, visibility 0s;
}
.mobile-drawer .mobile-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer .mobile-label {
  font-family: var(--font-en-display);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-base);
  margin-bottom: 4px;
}
.mobile-drawer .nav-buy {
  background: rgba(255, 193, 7, 0.1);
  padding: 10px 16px 10px 10px;
  font-size: 15px;
}

/* ====== HERO ====== */

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  padding: 60px 24px 80px;
  display: flex;
  align-items: center;
}
.hero-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-left { text-align: left; }
.hero-right { display: flex; justify-content: center; align-items: center; flex-direction: column; }

/* Hero calligraphic frame */
.hero-frame {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 600 / 360;
  margin: 0 0 18px;
}
.hero-frame-decor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}
.hero-calligraphy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6%;
}
.cal-char {
  font-family: var(--font-cn-brush);
  font-weight: 400;
  font-size: clamp(120px, 16vw, 220px);
  line-height: 1;
  background: linear-gradient(180deg, #fff5b8 0%, #ffe66d 25%, #ffc107 55%, #b8860b 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--red-deep);
  paint-order: stroke fill;
  text-shadow:
    0 2px 0 var(--red-bright),
    0 4px 0 var(--red-dark),
    0 6px 0 var(--gold-shadow),
    0 10px 24px rgba(0, 0, 0, 0.55),
    0 0 50px rgba(255, 193, 7, 0.55);
  filter: drop-shadow(0 0 12px rgba(255, 230, 109, 0.5));
}

.hero-frame-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.18) 52%,
    transparent 70%);
  background-size: 250% 250%;
  background-position: 200% 0;
  mix-blend-mode: overlay;
  animation: shine 7s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, #000 60%, transparent 90%);
          mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, #000 60%, transparent 90%);
}
@keyframes shine {
  0%, 100% { background-position: 200% 0; }
  50%      { background-position: -50% 0; }
}

/* BY TON pill */
.by-ton {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 11px 26px;
  background: linear-gradient(180deg, var(--ton-blue-light), var(--ton-blue), var(--ton-blue-dark));
  border: 3px solid var(--gold-base);
  border-radius: 999px;
  color: white;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 4px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 0 2px var(--red-deep);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 22px;
}
.by-ton .ton-diamond { width: 22px; height: 22px; }

/* Hero slogan */
.hero-slogan {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  color: var(--gold-light);
  text-shadow: 0 2px 0 var(--red-deep), 0 0 24px rgba(255, 193, 7, 0.55);
  letter-spacing: 1px;
  margin: 0 0 18px;
  min-height: 1.2em;
}
.typewriter::after {
  content: "|";
  display: inline-block;
  margin-left: 4px;
  color: var(--gold-light);
  animation: blink 1s steps(2) infinite;
}
.typewriter.done::after { animation: blink 1.5s steps(2) infinite; opacity: 0.6; }
@keyframes blink { to { opacity: 0; } }

.hero-sub {
  color: var(--cream);
  font-size: 17px;
  max-width: 580px;
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-base) 50%, var(--gold-mid) 100%);
  color: var(--ink);
  border: 2px solid var(--red-deep);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(150, 100, 0, 0.5),
    0 6px 18px rgba(255, 193, 7, 0.5),
    0 0 0 1px var(--gold-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-gold:hover {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(150, 100, 0, 0.5),
    0 12px 28px rgba(255, 193, 7, 0.75),
    0 0 0 1px var(--gold-deep);
}

.btn-shimmer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(110deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 70%,
    transparent 100%);
  transform: skewX(-20deg);
  animation: shimmerSweep 3.5s ease-in-out infinite;
}
@keyframes shimmerSweep {
  0%, 100% { left: -120%; }
  50%      { left: 130%; }
}

.btn-ghost {
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold-light);
  border: 2px solid var(--gold-base);
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.3);
}

/* 3D rotating coin */
.coin3d {
  width: clamp(220px, 28vw, 320px);
  aspect-ratio: 1;
  perspective: 1000px;
  margin-bottom: 24px;
}
.coin3d-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: spin3d 9s linear infinite;
}
@keyframes spin3d {
  from { transform: rotateY(0deg) rotateX(8deg); }
  to   { transform: rotateY(360deg) rotateX(8deg); }
}
.coin3d-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  box-shadow:
    0 0 30px rgba(255, 193, 7, 0.6),
    0 20px 40px rgba(0, 0, 0, 0.5);
}
.coin3d-face svg { width: 100%; height: 100%; display: block; }
.coin3d-back { transform: rotateY(180deg); }
.coin3d-edge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(90deg, #b8860b, #ffd43a, #b8860b);
  transform: translateZ(-4px);
  filter: blur(1px);
  opacity: 0.85;
}
.coin3d-shadow {
  width: 60%;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  filter: blur(4px);
  margin-top: -10px;
  animation: shadowPulse 9s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.55; }
  50%      { transform: scaleX(0.7); opacity: 0.4; }
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid var(--gold-base);
  display: grid;
  place-items: start center;
  padding-top: 8px;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.hero-scroll:hover { opacity: 1; }
.hero-scroll span {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold-light);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 0; }
  50%  { transform: translateY(8px); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0; }
}

/* ====== LORE CHAPTERS ====== */

.lore-chapter {
  position: relative;
  padding: 120px 24px;
  overflow: hidden;
}
.lore-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(255, 215, 0, 0.04) 0deg 6deg,
      transparent 6deg 18deg
    );
  pointer-events: none;
  z-index: -1;
}

.chapter-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.chapter-inner.reverse { direction: rtl; }
.chapter-inner.reverse > * { direction: ltr; }
.chapter-inner.center {
  grid-template-columns: 1fr;
  text-align: center;
}

.chapter-cal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cal-mega {
  font-family: var(--font-cn-brush);
  font-weight: 400;
  font-size: clamp(180px, 22vw, 360px);
  line-height: 1;
  background: linear-gradient(180deg, #fff5b8 0%, #ffe66d 25%, #ffc107 55%, #b8860b 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--red-deep);
  paint-order: stroke fill;
  filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 40px rgba(255, 193, 7, 0.45));
  display: inline-block;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.2);
}

.cal-pin {
  font-family: var(--font-en-display);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--gold-base);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

/* Wagging animation for 狗 */
.cal-mega.wag {
  transform-origin: 50% 100%;
  animation: wag 4s ease-in-out infinite;
}
@keyframes wag {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(2.5deg); }
  75%      { transform: rotate(-2.5deg); }
}

/* Calligraphy reveal: clip-path drawn from one side */
.reveal[data-reveal="cal-draw"] .cal-mega {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal[data-reveal="cal-draw"][data-cal-side="right"] .cal-mega {
  clip-path: inset(0 0 0 100%);
}
.reveal[data-reveal="cal-draw"].in .cal-mega {
  clip-path: inset(0 0 0 0);
}
.reveal[data-reveal="cal-draw"] .cal-pin {
  opacity: 0;
  transition: opacity 0.6s 1s ease;
}
.reveal[data-reveal="cal-draw"].in .cal-pin {
  opacity: 1;
}

/* Brush stroke imitation overlay */
.chapter-cal::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 232, 181, 0.25) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
  filter: blur(20px);
}

/* Chapter text */
.chapter-text { max-width: 560px; }
.chapter-text.center { margin: 0 auto; }
.chapter-eyebrow {
  display: inline-block;
  font-family: var(--font-en-display);
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--gold-base);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold-base);
}
.chapter-title {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  background: linear-gradient(180deg, #fff5b8, #ffc107 55%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  -webkit-text-stroke: 1px var(--red-deep);
  paint-order: stroke fill;
  margin-bottom: 22px;
  letter-spacing: 0.5px;
}
.chapter-text p {
  color: var(--cream);
  font-size: 17px;
  line-height: 1.75;
}
.chapter-text p + p { margin-top: 14px; }
.chapter-text strong {
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
  font-family: var(--font-cn-brush), var(--font-en-display);
  letter-spacing: 0.5px;
}

/* Chapter 3: legend - characters meet */
.legend-cal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  position: relative;
  margin-bottom: 30px;
}
.reveal[data-reveal="legend-meet"] .cal-mega {
  transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.4, 1.2), opacity 0.8s ease;
}
.reveal[data-reveal="legend-meet"] .cal-mega:first-child {
  transform: translateX(-180px) rotate(-8deg);
  opacity: 0;
}
.reveal[data-reveal="legend-meet"] .cal-mega:nth-child(2) {
  transform: translateX(180px) rotate(8deg);
  opacity: 0;
}
.reveal[data-reveal="legend-meet"].in .cal-mega:first-child,
.reveal[data-reveal="legend-meet"].in .cal-mega:nth-child(2) {
  transform: translateX(0) rotate(0);
  opacity: 1;
}
.legend-flash {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 230, 109, 0.6), transparent 60%);
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.6s 1.1s ease;
  pointer-events: none;
}
.reveal[data-reveal="legend-meet"].in .legend-flash {
  opacity: 1;
  animation: flashPulse 3s ease-in-out 1.4s infinite;
}
@keyframes flashPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* Chapter 4: TON orb */
.ton-orb {
  position: relative;
  width: clamp(160px, 18vw, 220px);
  aspect-ratio: 1;
  margin: 0 auto 30px;
}
.ton-orb svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 40px rgba(0, 152, 234, 0.6)) drop-shadow(0 0 60px rgba(0, 152, 234, 0.5));
  animation: orbFloat 5s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.ton-orb-pulse {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  border: 2px solid rgba(0, 152, 234, 0.5);
  animation: orbPulse 3s ease-out infinite;
  pointer-events: none;
}
@keyframes orbPulse {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 880px;
  margin: 50px auto 0;
}
.stat-card {
  background: linear-gradient(180deg, rgba(0, 152, 234, 0.16), rgba(0, 0, 0, 0.45));
  border: 2px solid var(--gold-base);
  border-radius: var(--radius-lg);
  padding: 30px 22px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
}
.stat-card:hover {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}
.stat-num {
  font-family: var(--font-en-display);
  font-weight: 900;
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1;
  background: linear-gradient(180deg, #fff5b8, #ffc107 60%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px var(--red-deep);
  paint-order: stroke fill;
  margin-bottom: 10px;
}
.stat-label {
  color: var(--cream);
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* Chapter 5: Three Virtues */
.virtues-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 50px auto 0;
}
.virtue-card {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.10), rgba(0, 0, 0, 0.4));
  border: 2px solid var(--gold-base);
  border-radius: var(--radius-lg);
  padding: 38px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.2), box-shadow 0.3s, border-color 0.3s;
  transform-style: preserve-3d;
}
.virtue-card:hover {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}
.virtue-card::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 215, 0, 0.06) 0deg 6deg,
    transparent 6deg 18deg
  );
  pointer-events: none;
}
.virtue-glyph {
  font-family: var(--font-cn-brush);
  font-size: 90px;
  font-weight: 400;
  line-height: 1;
  background: linear-gradient(180deg, #fff5b8, #ffc107 55%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px var(--red-deep);
  paint-order: stroke fill;
  display: inline-block;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  position: relative;
}
.virtue-card h3 {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--gold-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  position: relative;
}
.virtue-card p {
  color: var(--cream);
  font-size: 15px;
  position: relative;
}

/* ====== Section common ====== */

.section {
  padding: 80px 0;
  position: relative;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-title {
  text-align: center;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 50px);
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff5b8, #ffc107 50%, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 1px var(--red-deep);
  paint-order: stroke fill;
  margin-bottom: 14px;
}
.section-title.small { font-size: clamp(24px, 3vw, 36px); }
.section-sub {
  text-align: center;
  color: var(--cream);
  max-width: 720px;
  margin: 0 auto 40px;
  font-size: 17px;
}

/* ====== CA section ====== */

.ca-section { padding: 60px 0 40px; }

.ca-card {
  max-width: 920px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.12), rgba(0, 0, 0, 0.55));
  border: 3px solid var(--gold-base);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-gold);
  overflow: hidden;
}
.ca-shimmer-border {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 230, 109, 0.6) 60deg,
    transparent 140deg,
    transparent 240deg,
    rgba(255, 230, 109, 0.4) 320deg,
    transparent 360deg
  );
  z-index: -1;
  animation: spin 6s linear infinite;
  filter: blur(2px);
  pointer-events: none;
}
.ca-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.ca-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--gold-light);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.ca-warn {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.ca-warn::before {
  content: "⚠";
  font-size: 16px;
}

/* ====== Grab (compact buy) ====== */

.grab-section { padding: 30px 0 80px; }
.grab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.grab-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.15), rgba(0, 0, 0, 0.45));
  border: 2px solid var(--gold-base);
  color: var(--paper);
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
}
.grab-pill:hover {
  transform: translateY(-3px);
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}

/* ====== Footer ====== */

footer.site-footer {
  border-top: 2px solid rgba(255, 193, 7, 0.4);
  padding: 30px 24px 40px;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  margin-top: 30px;
}
footer.site-footer .copy {
  font-size: 13px;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  font-family: var(--font-en-display);
}
footer.site-footer .footer-ca {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(255, 232, 181, 0.55);
  word-break: break-all;
  margin-top: 8px;
}

/* ====== Toast ====== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, var(--gold-light), var(--gold-base));
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--red-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ====== Reveal-on-scroll ====== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal[data-reveal="fade-right"] { transform: translateX(40px); }
.reveal[data-reveal="fade-left"]  { transform: translateX(-40px); }
.reveal[data-reveal="cal-draw"]   { transform: none; opacity: 1; }
.reveal[data-reveal="legend-meet"]{ transform: none; opacity: 1; }
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ====== Mouse tilt readiness ====== */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* ====== Responsive ====== */

@media (max-width: 1100px) {
  .navbar-mid .nav-buy-label { display: none; }
  .navbar-mid .nav-buy {
    padding: 6px;
    border-radius: 999px;
  }
  .chapter-inner { gap: 50px; }
}

@media (max-width: 860px) {
  .navbar-mid,
  .social-tabs,
  .navbar-right > .lang-switch { display: none; }
  .burger { display: flex; }
  .mobile-drawer { display: flex; }
  .mobile-drawer .lang-switch.mobile-lang {
    display: flex;
    align-self: flex-start;
    padding: 6px;
  }
  .mobile-drawer .lang-switch.mobile-lang button {
    padding: 7px 14px;
    font-size: 13px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .hero-left { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .by-ton { font-size: 17px; padding: 9px 22px; }

  .lore-chapter { padding: 80px 24px; }
  .chapter-inner,
  .chapter-inner.reverse {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
    direction: ltr;
  }
  .chapter-text { max-width: none; margin: 0 auto; }
  .stats-grid { grid-template-columns: 1fr; gap: 16px; }
  .virtues-grid { grid-template-columns: 1fr; }
  .legend-cal { gap: 6px; }

  .reveal[data-reveal="fade-right"],
  .reveal[data-reveal="fade-left"] { transform: translateY(28px); }
}

@media (max-width: 520px) {
  .navbar-inner { padding: 10px 14px; gap: 10px; }
  .brand-medal { width: 38px; height: 38px; }
  .brand-cn { font-size: 19px; }
  .brand-en { font-size: 10px; }
  .container { padding: 0 16px; }
  .lore-chapter { padding: 60px 18px; }
  .ca-card { padding: 22px; }
  .grab-pill { font-size: 14px; padding: 10px 18px 10px 10px; }
}

/* ====== Reduced motion ====== */
@media (prefers-reduced-motion: reduce) {
  .bg-rays,
  .coin-field img,
  .coin3d-inner,
  .coin3d-shadow,
  .ton-orb svg,
  .ton-orb-pulse,
  .brand-medal::before,
  .ca-shimmer-border,
  .hero-frame-shine,
  .btn-shimmer::before,
  .cal-mega.wag,
  .legend-flash {
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none !important; transition: none; }
  .reveal[data-reveal="cal-draw"] .cal-mega { clip-path: none !important; }
  .typewriter::after { animation: none; opacity: 0.6; }
}
