/*
  RHABDOM site chrome (nav, footer, buttons) and the landing page.
  Extends the tokens in style.css; the visual system is described in DESIGN.md.
*/

body.site { max-width: none; padding-inline: 0; padding-block: 0; }
.page { max-width: 1480px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); padding-block: 0 24px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 18px; background: var(--gold); color: var(--ground);
  font-family: var(--display); font-weight: 700; text-decoration: none;
  clip-path: var(--pill-clip); transition: top .2s;
}
.skip-link:focus { top: 12px; outline: none; }

/* ---- nav ------------------------------------------------------------------ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 12, .78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: background-color .4s, box-shadow .4s;
}
.site-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--emerald) 20%, var(--amethyst) 55%, var(--gold) 85%, transparent);
  opacity: .45;
}
.site-nav[data-scrolled] { background: rgba(10, 15, 12, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.site-nav__inner {
  max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px);
  height: 68px; display: flex; align-items: center; gap: 20px;
}

.site-logo { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; margin-right: auto; }
.site-logo__mark { width: 34px; height: 34px; flex: none; transition: transform .9s cubic-bezier(.16, 1, .3, 1); }
.site-logo:hover .site-logo__mark, .site-logo:focus-visible .site-logo__mark { transform: rotate(60deg); }
.site-logo__word { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .28em; line-height: 1; }
.site-logo:hover { color: var(--text); }

.site-nav__menu { display: flex; align-items: center; gap: 4px; }
.site-nav__menu a {
  position: relative; padding: 10px 14px;
  font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); text-decoration: none; transition: color .25s;
}
.site-nav__menu a:hover { color: var(--text); }
.site-nav__menu a[aria-current="page"] { color: var(--text); }
.site-nav__menu a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; background: var(--gold);
}
.site-nav__menu .site-nav__cta {
  margin-left: 12px; padding: 11px 22px; color: var(--ground); font-weight: 700;
  background: var(--sheen); clip-path: var(--pill-clip); transition: filter .25s;
}
.site-nav__menu .site-nav__cta:hover { color: var(--ground); filter: brightness(1.12); }
.site-nav__menu .site-nav__cta::after { display: none; }
.site-nav__menu .site-nav__cta:focus-visible { outline: none; background: var(--gold); }

.site-nav__toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.site-nav__bars, .site-nav__bars::before, .site-nav__bars::after {
  display: block; width: 22px; height: 2px; background: currentColor; position: relative;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), background-color .2s;
}
.site-nav__bars::before, .site-nav__bars::after { content: ""; position: absolute; left: 0; }
.site-nav__bars::before { top: -7px; }
.site-nav__bars::after { top: 7px; }
.site-nav__toggle[aria-expanded="true"] .site-nav__bars { background: transparent; }
.site-nav__toggle[aria-expanded="true"] .site-nav__bars::before { transform: translateY(7px) rotate(45deg); }
.site-nav__toggle[aria-expanded="true"] .site-nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-nav__toggle { display: inline-flex; }
  .site-nav__menu {
    position: absolute; top: 68px; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px clamp(16px, 4vw, 48px) 22px;
    height: calc(100vh - 68px); height: calc(100dvh - 68px); overflow-y: auto;
    background: var(--ground);
  }
  .site-nav[data-open] .site-nav__menu { display: flex; }
  .site-nav__menu a { padding: 16px 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .site-nav__menu a[aria-current="page"]::after { left: 0; right: auto; width: 28px; bottom: 10px; }
  .site-nav__menu .site-nav__cta { margin: 18px 0 0; text-align: center; border-bottom: 0; }
}

/* ---- footer --------------------------------------------------------------- */
footer.site-footer {
  position: relative; margin-top: 0; padding-top: 0; border-top: 0;
  background: #080c0a; color: var(--text); font-size: 14px;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--emerald) 20%, var(--amethyst) 55%, var(--gold) 85%, transparent);
  opacity: .45;
}
.site-footer__inner {
  max-width: 1240px; margin-inline: auto;
  padding: 64px clamp(16px, 4vw, 48px) 28px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px 32px;
}
.site-footer__tag { color: var(--muted); max-width: 30ch; margin: 16px 0 0; }
h2.site-footer__h {
  font-family: var(--display); font-size: 12px; font-weight: 700; font-stretch: 100%;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0;
}
.site-footer ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 11px; }
.site-footer a { color: var(--text); text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--gold); }
.site-footer__small { color: var(--muted); font-size: 13px; margin: 16px 0 0; max-width: 36ch; }
.site-footer__small a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__base {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  margin-top: 20px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* ---- buttons ---------------------------------------------------------------- */
.button {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 32px; border: 0; cursor: pointer;
  font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: .03em; text-decoration: none;
  clip-path: var(--pill-clip);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), filter .25s, background-color .3s;
}
.button svg { width: 18px; height: 18px; flex: none; transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
.button:hover svg { transform: translateX(4px); }
.button--primary { background: var(--sheen); color: var(--ground); }
.button--primary:hover { color: var(--ground); transform: translateY(-2px); filter: brightness(1.1); }
.button--ghost { background: #3a4d43; color: var(--text); }
.button--ghost::before {
  content: ""; position: absolute; inset: 1.5px; z-index: -1; clip-path: var(--pill-clip); background: var(--ground);
  transition: background-color .3s;
}
.button--ghost:hover { background: var(--sheen); color: var(--text); transform: translateY(-2px); }
.button:focus-visible { outline: none; background: var(--gold); color: var(--ground); }
.button--ghost:focus-visible { color: var(--text); }
.button--ghost:focus-visible::before { background: #211d10; }

/* ---- landing: shared ------------------------------------------------------------ */
.landing section[id] { scroll-margin-top: 84px; }
.section { padding-block: clamp(88px, 12vw, 168px); }
.section--tight { padding-block: clamp(56px, 8vw, 104px); }
h2.section-title {
  font-family: var(--display); font-weight: 800; font-stretch: 82%;
  font-size: clamp(36px, 5.2vw, 64px); line-height: .98; letter-spacing: -.005em;
  text-transform: none; color: var(--text); max-width: 17ch; margin: 0;
}
.section-lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--muted); max-width: 58ch; margin: 22px 0 0; }
.section-lede strong { color: var(--text); font-weight: 600; }

.live-dot {
  display: inline-block; width: 9px; height: 10px; margin-right: 8px; vertical-align: -1px;
  clip-path: var(--hex-shape); background: var(--faint);
}
[data-state="live"] .live-dot { background: var(--emerald); animation: live-pulse 2.4s ease-in-out infinite; }
[data-state="offline"] .live-dot { background: var(--bad); }
@keyframes live-pulse { 50% { opacity: .35; } }

/* ---- hero -------------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: min(92vh, 900px); display: grid; align-items: center; }
@supports (min-height: 100svh) { .hero { min-height: min(92svh, 900px); } }
.hero__stage { position: absolute; inset: 0; z-index: 0; }
.hero__facets { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 22% 45%, rgba(10, 15, 12, .92), rgba(10, 15, 12, .55) 55%, transparent 80%),
    linear-gradient(180deg, transparent 70%, var(--ground));
}
.hero__content { position: relative; z-index: 1; width: 100%; padding-block: clamp(72px, 12vh, 150px) clamp(72px, 10vh, 120px); pointer-events: none; }
.hero__content a, .hero__content button, .hero__live { pointer-events: auto; }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-stretch: 76%; text-transform: uppercase;
  font-size: clamp(46px, 8.6vw, 96px); line-height: .9; letter-spacing: -.01em;
  max-width: 11ch; margin: 0; text-wrap: balance;
}
.hero h1 .hl { color: var(--gold); }
.hero__lede { font-size: clamp(18px, 1.8vw, 22px); line-height: 1.5; color: var(--muted); max-width: 46ch; margin: 30px 0 0; }
.hero__lede strong { color: var(--text); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.hero__live {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 40px;
  font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.hero__live b { color: var(--text); font-weight: 600; }
.hero__caption {
  position: absolute; z-index: 1; right: clamp(16px, 4vw, 48px); bottom: clamp(20px, 4vh, 40px);
  max-width: 30ch; margin: 0; font-size: 13px; color: var(--muted); text-align: right;
}
.hero__caption a { color: var(--text); }

/* the fly */
.fly {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: clamp(76px, 7.4vw, 118px); aspect-ratio: 120 / 140;
  will-change: transform; cursor: pointer; touch-action: manipulation;
  filter: drop-shadow(0 24px 16px rgba(0, 0, 0, .55));
  transition: filter .5s cubic-bezier(.16, 1, .3, 1);
}
.fly svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fly[data-mode="land"] { filter: drop-shadow(0 7px 5px rgba(0, 0, 0, .6)); }
.fly__wing { transform-box: view-box; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.fly__wing--l { transform-origin: 58px 57px; }
.fly__wing--r { transform-origin: 62px 57px; }
.fly[data-mode="fly"] .fly__wing--l { animation: wing-l 72ms linear infinite alternate; }
.fly[data-mode="fly"] .fly__wing--r { animation: wing-r 72ms linear infinite alternate; }
.fly[data-mode="escape"] .fly__wing--l { animation: wing-l 42ms linear infinite alternate; }
.fly[data-mode="escape"] .fly__wing--r { animation: wing-r 42ms linear infinite alternate; }
.fly[data-mode="land"] .fly__wing--l { transform: rotate(20deg) translate(2px, 2px); }
.fly[data-mode="land"] .fly__wing--r { transform: rotate(-20deg) translate(-2px, 2px); }
.fly[data-mode="idle"] .fly__wing--l { animation: wing-l 240ms ease-in-out infinite alternate; }
.fly[data-mode="idle"] .fly__wing--r { animation: wing-r 240ms ease-in-out infinite alternate; }
@keyframes wing-l { from { transform: rotate(-28deg) scaleY(.9); } to { transform: rotate(12deg) scaleY(1.05); } }
@keyframes wing-r { from { transform: rotate(28deg) scaleY(.9); } to { transform: rotate(-12deg) scaleY(1.05); } }

@media (max-width: 760px) {
  .hero { align-items: start; }
  .hero__vignette {
    background: linear-gradient(180deg, rgba(10, 15, 12, .9) 0%, rgba(10, 15, 12, .7) 55%, rgba(10, 15, 12, .2) 78%, var(--ground) 100%);
  }
  .hero__content { padding-block: 48px 300px; }
  .hero__caption { left: clamp(16px, 4vw, 48px); right: auto; text-align: left; }
}

/* ---- how it works ---------------------------------------------------------------- */
.how__steps { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: 64px; list-style: none; padding: 0; }
.how__line {
  position: absolute; top: 39px; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--teal), var(--amethyst), var(--orchid), var(--gold));
  opacity: .45;
}
.how__pulse {
  position: absolute; top: 31px; left: 10%; width: 16px; height: 18px; margin-left: -8px;
  clip-path: var(--hex-shape); background: var(--gold); opacity: 0;
}
.how[data-inview] .how__pulse { animation: pulse-run 4.2s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes pulse-run {
  0% { left: 10%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 90%; opacity: 0; }
}
.step { position: relative; display: grid; justify-items: center; align-content: start; gap: 12px; text-align: center; }
.step__node {
  position: relative; isolation: isolate; width: 72px; height: 80px;
  display: grid; place-items: center; clip-path: var(--hex-shape); background: var(--sheen);
}
.step__node::before { content: ""; position: absolute; inset: 2px; z-index: -1; clip-path: var(--hex-shape); background: var(--cell-2); }
.step__node svg { width: 30px; height: 30px; color: var(--text); }
h3.step__title {
  font-family: var(--display); font-size: 19px; font-weight: 700; text-transform: none; letter-spacing: .01em;
  color: var(--text); margin: 8px 0 0;
}
.step p { margin: 0; color: var(--muted); font-size: 14px; max-width: 24ch; }
.step p b { color: var(--text); font-weight: 600; font-family: var(--mono); font-size: 13px; }

@media (max-width: 900px) {
  .how__steps { grid-template-columns: minmax(0, 1fr); gap: 34px; margin-top: 48px; }
  .how__line { top: 40px; bottom: 40px; left: 35px; right: auto; width: 2px; height: auto;
    background: linear-gradient(180deg, var(--emerald), var(--teal), var(--amethyst), var(--orchid), var(--gold)); }
  .how__pulse { display: none; }
  .step { grid-template-columns: 72px minmax(0, 1fr); column-gap: 22px; row-gap: 4px; justify-items: start; text-align: left; }
  .step__node { grid-row: span 2; }
  h3.step__title { margin: 12px 0 0; }
}

/* ---- the turk ---------------------------------------------------------------------- */
.turk { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(40px, 7vw, 96px); align-items: center; }
.statline { display: flex; flex-wrap: wrap; gap: 20px 44px; margin-top: 38px; }
.stat-big .v { display: block; font-family: var(--mono); font-size: clamp(26px, 3vw, 34px); color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-big .k { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.turk .button { margin-top: 38px; }
.duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.plate {
  --cut-x: 18px; --cut-y: 31px;
  position: relative; isolation: isolate; aspect-ratio: 5 / 6;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 26px 18px 22px;
  clip-path: var(--cell-clip); background: var(--sheen);
}
.plate::before { content: ""; position: absolute; inset: 1.5px; z-index: -1; clip-path: var(--cell-clip); background: linear-gradient(165deg, var(--cell-2), var(--cell) 45%, #0c120f); }
.stat-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.plate .fly-mini { position: relative; left: auto; top: auto; cursor: default; width: 62%; align-self: center; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .5)); }
.plate--b .fly-mini { transform: rotate(14deg); }
.plate--a .fly-mini { transform: rotate(-10deg); }
.plate__label { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .12em; }
.plate--a .plate__label { color: var(--a); }
.plate--b .plate__label { color: var(--b); }
.plate__q { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.duel__vs { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--faint); letter-spacing: .1em; }
@media (max-width: 900px) {
  .turk { grid-template-columns: minmax(0, 1fr); }
}

/* ---- rug check ---------------------------------------------------------------------- */
.rug { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: center; padding: clamp(32px, 5vw, 64px) clamp(24px, 5vw, 64px); }
.rug__number {
  font-family: var(--display); font-weight: 800; font-stretch: 76%; line-height: .88;
  font-size: clamp(72px, 11vw, 96px); color: var(--gold); margin: 0; font-variant-numeric: tabular-nums;
}
.rug__number span.of { color: var(--muted); font-size: .5em; font-stretch: 90%; margin-inline: .1em; }
.rug__caption { margin: 16px 0 0; font-size: 16px; color: var(--muted); max-width: 34ch; }
.rug__caption b { color: var(--text); }
.rug h2.section-title { font-size: clamp(30px, 3.6vw, 44px); }
.rug-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.rug-form input {
  flex: 1 1 260px; min-width: 0; min-height: 54px; padding: 0 18px;
  border: 1px solid var(--line); background: var(--well); color: var(--text);
  font-family: var(--mono); font-size: 14px; border-radius: 0; transition: border-color .25s;
}
.rug-form input::placeholder { color: var(--faint); }
.rug-form input:hover { border-color: #3a4d43; }
.rug-form input:focus-visible { outline: none; border-color: var(--gold); }
.rug-form__error { width: 100%; margin: 4px 0 0; min-height: 1.4em; font-size: 13px; color: var(--bad); }
@media (max-width: 900px) {
  .rug { grid-template-columns: minmax(0, 1fr); }
}

/* ---- closing ---------------------------------------------------------------------- */
.closing { position: relative; isolation: isolate; overflow: hidden; text-align: center; padding-block: clamp(110px, 16vw, 200px); }
.closing__mark { position: absolute; left: 50%; top: 50%; width: min(620px, 120vw); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; opacity: .07; }
.closing h2.section-title { font-size: clamp(42px, 7vw, 88px); max-width: none; text-transform: uppercase; font-stretch: 76%; }
.closing p { margin: 20px auto 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); }
.closing .button { margin-top: 36px; }

.landing .comb { margin-top: 48px; }

@media (prefers-reduced-motion: reduce) {
  .fly__wing, .fly { animation: none !important; transition: none !important; }
  .how[data-inview] .how__pulse { animation: none; opacity: 0; }
  [data-state="live"] .live-dot { animation: none; }
}
.band--status { justify-content: flex-start; padding-block: 20px 4px; }

/* ---- the token ----------------------------------------------------------------- */
.copy-btn {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 6px 13px; cursor: pointer; clip-path: var(--pill-clip);
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--text); border-color: #3a4d43; }
.copy-btn:focus-visible { outline: none; background: var(--gold); color: var(--ground); }
.copy-btn[data-copied] { color: var(--emerald); border-color: var(--emerald); }
.copy-btn--lg { font-size: 13px; padding: 11px 20px; }

.site-footer__token { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 0; }
.site-footer__token .k {
  font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.site-footer__token code { font-family: var(--mono); font-size: 12px; color: var(--text); word-break: break-all; }

.token-band { border-block: 1px solid var(--line); background: var(--well); }
.token-band__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-block: 20px; }
h2.token-band__h {
  font-family: var(--display); font-size: 12px; font-weight: 700; font-stretch: 100%;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0;
}
.token-band__addr {
  flex: 1 1 auto; min-width: 0; word-break: break-all;
  font-family: var(--mono); font-size: clamp(12px, 1.4vw, 15px); color: var(--text);
}
.token-band__note { flex: 1 0 100%; margin: 0; font-size: 13px; color: var(--muted); }
