/* ==========================================================================
   anttek — tokens, type, shell
   Claude palette on a near-black ground. One accent (clay orange) for full stops,
   active states, the queen and progress.
   ========================================================================== */

:root {
  --bg: #121211;
  --bg-2: #181816;
  --panel: #1a1918;
  --panel-2: #201f1d;
  --well: #0e0e0d;
  --text: #f4f3ee;
  --text-2: #cfcbc1;
  --text-3: #8f8a80;
  --accent: #ff6a2b;
  --accent-deep: #e5521a;
  --accent-ink: #160d08;
  --accent-soft: rgb(255 106 43 / 0.14);
  --pos: #86c497;
  --neg: #ec8a72;
  --line: rgb(244 243 238 / 0.09);
  --line-2: rgb(244 243 238 / 0.16);
  --dots: rgb(244 243 238 / 0.05);

  --font-head: 'Heading', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --fs-display: clamp(3.2rem, 7.2vw, 7.8rem);
  --fs-h1: clamp(2.6rem, 5vw, 4.8rem);
  --fs-h2: clamp(2.1rem, 3.6vw, 3.5rem);
  --fs-h3: clamp(1.35rem, 1.8vw, 1.7rem);
  --fs-lead: clamp(1.15rem, 1.4vw, 1.35rem);
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  --max: 1400px;
  --pad: clamp(1.1rem, 3.2vw, 2.75rem);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;
  --topbar-h: 76px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(var(--dots) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }

.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 70% -10%, rgb(255 106 43 / 0.10), transparent 55%);
}

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

/* Type ------------------------------------------------------------------- */

h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 650; letter-spacing: -0.035em; line-height: 0.98; text-wrap: balance; }
.has-heading-font h1, .has-heading-font h2 { font-weight: 400; }
.display { font-size: var(--fs-display); }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.12; }
.dot { color: var(--accent); }
.lead { font-size: var(--fs-lead); color: var(--text-2); line-height: 1.5; max-width: 40rem; margin: 0; text-wrap: pretty; }
.muted { color: var(--text-3); }
.fine { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.55; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
p { margin: 0; }

/* Icons ------------------------------------------------------------------ */

.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon .fill { fill: currentColor; stroke: none; }
[data-icon] { display: inline-flex; align-items: center; }

/* Buttons ---------------------------------------------------------------- */

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 52px; padding: 0 1.5rem;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: transparent; color: var(--text);
  font-weight: 560; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: transform 0.35s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { border-color: var(--text-3); background: rgb(244 243 238 / 0.04); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #ff7a40; border-color: #ff7a40; }
.btn--light { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; }
.btn--ghost { background: rgb(244 243 238 / 0.03); }
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .icon { width: 1.1em; height: 1.1em; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-width: 40px; height: 40px; padding: 0 0.6rem;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: rgb(244 243 238 / 0.03);
  color: var(--text-2); text-decoration: none; transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.kbd { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 34px; padding: 0 0.85rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: rgb(244 243 238 / 0.03);
  font-size: 0.88rem; color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
button.chip:hover, a.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip[aria-pressed='true'], .chip.is-on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2);
}
.tag--accent { border-color: rgb(255 106 43 / 0.5); color: var(--accent); }
.tag--live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pos); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Level badges */
.lvl {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 7px; border-radius: 7px;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.lvl--2 { border-color: rgb(242 180 90 / 0.5); color: #f2b45a; }
.lvl--3 { border-color: rgb(157 184 255 / 0.5); color: #9db8ff; }
.lvl--4 { border-color: rgb(201 162 255 / 0.55); color: #c9a2ff; }
.lvl--5 { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }

/* Panels ----------------------------------------------------------------- */

.panel {
  position: relative;
  background: linear-gradient(180deg, rgb(32 31 29 / 0.88), rgb(24 23 22 / 0.88));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(1.25rem, 2.2vw, 2rem);
  backdrop-filter: blur(10px);
}
.panel--tight { padding: 1.1rem 1.25rem; border-radius: var(--r-lg); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.panel__title { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.panel__title .icon { color: var(--accent); }

.stat { display: grid; gap: 0.25rem; }
.stat__label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.stat__value { font-family: var(--font-mono); font-size: clamp(1.25rem, 1.9vw, 1.7rem); letter-spacing: -0.03em; font-weight: 500; }
.stat__sub { font-size: var(--fs-xs); color: var(--text-3); }

/* Thumbs */
.thumb {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; color: var(--text-3);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb--lg { width: 64px; height: 64px; border-radius: 16px; font-size: 0.9rem; }

.spark { width: 96px; height: 32px; fill: none; stroke-width: 1.6; }

/* Forms ------------------------------------------------------------------ */

.field { display: grid; gap: 0.45rem; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 560; font-size: 0.95rem; }
.field__label small { font-weight: 400; color: var(--text-3); font-size: 0.82rem; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 0.75rem 1rem;
  background: var(--well); border: 1px solid var(--line-2); border-radius: var(--r-md);
  color: var(--text); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: #5f5b54; }
.field.is-error .input, .field.is-error .textarea { border-color: var(--neg); }
.field__error { color: var(--neg); font-size: 0.85rem; min-height: 0; }
.field__hint { color: var(--text-3); font-size: 0.85rem; }

/* Segmented */
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--well); border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 0.45rem 0.95rem; border-radius: var(--r-pill); color: var(--text-3); font-size: 0.88rem; font-weight: 520; transition: color 0.2s; }
.seg button[aria-selected='true'] { color: var(--accent-ink); }
.seg__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: var(--r-pill); background: var(--accent); transition: transform 0.45s var(--ease), width 0.45s var(--ease); }

/* Top bar ---------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled { background: rgb(18 18 17 / 0.82); backdrop-filter: blur(14px); border-color: var(--line); }
.topbar__in { display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__logo { width: 34px; height: 34px; object-fit: contain; }
.brand__word { font-family: var(--font-head); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.045em; }
.nav { display: flex; gap: 0.25rem; margin-left: 1rem; }
.nav a { padding: 0.5rem 0.9rem; border-radius: var(--r-pill); text-decoration: none; color: var(--text-3); font-weight: 520; font-size: 0.97rem; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--text); }
.nav a[aria-current='page'] { color: var(--text); background: rgb(244 243 238 / 0.06); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.wallet { position: relative; }
.wallet.is-connected .wallet__btn { border-color: rgb(134 196 151 / 0.4); }
.wallet.is-connected .wallet__btn::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.wallet__label { font-family: var(--font-mono); font-size: 0.85rem; }
.wallet__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgb(0 0 0 / 0.5); display: grid; }
.wallet__menu > * { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border-radius: 10px; border: 0; background: none; text-align: left; text-decoration: none; font-size: 0.92rem; color: var(--text-2); }
.wallet__menu > *:hover { background: rgb(244 243 238 / 0.06); color: var(--text); }

@media (max-width: 900px) {
  :root { --topbar-h: 64px; }
  .nav { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 45; margin: 0; padding: 5px; border-radius: var(--r-pill); background: rgb(26 25 24 / 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgb(0 0 0 / 0.5); }
  .nav a { font-size: 0.9rem; padding: 0.55rem 0.8rem; }
  .wallet__label { display: none; }
  .wallet__btn { padding: 0 0.7rem; }
  [data-kbd] { display: none; }
  body { padding-bottom: 76px; }
}

/* View transitions -------------------------------------------------------- */

.view { position: relative; z-index: 1; flex: 1; outline: none; opacity: 0; transform: translateY(10px); }
.view.is-in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* Footer ----------------------------------------------------------------- */

.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); margin-top: 5rem; padding: 3rem 0 3.5rem; }
.foot__in { display: grid; grid-template-columns: 1fr auto; gap: 2rem 3rem; align-items: start; }
.foot__brand p { color: var(--text-3); margin-top: 0.4rem; }
.foot__nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.foot__nav a { color: var(--text-2); text-decoration: none; }
.foot__nav a:hover { color: var(--accent); }
.foot__legal { grid-column: 1 / -1; max-width: 62rem; }
@media (max-width: 700px) { .foot__in { grid-template-columns: 1fr; } }

/* Overlays ---------------------------------------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 12vh 1rem 1rem; }
.overlay__scrim { position: absolute; inset: 0; background: rgb(10 10 9 / 0.7); backdrop-filter: blur(6px); }
.palette, .modal { position: relative; width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgb(0 0 0 / 0.6); animation: pop 0.35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.palette__field { display: flex; align-items: center; gap: 0.75rem; padding: 0 1.1rem; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette__field input { flex: 1; height: 62px; border: 0; background: none; outline: none; font-size: 1.08rem; color: var(--text); }
.palette__list { max-height: 55vh; overflow: auto; padding: 6px; }
.palette__hint { padding: 1rem; color: var(--text-3); font-size: 0.95rem; }
.palette__item { display: grid; grid-template-columns: auto 1fr auto auto auto auto; align-items: center; gap: 0.9rem; padding: 0.6rem 0.75rem; border-radius: 12px; text-decoration: none; font-size: 0.92rem; }
.palette__item:hover, .palette__item.is-sel { background: rgb(244 243 238 / 0.06); }
.palette__name { display: grid; line-height: 1.25; min-width: 0; }
.palette__name small { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .palette__item { grid-template-columns: auto 1fr auto auto; } .palette__item > .num:nth-last-child(-n+2) { display: none; } }

.modal { padding: 1.5rem; display: grid; gap: 1rem; width: min(440px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: center; }
.modal__head h2 { font-size: 1.5rem; letter-spacing: -0.03em; }
.wallet-list { display: grid; gap: 0.5rem; }
.wallet-opt { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--well); text-decoration: none; font-weight: 560; text-align: left; }
.wallet-opt:hover { border-color: var(--accent); }
.wallet-opt small { margin-left: auto; color: var(--text-3); font-weight: 400; }
.wallet-opt__logo { color: var(--accent); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { padding: 0.7rem 1.1rem; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-weight: 560; font-size: 0.92rem; box-shadow: 0 12px 30px rgb(0 0 0 / 0.4); animation: pop 0.3s var(--ease); }
.toast.is-leaving { animation: out 0.3s forwards; }
@keyframes out { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 900px) { .toasts { bottom: 90px; } }

/* Skeleton */
.skel { display: inline-block; min-width: 3em; height: 1em; border-radius: 6px; background: linear-gradient(90deg, rgb(244 243 238 / 0.05), rgb(244 243 238 / 0.11), rgb(244 243 238 / 0.05)); background-size: 200% 100%; animation: shimmer 1.3s infinite; vertical-align: middle; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal, .view { opacity: 1; transform: none; }
}
