/* =====================================================================
 * Arrow Phase 30 — the visual system.
 *
 * Loaded last, so it is the layer that decides how Arrow feels. The brand
 * is unchanged: near-black, mint, the pixel arrow, the same type. What
 * changes is craft — real elevation instead of flat bordered boxes, one
 * spacing scale instead of ad-hoc margins, motion that means something, and
 * cards built around the picture rather than around a table of figures.
 *
 * Rules kept from the rest of the site: no remote fonts or images (the CSP
 * forbids them), every number still comes from the chain, and everything
 * here respects prefers-reduced-motion.
 * ===================================================================== */

:root {
  scroll-padding-top: 88px;
  /* one spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  /* elevation: a rim light along the top edge, shadow beneath */
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --lift-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --lift-2: 0 8px 24px -8px rgba(0, 0, 0, 0.65);
  --lift-3: 0 20px 48px -16px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 1px rgba(75, 240, 177, 0.28);
  --halo: 0 8px 32px -8px rgba(75, 240, 177, 0.22);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 140ms;
  --slow: 320ms;
}

/* two soft lights rather than a flat fill: the page has depth before anything is drawn on it */
body {
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(75, 240, 177, 0.07), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(23, 181, 134, 0.05), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------------------------------------------------------- surfaces */

.sf-panel,
.review-card,
.info-card,
.market-card,
.wizard-panel,
.wizard-nav,
.sf-first {
  border-radius: 16px;
  box-shadow: var(--rim), var(--lift-1);
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.sf-panel,
.wizard-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0)),
    var(--surface);
}

/* ------------------------------------------------------------ header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(4, 7, 10, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(27, 42, 54, 0.7);
}

.topbar nav a {
  position: relative;
  transition: color var(--fast) var(--ease);
}

.topbar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--slow) var(--ease);
}

.topbar nav a.active::after,
.topbar nav a:hover::after {
  transform: scaleX(1);
}

/* the nav is one line, always: "How It Works" wrapping mid-phrase reads as broken */
.topbar nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 30px);
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar nav::-webkit-scrollbar { display: none; }

.topbar nav a {
  white-space: nowrap;
  font-size: var(--step-0);
  padding: 6px 0;
}

.topbar { gap: var(--s-4); }

/* the launch link is the point of the site: it looks like an action */
.topbar nav a[href="#launch"] {
  color: var(--mint);
  font-weight: 700;
}

/* --------------------------------------------------------- the hero */

/*
 * Phase 30: the hero was 714px tall — the whole first screen — on a site
 * whose point is the coins below it. A launchpad should show launches above
 * the fold. This keeps the headline and the two actions, and gives the rest
 * of the height back to the market.
 */
.sf-hero { padding-top: var(--s-6); padding-bottom: var(--s-5); }

.sf-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: var(--s-6);
  align-items: center;
}

.sf-h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: var(--s-2) 0 var(--s-3);
}

.sf-sub { font-size: var(--step-1); max-width: 54ch; margin-bottom: var(--s-3); }
.sf-earn { margin-bottom: var(--s-2); }
.sf-risk-line { font-size: var(--step--1); color: var(--text-3); margin-bottom: var(--s-4); }

.sf-hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.sf-hero-actions .sf-cta, .sf-hero-actions .sf-cta-ghost { padding: 12px 22px; border-radius: 12px; }

.sf-assure {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-4);
  font-size: 12px;
  color: var(--text-3);
}

.sf-assure b { color: var(--mint-deep); }

/* the first-launch panel sits beside the headline, not under everything */
.sf-first { padding: var(--s-5); gap: var(--s-3); }
.sf-first strong { font-size: var(--step-2); }
.sf-first span { font-size: var(--step--1); }

@media (max-width: 900px) {
  .sf-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .sf-hero { padding-top: var(--s-5); }
}

/* ------------------------------------------------------------- cards */

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: var(--s-4);
}

.market-card {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  animation: arrow-rise var(--slow) var(--ease) both;
}

.market-card:hover {
  transform: translateY(-3px);
  border-color: rgba(75, 240, 177, 0.45);
  box-shadow: var(--rim), var(--lift-3), var(--ring), var(--halo);
}

.market-card:active {
  transform: translateY(-1px);
}

/* the picture is the card: a square that fills the top half */
.market-art {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
}

.market-art .market-image,
.market-art .market-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
}

.market-art .market-mark svg {
  width: 56%;
  height: 56%;
  opacity: 0.9;
}

.market-image {
  transition: transform var(--slow) var(--ease);
}

.market-card:hover .market-image {
  transform: scale(1.04);
}

.market-state {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
}

.market-body {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-3) var(--s-4);
  align-content: start;
}

.market-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.market-name strong {
  font-size: var(--step-1);
  color: var(--text);
}

.market-name span {
  font-size: var(--step--1);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}

.market-cap {
  font-size: var(--step-1);
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}

.market-age,
.market-progress {
  font-size: var(--step--1);
  color: var(--text-3);
}

.market-progress {
  font-size: 11px;
}

/* ---------------------------------------------------------- controls */

.primary-btn,
.sf-cta {
  background: linear-gradient(180deg, var(--mint), var(--mint-deep));
  color: #04120c;
  border: none;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 20px -8px rgba(75, 240, 177, 0.6);
  transition:
    transform var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease),
    filter var(--fast) var(--ease);
}

.primary-btn:hover:not(:disabled),
.sf-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 28px -10px rgba(75, 240, 177, 0.75);
}

.primary-btn:active:not(:disabled),
.sf-cta:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.secondary-btn,
.sf-cta-ghost {
  background: rgba(14, 23, 32, 0.8);
  border: 1px solid var(--line-2);
  transition:
    border-color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.secondary-btn:hover,
.sf-cta-ghost:hover {
  border-color: rgba(75, 240, 177, 0.5);
  background: var(--surface-3);
}

/* one visible focus ring, everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------ filter pills */

.market-controls button,
.sf-chip {
  border-radius: 999px;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  background: rgba(14, 23, 32, 0.75);
  color: var(--text-2);
  font-size: var(--step--1);
  cursor: pointer;
  transition:
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.market-controls button:hover,
.sf-chip:hover {
  border-color: rgba(75, 240, 177, 0.4);
  color: var(--text);
}

.market-controls button.active,
.sf-chip.active {
  background: rgba(75, 240, 177, 0.16);
  border-color: rgba(75, 240, 177, 0.55);
  color: var(--text);
}

/* ------------------------------------------------------- empty state */

.market-empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  text-align: center;
  padding: var(--s-8) var(--s-5);
  border: 1px dashed var(--line-2);
  border-radius: 20px;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(75, 240, 177, 0.06), transparent 70%),
    var(--surface);
}

.market-empty-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  opacity: 0.85;
}

.market-empty-mark svg { width: 100%; height: 100%; }

.market-empty strong {
  font-size: var(--step-3);
  color: var(--text);
}

.market-empty > span:not(.market-empty-mark) {
  color: var(--text-2);
  max-width: 46ch;
}

.market-empty .sf-cta { margin-top: var(--s-2); }

/* skeleton lines inside a loading card */
.skeleton-line { height: 12px; border-radius: 6px; }
.skeleton-line.short { width: 60%; }
.market-card.is-loading { pointer-events: none; animation: none; }
.market-card.is-loading .market-art { border-radius: 0; }

/* ------------------------------------------------------ docs: contracts */

.addr-list {
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: var(--s-4);
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.addr-list li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4px var(--s-3);
  align-items: baseline;
}

.addr-name { font-weight: 600; color: var(--text); }

.addr-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--step--1);
  color: var(--mint);
  word-break: break-all;
  text-decoration: none;
}

.addr-value:hover { text-decoration: underline; }
.addr-note { grid-column: 2; color: var(--text-3); font-size: 11px; }

@media (max-width: 620px) {
  .addr-list li { grid-template-columns: minmax(0, 1fr); }
  .addr-note { grid-column: 1; }
}

/* --------------------------------------------------------- analytics */

/*
 * The six headline tiles used to be an auto-fit grid: at desktop width five
 * fitted and the sixth dropped to a row of its own, leaving a wide grey
 * slab beside it. The count is fixed at six, so the columns are too —
 * 6 / 3 / 2 / 1 — and every row is full at every width.
 */
.tile-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
}

.stat-tile { padding: 18px 16px; gap: 5px; }
.stat-tile .stat-value { font-size: clamp(19px, 1.5vw, 26px); }
.stat-tile .sf-fine { min-height: 0; }

@media (max-width: 1180px) { .tile-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .tile-row { grid-template-columns: minmax(0, 1fr); } }

/* the page's opening paragraph reads as a column, not a stripe */
.page-title .sf-sub { max-width: 68ch; }

/* ------------------------------------------------------- the coin page */

.token-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-5);
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(75, 240, 177, 0.07), transparent 70%),
    var(--surface);
  box-shadow: var(--rim), var(--lift-1);
  margin-bottom: var(--s-4);
}

.token-hero h1 {
  margin: 0 0 var(--s-2);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.token-hero img,
.token-hero .token-mark {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: flex-end;
  align-items: center;
}

.badge-action {
  cursor: pointer;
  border: 1px solid var(--line-2);
  background: rgba(14, 23, 32, 0.8);
  color: var(--text-2);
  font: inherit;
  font-size: var(--step--1);
  padding: 6px 12px;
  border-radius: 999px;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.badge-action:hover { border-color: rgba(75, 240, 177, 0.5); color: var(--text); }

/* the trade box follows you down the page: it is what the page is for */
.trade-sticky { position: sticky; top: 88px; z-index: 5; }

/* tabs */
.token-tabs { display: grid; gap: var(--s-3); }
.tab-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  color: var(--text-3);
}

.sf-chip.active .tab-count { background: rgba(75, 240, 177, 0.2); color: var(--text); }
.tab-body > .sf-panel { margin: 0; }

@media (max-width: 900px) {
  .trade-sticky { position: static; }
  .token-hero { grid-template-columns: auto minmax(0, 1fr); }
  .token-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 480px) {
  .token-hero { padding: var(--s-4); gap: var(--s-3); }
  .token-hero img, .token-hero .token-mark { width: 60px; height: 60px; border-radius: 12px; }
}

/* --------------------------------------------------------- feedback */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: arrow-shimmer 1.4s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes arrow-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@keyframes arrow-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ phones */

@media (max-width: 480px) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .market-body { padding: 10px 10px 12px; }
  .market-name strong { font-size: var(--step-0); }
  .market-cap { font-size: var(--step-0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .market-card:hover,
  .primary-btn:hover:not(:disabled) {
    transform: none;
  }
}
