/* ==========================================================================
   $SKINS — Agent Skins design system: "The Studio"
   Every skin is shot in the same grey photo studio, so the site is that
   studio: warm light-grey paper, black ink, one cobalt accent. Skins are
   collectible cards (Nº, type, stats); Extreme skins get holographic foil.
   Type: Archivo at expanded width for display, normal width for UI;
   IBM Plex Mono for card labels and numbers.
   Single light look by design (body and every colour set explicitly).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;

  --bg: #ebe8e3;
  --bg-2: #e2ded7;
  --surface: #f6f4f0;
  --surface-2: #fbfaf8;
  --surface-3: #ffffff;
  --line: rgba(20, 19, 18, .10);
  --line-2: rgba(20, 19, 18, .18);

  --ink: #141312;
  --ink-2: #4b4844;
  --ink-3: #85807a;

  --accent: #2b44ff;
  --accent-2: #1f33d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(43, 68, 255, .10);
  /* aliases kept for pages written against the first palette */
  --gold: var(--accent);
  --gold-ink: var(--accent-ink);
  --gold-soft: var(--accent-soft);

  --up: #0d8f4f;
  --up-soft: rgba(13, 143, 79, .12);
  --down: #d93036;
  --down-soft: rgba(217, 48, 54, .11);

  /* skin types, read like card rarities */
  --t-average: #7b8089;
  --t-bold: #2b44ff;
  --t-extreme: #b03cff;
  --holo: conic-gradient(from 210deg, #ff6ad5, #ffd36a, #6affc8, #6ac8ff, #b36aff, #ff6ad5);

  --photo: #bdb6ac;

  --f-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-ui: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 66px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-card: 0 1px 0 rgba(20, 19, 18, .04), 0 18px 40px -24px rgba(20, 19, 18, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-variation-settings: 'wdth' 100;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  line-height: .92;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0;
}
.d-1 { font-size: clamp(44px, 7vw, 104px); }
.d-2 { font-size: clamp(34px, 4.8vw, 68px); }
.d-3 { font-size: clamp(28px, 3.4vw, 46px); }
.d-4 { font-size: clamp(20px, 2vw, 26px); letter-spacing: -.02em; line-height: 1; }
.gold, .accent { color: var(--accent); }
.outline-text { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 36em; margin: 0; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface-3);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-gold, .btn-accent { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); box-shadow: 0 10px 24px -12px rgba(43, 68, 255, .7); }
.btn-gold:hover, .btn-accent:hover { --btn-bg: var(--accent-2); }
.btn-light, .btn-ink { --btn-bg: var(--ink); --btn-ink: #fff; }
.btn-ghost { --btn-bg: transparent; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- tags / chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-live { color: var(--up); border-color: rgba(13, 143, 79, .35); background: var(--up-soft); }
.pill-paused { color: var(--ink-2); }
.pill-closed { color: var(--down); border-color: rgba(217, 48, 54, .3); background: var(--down-soft); }
.pill-ai { color: var(--ink-2); }
.pill-ai .dot { background: var(--accent); }
.pill-gold, .pill-accent { color: var(--accent); border-color: rgba(43, 68, 255, .3); background: var(--accent-soft); }
.pill-type[data-type="average"] { color: var(--t-average); border-color: color-mix(in srgb, var(--t-average) 40%, transparent); }
.pill-type[data-type="bold"] { color: var(--t-bold); border-color: color-mix(in srgb, var(--t-bold) 40%, transparent); }
.pill-type[data-type="extreme"] { color: var(--t-extreme); border-color: color-mix(in srgb, var(--t-extreme) 40%, transparent); }

.pnl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pnl.is-up { color: var(--up); background: var(--up-soft); }
.pnl.is-down { color: var(--down); background: var(--down-soft); }
.pnl.is-flat { color: var(--ink-2); background: rgba(20, 19, 18, .06); }

.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 550;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- header ---------- */
.top-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px var(--gutter);
  background: var(--ink);
  color: #f2efe9;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
}
.top-banner b { color: #9fb0ff; font-weight: 600; }
.app-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(235, 232, 227, .86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header .wrap { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand-word {
  font-family: var(--f-display);
  font-weight: 800;
  font-variation-settings: 'wdth' 125;
  font-size: 17px;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-word b { color: var(--accent); font-weight: 800; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 550;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: rgba(20, 19, 18, .07); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wallet-btn .addr { font-family: var(--f-mono); font-size: 13px; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .nav, .header-actions .hide-sm { display: none; }
  .menu-btn { display: inline-flex; }
  .app-header .wrap { gap: 12px; }
}
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mobile-menu a.mm-link {
  font-family: var(--f-display);
  font-weight: 800;
  font-variation-settings: 'wdth' 125;
  letter-spacing: -.03em;
  font-size: 38px;
  text-transform: uppercase;
  line-height: 1.1;
}
.mobile-menu a.mm-link[aria-current="page"] { color: var(--accent); }
.mobile-menu .mm-actions { margin-top: auto; display: grid; gap: 10px; }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(26px, 4vw, 44px); }
.section-head .lede { margin-top: 14px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.ink-section { background: var(--ink); color: #f2efe9; }
.ink-section .lede, .ink-section .muted { color: #b9b4ad; }
.ink-section .eyebrow { color: #b9b4ad; }

/* ---------- skin card: a collectible ---------- */
.skin-card {
  --type: var(--t-average);
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px 10px 14px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.skin-card[data-type="bold"] { --type: var(--t-bold); }
.skin-card[data-type="extreme"] { --type: var(--t-extreme); }
.skin-card::before {
  /* type strip along the top edge, like a card's rarity bar */
  content: '';
  position: absolute;
  left: 18px; right: 18px; top: -1px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--type);
}
.skin-card[data-type="extreme"]::before { background: var(--holo); }
a.skin-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 1px 0 rgba(20, 19, 18, .04), 0 30px 50px -26px rgba(20, 19, 18, .45); }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sc-head .sc-type { color: var(--type); font-weight: 600; }
.skin-card[data-type="extreme"] .sc-type { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sc-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--photo); }
.sc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform .6s var(--ease); }
a.skin-card:hover .sc-photo img { transform: scale(1.04); }
.sc-photo .sc-status { position: absolute; left: 8px; top: 8px; z-index: 2; }
.sc-photo .pill { background: rgba(251, 250, 248, .9); }
.skin-card[data-type="extreme"] .sc-photo::after {
  /* holographic foil sheen: parked off-card at rest, sweeps across on hover */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, transparent 38%, rgba(255, 106, 213, .55) 44%, rgba(255, 211, 106, .5) 48%, rgba(106, 255, 200, .5) 52%, rgba(106, 200, 255, .55) 56%, transparent 62%, transparent 100%);
  background-size: 300% 300%;
  background-position: 100% 100%;
  mix-blend-mode: soft-light;
  transition: background-position 1.1s var(--ease);
  pointer-events: none;
}
.skin-card[data-type="extreme"]:hover .sc-photo::after { background-position: 0 100%; }
.sc-name {
  padding: 2px 4px 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-variation-settings: 'wdth' 125;
  font-size: clamp(19px, 1.8vw, 24px);
  letter-spacing: -.03em;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.sc-meta .pnl { white-space: nowrap; flex: 0 0 auto; }
.sc-meta .handle { font-family: var(--f-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sc-stats { display: grid; gap: 5px; padding: 8px 4px 0; border-top: 1px dashed var(--line-2); }
.sc-stat { display: grid; grid-template-columns: 68px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sc-stat .bar { height: 5px; border-radius: 3px; background: rgba(20, 19, 18, .08); overflow: hidden; }
.sc-stat .bar i { display: block; height: 100%; border-radius: 3px; background: var(--ink); }
.sc-stat b { font-weight: 500; color: var(--ink-2); text-align: right; }
.skin-card.is-placeholder { place-items: center; min-height: 320px; }

.skins-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 22px); }
@media (max-width: 1080px) { .skins-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .skins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-stats { display: none; } }
@media (max-width: 380px) { .skins-grid { gap: 10px; } .skin-card { padding: 7px 7px 10px; } }

/* ---------- panels ---------- */
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-pad { padding: clamp(18px, 2.4vw, 26px); }
.stat { display: grid; gap: 6px; }
.stat .k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-family: var(--f-display); font-weight: 800; font-variation-settings: 'wdth' 125; letter-spacing: -.03em; font-size: clamp(26px, 2.8vw, 38px); line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field label, .field .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error-text { font-size: 13px; color: var(--down); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 19, 18, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: 0 40px 100px -40px rgba(20, 19, 18, .6);
}
.modal h3 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 800; font-variation-settings: 'wdth' 125; letter-spacing: -.03em; font-size: 26px; text-transform: uppercase; line-height: 1; }
.wallet-list { display: grid; gap: 8px; margin-top: 18px; }
.wallet-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  font-weight: 650;
}
.wallet-opt:hover { border-color: var(--accent); }

/* ---------- toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 20px 50px -20px rgba(20, 19, 18, .6); }
.toast.is-error { background: var(--down); color: #fff; }

/* ---------- footer ---------- */
.app-footer { background: var(--ink); color: #f2efe9; padding-block: 48px 36px; margin-top: 40px; }
.app-footer .wrap { display: grid; gap: 28px; }
.app-footer .brand-word { color: #f2efe9; }
.app-footer .brand-word b { color: #8fa2ff; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; color: #b9b4ad; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-legal { font-size: 12.5px; color: #8a857e; max-width: 70ch; }

/* ---------- skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--bg-2); }
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skin-card.skeleton { min-height: 360px; box-shadow: none; border-color: transparent; }

/* ---------- empty state ---------- */
.empty { display: grid; justify-items: center; gap: 12px; padding: 56px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-2); }
.empty .display { color: var(--ink); }

.example-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 480px) {
  .hide-xs { display: none !important; }
  .top-banner { font-size: 11px; }
}
