/* ============================================================
   BIBI — The Binance Mascot on BNB Chain
   Dark, warm, premium: gold diamond on ink.
   v2 — centered hero, angular cards, dot-grid motif.
   ============================================================ */

:root {
  --ink: #0A0B0D;
  --panel: #131519;
  --card-border: rgba(240, 185, 11, .25);
  --gold: #F0B90B;
  --gold-bright: #FCD535;
  --amber: #E8890B;
  --text: #F5F6F7;
  --body: #B7BDC6;
  --muted: #7A808A;
  --radius: 12px;
  --nav-h: 68px;
  --font-ui: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

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

html {
  scroll-padding-top: calc(var(--nav-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--body);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.12;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5.4vw + 1rem, 3.8rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.55rem, 2.6vw + .8rem, 2.35rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}
@media (min-width: 768px) {
  .container { padding-inline: 32px; }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { left: 8px; }

/* ---------- Diamond motif ---------- */
.diamond {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: var(--gold);
  border-radius: 2px;
  transform: rotate(45deg);
  vertical-align: middle;
  flex: none;
}

/* Faint diamond dot-grid (CSS only) */
.cta-panel, .hero::after {
  background-image:
    radial-gradient(rgba(240, 185, 11, .10) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: 13px 26px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; }

.btn-gold {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 55%, var(--amber) 130%);
  color: var(--ink);
}
.btn-gold:hover {
  box-shadow: 0 4px 26px rgba(240, 185, 11, .45);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--card-border);
  color: var(--gold-bright);
  background: rgba(240, 185, 11, .04);
}
.btn-outline:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(240, 185, 11, .2);
  transform: translateY(-1px);
}

.btn-sm { padding: 9px 20px; font-size: .88rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row.center { justify-content: center; }

/* ---------- Chips & labels ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: rgba(240, 185, 11, .07);
  color: var(--gold-bright);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.chip-live { margin: 0 0 20px; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.section-label {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 6px 14px;
  border: 1px solid rgba(240, 185, 11, .2);
  border-radius: 6px;
  background: rgba(240, 185, 11, .05);
  color: var(--gold);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.section h2 {
  margin-bottom: 30px;
  padding-bottom: 14px;
  position: relative;
}
.section h2::after {
  /* short gold underline accent */
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-bright), var(--amber));
}

/* ---------- Sticky nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 13, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240, 185, 11, .18);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .08em;
}
.brand:hover { text-decoration: none; }
.brand-glyph { width: 30px; height: 30px; }
.brand-name { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--gold-bright);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-menu > a:not(.btn) {
  position: relative;
  color: var(--body);
  font-size: .92rem;
  font-weight: 500;
  padding: 4px 0;
}
.nav-menu > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--gold-bright);
  transition: right .2s ease;
}
.nav-menu > a:not(.btn):hover { color: var(--gold-bright); text-decoration: none; }
.nav-menu > a:not(.btn):hover::after { right: 0; }

@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 20px 20px;
    background: rgba(10, 11, 13, .97);
    border-bottom: 1px solid var(--card-border);
    display: none;
  }
  .nav-open .nav-menu { display: flex; }
  .nav-menu > a:not(.btn) { padding: 10px 4px; font-size: 1rem; }
  .nav-menu > a:not(.btn)::after { content: none; }
  .nav-buy { margin-top: 8px; text-align: center; }
}

/* ---------- Hero (centered) ---------- */
.hero {
  position: relative;
  padding: 56px 0 72px;
  overflow: hidden;
}
.hero::before {
  /* warm gold wash behind the hero */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 45% at 50% 12%, rgba(240, 185, 11, .14), transparent 70%),
    radial-gradient(40% 35% at 85% 80%, rgba(232, 137, 11, .06), transparent 70%);
  pointer-events: none;
}
.hero::after {
  /* faint diamond dot-grid fading downward; painted behind content so the
     avatar's screen-blend still composites against the page */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 65%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 65%);
}
@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
}

.hero-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 em {
  font-style: italic;
  color: var(--gold-bright);
}

.hero-sub {
  max-width: 36rem;
  font-size: 1.06rem;
  margin-bottom: 26px;
}
.hero-sub strong { color: var(--text); }

.hero-cta { margin-bottom: 30px; }

/* Contract bar */
.ca-bar {
  width: 100%;
  max-width: 640px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 22px;
  text-align: left;
}
.ca-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ca-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ca-value {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .82rem;
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}
.ca-short { display: none; }
@media (max-width: 719px) {
  /* keep the full CA readable to assistive tech, show the truncated one visually */
  .ca-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .ca-short { display: inline; font-size: 1rem; }
}

.copy-btn {
  flex: none;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold));
  color: var(--ink);
  font-family: var(--font-display);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .18s ease, transform .18s ease;
}
.copy-btn:hover { box-shadow: 0 3px 18px rgba(240, 185, 11, .45); transform: translateY(-1px); }
.copy-btn.copied { background: var(--panel); color: var(--gold-bright); box-shadow: inset 0 0 0 1.5px var(--gold); }

/* Hero badges */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.badge-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.badge-pill strong {
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: .84rem;
  letter-spacing: 0;
}

.fineprint { color: var(--muted); font-size: .8rem; margin: 0; }

/* Hero art */
.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(360px, 90vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(240, 185, 11, .30), rgba(240, 185, 11, .05) 55%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}
.hero-art .art {
  position: relative;
  width: min(230px, 56vw);
  height: auto;
  /* the art has a baked-in black background; screen-blend dissolves it into the ink page */
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: no-preference) {
  .float { animation: float 6s ease-in-out infinite; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }

.section-alt {
  background: linear-gradient(180deg, rgba(19, 21, 25, .55), rgba(19, 21, 25, 0));
  border-top: 1px solid rgba(240, 185, 11, .08);
}

/* ---------- Live market ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 12px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  padding: 20px 22px;
  border-left: 1px solid rgba(240, 185, 11, .12);
  border-top: 1px solid rgba(240, 185, 11, .12);
}
.stat-card:nth-child(odd) { border-left: 0; }
.stat-card:nth-child(-n+2) { border-top: 0; }
@media (min-width: 768px) {
  .stat-card { border-top: 0; border-left: 1px solid rgba(240, 185, 11, .12); }
  .stat-card:first-child { border-left: 0; }
}

.stat-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.stat-sub { font-weight: 500; letter-spacing: .06em; }
.stat-value {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.1vw + .8rem, 1.35rem);
  color: var(--text);
}
.stat-value sub {
  font-size: .62em;
  line-height: 0;
}
.stat-value.is-loading {
  color: var(--muted);
  animation: pulse 1.4s ease-in-out infinite;
}

.market-note {
  color: var(--muted);
  font-size: .86rem;
  margin: 0 0 20px;
}

.chart-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 20px 0 24px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}
@media (min-width: 768px) {
  .chart-frame { aspect-ratio: 16 / 9; }
}
.chart-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Story ---------- */
.story-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .story-grid { grid-template-columns: .9fr 1.1fr; gap: 64px; }
}
.story-art {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-bottom: 3px solid var(--gold);
  background: var(--panel);
  max-width: 460px;
  transform: rotate(-1.2deg);
}
/* keep the tilt through the reveal transition */
.js .story-art.reveal { transform: translateY(18px) rotate(-1.2deg); }
.js .story-art.reveal.in { transform: rotate(-1.2deg); }
.story-body p { max-width: 36rem; }
.story-body strong { color: var(--text); }

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.mini-stats li {
  flex: 1 1 140px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
}
.mini-stats strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--gold-bright);
}
.mini-stats span { color: var(--muted); font-size: .8rem; }

/* ---------- On-chain tribute ---------- */
.highlight-card {
  margin-bottom: 28px;
  padding: 30px 32px;
  background: linear-gradient(135deg, rgba(240, 185, 11, .13), rgba(232, 137, 11, .05)), var(--panel);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 0 44px rgba(240, 185, 11, .13);
}
.highlight-card h3 { display: flex; align-items: center; font-size: 1.3rem; }
.highlight-card p { margin: 0 0 .8em; max-width: 46rem; }
.highlight-card p:last-child { margin-bottom: 0; }
.highlight-card a { font-weight: 700; white-space: nowrap; }
.highlight-note { color: var(--muted); font-size: .9rem; }

/* ---------- World of BiBi gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.gallery-card {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.gallery-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 24px rgba(240, 185, 11, .16);
}
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.gallery-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(10, 11, 13, .88) 55%);
}
.gallery-card .chip { font-size: .62rem; padding: 3px 10px; background: rgba(10, 11, 13, .65); }
.gallery-card figcaption p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: .88rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

/* ---------- Final CTA ---------- */
.cta-panel {
  position: relative;
  padding: 56px 24px;
  background-color: var(--panel);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--gold);
  border-radius: 18px;
  text-align: center;
  overflow: hidden;
}
@media (min-width: 768px) { .cta-panel { padding: 72px 48px; } }
.cta-panel h2 { margin-bottom: 24px; padding-bottom: 0; }
.cta-panel h2::after { content: none; }
.cta-panel .btn-row { margin-bottom: 32px; }
.cta-panel .ca-bar {
  margin: 0 auto;
  text-align: left;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(240, 185, 11, .12);
  padding: 40px 0 48px;
  text-align: center;
}
.footer-disclaimer {
  max-width: 46rem;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: .82rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.footer-links li { display: flex; align-items: center; }
.footer-links li + li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 14px;
  background: var(--gold);
  border-radius: 1px;
  transform: rotate(45deg);
  opacity: .6;
}
.footer-links a { color: var(--body); font-size: .9rem; font-weight: 500; }
.footer-links a:hover { color: var(--gold-bright); }
.footer-copy { color: var(--muted); font-size: .8rem; margin: 0; }

/* ---------- Missing-image fallback: gold diamond placeholder ---------- */
.img-missing {
  position: relative;
  min-height: 220px;
  background: var(--panel);
}
.img-missing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(135deg, var(--gold-bright), var(--amber));
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(240, 185, 11, .4);
}

/* ---------- Scroll reveal (JS-enhanced only) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
