/* ──────────────────────────────────────────────────────────────────────────
 * k.nexus canonical components — DO NOT edit in service repos.
 * Source: /Users/kei/projects/k-nexus/design/components.css
 * Brand source-of-truth: /Users/kei/projects/nexusai-brand/NEXUS-AI-Brand-Guide.html
 *
 * Calm Toss-clean body + NEXUS AI brand identity at hero/wordmark moments.
 * See migration note at bottom of file for service-repo upgrade delta.
 * ────────────────────────────────────────────────────────────────────────── */

/* ── Layout container ────────────────────────────────────────────────────── */
.shell {
  max-width: 560px;
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    20px
    max(80px, env(safe-area-inset-bottom));
}

/* ── Tile (card) — flat, no border, soft separation via bg contrast ────── */
.tile {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-top: 12px;
  box-shadow: var(--shadow-card);
}
.tile:first-child { margin-top: 0; }

.tile h2 {
  margin: 0 0 14px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.tile h3 {
  margin: 0 0 8px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--ink);
}
.tile p {
  margin: 0;
  color: var(--ink-soft);
  line-height: var(--lh-base);
}

/* Row pattern — label left, value right. */
.tile .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-base);
  padding: 4px 0;
}
.tile .row + .row { margin-top: 4px; }
.tile .row > span:first-child { color: var(--ink-soft); }
.tile .row .v {
  font-weight: var(--fw-bold);
  color: var(--ink);
  font-size: var(--fs-lg);
}

/* ── Big display number — balance, prize, score ─────────────────────────── */
.stat-big {
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--brand);    /* Electric Violet */
  color: var(--nx-white);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.btn-secondary:hover { background: rgba(123, 97, 255, 0.18); }
.btn-secondary:active { transform: scale(0.97); }
.btn-secondary:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.tile .btn-primary + .btn-secondary,
.tile .btn-secondary + .btn-primary,
.tile .btn-primary + .btn-primary,
.tile .btn-secondary + .btn-secondary { margin-top: 10px; }

/* ── Tags / pills — soft tint, lighter weight ─────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
}
.tag.tag-go {
  background: var(--good-soft);
  color: var(--good);
}
.tag.tag-out {
  background: var(--bad-soft);
  color: var(--bad);
}
.tag.tag-info {
  background: var(--info-soft);
  color: #00a0ad;          /* legible cyan-tone (info bg too light for body text) */
}
.tag.tag-accent {
  background: var(--accent-soft);
  color: #b87a00;          /* legible amber */
}

/* ── Typography utilities ─────────────────────────────────────────────── */
.muted {
  color: var(--muted);
  font-size: var(--fs-base);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Top bar (back + utility links) — no border, generous tap ─────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -6px 4px;
}
.top-links { display: flex; gap: 4px; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--ink-soft);
  text-decoration: none;
}
.back:hover { color: var(--ink); }

.wallet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--brand);
  text-decoration: none;
}
.wallet-link:hover { color: var(--brand-dark); }

/* ── Banner — soft violet info strip ──────────────────────────────────── */
.referral-banner {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  margin: 12px 0 16px;
}
.referral-banner strong {
  color: var(--brand-dark);
  font-weight: var(--fw-semibold);
}

/* ── Meter (progress) — slim violet track ─────────────────────────────── */
.meter {
  height: 6px;
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 16px;
}
.meter-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-out);
}
.meter-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.meter-meta strong {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
.input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-lg);
  font-weight: var(--fw-regular);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--muted); }
.input:focus {
  outline: none;
  border-color: var(--brand);
  border-width: 1.5px;
  padding-left: 15.5px;
  padding-right: 15.5px;
}
.input:disabled { background: var(--bg); color: var(--muted); }

/* ── NEXUS AI Wordmark (Orbitron 600, brand-mandated spec) ────────────── */
/* Markup:
 *   <span class="wordmark">N<span class="x">Ξ</span>XUS <span class="ai">ΛI</span></span>
 *   (the Ξ and Λ glyphs are Greek substitutes per brand guide §01)
 *
 * Sizes via modifier: .wordmark-sm | -md | -lg | -hero. Default = md.
 * Color via context: place inside .on-dark for white, default = rich black.
 */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Orbitron', 'Inter', system-ui, sans-serif;
  font-weight: var(--fw-semibold);
  letter-spacing: 12px;
  font-size: var(--wm-md);
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  /* compensate trailing letter-spacing — visual centering */
  padding-left: 12px;
}
.wordmark-sm   { font-size: var(--wm-sm);   letter-spacing:  8px; padding-left:  8px; }
.wordmark-md   { font-size: var(--wm-md);   letter-spacing: 12px; padding-left: 12px; }
.wordmark-lg   { font-size: var(--wm-lg);   letter-spacing: 16px; padding-left: 16px; }
.wordmark-hero { font-size: var(--wm-hero); letter-spacing: 20px; padding-left: 20px; }

/* The "ΛI" suffix carries the brand signature gradient. */
.wordmark .ai {
  background: var(--nx-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

/* On dark surface the wordmark goes white. */
.on-dark .wordmark { color: var(--nx-white); }

/* ── Gradient text utility (use sparingly — wordmark + 1 hero moment) ─── */
.brand-gradient-text {
  background: var(--nx-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: var(--fw-bold);
}

/* ──────────────────────────────────────────────────────────────────────────
 * MIGRATION NOTE (services updating from previous tokens):
 *
 * - --brand is now Electric Violet #7B61FF (NEXUS brand color), NOT Toss
 *   blue, NOT teal. Anything hard-coded to the old teal must update.
 * - --ink is Rich Black #08080A (brand spec), not generic #0f172a.
 * - --bg is brand Light Gray #F4F4F6, not Toss neutral #f2f4f6.
 * - --bad shifted to Hot Magenta #FF2D92 (brand). --good is brand-adjacent
 *   green #00D68F. --info is Neon Cyan #00F0FF (use .tag-info / .tag-accent
 *   for cyan/amber semantic pills).
 * - Tiles are FLAT — no border, near-zero shadow.
 * - Button radius is 14px, not pill. Weight 600 max.
 * - .btn-secondary is a tinted-fill (brand-soft bg), not bordered ghost.
 * - .referral-banner is now violet-tinted, not mint-green.
 * - .meter track is 6px (was 12px+).
 * - NEW: .wordmark (Orbitron NEXUS ΛI per brand guide), .brand-gradient-text
 *   (utility for the signature 4-color gradient), .stat-big, .input,
 *   .number utility, .tag-info, .tag-accent.
 * - Orbitron font now loaded via @import in tokens.css. CDN required.
 * - Old --shadow-card heavy drop-shadow is gone. If a service tile looked
 *   "floating", it now sits flat. This is intentional.
 * ────────────────────────────────────────────────────────────────────────── */
