/* ============================================================
   XP Union Vault — Xphere brand system
   pure black · Pretendard · cream→orange→crimson gradient
   (tokens sampled from x-phere.com / docs.x-phere.com)
   ============================================================ */

:root {
  --ink: #000000;
  --ink-2: #121212;
  --ink-3: #1b1b1b;
  --line: #292929;
  --ash: #888888;
  --ash-2: #666666;
  --bone: #eeeeee;
  /* Xphere signature ramp: #FFEED4 → #FF9738 → #E7453A → #CF1512 */
  --cream: #ffeed4;
  --ember: #e7453a;
  --ember-2: #ff9738;
  --ember-deep: #cf1512;
  --ember-glow: rgba(207, 21, 18, 0.45);
  --burn: #e7453a;
  --brand-gradient: linear-gradient(to right, #ffeed4 0%, #ff9738 9%, #e7453a 47%, #cf1512 100%);
  --ok: #6fce9f;
  --r: 14px;
  --maxw: 1180px;
  --font-display: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-script: "Alex Brush", cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Respect the HTML `hidden` attribute even when an element sets display.
   Without this, `.launch-modal { display: flex }` overrides `hidden` and the
   modal stays visible after JS sets modal.hidden = true. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* atmosphere ------------------------------------------------ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.emberfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.emberfield::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -30vh;
  width: 90vw;
  height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--ember-glow), rgba(255, 151, 56, 0.12) 45%, transparent 62%);
  opacity: 0.5;
  filter: blur(30px);
  animation: breathe 9s ease-in-out infinite;
}
.emberfield span {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 8px 1px var(--ember);
  opacity: 0;
  animation: rise-ember 7s linear infinite;
}
.emberfield span:nth-child(1) { left: 12%; animation-delay: 0s; }
.emberfield span:nth-child(2) { left: 28%; animation-delay: 2.4s; }
.emberfield span:nth-child(3) { left: 47%; animation-delay: 4s; }
.emberfield span:nth-child(4) { left: 63%; animation-delay: 1.2s; }
.emberfield span:nth-child(5) { left: 79%; animation-delay: 3.3s; }
.emberfield span:nth-child(6) { left: 91%; animation-delay: 5.1s; }

@keyframes rise-ember {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.9; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-88vh) scale(0.3); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.32; }
  50% { opacity: 0.5; }
}

/* Skip rendering work for below-the-fold sections until scrolled near
   (their glass cards / borders aren't composited while off-screen). */
.mechanism,
.partners,
.developers {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

/* layout scaffolding --------------------------------------- */
section {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.2rem, 4vw, 2.5rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
}
.section-head .idx {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ember);
  letter-spacing: 0.1em;
}
.section-head .idx::before { content: "["; color: var(--ash-2); }
.section-head .idx::after { content: "]"; color: var(--ash-2); }
.section-head h2 {
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  letter-spacing: -0.02em;
}

/* nav ------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1.2rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--bone);
  margin-right: auto;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
}
.brand-mark img {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 10px var(--ember-glow));
}
.brand-name {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 0.86rem;
}
.brand-sub {
  color: var(--ash-2);
  margin-left: 0.3rem;
}
.nav-links {
  display: flex;
  gap: 1.6rem;
}
.nav-links a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ash);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--bone);
}
.nav-links .em-link {
  color: var(--ember-2);
}
.lede-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ember-2);
}

/* buttons --------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--bone);
  padding: 0.62rem 1.1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.22s ease;
  letter-spacing: 0.02em;
}
.btn:hover {
  border-color: var(--ember);
  color: var(--ember-2);
}
.btn-connect {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-connect .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ash-2);
  transition: all 0.3s;
}
.btn-connect[data-state="connected"] .dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.btn-primary {
  width: 100%;
  background: linear-gradient(100deg, #ff9738, #e7453a 55%, #cf1512);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 6px 24px -8px var(--ember-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  color: #fff;
  transform: translateY(-1px);
}
.btn-ghost {
  width: 100%;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* demo badge ------------------------------------------------ */
.demo-badge {
  position: fixed;
  z-index: 30;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ember-2);
  background: color-mix(in srgb, var(--ink-3) 90%, transparent);
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

/* hero ------------------------------------------------------ */
.hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ember);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.hero-title {
  font-weight: 700;
  font-size: clamp(2.7rem, 9.5vw, 7.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.hero-title span {
  display: block;
}
.hero-title .em {
  color: transparent;
  background: var(--brand-gradient);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 8s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
.hero { position: relative; }
.hero-art {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-52%);
  width: 58%;
  max-width: 860px;
  z-index: -1;
  pointer-events: none;
}
.hero-art img,
.hero-art video {
  width: 100%;
  mix-blend-mode: screen; /* hides the video's black background over the dark canvas */
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 52%, transparent 78%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 52%, transparent 78%);
}
.hero-lede {
  max-width: 46ch;
  margin-top: 2rem;
  color: var(--ash);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}
.hero-lede strong {
  color: var(--bone);
  font-weight: 500;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.stat {
  padding: 1.7rem 1.6rem 1.5rem;
  border-radius: var(--r);
}
.stat-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--ash-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-value {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0.35rem;
  font-variant-numeric: tabular-nums;
}
.stat-value.em {
  color: var(--ember-2);
}
.stat-foot {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ash-2);
}
.stat.burn .flame {
  color: var(--burn);
  font-size: 0.7em;
  animation: flicker 2.5s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.cap-track {
  margin-top: 0.9rem;
  height: 3px;
  background: var(--ink-3);
  border-radius: 3px;
  overflow: hidden;
}
.cap-fill {
  height: 100%;
  width: 0;
  background: var(--brand-gradient);
  background-size: 220% 100%;
  animation: shimmer 5s linear infinite;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* mechanism ------------------------------------------------- */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1.4fr;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem);
}
.flow-node {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem 1.5rem;
}
.flow-node.inflow {
  border-left: 2px solid var(--ember);
}
.flow-node .fn-title {
  font-size: 1.25rem;
  font-weight: 400;
}
.flow-node .fn-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ash);
  margin-top: 0.35rem;
}
.flow-node .fn-note {
  font-size: 0.86rem;
  color: var(--ash-2);
  margin-top: 0.8rem;
  line-height: 1.45;
}
.flow-split {
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--ember), transparent);
  position: relative;
}
.flow-split::before,
.flow-split::after {
  content: "";
  position: absolute;
  right: 0;
  width: 24px;
  height: 1px;
  background: var(--line);
}
.flow-split::before { transform: rotate(28deg); transform-origin: right; top: -8px; }
.flow-split::after { transform: rotate(-28deg); transform-origin: right; top: 8px; }
.flow-branches {
  display: grid;
  gap: 1rem;
}
.flow-node .pct {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.flow-node .pct.em {
  color: var(--burn);
  text-shadow: 0 0 18px var(--ember-glow);
}
.flow-node.burned {
  border-left: 2px solid var(--ember-deep);
}
.flow-node.stakers {
  border-left: 2px solid var(--ember-2);
}
.mechanism-foot {
  margin-top: 2rem;
  color: var(--ash);
  max-width: 62ch;
  font-size: 1rem;
}
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ember-2);
  background: var(--ink-3);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

/* stake ----------------------------------------------------- */
.stake-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.4rem;
}
.position-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.6rem;
  align-self: start;
}
.pc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
}
.pc-row:last-of-type {
  border-bottom: none;
}
.pc-row span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ash-2);
}
.pc-row b {
  font-weight: 400;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.pc-row b.em {
  color: var(--ember-2);
}
.pc-hint {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ash-2);
  line-height: 1.5;
}

.actions {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem 1.5rem 1.6rem;
}
.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  background: none;
  border: none;
  color: var(--ash-2);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s;
}
.tab:hover { color: var(--bone); }
.tab.active {
  color: var(--ember-2);
  border-bottom-color: var(--ember);
}
.panel {
  display: none;
  animation: fade 0.3s ease;
}
.panel.active {
  display: block;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.field {
  display: block;
  margin-bottom: 1rem;
}
.field span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ash);
  margin-bottom: 0.4rem;
}
.field span em {
  color: var(--ash-2);
  font-style: normal;
}
.field input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--ember);
}
.micro {
  font-size: 0.86rem;
  color: var(--ash-2);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.requests {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}
.req {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
}
.req .ready { color: var(--ok); }
.req .wait { color: var(--ash-2); }

.claim-figure {
  text-align: center;
  padding: 1.4rem 0 1.6rem;
}
.cf-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ash-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cf-value {
  font-size: 2.6rem;
  font-weight: 600;
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.how {
  margin-top: 1.1rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.8rem;
}
.how summary {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ash);
  cursor: pointer;
  list-style: none;
}
.how summary::before {
  content: "› ";
  color: var(--ember);
}
.how[open] summary::before {
  content: "⌄ ";
}
.how pre {
  margin-top: 0.7rem;
}

.tx-status {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
}
.tx-status.pending { color: var(--ember-2); border-color: var(--ember); }
.tx-status.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.tx-status.err { color: #ff6b6b; border-color: #5a2a2a; }

/* code blocks ----------------------------------------------- */
pre {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
}
pre code {
  background: none;
  color: #d9cfc2;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.65;
}

/* partners -------------------------------------------------- */
.partners-lede,
.dev-lede {
  max-width: 66ch;
  color: var(--ash);
  margin-bottom: 2.4rem;
  font-size: 1.05rem;
}
.partners-lede strong { color: var(--bone); font-weight: 500; }
.partners-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.4rem;
}
.leaderboard,
.simulator {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
}
.lb-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ash-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.lb-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  align-items: center;
  padding: 0.95rem 0;
  border-bottom: 1px dashed var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
}
.lb-name .tag {
  width: 8px; height: 8px; border-radius: 2px; background: var(--ember);
}
.lb-tvl { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lb-share {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ember-2);
  text-align: right;
}
.lb-bar {
  grid-column: 1 / -1;
  height: 2px;
  background: var(--ink-3);
  border-radius: 2px;
  margin-top: 0.7rem;
  overflow: hidden;
}
.lb-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--ember), var(--ember-2));
  border-radius: 2px;
}
.simulator h3 {
  font-weight: 400;
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
}
.sim-out {
  display: grid;
  gap: 0.7rem;
  margin: 1.1rem 0;
  padding: 1.1rem;
  background: var(--ink);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.sim-out div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sim-out span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ash-2);
}
.sim-out b {
  font-weight: 400;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.sim-out b.em { color: var(--ember-2); }

/* developers ------------------------------------------------ */
.addr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.addr-card {
  padding: 1.2rem 1.3rem;
  border-radius: var(--r);
}
.addr-card .ac-name {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ash-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.addr-card .ac-addr {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ember-2);
  margin-top: 0.5rem;
  word-break: break-all;
  cursor: pointer;
}
.addr-card .ac-addr:hover { text-decoration: underline; }

.code-tabs {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.2rem 1.4rem 1.4rem;
}
.code-panel {
  display: none;
  position: relative;
}
.code-panel.active { display: block; }
.copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--ash);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.copy:hover { color: var(--ember-2); border-color: var(--ember); }

/* footer ---------------------------------------------------- */
.footer {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem clamp(1.2rem, 4vw, 2.5rem) 3.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ash-2);
}
.footer .brand-mark { margin-right: 0.4rem; }

/* brand signature (vertical script, right edge) ------------- */
.signature {
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
  user-select: none;
}
.signature img {
  width: 24px;
  opacity: 0.55;
  display: block;
}
@media (max-width: 1100px) {
  .signature { display: none; }
}

/* reveal animation (scroll-driven via IntersectionObserver) --- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .emberfield span, .emberfield::before, .flame, .hero-art img, .hero-art video,
  .hero-title .em, .cap-fill, .mesh i, .stars { animation: none; }
  html { scroll-behavior: auto; }
}

/* partner guide page ---------------------------------------- */
.guide-hero { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: clamp(2.2rem, 4vw, 3.2rem);
}
.fact-strip div {
  padding: 1.2rem 1.3rem;
  border-radius: var(--r);
}
.fact-strip b {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ember-2);
}
.fact-strip span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ash-2);
}

.steps {
  list-style: none;
  display: grid;
  gap: 1.2rem;
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.4rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.7rem 1.8rem;
}
.step-no {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ember);
  text-shadow: 0 0 18px var(--ember-glow);
  line-height: 1;
}
.step h3 {
  font-weight: 400;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.step p {
  color: var(--ash);
  font-size: 0.98rem;
  max-width: 62ch;
}
.step pre { margin: 0.9rem 0; }
.step a { color: var(--ember-2); }

.rev-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.4rem;
  align-items: start;
}
.rev-copy p { color: var(--ash); max-width: 58ch; }
.rev-copy p strong { color: var(--bone); font-weight: 500; }
.formula {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 1rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ember);
  border-radius: var(--r);
  padding: 1.4rem 1.5rem;
  margin: 1.4rem 0 1rem;
}
.formula em { color: var(--ember); font-style: normal; font-size: 1.3rem; }
.frac { display: inline-grid; text-align: center; gap: 0.3rem; }
.frac i { display: block; height: 1px; background: var(--ash-2); }
.frac b { font-weight: 500; font-size: 0.9rem; }
.rev-example {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
}
.rev-example h3 { font-weight: 400; font-size: 1.15rem; margin-bottom: 1rem; }
.rev-example table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.82rem; }
.rev-example th {
  text-align: left;
  color: var(--ash-2);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.rev-example td { padding: 0.7rem 0; border-bottom: 1px dashed var(--line); }
.rev-example td.em { color: var(--ember-2); }
.rev-example a { color: var(--ember-2); }

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.wallet-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
}
.wallet-card h3 { font-weight: 400; font-size: 1.1rem; margin-bottom: 0.8rem; }
.wallet-card pre { font-size: 0.75rem; }
.callout {
  margin-top: 1.6rem;
  background: color-mix(in srgb, var(--ember) 7%, var(--ink-2));
  border: 1px solid color-mix(in srgb, var(--ember) 35%, var(--line));
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
  font-size: 0.95rem;
  color: var(--ash);
}
.callout b { color: var(--ember-2); font-weight: 500; }

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.rule {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem 1.6rem;
}
.rule h3 { font-weight: 400; font-size: 1.12rem; margin-bottom: 0.5rem; }
.rule p { color: var(--ash); font-size: 0.94rem; }
.rule pre { margin-top: 0.8rem; }

.checklist {
  margin-top: 1.6rem;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem 1.7rem;
}
.checklist h3 { font-weight: 400; font-size: 1.15rem; margin-bottom: 0.9rem; }
.checklist ul { list-style: none; display: grid; gap: 0.55rem; }
.checklist li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ash);
  padding-left: 1.5rem;
  position: relative;
}
.checklist li::before {
  content: "▢";
  position: absolute;
  left: 0;
  color: var(--ember);
}
.cta-row { display: flex; gap: 0.9rem; margin-top: 2rem; flex-wrap: wrap; }
.cta-row .cta { width: auto; padding-inline: 1.8rem; }
.cta-row .btn { width: auto; }

/* responsive ------------------------------------------------ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .stat-row { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-split { display: none; }
  .stake-grid,
  .partners-grid,
  .rev-grid,
  .rules { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 44px 1fr; padding: 1.3rem; }

  /* ---- kill horizontal overflow (code blocks + wide grids) ---- */
  .actions,
  .code-tabs,
  .code-panel,
  .how,
  .step,
  .position-card,
  .leaderboard,
  .simulator,
  .rev-example,
  .wallet-card {
    min-width: 0; /* let flex/grid children shrink so <pre> can scroll */
  }
  pre { max-width: 100%; }
  .lb-head,
  .lb-row { grid-template-columns: 1.3fr 1fr 0.6fr; }

  /* content-visibility reserved size caused blank gaps on tall mobile
     stacks — render these normally on small screens */
  .mechanism,
  .partners,
  .developers {
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  /* tighten section rhythm */
  section { padding: clamp(3rem, 12vw, 4.5rem) 1.1rem; }
  .section-head { margin-bottom: 1.8rem; }

  /* lighten background layers for weaker mobile GPUs */
  .devgrid { display: none; }
  .mesh { opacity: 0.4; }
  .signature { display: none; }
}

@media (max-width: 480px) {
  .fact-strip { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2.4rem, 13vw, 3rem); }
  .stat-value { font-size: 2rem; }
  .addr-grid { grid-template-columns: 1fr 1fr; }
  .btn-pair { grid-template-columns: 1fr; }
}


/* ============================================================
   Frosted Glass / Blurred Mesh Gradient system
   ============================================================ */

/* animated mesh blobs behind everything (glass surfaces blur these) */
/* Static color glow. Blobs are NOT animated (animating transforms under a
   large blur forces a full-viewport re-render every frame). */
.mesh {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  filter: blur(64px);
  opacity: 0.5;
}
.mesh i {
  position: absolute;
  border-radius: 50%;
}
.mesh i:nth-child(1) {
  width: 46vw; height: 46vw; left: -10vw; top: -8vh;
  background: radial-gradient(circle, rgba(207, 21, 18, 0.4), transparent 65%);
}
.mesh i:nth-child(2) {
  width: 38vw; height: 38vw; right: -8vw; top: 24vh;
  background: radial-gradient(circle, rgba(255, 151, 56, 0.26), transparent 65%);
}
.mesh i:nth-child(3) {
  width: 30vw; height: 30vw; left: 32vw; bottom: -14vh;
  background: radial-gradient(circle, rgba(255, 238, 212, 0.12), transparent 60%);
}

/* official starfield texture (intro_star.png). Static — no background-position
   animation (that repaints the whole layer every frame). */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("assets/brand/intro_star.png") repeat;
  opacity: 0.1;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 45vh, transparent 85vh);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 45vh, transparent 85vh);
}

/* Card surfaces — solid near-black fills (no backdrop-filter). Over the dark
   canvas this reads identically to frosted glass but removes ~15 per-frame
   blur passes. Real backdrop blur is reserved for the nav / ticker / modal. */
.stat,
.actions,
.position-card,
.leaderboard,
.simulator,
.addr-card,
.code-tabs,
.flow-node,
.wallet-card,
.rev-example,
.formula,
.step,
.checklist,
.callout,
.fact-strip div {
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 44px -26px rgba(0, 0, 0, 0.85);
}
.flow-node.inflow { border-left: 2px solid var(--ember); }
.flow-node.stakers { border-left: 2px solid var(--ember-2); }
.flow-node.burned { border-left: 2px solid var(--ember-deep); }

/* glass hover: lift + warm edge + sheen sweep */
.stat,
.flow-node,
.addr-card,
.wallet-card,
.fact-strip div {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.stat:hover,
.flow-node:hover,
.addr-card:hover,
.wallet-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 151, 56, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 50px -24px rgba(207, 21, 18, 0.35);
}
.stat::after,
.flow-node::after,
.addr-card::after,
.wallet-card::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 238, 212, 0.07), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.stat:hover::after,
.flow-node:hover::after,
.addr-card:hover::after,
.wallet-card:hover::after {
  left: 130%;
}

/* inner panels stay solid for readability on top of glass */
pre,
.field input,
.sim-out,
.req,
.tx-status,
.claim-figure {
  background: rgba(0, 0, 0, 0.45);
}

/* burn ambient artwork behind the partners section */
.partners {
  position: relative;
}
.partners::before {
  content: "";
  position: absolute;
  inset: 4% 0 0;
  z-index: -1;
  background: url("assets/burn-ambient.png") center bottom / cover no-repeat;
  opacity: 0.28;
  mix-blend-mode: screen;
  filter: blur(3px);
  border-radius: 28px;
  pointer-events: none;
}

@media (max-width: 860px) {
  /* keep the hero video inside the viewport and behind the text as a soft accent */
  .hero-art {
    right: 50%;
    left: auto;
    transform: translate(50%, -50%);
    top: 46%;
    width: 92%;
    max-width: 92vw;
    opacity: 0.4;
  }
  .mesh { filter: blur(56px); }
}


/* ============================================================
   Developer-flashy layer: ticker · terminal · neon borders · grid
   ============================================================ */

/* blueprint grid */
.devgrid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 85%);
}

/* live data ticker */
.ticker {
  position: relative;
  z-index: 5;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 36s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker-set {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}
.tk {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ash);
  padding: 0 1.4rem;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.tk b { color: var(--bone); font-weight: 500; }
.tk .up { color: var(--ember-2); }
.tk .dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse { 50% { opacity: 0.35; } }

/* rotating neon border (brand conic) on hero stat cards */
@property --spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
/* Rotating neon border kept only on the 3 hero stat cards (above the fold).
   Removed from the terminal to cut an always-on per-frame conic repaint. */
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  padding: 1px;
  background: conic-gradient(
    from var(--spin),
    transparent 0 58%,
    rgba(255, 151, 56, 0.55) 72%,
    rgba(231, 69, 58, 0.9) 80%,
    rgba(255, 238, 212, 0.7) 86%,
    transparent 94%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 7s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { --spin: 360deg; } }

/* value glow */
.stat-value.em { text-shadow: 0 0 26px rgba(255, 151, 56, 0.35); }
.stat.burn .stat-value { text-shadow: 0 0 26px rgba(207, 21, 18, 0.4); }

/* settle terminal */
.terminal {
  position: relative;
  margin-top: 2.2rem;
  border-radius: var(--r);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 26px 60px -30px rgba(207, 21, 18, 0.35);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.term-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3a3a3a;
}
.term-bar i:nth-child(1) { background: #e7453a; }
.term-bar i:nth-child(2) { background: #ff9738; }
.term-bar i:nth-child(3) { background: #6fce9f; }
.term-bar span {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ash-2);
  letter-spacing: 0.04em;
}
.term-body {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 1.1rem 1.2rem 1.3rem;
  min-height: 210px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: #cfc6ba;
  white-space: pre-wrap;
}
.term-body .cmd { color: var(--bone); }
.term-body .val { color: var(--ember-2); }
.term-body .burnv { color: var(--ember); }
.term-body .ok { color: var(--ok); }
.term-body .dim { color: var(--ash-2); }
.caret {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--ember-2);
  vertical-align: text-bottom;
  animation: caretBlink 0.9s step-end infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .stat::before, .terminal::before, .tk .dot-live, .caret { animation: none; }
}
@media (max-width: 860px) {
  .term-body { font-size: 0.72rem; min-height: 240px; }
}


/* ============================================================
   Launch preview notice (auto-removed when CFG.launch.live)
   ============================================================ */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: linear-gradient(90deg, rgba(207, 21, 18, 0.16), rgba(255, 151, 56, 0.12), rgba(207, 21, 18, 0.16));
  border-bottom: 1px solid rgba(255, 151, 56, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.preview-banner .pb-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #1a0d06;
  background: linear-gradient(100deg, var(--ember-2), var(--ember));
  padding: 0.14rem 0.55rem;
  border-radius: 100px;
}
.preview-banner .pb-text {
  font-size: 0.86rem;
  color: var(--bone);
}
.preview-banner .pb-eta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ember-2);
  letter-spacing: 0.04em;
}

.launch-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lmFade 0.35s ease;
}
@keyframes lmFade { from { opacity: 0; } }
.lm-card {
  position: relative;
  max-width: 460px;
  width: 100%;
  background: rgba(14, 14, 14, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 2.1rem 2.1rem 1.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -30px rgba(207, 21, 18, 0.45);
  text-align: center;
  animation: lmPop 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}
@keyframes lmPop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.lm-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: conic-gradient(from var(--spin), transparent 0 55%, rgba(255, 151, 56, 0.6) 72%, rgba(231, 69, 58, 0.9) 80%, rgba(255, 238, 212, 0.7) 87%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 8s linear infinite;
  pointer-events: none;
}
.lm-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember-2);
  margin-bottom: 0.8rem;
}
.lm-card h2 {
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.lm-card p {
  color: var(--ash);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.1rem;
}
.lm-eta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ember-2);
  margin-bottom: 1.5rem;
}
.lm-card .btn-primary { width: auto; padding-inline: 1.6rem; }
@media (prefers-reduced-motion: reduce) {
  .launch-modal, .lm-card, .lm-card::before { animation: none; }
}
