/* ============================================================================
   Sovereign Systems — component library (depends on tokens.css)
   ============================================================================ */

/* --- Layout primitives ---------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 4vw, 32px); }
.prose { max-width: var(--maxw-prose); }
.section { padding-block: clamp(52px, 8vw, 92px); position: relative; }
.section--tight { padding-block: clamp(28px, 4vw, 44px); }
.section--rule > .wrap::before {
  content: ""; display: block; height: 1px; margin-bottom: clamp(36px, 6vw, 60px);
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}
.stack > * + * { margin-top: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* --- Eyebrow / section head -------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary-bright);
}
.eyebrow--gold { color: var(--gold-bright); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.section-head { max-width: 620px; margin-bottom: clamp(36px, 6vw, 56px); }
.section-head h2 { margin-block: var(--sp-4) var(--sp-3); }
.section-head p { color: var(--text-soft); font-size: var(--step-1); }
.section-head--center { margin-inline: auto; text-align: center; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--step-0);
  padding: 12px 22px; border-radius: var(--r-pill); border: 1px solid var(--line-bright);
  background: var(--btn-bg); color: var(--btn-fg); cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: linear-gradient(135deg, var(--primary-bright), var(--primary)); --btn-fg: var(--text-on-accent); border-color: transparent; box-shadow: var(--shadow-primary); }
.btn--gold    { --btn-bg: linear-gradient(135deg, var(--gold-bright), var(--gold)); --btn-fg: var(--text-on-accent); border-color: transparent; box-shadow: var(--shadow-gold); }
.btn--solid   { --btn-bg: var(--text); --btn-fg: #0a0a0a; border-color: transparent; }
.btn--ghost   { --btn-bg: transparent; }
.btn--sm { padding: 8px 14px; font-size: var(--step--1); }
.btn--lg { padding: 15px 28px; font-size: var(--step-1); }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* --- Nav -------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 55%, #8a6f3d);
  display: grid; place-items: center; color: #0a0704; font-weight: 700; font-size: .8125rem;
  box-shadow: 0 6px 14px -6px rgba(201,164,99,.5);
}
.brand__sub { color: var(--text-faint); font-weight: 400; font-size: .7rem; font-family: var(--font-mono); }
.nav__links { display: flex; align-items: center; gap: clamp(18px, 3vw, 34px); }
.nav__links a:not(.btn) { color: var(--text-muted); font-size: .875rem; font-weight: 500; transition: color .2s; }
.nav__links a:not(.btn):hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; }
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links:not(.is-open) { display: none; }
  .nav__links.is-open {
    position: absolute; inset: var(--nav-h) 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; padding: var(--sp-3); background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .nav__links.is-open a:not(.btn) { padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .nav__links.is-open .btn { margin-top: var(--sp-3); }
}

/* --- Footer --------------------------------------------------------------- */
.footer { padding-block: var(--sp-8) var(--sp-6); border-top: 1px solid var(--line); margin-top: var(--sp-9); }
.footer__grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-7); }
.footer__brand p { color: var(--text-faint); font-size: var(--step--1); max-width: 280px; margin-top: var(--sp-3); }
.footer__cols { display: flex; gap: clamp(32px, 6vw, 64px); flex-wrap: wrap; }
.footer__col h5 { font-family: var(--font-mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); margin-bottom: var(--sp-4); }
.footer__col a { display: block; color: var(--text-muted); font-size: var(--step--1); margin-bottom: 10px; transition: color .2s; }
.footer__col a:hover { color: var(--text); }
.footer__note { display: block; color: var(--text-faint); font-size: .75rem; line-height: 1.5; max-width: 240px; }

/* Honeypot — off-screen, never shown to a real user; bots fill it. */
.hp-field { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.footer__bottom { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-4); }
.footer__bottom-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3) var(--sp-5); }
.footer__bottom p { color: var(--text-faint); font-size: .75rem; margin: 0; }
.footer__seal { width: clamp(46px, 12vw, 56px); height: auto; opacity: .92; flex-shrink: 0; }
.footer__disclaimer { color: var(--text-faint); font-size: .72rem; line-height: 1.7; max-width: 760px; margin-top: var(--sp-4); }

/* --- Card ------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-6); box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-bright); }
.card--feature { border-color: var(--primary-line); box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-line); }
.card__icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-dim); color: var(--primary-bright);
  font-family: var(--font-display); font-weight: 600; margin-bottom: var(--sp-4);
}
.card__icon--gold { background: var(--gold-dim); color: var(--gold-bright); }
.card h3 { font-size: var(--step-1); margin-bottom: var(--sp-2); }
.card p { color: var(--text-muted); font-size: var(--step-0); }

/* --- Badge / status dot --------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .65rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-soft);
}
.badge--ok     { background: var(--ok-dim); color: var(--ok); }
.badge--warn   { background: var(--warn-dim); color: var(--warn); }
.badge--danger { background: var(--danger-dim); color: var(--danger); }
.badge--primary{ background: var(--primary-dim); color: var(--primary-bright); }
.badge--gold   { background: var(--gold-dim); color: var(--gold-bright); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.dot--warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.dot--danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-dim); }
.dot--live { background: var(--ok); animation: pulse 2.4s infinite; }

/* --- Alert --------------------------------------------------------------- */
.alert {
  display: flex; gap: var(--sp-3); padding: var(--sp-4);
  border-radius: var(--r-md); border: 1px solid var(--line-bright);
  background: var(--surface); font-size: var(--step-0); color: var(--text-soft);
}
.alert__mark { flex-shrink: 0; font-family: var(--font-mono); font-weight: 700; }
.alert--info    { border-color: var(--primary-line); background: var(--primary-dim); }
.alert--ok      { border-color: rgba(79,211,154,.3); background: var(--ok-dim); }
.alert--warn    { border-color: rgba(240,178,94,.3); background: var(--warn-dim); }
.alert--danger  { border-color: rgba(240,131,126,.3); background: var(--danger-dim); }

/* --- Table ----------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step-0); min-width: 520px; }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.data th { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); background: var(--bg-soft); }
table.data td { color: var(--text-soft); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }

/* --- Forms --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--step--1); color: var(--text-soft); font-weight: 500; }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--line-bright); color: var(--text);
  font-family: var(--font-body); font-size: var(--step-0); transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.input--mono { font-family: var(--font-mono); }
.field__hint { font-size: var(--step--1); color: var(--text-faint); }
.field__error { font-size: var(--step--1); color: var(--danger); }

/* --- State blocks (empty / loading / error) -------------------------- */
.state { text-align: center; padding: var(--sp-8) var(--sp-5); color: var(--text-muted); }
.state__icon { font-size: 1.5rem; margin-bottom: var(--sp-3); opacity: .6; }
.state h4 { color: var(--text-soft); margin-bottom: var(--sp-2); }
.state p { font-size: var(--step-0); max-width: 360px; margin-inline: auto; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-bright); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Hero ----------------------------------------------------------- */
.hero { padding-block: clamp(56px, 9vw, 104px) clamp(40px, 7vw, 72px); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 60px); align-items: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }
.hero h1 { margin-block: var(--sp-5) var(--sp-4); }
.hero h1 .accent { color: var(--gold-bright); font-style: italic; }
.hero__sub { font-size: var(--step-1); color: var(--text-soft); max-width: 480px; margin-bottom: var(--sp-6); }
.hero__sub b { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero__meta { margin-top: var(--sp-5); font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-faint); }

/* --- Execution-engine panel (reusable visualization) ---------------- */
.xengine {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg);
}
.xengine__bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.18); }
.xengine__bar .tdot { width: 9px; height: 9px; border-radius: 50%; }
.xengine__bar .tdot:nth-child(1) { background: var(--danger); }
.xengine__bar .tdot:nth-child(2) { background: var(--gold); }
.xengine__bar .tdot:nth-child(3) { background: var(--ok); }
.xengine__bar .tlabel { margin-left: 6px; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.xengine__body { padding: var(--sp-5); font-family: var(--font-mono); font-size: .8rem; min-height: 340px; }

.xstage { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--text-muted); }
.xstage__pip { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); flex-shrink: 0; transition: background .3s, box-shadow .3s; }
.xstage.is-done { color: var(--text-soft); }
.xstage.is-done .xstage__pip { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.xstage.is-active .xstage__pip { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.xstage .k { color: var(--primary-bright); }

.xticket {
  margin-top: var(--sp-4); padding: var(--sp-4);
  background: linear-gradient(180deg, var(--primary-dim), rgba(255,255,255,.02));
  border: 1px solid var(--primary-line); border-radius: var(--r-md);
}
.xticket__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.xticket__pair { font-weight: 700; color: var(--text); }
.xticket__rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); font-size: .72rem; color: var(--text-muted); }
.xticket__rows b { display: block; color: var(--text); font-size: .82rem; margin-top: 2px; }
.xticket__routes { display: flex; gap: 6px; margin-top: var(--sp-3); flex-wrap: wrap; }
.xticket__route { font-size: .68rem; padding: 3px 8px; border-radius: var(--r-pill); background: var(--ok-dim); color: var(--ok); }

/* --- Pricing ------------------------------------------------------------- */
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card--feature { background: linear-gradient(180deg, var(--primary-dim), var(--surface) 42%); border-color: var(--primary-line); box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-line); }
.price-card__tag { position: absolute; top: -12px; left: var(--sp-6); font-family: var(--font-mono); font-size: .65rem; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: linear-gradient(135deg, var(--primary-bright), var(--primary)); color: var(--text-on-accent); }
.price-card__name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); }
.price-card__desc { color: var(--text-faint); font-size: var(--step--1); margin-top: 4px; }
.price-card__amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; margin-top: var(--sp-4); }
.price-card__amount span { font-size: .9rem; color: var(--text-faint); font-family: var(--font-body); font-weight: 400; }
.price-card__note { font-size: var(--step--1); color: var(--text-faint); margin-top: 2px; }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-block: var(--sp-5); flex: 1; }
.price-card li { display: flex; gap: 9px; font-size: var(--step-0); color: var(--text-soft); }
.price-card li::before { content: "✓"; color: var(--primary-bright); font-weight: 700; flex-shrink: 0; }
.price-card li.muted { color: var(--text-faint); }
.price-card li.muted::before { content: "—"; color: var(--text-faint); }

/* --- Step list --------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step__num { font-family: var(--font-display); font-style: italic; font-size: .9rem; color: var(--text-faint); padding-bottom: var(--sp-3); margin-bottom: var(--sp-3); border-bottom: 2px solid var(--primary); width: fit-content; }
.step__num b { color: var(--primary-bright); font-style: normal; }
.step h4 { margin-bottom: 6px; }
.step p { color: var(--text-muted); font-size: var(--step-0); }

/* --- Prose (docs / legal / faq) ------------------------------------- */
.rich { color: var(--text-soft); }
.rich > * + * { margin-top: var(--sp-4); }
.rich h2 { margin-top: var(--sp-7); font-size: var(--step-3); }
.rich h3 { margin-top: var(--sp-5); font-size: var(--step-2); }
.rich a { color: var(--primary-bright); text-decoration: underline; text-underline-offset: 2px; }
.rich ul, .rich ol { padding-left: 1.3em; }
.rich li + li { margin-top: 6px; }
.rich code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.rich pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); overflow-x: auto; }
.rich pre code { background: none; padding: 0; }
.rich blockquote { border-left: 3px solid var(--primary); padding-left: var(--sp-4); color: var(--text-muted); }

/* --- Auth pages --------------------------------------------------------- */
.auth { min-height: calc(100vh - var(--nav-h) - 120px); display: grid; place-items: center; padding: var(--sp-7) var(--sp-4); }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(28px, 5vw, 40px); box-shadow: var(--shadow-lg); }
.auth__card h1 { font-size: var(--step-3); margin-bottom: 6px; }
.auth__card > p.sub { color: var(--text-muted); font-size: var(--step-0); margin-bottom: var(--sp-5); }
.auth__card form > * + * { margin-top: var(--sp-4); }
.auth__alt { margin-top: var(--sp-5); font-size: var(--step--1); color: var(--text-muted); text-align: center; }
.auth__alt a { color: var(--primary-bright); }
.auth__legal { margin-top: var(--sp-4); font-size: .72rem; color: var(--text-faint); text-align: center; line-height: 1.6; }

/* --- Utilities --------------------------------------------------------- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.pill-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin-block: var(--sp-6); }
.cta-band { text-align: center; background: linear-gradient(135deg, var(--surface), var(--bg-soft)); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(36px, 7vw, 60px); box-shadow: var(--shadow-lg); }
.cta-band h2 { margin-bottom: var(--sp-3); }
.cta-band p { color: var(--text-soft); margin-inline: auto; margin-bottom: var(--sp-5); max-width: 440px; }
