/* ==========================================================================
   AN AMAZON BOX — styles

   One warm page: the banner's own cream carries through the whole document,
   so the clip sits flush at the top with no seam. Ink is near-black, the only
   accent is the cardboard tan the banner is lettered in, and every icon rides
   in a tan disc so the six cards read as one set.
   ========================================================================== */

:root {
  /* Surfaces & ink — --page is sampled from the banner, so they match exactly */
  --page:        #fbf7f6;
  --surface:     #fdfbfa;
  --ink:         #14110f;
  --ink-2:       #4b443e;
  --muted:       #857b73;
  --line:        #e9e0d7;
  --line-strong: #ddd2c6;

  /* Cardboard accent */
  --tan:         #b9855b;
  --tan-deep:    #9a6a3f;
  --tan-soft:    #f2e7db;

  --base-blue:   #0052ff;

  /* Shape */
  --r-btn:       12px;
  --r-card:      16px;

  --shadow-card: 0 1px 2px rgba(20,17,15,.03), 0 6px 18px rgba(122,94,66,.05);

  --wrap:        1000px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  /* The faint isometric cubes behind everything. Drawn rather than shipped as
     an image so it stays crisp at any zoom and costs no request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cg fill='none' stroke='%23b9855b' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M30 0 60 17v34L30 68 0 51V17Z'/%3E%3Cpath d='M0 17l30 17 30-17M30 34v34'/%3E%3Cpath d='M90 52l30 17v34l-30 17-30-17V69Z'/%3E%3Cpath d='M60 69l30 17 30-17M90 86v34'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center top;
}

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

a { color: inherit; text-decoration: none; }

:where(a, button):focus-visible {
  outline: 2.5px solid var(--tan-deep);
  outline-offset: 3px;
  border-radius: var(--r-btn);
}

/* Present to screen readers, absent on screen — the banner carries the
   wordmark as pixels, so the page still needs a real heading. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 8px 20px 0;
  overflow: hidden;   /* contains the mobile overscan below */
}

.hero__inner {
  max-width: var(--wrap);
  margin: 0 auto;
}

.hero__media {
  display: block;
  width: 100%;
  height: auto;          /* beats the element's height attribute */
  aspect-ratio: 18 / 7;  /* the clip and the still banner share this ratio */
  object-fit: cover;
  background: var(--page);
}

/* ==========================================================================
   Actions — the three buttons under the banner
   ========================================================================== */

.actions { padding: 20px 20px 34px; }

.actions__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  background: var(--surface);
  font: inherit;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--tan);
  box-shadow: 0 4px 14px rgba(122,94,66,.10);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn__icon { width: 19px; height: 19px; flex: none; color: var(--ink); }

.btn__icon--stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Copied toast */
.ca-wrap { position: relative; }

.toast {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-btn);
  background: #14110f;
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(20,17,15,.22);
  opacity: 0;
  transform: translate(-50%, -6px) scale(.96);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 4;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

.toast__check { width: 15px; height: 15px; color: #7ddb6a; flex: none; }
.toast.is-error .toast__check { color: #ff8a7a; }

/* ==========================================================================
   Dashboard cards
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Label and figure left, icon right — the disc is the card's only colour */
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 2px 4px rgba(20,17,15,.04), 0 14px 30px rgba(122,94,66,.10);
}

.stat__body { min-width: 0; }

.stat__label {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: clamp(25px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
  word-break: break-word;
}

.stat__unit {
  font-size: .62em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

/* No source for this metric yet — don't dress a dash up as a figure */
.stat__value .is-empty { color: var(--muted); font-weight: 500; }

.stat__sub {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.stat__sub b { font-weight: 500; }
.stat__sub b::before { content: "$"; }

/* Values are numeric strings that swap in — keep them from reflowing */
.stat__value, .stat__sub b { font-variant-numeric: tabular-nums; }

/* One icon spec for the whole set: a tan disc with a drawn glyph inside */
.stat__icon,
.fact__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tan-soft);
}

.stat__icon svg,
.fact__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--tan-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Blinking "…" placeholder, shown until the first data load resolves */
.dots {
  display: inline-flex;
  align-items: flex-end;
  gap: .18em;
  padding-bottom: .12em;
}

.dots i {
  width: .2em;
  height: .2em;
  border-radius: 50%;
  background: currentColor;
  opacity: .25;
  animation: dot-blink 1.25s infinite ease-in-out;
}

.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }

@keyframes dot-blink {
  0%, 65%, 100% { opacity: .22; }
  32%           { opacity: 1; }
}

/* The sub-line's "$" prefix would sit oddly beside the dots */
.stat__sub b:has(.dots)::before { content: none; }

.note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   Token facts — one card, three fixed properties
   ========================================================================== */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 26px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.fact {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* Base keeps its own blue — it is a network mark, not part of the set */
.fact__icon--base { background: transparent; }
.fact__icon--base svg { stroke: var(--base-blue); stroke-width: 1.8; width: 30px; height: 30px; }

.fact__body { min-width: 0; }

.fact__label {
  margin: 0 0 5px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact__value {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--ink);
}

.fact__accent { color: var(--tan); }

.fact__sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

/* ==========================================================================
   Ecosystem
   ========================================================================== */

.eco {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin: 44px auto 0;
  max-width: 660px;
  padding: 22px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.eco__half {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 4px 8px;
  border-radius: 12px;
  text-align: center;
  transition: transform .18s ease;
}

.eco__half:hover { transform: translateY(-2px); }

.eco__kicker {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.3;
}

/* Both lockups have the resolution to run large — 550×112 and 800×261 — so
   they are sized by height and left to keep their own ratios. The
   Stonks.Exchange bar is much the wider of the two, which makes it read
   smaller at a matched height, so it gets a little more. */
.eco__logo { height: 44px; width: auto; }
.eco__logo--stonks { height: 52px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 34px 20px 40px;
}

.foot p { margin: 0; }

/* Reads a step above the risk line — it is a statement, not fine print.
   Scoped under .foot so its auto margins beat the `.foot p` reset above. */
.foot .foot__notice {
  max-width: 620px;
  margin: 0 auto 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .stats { gap: 14px; }
  .stat { padding: 18px 20px; gap: 14px; }
  .stat__icon, .fact__icon { width: 46px; height: 46px; }
  .stat__icon svg, .fact__icon svg { width: 23px; height: 23px; }
  .facts { gap: 20px; padding: 20px; }
}

@media (max-width: 760px) {
  .btn { min-height: 46px; padding: 0 18px; font-size: 14px; gap: 8px; }
  .btn__icon { width: 17px; height: 17px; }

  /* One fact per row, so the value never wraps under its own icon */
  .facts { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 620px) {
  /* The hero drops its side padding and runs edge to edge, slightly
     overscanning the banner's own margins so it reads as large as it can. */
  .hero { padding: 4px 0 0; }

  .hero__media {
    width: 106%;        /* eats the banner's own margins, not its content */
    max-width: none;
    margin-left: -3%;
  }

  .actions { padding: 4px 14px 22px; gap: 10px; }
  .actions__inner { gap: 10px; }
  .btn { min-height: 42px; padding: 0 14px; font-size: 13.5px; }

  .wrap { padding: 0 14px; }

  /* One card per row: the figure + disc pairing needs the width */
  .stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .stat { padding: 16px 18px; gap: 13px; }
  .stat__label { font-size: 11.5px; letter-spacing: .07em; }
  .stat__value { font-size: 24px; gap: 6px; }
  .stat__sub { font-size: 14.5px; }

  .stat__icon, .fact__icon { width: 42px; height: 42px; }
  .stat__icon svg, .fact__icon svg { width: 21px; height: 21px; }

  /* Stack the two ecosystem blocks */
  .eco { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 32px; padding: 18px 16px 20px; }
  .eco__kicker { font-size: 12.5px; }
  .eco__logo { height: 34px; }
  .eco__logo--stonks { height: 30px; }

  .foot { padding: 26px 16px 32px; }
}

@media (max-width: 420px) {
  .actions__inner { gap: 8px; }
  .btn { min-height: 40px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
  .btn__icon { width: 15px; height: 15px; }
  .stat__value { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  /* …but the loading placeholder still needs to be visible */
  .dots i { opacity: .55; }
}
