/* ==========================================================================
   BASED COIN — styles

   Hand-lettered throughout: Gloria Hallelujah carries the display type, and
   Architects Daughter everything else. Both are single-weight faces, so
   emphasis comes from size and colour, never font-weight.
   ========================================================================== */

:root {
  /* Brand */
  --blue:        #1f55f0;
  --blue-deep:   #143bb0;
  --blue-soft:   #9db6f7;   /* the pale sketch strokes in the banner */
  --green-ink:   #1c8a24;

  /* Surfaces & ink */
  --page:        #ffffff;
  --band:        #eaf0fe;   /* the blue band behind the dashboard */
  --surface:     #ffffff;
  --ink:         #10131a;
  --ink-2:       #3d4655;
  --muted:       #7a8496;
  --line:        #12161f;   /* hand-drawn outlines are near-black, not grey */
  --line-soft:   #d9e2fa;

  /* Shape */
  --r-btn:       14px;
  --r-card:      20px;

  --shadow-card: 0 2px 3px rgba(16,19,26,.04), 0 10px 26px rgba(31,85,240,.07);
  --shadow-btn:  0 2px 0 rgba(16,19,26,.9);

  --wrap:        1040px;
  --wave-h:      clamp(34px, 4.4vw, 64px);

  --font-hand:    "Architects Daughter", "Comic Sans MS", ui-rounded, cursive;
  --font-display: "Gloria Hallelujah", "Architects Daughter", "Comic Sans MS", cursive;

  color-scheme: light;
}

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

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

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

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

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

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

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar { padding: 18px 20px 6px; }

.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* Brand lockup — mark, then the two-line wordmark */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand__mark { width: 46px; height: 46px; }

.brand__word {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: .01em;
}

.brand__line { display: block; }
.brand__line--blue { color: var(--blue); }

/* Buttons carry a drawn outline rather than a border + shadow stack */
.topbar__links {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 2.5px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

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

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

.btn--icon { padding: 0 20px; }

.btn--ca { gap: 8px; text-transform: none; }

.btn__tag { color: var(--muted); }

.btn__addr {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.btn__icon--copy { color: var(--muted); width: 16px; height: 16px; }
.btn--ca:hover .btn__icon--copy { color: var(--blue); }

/* The @handle is a caption under the X button, so it can't widen the row */
.x-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.x-wrap .btn { width: 100%; }

.x-handle {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.2;
  white-space: nowrap;
}

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

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

.toast.is-on { opacity: 1; transform: translateY(0) scale(1); }

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

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

.hero {
  padding: 6px 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: 50 / 23; /* the clip and the still banner share this ratio */
  object-fit: cover;
  background: var(--page);
}

/* ==========================================================================
   Waves — the drawn edges of the blue band
   ========================================================================== */

.wave { line-height: 0; }

.wave svg {
  display: block;
  width: 100%;
  height: var(--wave-h);
}

.wave__fill { fill: var(--band); }

.wave__line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;   /* the stretch must not fatten the line */
}

/* ==========================================================================
   Band
   ========================================================================== */

.band { background: var(--band); }

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

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

.dashboard__title {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 30px;
  padding-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .05em;
  color: var(--blue);
  text-transform: uppercase;
  text-align: center;
}

/* The drawn rule under the title, stretched to whatever the title measures */
.underline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12px;
  overflow: visible;
}

.underline path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

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

.stat {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(16,19,26,.05), 0 16px 34px rgba(31,85,240,.12);
}

/* Drawn outline icons: one stroke spec for every path in the set */
.stat__icon { flex: none; display: grid; place-items: center; }

.stat__icon svg {
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat__icon--logo img { width: 52px; height: 52px; }

.stat__body { min-width: 0; }

.stat__label {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.stat__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.15;
  color: var(--ink);
  word-break: break-word;
}

.stat__unit { font-size: .62em; color: var(--blue); }

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

.stat__sub {
  margin: 5px 0 0;
  font-size: 15px;
  color: var(--ink-2);
  white-space: nowrap;
}

.stat__sub--usd b::before { content: "$"; }

.stat__sub b { font-weight: 400; }

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

/* 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: .22em;
  height: .22em;
  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; }

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

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

.eco {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 26px 0 8px;
  padding: 18px 20px;
  border: 2.5px dashed var(--blue-soft);
  border-radius: var(--r-card);
}

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

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

.eco__kicker {
  font-size: 14px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.3;
}

.eco__logo { height: 34px; width: auto; }

.eco__rule {
  width: 2.5px;
  align-self: stretch;
  min-height: 62px;
  border-radius: 999px;
  background: var(--blue-soft);
}

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

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 10px 20px 26px;
}

.foot p { margin: 0; }

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

@media (max-width: 900px) {
  .topbar__inner { flex-direction: column; align-items: center; gap: 12px; }
  .topbar__links { justify-content: center; }
  .stats { gap: 14px; }
  .stat { padding: 16px 18px; gap: 14px; }
  .stat__icon svg, .stat__icon--logo img { width: 46px; height: 46px; }
}

@media (max-width: 620px) {
  .topbar { padding: 14px 14px 4px; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__word { font-size: 19px; }

  .btn { min-height: 40px; padding: 0 13px; font-size: 13.5px; gap: 7px; }
  .btn__icon { width: 16px; height: 16px; }
  .x-handle { font-size: 11.5px; }

  /* 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%;
  }

  .band__inner { padding: 2px 14px 6px; }

  .dashboard__title { margin-bottom: 22px; }

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

  .stat { padding: 14px 16px; gap: 13px; border-radius: 16px; }
  .stat__icon svg, .stat__icon--logo img { width: 42px; height: 42px; }
  .stat__label { font-size: 13px; letter-spacing: .04em; }
  .stat__value { font-size: 23px; gap: 6px; }
  .stat__sub { font-size: 13.5px; }

  /* Stack the two ecosystem blocks, with the rule turned across */
  .eco { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px; margin-top: 20px; }
  .eco__rule { width: auto; height: 2.5px; min-height: 0; justify-self: stretch; }
  .eco__kicker { font-size: 12.5px; }
  .eco__logo { height: 28px; }
}

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