/* ───────────────────────────────────────────────────────────
   HIVEMIND — token system
   Color   #100B06 void / #1D1509 cell / #F2A93B honey / #FFD37A bright
           #F7ECD8 wax(text) / #A4906C ink(dim) / #ABC65A up / #D1573D down
   Type    Fraunces (display, organic warmth) + Space Mono (data, precision)
   Layout  honeycomb: offset hex cells on desktop, stacked cards on mobile
   ─────────────────────────────────────────────────────────── */

:root {
  --void: #100b06;
  --cell: #1d1509;
  --cell-2: #251a0c;
  --line: #3c2a12;
  --line-soft: #2a1e0f;
  --honey: #f2a93b;
  --honey-deep: #c97e1f;
  --honey-bright: #ffd37a;
  --wax: #f7ecd8;
  --ink: #a4906c;
  --ink-dim: #786246;
  --up: #abc65a;
  --down: #d1573d;

  --font-display: "Fraunces", Georgia, serif;
  --font-data: "Space Mono", ui-monospace, Menlo, monospace;

  color-scheme: dark;
}

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

body {
  background: var(--void);
  color: var(--wax);
  font-family: var(--font-data);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* faint honeycomb wallpaper */
.comb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0, transparent 34%, var(--line-soft) 34.5%, var(--line-soft) 35.5%, transparent 36%),
    linear-gradient(var(--void), var(--void));
  background-size: 84px 96px;
  background-position: 0 0, 42px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 0%, transparent 75%);
}

.hidden { display: none !important; }

/* ── header ─────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(18px, 5vw, 56px) 10px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  font-size: 30px;
  color: var(--honey);
  line-height: 1;
  transform: rotate(0deg);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--wax);
}

.brand-ticker {
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cell);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-dim);
}

.status.live .status-dot {
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(171, 198, 90, 0.6);
  animation: pulse 1.8s infinite;
}

.status.error .status-dot { background: var(--down); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(171, 198, 90, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(171, 198, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(171, 198, 90, 0); }
}

/* ── layout shell ───────────────────────────────────── */

main#app {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 10px clamp(16px, 5vw, 40px) 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel {
  background: var(--cell);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 32px);
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--wax);
}

.panel-sub {
  font-family: var(--font-data);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink);
  margin-left: 8px;
}

/* ── setup / error / loading states ────────────────── */

.setup-notice, .error-notice {
  text-align: center;
  padding: 56px 28px;
}

.setup-notice h1, .error-notice h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 12px;
  color: var(--honey-bright);
}

.setup-notice p, .error-notice p {
  color: var(--ink);
  max-width: 46ch;
  margin: 0 auto;
  line-height: 1.6;
}

.setup-notice code, .error-notice code {
  background: var(--cell-2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--honey-bright);
}

.link-button {
  display: inline-block;
  margin-top: 18px;
  color: var(--void);
  background: var(--honey);
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.loading-notice {
  text-align: center;
  padding: 64px 20px;
  color: var(--ink);
}

.loader-hex {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.loader-hex span {
  width: 16px;
  height: 16px;
  background: var(--honey);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  animation: bob 1s infinite ease-in-out;
}

.loader-hex span:nth-child(2) { animation-delay: 0.15s; }
.loader-hex span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

/* ── hero ───────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 36px);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.hero-hex {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 260px;
  line-height: 1;
  color: var(--honey);
  opacity: 0.06;
  pointer-events: none;
}

.hero-main { position: relative; z-index: 1; }

.hero-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 6px;
}

.hero-price {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 600;
  color: var(--honey-bright);
  line-height: 1.05;
}

.hero-change {
  margin-top: 10px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
}

.hero-change-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink);
}

.hero-change.up #heroChangeVal, .up-text { color: var(--up); }
.hero-change.down #heroChangeVal, .down-text { color: var(--down); }

.hero-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-left: auto;
  padding-left: clamp(16px, 4vw, 36px);
  border-left: 1px solid var(--line);
}

.hero-stat { display: flex; flex-direction: column; gap: 3px; }

.hero-stat-label { font-size: 11px; color: var(--ink); }

.hero-stat-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--wax);
}

/* ── honeycomb stat grid ────────────────────────────── */

.comb-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 2px;
  padding: 30px 0 10px;
}

.hex-cell {
  width: 190px;
  height: 168px;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
  background: linear-gradient(160deg, var(--cell-2), var(--cell));
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 26px;
  gap: 6px;
}

.hex-cell:nth-child(odd) { margin-top: 42px; }

.hex-cell .cell-icon { font-size: 18px; opacity: 0.85; }

.hex-cell .cell-label {
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.hex-cell .cell-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--wax);
}

.hex-cell .cell-sub {
  font-size: 10.5px;
  color: var(--ink-dim);
}

/* ── activity (buy/sell pressure) ──────────────────── */

.activity-rows { display: flex; flex-direction: column; gap: 14px; }

.activity-row { display: flex; flex-direction: column; gap: 6px; }

.activity-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink);
}

.activity-row-top strong { color: var(--wax); font-weight: 700; }

.bar-track {
  height: 8px;
  border-radius: 5px;
  background: var(--down);
  overflow: hidden;
  display: flex;
}

.bar-buys { background: var(--up); height: 100%; }

.activity-row-counts {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-dim);
}

/* ── meta / contract ────────────────────────────────── */

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 20px;
  margin: 0 0 22px;
}

.meta-grid div.meta-item { display: flex; flex-direction: column; gap: 3px; }
.meta-grid dt { font-size: 11px; color: var(--ink); }
.meta-grid dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--wax); }

.ca-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cell-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.ca-label { font-size: 11px; color: var(--ink); white-space: nowrap; }

.ca-value {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--honey-bright);
}

.copy-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--wax);
  font-family: var(--font-data);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover { border-color: var(--honey); color: var(--honey-bright); }

.external-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.external-links a {
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
}

.external-links a:hover { color: var(--honey-bright); border-color: var(--honey); }

/* ── footer ─────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 11px;
  color: var(--ink-dim);
  padding: 10px 20px 34px;
}

.dot-sep { margin: 0 8px; }

/* ── focus visibility ───────────────────────────────── */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
}

/* ── reduced motion ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .status.live .status-dot { animation: none; }
  .loader-hex span { animation: none; }
}

/* ── responsive: drop the hex tessellation below tablet width ── */

@media (max-width: 680px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-side {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
    margin-left: 0;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
  .hero-hex { display: none; }

  .comb-grid { gap: 10px; padding-top: 20px; }
  .hex-cell {
    clip-path: none;
    border-radius: 14px;
    width: calc(50% - 5px);
    height: auto;
    min-height: 108px;
    padding: 14px 10px;
  }
  .hex-cell:nth-child(odd) { margin-top: 0; }
}

@media (max-width: 420px) {
  .hex-cell { width: 100%; }
}
