/*
 * PONZINC landing (css/landing.css). Landing-owned. One full-screen hero, laid out to the measured ORE home:
 *   1440 x 900: header row 80 tall (24px gutters, 40px hit areas), ring 1192 square centred at (50%, 44%),
 *               H1 48px two lines ending 24px above the buttons, buttons 48 tall ending 64px above the bottom,
 *               the quiet bottom row 24px above the bottom (24px clear of the buttons).
 *   390 x 844:  header 64 tall (8px gutters), ring 838 square, H1 36px; the bottom row sits in the flow under
 *               the buttons (24px clear of them, 24px or the safe area above the bottom), so the heading and
 *               buttons ride 22px higher than the reference, which has no bottom row.
 * The ring image is 2000 px of original art whose outer band ends at 72% of its radius, so a 1192 box shows a
 * ring 858 px across, the size of the reference ring. The mesh bands are a second, level image laid over it.
 *
 * Ring fit: the heading must never sit on the bright mineral ring (0.134 of the box from the centre). --lead-h is
 * the height from the top of the heading to the bottom of the hero at each breakpoint.
 *   desktop  the heading also clears the inner mesh band (band A, 0.191): the ring is capped so band A fits
 *            between the header (80px) and the heading, and its centre moves up from 44% when the screen is too
 *            short to keep band A 20px clear of the heading (short laptop windows, phones held sideways).
 *   phones   the nav spans the width, so the outer band (0.36) must also stay below the header (56px): the ring
 *            is capped so the outer band's top and the mineral ring's bottom (12px above the heading) both fit,
 *            and its centre is clamped between those two limits around 44%.
 * At 1440 x 900 and 390 x 844 no limit bites, so those match the reference exactly.
 */

:root {
  --bg: rgb(9, 8, 16);
  --text: rgb(240, 238, 233);
  --muted: rgb(126, 126, 140);
  --pill: rgb(245, 245, 245);
  --pill-text: rgb(9, 8, 16);
  --hover-bg: rgba(240, 238, 233, 0.06);
  --green: #1fdb63;
  --green-soft: rgba(31, 219, 99, 0.18);
  /* "Explore data" sits on the ring's outer band, not the plain ground: one step lighter than --muted keeps
     it at WCAG AA (4.5:1) against the lit mesh at every rotation (tools/hero.check.mjs) */
  --muted-strong: rgb(150, 150, 164);
  --line: rgba(126, 126, 140, 0.38);
  --hero-h: max(540px, 100vh);
  --foot-pad: max(24px, env(safe-area-inset-bottom, 0px));
  /* heading top to hero bottom: two 60px lines + 24 + 48px buttons + 64 */
  --lead-h: 256px;
  /* the reference sizes its ring box min(max(75vw, 75vh), 900px); ours is that times 1192/900, capped so the
     inner band (0.382 of the box across) fits between the header and the heading */
  --ring: min(calc(min(max(75vw, 75vh), 900px) * 1.3244), calc((var(--hero-h) - var(--lead-h) - 100px) * 2.618));
  --ring-y: min(44%, calc(100% - var(--lead-h) - 20px - var(--ring) * 0.191));
  --gutter: 24px;
  color-scheme: dark;
}

@supports (height: 100dvh) {
  :root { --hero-h: max(540px, 100dvh); }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
p { margin: 0; }

.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;
}

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------- hero frame */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}

/* ---------------------------------------------------------------- header */

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  border-radius: 8px;
  flex: none;
}
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }
.brand-word {
  font-weight: 800;
  font-stretch: 125%;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 16px; white-space: nowrap; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-link:hover { color: var(--text); background: var(--hover-bg); }

/* disabled: Trade while TOKEN.buyUrl is blank */
.nav-link.is-soon { cursor: not-allowed; }
.nav-link.is-soon:hover { color: var(--muted); background: transparent; }

.soon {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--muted);
  font-stretch: 100%;
}
.soon-float {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  transform: translate(-50%, -4px);
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-link.is-soon:hover .soon-float,
.nav-link.is-soon:focus-visible .soon-float { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- ring */

/* The stage is its own stacking context, so the screened layers (bands, glow) blend with what is painted inside
   it. Its opaque page-colour ground gives them a backdrop past the ring's transparent rim; without it the black
   of the bands image shows as a box. */
.stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
}

.ring,
.ring-bands,
.ring-glow {
  position: absolute;
  left: 50%;
  top: var(--ring-y);
}

.ring {
  display: block;
  width: var(--ring);
  height: var(--ring);
  margin: calc(var(--ring) / -2) 0 0 calc(var(--ring) / -2);
}

.ring-img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  animation: ring-turn 240s linear infinite;
  will-change: transform;
}

/* the mesh bands: a level strip 2000 x 400 of the ring's 2000, its row 175 on the ring centre, screened over the
   turning ring (black in it leaves the ring untouched) */
.ring-bands {
  display: block;
  width: var(--ring);
  height: calc(var(--ring) * 0.2);
  margin: calc(var(--ring) * -0.0875) 0 0 calc(var(--ring) / -2);
  mix-blend-mode: screen;
}
.ring-bands img { display: block; width: 100%; height: 100%; user-select: none; }

/* the breathing light around the mineral ring (image radius 0.13 .. 0.27 of the box half) */
.ring-glow {
  width: calc(var(--ring) * 0.44);
  height: calc(var(--ring) * 0.44);
  margin: calc(var(--ring) * -0.22) 0 0 calc(var(--ring) * -0.22);
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(31, 219, 99, 0) 44%,
    rgba(31, 219, 99, 0.13) 58%,
    rgba(124, 245, 166, 0.07) 66%,
    rgba(31, 219, 99, 0.035) 80%,
    rgba(31, 219, 99, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: ring-breathe 7s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

@keyframes ring-turn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ring-breathe {
  from { opacity: 0.35; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1.015); }
}

/* ---------------------------------------------------------------- lead: heading + buttons */

.lead {
  position: relative;
  z-index: 2;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 16px 64px;
  text-align: center;
}

.title {
  margin: 0;
  font-weight: 700;
  font-stretch: 125%;
  font-size: 48px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text);
  text-shadow: 0 2px 28px rgba(9, 8, 16, 0.65);
}

.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* On desktop the buttons sit on the ring's outer band, whose lit edge turns under them. A soft shadow of the
   page colour keeps the quiet link readable at every angle without a visible box. */
.cta::before {
  content: '';
  position: absolute;
  inset: -26px -56px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(9, 8, 16, 0.66), rgba(9, 8, 16, 0.5) 55%, rgba(9, 8, 16, 0));
  pointer-events: none;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-text);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.btn-pill:hover { transform: scale(1.05); background: #fff; }
.btn-pill:active { transform: scale(0.98); }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted-strong);
  white-space: nowrap;
  transition: color 0.3s ease;
}
.btn-quiet .arrow { display: block; width: 14px; height: 14px; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; transform: translateX(-3px); }
.btn-quiet:hover,
.btn-quiet:focus-visible { color: var(--text); }
.btn-quiet:hover .arrow,
.btn-quiet:focus-visible .arrow { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- the quiet bottom row */

.foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--foot-pad);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

.foot-copy { white-space: nowrap; }

.foot-links { display: flex; align-items: center; gap: 16px; }

.foot-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -4px;
  border-radius: 6px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.foot-x svg { display: block; }
.foot-x:hover { color: var(--text); }

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.foot-link:hover { color: var(--text); }
.foot-link.is-soon,
.foot-link:disabled { cursor: not-allowed; }
.foot-link.is-soon:hover,
.foot-link:disabled:hover { color: var(--muted); }
button.foot-link { cursor: pointer; }
button.foot-link:disabled { cursor: not-allowed; }

/* ---------------------------------------------------------------- phones */

/* Phones: the bottom row wraps to two lines (links, then the copyright), so it joins the flow under the buttons
   instead of floating over them: 24px between the buttons and the row, the row ends 24px (or the safe area)
   above the bottom. */
@media (max-width: 767px) {
  :root {
    --gutter: 8px;
    /* two 45px lines + 24 + 48 + 24 + the row (16 + 8 + 16) + its bottom padding */
    --lead-h: calc(226px + var(--foot-pad));
    /* 0.494 = 0.36 above the centre (outer band) + 0.134 below it (mineral ring) */
    --ring: min(calc(min(max(75vw, 75vh), 900px) * 1.3244), calc((var(--hero-h) - var(--lead-h) - 68px) * 2.0243));
    --ring-y: clamp(calc(56px + var(--ring) * 0.36), 44%, calc(100% - var(--lead-h) - 12px - var(--ring) * 0.134));
  }
  .top { padding: 12px var(--gutter); }
  .brand { gap: 8px; }
  .brand-word { font-size: 17px; }
  .title { font-size: 36px; }
  .lead { padding-bottom: 24px; }
  .foot {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 0 16px var(--foot-pad);
  }
}

/* narrow phones: the wordmark and three nav links need the room */
@media (max-width: 389px) {
  .nav { gap: 2px; }
}

@media (max-width: 359px) {
  :root { --lead-h: calc(216px + var(--foot-pad)); }
  .brand-word { display: none; }
  .title { font-size: 32px; }
  .btn-pill, .btn-quiet { padding: 0 20px; }
}

/* short screens: a smaller heading; the ring shrinks and rises through --lead-h (see the top of this file) */
@media (max-height: 620px) and (min-width: 768px) {
  :root { --lead-h: 236px; }
  .title { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .ring-img,
  .ring-glow { animation: none; }
  .ring-glow { opacity: 0.7; }
  .btn-pill, .btn-quiet, .btn-quiet .arrow, .nav-link, .soon-float { transition: none; }
}
