/* Baxia AI - shared components */

/* Buttons */
.btn { --h: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: var(--h); padding: 0 22px; border-radius: var(--radius); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; border: 1px solid transparent; transition: background-color .3s var(--ease-out), color .3s, border-color .3s, transform .5s var(--ease-out); }
.btn i { font-size: 1.1em; transition: transform .45s var(--ease-out); }
.btn:hover i { transform: translateX(4px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ink { background: var(--ink); color: var(--text-inv); }
.btn--ink:hover { background: var(--ink-3); }
.btn--line { border-color: var(--paper-line); color: var(--text); }
.btn--line:hover { border-color: var(--ink); }
.btn--line-inv { border-color: var(--ink-line); color: var(--text-inv); }
.btn--line-inv:hover { border-color: var(--text-inv-2); }
.btn--sm { --h: 40px; padding: 0 16px; }
.btn--lg { --h: 60px; padding: 0 28px; font-size: var(--fs-base); }
.btn--block { width: 100%; }

.link-arrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; padding-bottom: 4px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .6s var(--ease-out); }
.link-arrow:hover { background-size: 0 1px; background-position: 100% 100%; }
.link-arrow i { transition: transform .45s var(--ease-out); }
.link-arrow:hover i { transform: translateX(4px); }

.live-badge { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--up); display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); display: inline-block; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); display: inline-block; animation: pulseGlow 2s infinite ease-in-out; }
@keyframes pulseGlow { 0%, 100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.2); } }


/* Header */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h); border-bottom: 1px solid transparent; transition: transform .5s var(--ease-out), background-color .3s, border-color .3s, color .3s; }
.site-header.is-scrolled { background: var(--paper); border-color: var(--paper-line); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 40px; }
.logo { font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; letter-spacing: .02em; display: inline-flex; align-items: baseline; gap: .28em; line-height: 1; }
.logo span { color: var(--accent); }
.nav { flex: 1; display: flex; justify-content: center; gap: 30px; }
.nav a { position: relative; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); padding-block: 6px; transition: color .25s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out); }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); }
.nav a:hover::after, .nav a[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.header-actions { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.link-login { font-size: var(--fs-sm); font-weight: 500; }
.link-login:hover { color: var(--accent); }

.menu-toggle { display: none; width: 44px; height: 44px; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform .5s var(--ease-out), top .5s var(--ease-out); }
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 26px; }
.menu-open .menu-toggle span:first-child { top: 21.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 21.5px; transform: rotate(-45deg); }
.menu-open .site-header { background: var(--ink); color: var(--text-inv); border-color: var(--ink-line); }

.mobile-menu { position: fixed; inset: 0; z-index: 45; background: var(--ink); color: var(--text-inv); padding: calc(var(--header-h) + 24px) var(--gutter) 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow-y: auto; clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .7s var(--ease-in-out), visibility 0s .7s; }
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .7s var(--ease-in-out), visibility 0s 0s; }
.mobile-menu__links a { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-display); font-weight: 500; font-size: clamp(2rem, 8vw, 3.25rem); letter-spacing: -.02em; line-height: 1.15; padding-block: 10px; border-bottom: 1px solid var(--ink-line); opacity: 0; transform: translateY(24px); transition: opacity .5s, transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms + 150ms); }
.mobile-menu__links small { font-family: var(--f-mono); font-size: var(--fs-xs); color: var(--text-inv-3); letter-spacing: .06em; }
.menu-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu__actions { display: grid; gap: 12px; }

@media (max-width: 1080px) {
  .nav, .link-login { display: none; }
  .menu-toggle { display: inline-block; }
  .header-actions { gap: 8px; }
}
@media (max-width: 560px) { .header-actions .btn { display: none; } }

/* Footer */
.site-footer { padding-top: clamp(72px, 9vw, 128px); overflow: hidden; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr); gap: 64px; padding-bottom: 72px; border-bottom: 1px solid var(--ink-line); }
.footer-brand .logo { font-size: 1.75rem; }
.footer-brand p { color: var(--text-inv-2); max-width: 30ch; margin: 20px 0 28px; }
.footer-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px; }
.footer-col h3 { font-family: var(--f-mono); font-size: var(--fs-xs); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--text-inv-3); margin-bottom: 18px; }
.footer-col a { display: block; color: var(--text-inv-2); font-size: var(--fs-sm); padding-block: 5px; transition: color .2s; }
.footer-col a:hover { color: var(--text-inv); }
.footer-legal { padding-block: 40px; display: grid; gap: 28px; }
.footer-risk { max-width: 90ch; font-size: var(--fs-xs); line-height: 1.7; color: var(--text-inv-3); }
.footer-risk strong { color: var(--text-inv-2); font-weight: 500; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--text-inv-3); }
.footer-wordmark { font-family: var(--f-display); font-weight: 600; font-size: 17vw; line-height: .78; letter-spacing: -.045em; text-align: center; white-space: nowrap; color: var(--ink-3); user-select: none; margin-bottom: -.06em; }
@media (max-width: 1080px) { .footer-top { grid-template-columns: 1fr; } .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Terminal mockup */
.term { background: var(--ink-2); color: var(--text-inv); border: 1px solid var(--ink-line); border-radius: var(--radius-lg); overflow: hidden; font-size: 12px; box-shadow: 0 50px 90px -50px rgba(11, 13, 16, .55); }
.term__bar { display: flex; align-items: center; gap: 22px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--ink-line); font-family: var(--f-mono); font-size: 11px; color: var(--text-inv-3); }
.term__brand { font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .04em; color: var(--text-inv); }
.term__tabs { display: flex; gap: 18px; }
.term__tabs .is-active { color: var(--text-inv); }
.term__status { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.term__status::before { content: ''; width: 10px; height: 2px; background: var(--up); }
.term__body { display: grid; grid-template-columns: minmax(0, 1fr) 200px; }
.term__main { padding: 16px; min-width: 0; }
.term__side, .term__nav { padding: 16px; border-left: 1px solid var(--ink-line); }
.term__nav { border-left: 0; border-right: 1px solid var(--ink-line); }
.term__pair { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.term__sym { font-family: var(--f-mono); color: var(--text-inv-2); }
.term__pair strong { font-family: var(--f-mono); font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.term__range { display: flex; gap: 14px; margin: 10px 0 8px; font-family: var(--f-mono); font-size: 10px; color: var(--text-inv-3); }
.term__range b { color: var(--text-inv); font-weight: 500; }
.term__chart { width: 100%; height: auto; aspect-ratio: 600 / 220; }
.term__h { font-family: var(--f-mono); font-size: 10px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--text-inv-3); margin: 0 0 8px; }
.term__h + * { margin-bottom: 18px; }
.term__item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ink-line); }
.term__item:last-child { border-bottom: 0; }
.term__item span:last-child { font-family: var(--f-mono); color: var(--text-inv-2); }
.state { font-family: var(--f-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.state--run { color: var(--up); }
.state--pause { color: var(--accent); }
.state--stop { color: var(--text-inv-3); }
.term__table { margin-top: 12px; font-family: var(--f-mono); font-size: 11px; border-top: 1px solid var(--ink-line); }
.term__row { display: grid; grid-template-columns: 1.3fr 1fr .6fr .9fr .9fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ink-line); color: var(--text-inv-2); }
.term__row > :last-child { text-align: right; }
.term__row--head { color: var(--text-inv-3); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.term__foot { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--ink-line); font-family: var(--f-mono); font-size: 10px; color: var(--text-inv-3); }
.term--xl { font-size: 13px; }
.term--xl .term__body { grid-template-columns: 200px minmax(0, 1fr) 250px; }
@media (max-width: 1080px) { .term--xl .term__body { grid-template-columns: minmax(0, 1fr) 220px; } .term--xl .term__nav { display: none; } }
@media (max-width: 640px) { .term__body, .term--xl .term__body { grid-template-columns: 1fr; } .term__side { display: none; } .term__tabs span:not(.is-active) { display: none; } .term__row { grid-template-columns: 1.3fr 1fr .9fr; } .term__row > :nth-child(3), .term__row > :nth-child(4) { display: none; } }

/* Chart line draw for static decorative cards */
.js-motion [data-draw] .chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js-motion [data-draw].is-drawn .chart-line { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s var(--ease-out); }

/* Dynamic live market charts must never be clipped */
#hero-bot-line,
#hero-bot-trail,
#showcase-term-line {
  stroke-dasharray: none !important;
  stroke-dashoffset: 0 !important;
}

/* Panels (UI fragments) */
.panel { background: var(--white); border: 1px solid var(--paper-line); border-radius: var(--radius-lg); padding: 20px; font-size: 13px; }
.panel--ink { background: var(--ink-2); border-color: var(--ink-line); color: var(--text-inv); }
.panel__head { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--paper-line); }
.panel--ink .panel__head { color: var(--text-inv-3); border-color: var(--ink-line); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--paper-line); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--text-3); }
.kv dd { font-family: var(--f-mono); }
.panel--ink .kv { border-color: var(--ink-line); }
.panel--ink .kv dt { color: var(--text-inv-3); }

/* Real-time market tick transitions */
.tick-up {
  color: #1FA971 !important;
  text-shadow: 0 0 8px rgba(31, 169, 113, 0.45);
  transition: color 0.12s ease, text-shadow 0.12s ease;
}
.tick-down {
  color: #E5484D !important;
  text-shadow: 0 0 8px rgba(229, 72, 77, 0.45);
  transition: color 0.12s ease, text-shadow 0.12s ease;
}
.tick-ladder-flash {
  box-shadow: inset 0 0 12px rgba(255, 91, 20, 0.2);
  transition: box-shadow 0.25s ease;
}
#hero-bot-beacon,
#showcase-term-beacon {
  transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
