/* ==========================================================================
   MIZAN X · FORGED — theme pack (default global theme, logo 1)
   Black embossed leather, brushed-silver structure, one gold lightning
   accent, candle green/red as the only vivid colors. Heavy. Forged. Premium.

   Identity layers in this pack:
     1. Tokens        — silver structure (--accent-metal), gold bolt (--brass)
     2. Material      — pebbled-leather ground (layered CSS + SVG grain),
                        ambient sheen drift (transform-only, 52s, α≤0.05)
     3. Typography    — Rajdhani display face on every headline
     4. Component     — silver-plated CTAs with a gold bolt edge, leather
        skins            cards, bolt dividers, re-tinted member app & admin
     5. Motion        — press glint sweep, breathing live badges, bolt-strike
                        TP celebration (all transform/opacity, all disabled
                        under prefers-reduced-motion)
   ========================================================================== */

@font-face {
  font-family: "Rajdhani";
  src: url("/fonts/rajdhani-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- 1 · Tokens ------------------------------------------------- */
[data-theme="forged"] {
  --ink-950: #0a0a0b;
  --ink-900: #0e0e10;
  --ink-850: #121214;
  --ink-800: #161619;
  --ink-750: #1c1c20;
  --line: #2b2b30;
  --line-soft: color-mix(in srgb, #2b2b30 65%, transparent);
  --paper: #e9eaee;
  --paper-soft: #b8bcc4;
  --muted: #8a8e97;
  /* Gold stays the LIGHTNING accent only. */
  --brass: #d9a441;
  --brass-soft: #f2cf7c;
  /* Silver is the structural metal of this identity. */
  --accent-metal: #c9ced6;
  --accent-metal-soft: #e6e9ee;
  --accent-metal-deep: #8e959f;
  /* Cool steel replaces aqua; candles keep their vivid green/red. */
  --aqua: #9fb2bc;
  --focus: #cdd4dc;
  --warning: #d9a441;
  /* No var() references here: --font-ui resolves through --font-geist-sans,
     which only exists on body, so a chain through it collapses to invalid
     at :root scope. Plain stack keeps Rajdhani reliable. */
  --font-display: "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  /* Chiseled radii: tighter corners than the base identity. */
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 19px;
  --radius-xl: 26px;
  --shadow-1: 0 22px 70px rgba(0, 0, 0, 0.5);
  --shadow-brass: 0 14px 45px rgba(217, 164, 65, 0.14);
  --admin-card: #101013;
  --admin-border: #26262b;
}

/* App-shell physics: contained overscroll, dark chrome scrollbars. */
html[data-theme="forged"],
[data-theme="forged"] body {
  overscroll-behavior: none;
  scrollbar-color: #2f2f35 #0a0a0b;
}
[data-theme="forged"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: #0a0a0b;
}
[data-theme="forged"] ::-webkit-scrollbar-thumb {
  border: 2px solid #0a0a0b;
  border-radius: 8px;
  background: #2f2f35;
}
[data-theme="forged"] ::-webkit-scrollbar-thumb:hover {
  background: #3c3c44;
}

[data-theme="forged"] ::selection {
  color: #101215;
  background: var(--accent-metal);
}
[data-theme="forged"] :focus-visible {
  outline-color: var(--focus);
}

/* ---------- 2 · Material — embossed pebbled leather -------------------- */
/* Grain (SVG turbulence) + two offset pebble lattices + a quilted diagonal
   weave + edge vignette. All static layers: zero paint cost after load. */
[data-theme="forged"] body {
  background:
    radial-gradient(
      140% 100% at 50% 0%,
      transparent 58%,
      rgba(0, 0, 0, 0.5) 100%
    ),
    radial-gradient(
      1100px 640px at 80% -12%,
      rgba(217, 164, 65, 0.05),
      transparent 62%
    ),
    radial-gradient(
      900px 560px at -10% 30%,
      rgba(201, 206, 214, 0.035),
      transparent 55%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.06 0 0 0 0 0.065 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(
      circle at 30% 35%,
      rgba(255, 255, 255, 0.016) 0 2px,
      transparent 7px
    ),
    radial-gradient(
      circle at 72% 68%,
      rgba(255, 255, 255, 0.013) 0 2px,
      transparent 8px
    ),
    radial-gradient(
      circle at 55% 15%,
      rgba(0, 0, 0, 0.3) 0 3px,
      transparent 9px
    ),
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.008) 0 2px,
      transparent 2px 11px
    ),
    repeating-linear-gradient(
      55deg,
      rgba(0, 0, 0, 0.12) 0 1px,
      transparent 1px 13px
    ),
    var(--ink-950);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    160px 160px,
    67px 59px,
    83px 71px,
    97px 89px,
    100% 100%,
    100% 100%,
    100% 100%;
}

/* Ambient life: a leather sheen drifting across the ground. One fixed
   compositor layer, transform-only, 52s, highlight alpha 0.05. */
[data-theme="forged"] body::before {
  inset: -35%;
  opacity: 0.85;
  mask-image: none;
  background-image: linear-gradient(
    115deg,
    transparent 41%,
    rgba(230, 233, 238, 0.028) 47%,
    rgba(230, 233, 238, 0.05) 50%,
    rgba(230, 233, 238, 0.028) 53%,
    transparent 59%
  );
  background-size: 100% 100%;
  will-change: transform;
  animation: forged-sheen 52s ease-in-out infinite alternate;
}
@keyframes forged-sheen {
  from {
    transform: translate3d(-7%, -3%, 0);
  }
  to {
    transform: translate3d(7%, 3%, 0);
  }
}

/* ---------- 3 · Typography — Rajdhani display -------------------------- */
[data-theme="forged"] h1,
[data-theme="forged"] h2,
[data-theme="forged"] h3,
[data-theme="forged"] .plan-name,
[data-theme="forged"] .plan-price b,
[data-theme="forged"] .brand-mark,
[data-theme="forged"] .m3-page-intro h1,
[data-theme="forged"] .m3-trade-main h1,
[data-theme="forged"] .m3-crypto-title h1,
[data-theme="forged"] .m3-login-card h1,
[data-theme="forged"] .admin-page-title h1,
[data-theme="forged"] .offline-page h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.015em;
}
[data-theme="forged"] .clarity-hero h1,
[data-theme="forged"] .clarity-section-head h2,
[data-theme="forged"] .clarity-safety h2,
[data-theme="forged"] .clarity-start h2,
[data-theme="forged"] .clarity-faq h2,
[data-theme="forged"] .step-content > h1 {
  letter-spacing: -0.015em;
  line-height: 1;
}
[data-theme="forged"] .eyebrow {
  color: var(--accent-metal);
  letter-spacing: 0.2em;
}
[data-theme="forged"] .eyebrow::before {
  background: linear-gradient(90deg, var(--brass), currentColor);
  opacity: 1;
}

/* ---------- 4 · Component skins ---------------------------------------- */

/* Brand glyph: silver ring, gold bolt strokes — the logo's grammar. */
[data-theme="forged"] .brand-glyph {
  border-color: color-mix(in srgb, var(--accent-metal) 55%, transparent);
  box-shadow:
    inset 0 0 0 5px var(--ink-950),
    0 0 0 1px rgba(217, 164, 65, 0.25);
}
[data-theme="forged"] .brand-glyph::before,
[data-theme="forged"] .brand-glyph::after {
  background: linear-gradient(120deg, var(--brass-soft), var(--brass));
}

/* Silver-plated CTAs with the gold bolt edge. */
[data-theme="forged"] .button-primary,
[data-theme="forged"] .m3-primary-button,
[data-theme="forged"] .pay-cta,
[data-theme="forged"] .m3-install-banner > button,
[data-theme="forged"] .settings-actions button:not(.ghost) {
  color: #111318;
  background: linear-gradient(
    172deg,
    #eef1f5 0%,
    #c6ccd5 42%,
    #aab1bc 58%,
    #d5dae1 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(217, 164, 65, 0.5),
    0 14px 38px rgba(0, 0, 0, 0.42);
  border-color: transparent;
}
[data-theme="forged"] .button-primary:hover,
[data-theme="forged"] .m3-primary-button:hover {
  background: linear-gradient(
    172deg,
    #f7f9fb 0%,
    #d3d8e0 42%,
    #b8bfc9 58%,
    #e0e4ea 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(217, 164, 65, 0.7),
    0 18px 46px rgba(0, 0, 0, 0.5);
}
[data-theme="forged"] .button-secondary,
[data-theme="forged"] .m3-secondary-button {
  border-color: #34343b;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 45%),
    rgba(255, 255, 255, 0.028);
}
[data-theme="forged"] .button-secondary:hover,
[data-theme="forged"] .m3-secondary-button:hover {
  border-color: #4a4a54;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 45%),
    rgba(255, 255, 255, 0.05);
}

/* Press feedback: a metallic glint sweeps across the plate.
   transform/opacity only; fires on :active. */
[data-theme="forged"] .button,
[data-theme="forged"] .m3-primary-button,
[data-theme="forged"] .m3-secondary-button,
[data-theme="forged"] .pay-cta,
[data-theme="forged"] .plan-select,
[data-theme="forged"] .settings-actions button {
  position: relative;
  overflow: hidden;
}
[data-theme="forged"] .button::after,
[data-theme="forged"] .m3-primary-button::after,
[data-theme="forged"] .m3-secondary-button::after,
[data-theme="forged"] .pay-cta::after,
[data-theme="forged"] .plan-select::after,
[data-theme="forged"] .settings-actions button::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -18%;
  width: 34%;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.55) 50%,
    transparent
  );
  transform: translateX(-180%) skewX(-18deg);
}
[data-theme="forged"] .button:active::after,
[data-theme="forged"] .m3-primary-button:active::after,
[data-theme="forged"] .m3-secondary-button:active::after,
[data-theme="forged"] .pay-cta:active::after,
[data-theme="forged"] .plan-choice:active .plan-select::after,
[data-theme="forged"] .settings-actions button:active::after {
  animation: forged-glint 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes forged-glint {
  0% {
    opacity: 0;
    transform: translateX(-180%) skewX(-18deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(460%) skewX(-18deg);
  }
}
[data-theme="forged"] .plan-choice:active {
  transform: scale(0.988);
}

/* The gold bolt — signature divider. Apply to any hr/divider. */
[data-theme="forged"] .bolt-divider {
  height: 2px;
  border: 0;
  background:
    linear-gradient(
        105deg,
        transparent 44%,
        rgba(242, 207, 124, 0.95) 49%,
        #f2cf7c 50%,
        rgba(242, 207, 124, 0.95) 51%,
        transparent 56%
      )
      50% 50% / 130px 2px no-repeat,
    linear-gradient(
      90deg,
      transparent,
      rgba(217, 164, 65, 0.55) 30%,
      rgba(217, 164, 65, 0.75) 50%,
      rgba(217, 164, 65, 0.55) 70%,
      transparent
    );
}
[data-theme="forged"] .m3-trade-result hr,
[data-theme="forged"] .cockpit-risk hr {
  border-image: linear-gradient(
      90deg,
      transparent,
      rgba(217, 164, 65, 0.4) 35%,
      #f2cf7c 50%,
      rgba(217, 164, 65, 0.4) 65%,
      transparent
    )
    1;
}
/* Landing/onboarding section seams become the bolt line. */
[data-theme="forged"] .clarity-how,
[data-theme="forged"] .clarity-today,
[data-theme="forged"] .clarity-markets,
[data-theme="forged"] .clarity-faq {
  border-top-color: rgba(217, 164, 65, 0.28);
  border-image: linear-gradient(
      95deg,
      transparent 2%,
      rgba(217, 164, 65, 0.14) 30%,
      #d9a441 49%,
      #f2cf7c 50%,
      #d9a441 51%,
      rgba(217, 164, 65, 0.14) 70%,
      transparent 98%
    )
    1;
}

/* TP celebration accent: toggle .bolt-strike on any element to fire the
   forge flash (member app triggers it on take-profit events). */
[data-theme="forged"] .bolt-strike {
  animation: forged-bolt-strike 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes forged-bolt-strike {
  0% {
    opacity: 0.35;
    transform: scale(0.97);
  }
  16% {
    opacity: 1;
    transform: scale(1.02);
  }
  32% {
    transform: scale(0.995);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Breathing live badges — the app is alive at rest. */
[data-theme="forged"] .m3-live-pill i,
[data-theme="forged"] .status-pill.active::before,
[data-theme="forged"] .status-pill.operational::before,
[data-theme="forged"] .admin-system-state i,
[data-theme="forged"] .admin-safety > i {
  will-change: transform, opacity;
  animation: forged-breathe 3.4s ease-in-out infinite;
}
@keyframes forged-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.66;
    transform: scale(1.3);
  }
}

/* ---------- Landing ----------------------------------------------------- */
[data-theme="forged"] .clarity-landing {
  background:
    radial-gradient(
      circle at 82% 6%,
      rgba(201, 206, 214, 0.05),
      transparent 30rem
    ),
    radial-gradient(
      circle at 12% 40%,
      rgba(217, 164, 65, 0.035),
      transparent 26rem
    ),
    var(--ink-950);
}
[data-theme="forged"] .one-sentence-card {
  border-color: rgba(201, 206, 214, 0.22);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      transparent 38%
    ),
    linear-gradient(145deg, #17171a 0%, #0e0e10 60%, #0b0b0d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 40px 100px rgba(0, 0, 0, 0.55);
}
[data-theme="forged"] .one-sentence-card::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-metal) 35%,
    var(--brass-soft) 50%,
    var(--accent-metal) 65%,
    transparent
  );
}
[data-theme="forged"] .one-sentence-card > div {
  color: var(--accent-metal);
}
[data-theme="forged"] .clarity-steps article,
[data-theme="forged"] .clarity-market-grid article {
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 34%),
    #101013;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 50px rgba(0, 0, 0, 0.38);
}
[data-theme="forged"] .clarity-steps article > svg {
  color: var(--accent-metal);
}
[data-theme="forged"] .clarity-steps article > span {
  color: rgba(201, 206, 214, 0.14);
  font-family: var(--font-display);
}
[data-theme="forged"] .clarity-today {
  background: #0c0c0e;
}
[data-theme="forged"] .plain-answer {
  background:
    linear-gradient(145deg, rgba(201, 206, 214, 0.09), transparent 55%),
    linear-gradient(145deg, #131316, #0d0d0f);
}
[data-theme="forged"] .language-toggle button[aria-pressed="true"] {
  color: #111318;
  background: var(--accent-metal);
}

/* ---------- Onboarding -------------------------------------------------- */
[data-theme="forged"] .onboarding {
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(201, 206, 214, 0.05),
      transparent 34rem
    ),
    var(--ink-950);
}
[data-theme="forged"] .progress-track i {
  background: linear-gradient(
    90deg,
    var(--accent-metal-deep),
    var(--accent-metal) 55%,
    var(--brass-soft)
  );
}
[data-theme="forged"] .step-number {
  color: var(--accent-metal);
}
[data-theme="forged"] .plan-choice {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
/* The flagship keeps gold; harden the frame with forged steel edges. */
[data-theme="forged"] .plan-full {
  box-shadow:
    inset 0 1px 0 rgba(242, 207, 124, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.45);
}
[data-theme="forged"] .plan-trading {
  border-color: rgba(201, 206, 214, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(230, 233, 238, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ---------- Member app (m3) --------------------------------------------- */
[data-theme="forged"] .m3-shell {
  background:
    radial-gradient(
      circle at 88% -5%,
      rgba(201, 206, 214, 0.07),
      transparent 24rem
    ),
    radial-gradient(
      circle at 0 28%,
      rgba(217, 164, 65, 0.05),
      transparent 20rem
    ),
    var(--ink-950);
}
[data-theme="forged"] .m3-topbar {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 11, 0.92);
}
[data-theme="forged"] .m3-bottom-nav {
  border-top-color: rgba(255, 255, 255, 0.07);
  background: rgba(12, 12, 14, 0.95);
}
[data-theme="forged"] .m3-bottom-nav > a.active {
  color: var(--accent-metal-soft);
  background: linear-gradient(
    to top,
    rgba(201, 206, 214, 0.08),
    transparent
  );
}
[data-theme="forged"] .m3-bottom-nav > a.active::before {
  background: linear-gradient(90deg, var(--accent-metal), var(--brass-soft));
  box-shadow: 0 3px 13px rgba(217, 164, 65, 0.4);
}
[data-theme="forged"] .m3-trade-main {
  border-color: rgba(201, 206, 214, 0.24);
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(201, 206, 214, 0.1),
      transparent 18rem
    ),
    radial-gradient(
      circle at 92% 88%,
      rgba(217, 164, 65, 0.07),
      transparent 14rem
    ),
    linear-gradient(145deg, #17171a, #0c0c0e 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 30px 80px rgba(0, 0, 0, 0.5);
}
[data-theme="forged"] .m3-live-pill.action {
  border-color: rgba(217, 164, 65, 0.45);
  color: var(--brass-soft);
  background: rgba(217, 164, 65, 0.1);
  box-shadow: 0 0 34px rgba(217, 164, 65, 0.16);
}
[data-theme="forged"] .m3-install-banner {
  border-color: rgba(201, 206, 214, 0.24);
  background: linear-gradient(
    135deg,
    rgba(201, 206, 214, 0.08),
    rgba(217, 164, 65, 0.06)
  );
}
[data-theme="forged"] .m3-card-icon.violet {
  color: var(--accent-metal);
  background: rgba(201, 206, 214, 0.09);
}
[data-theme="forged"] .m3-next-card > div > small {
  color: var(--accent-metal);
}
[data-theme="forged"] .m3-login-page {
  background:
    radial-gradient(
      circle at 50% 7%,
      rgba(201, 206, 214, 0.07),
      transparent 26rem
    ),
    var(--ink-950);
}
[data-theme="forged"] .m3-login-card {
  border-color: rgba(201, 206, 214, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 40%),
    linear-gradient(145deg, #17171a, #0d0d0f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(217, 164, 65, 0.14),
    0 38px 100px rgba(0, 0, 0, 0.55);
}
[data-theme="forged"] .m3-login-card > small {
  color: var(--accent-metal);
}

/* ---------- Admin ------------------------------------------------------- */
[data-theme="forged"] .admin-shell {
  color: var(--paper);
  background: #0a0a0b;
}
[data-theme="forged"] .admin-sidebar {
  border-right-color: rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
    #0e0e10;
}
[data-theme="forged"] .admin-sidebar nav a.active {
  background: rgba(201, 206, 214, 0.07);
}
[data-theme="forged"] .admin-sidebar nav a.active svg {
  color: var(--accent-metal-soft);
}
[data-theme="forged"] .admin-brand > span {
  border-color: rgba(201, 206, 214, 0.35);
  color: var(--accent-metal);
}
[data-theme="forged"] .admin-topbar {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 11, 0.9);
}
[data-theme="forged"] .settings-actions button.ghost,
[data-theme="forged"] .settings-wallets button.ghost {
  color: var(--accent-metal);
  border-color: #3a3a42;
}
[data-theme="forged"] .settings-logo-slot b {
  color: var(--accent-metal);
}

/* ---------- 5 · Reduced motion: everything stands still ----------------- */
@media (prefers-reduced-motion: reduce) {
  [data-theme="forged"] body::before,
  [data-theme="forged"] .m3-live-pill i,
  [data-theme="forged"] .status-pill.active::before,
  [data-theme="forged"] .status-pill.operational::before,
  [data-theme="forged"] .admin-system-state i,
  [data-theme="forged"] .admin-safety > i,
  [data-theme="forged"] .bolt-strike,
  [data-theme="forged"] .button::after,
  [data-theme="forged"] .m3-primary-button::after,
  [data-theme="forged"] .m3-secondary-button::after,
  [data-theme="forged"] .pay-cta::after,
  [data-theme="forged"] .plan-select::after,
  [data-theme="forged"] .settings-actions button::after {
    animation: none !important;
    will-change: auto;
  }
  [data-theme="forged"] body::before {
    transform: none;
  }
}
