/* Trade Raftar — shared styles (brand v1) */
:root {
  --ink: #0a0c10;
  --ink-2: #0d1015;
  --carbon: #12151c;
  --carbon-2: #191d26;
  --line: #1c2029;
  --line-2: #252a35;
  --line-3: #2e3441;
  --fog: #a7abb6;
  --muted: #7c8190;
  --bone: #f2efe8;
  --amber: #ffb21a;
  --amber-hi: #ffc857;
  --up: #3ddc97;
  --down: #ff7a7a;
  --display: "Bricolage Grotesque", "Outfit", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --urdu: "Noto Nastaliq Urdu", serif;
  --gutter: 80px;
  color-scheme: dark;
}
@media (max-width: 1100px) { :root { --gutter: 32px; } }
@media (max-width: 640px) { :root { --gutter: 16px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--bone); font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
img, svg { display: block; }
button { font: inherit; cursor: pointer; }
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); max-width: 1600px; margin: 0 auto; }
.hidden { display: none !important; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.muted { color: var(--fog); }
.dim { color: var(--muted); }
.eyebrow { font-size: 13px; letter-spacing: 0.14em; color: var(--amber); text-transform: uppercase; }
.h-display { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; font-size: clamp(34px, 4.2vw, 56px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 12, 16, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { height: 72px; display: flex; align-items: center; gap: 36px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--bone); }
.logo:hover { color: var(--bone); }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo .word { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; }
.logo .word b { color: var(--amber); font-weight: 800; }
.logo path { stroke-dasharray: 60; }
.logo:hover path { animation: rf-dash .7s ease both; }
.nav { display: flex; gap: 30px; font-size: 15px; }
.nav a { position: relative; color: var(--fog); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bone); }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.top-actions .link { color: var(--bone); padding: 10px 14px; }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-3); background: transparent; color: var(--bone); align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; margin-left: 0; }
  .top .wrap { gap: 12px; height: 64px; }
  .top-actions .link { display: none; }
  .top.open .nav { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--ink); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .top.open .nav a { padding: 12px 0; }
  .top.open .nav a::after { display: none; }
}
@media (max-width: 560px) { .top-actions .btn { padding: 10px 14px; font-size: 14px; } .logo .word { font-size: 19px; } }
@media (max-width: 900px) { .hide-sm { display: none !important; } }

/* ---------- buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 13px 22px; font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: transform .2s ease, box-shadow .2s ease, border-color .2s, background .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { color: var(--ink); box-shadow: 0 12px 32px rgba(255, 178, 26, 0.28); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--line-3); font-weight: 500; }
.btn-ghost:hover { color: var(--bone); border-color: #4a5160; }
.btn-dark { background: var(--ink); color: var(--bone); }
.btn-dark:hover { color: var(--bone); box-shadow: 0 12px 30px rgba(10, 12, 16, 0.35); }
.btn-lg { padding: 16px 26px; font-size: 17px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.shine::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.55), rgba(255,255,255,0)); animation: rf-sweep 3.4s ease-in-out 1.5s infinite; pointer-events: none; }

/* ---------- surfaces ---------- */
.card { background: var(--carbon); border: 1px solid var(--line-2); border-radius: 20px; padding: 24px; }
.card-lift { transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s, background .3s; }
.card-lift:hover { transform: translateY(-6px); border-color: rgba(255, 178, 26, 0.55); background: #141821; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--carbon); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--fog); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--up); animation: rf-ping 1.6s ease-out infinite; }
.dot.off { background: var(--down); }
.chip { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.chip.buy { color: var(--up); background: rgba(61, 220, 151, 0.12); }
.chip.sell { color: var(--down); background: rgba(255, 107, 107, 0.12); }
.chip.warn { color: var(--amber); background: rgba(255, 178, 26, 0.12); }
.chip.neutral { color: var(--fog); background: rgba(167, 171, 182, 0.1); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; padding: 12px 8px; border-bottom: 1px solid #1f242e; white-space: nowrap; }
td { padding: 13px 8px; border-bottom: 1px solid #171b23; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: #171b23; }
td.n, th.n { text-align: right; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.sym { font-weight: 600; }
tr.is-new td { animation: rf-newrow 3s ease both; }
.empty { color: var(--muted); text-align: center; padding: 28px 0 !important; font-size: 14px; }

/* ---------- forms ---------- */
label { display: grid; gap: 6px; font-size: 13px; color: var(--fog); }
input, select { width: 100%; background: var(--ink); color: var(--bone); border: 1px solid var(--line-3); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; }
input:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 178, 26, 0.15); }
.msg { font-size: 14px; min-height: 20px; }
.msg.err { color: var(--down); }
.msg.ok { color: var(--up); }

/* ---------- footer ---------- */
.foot { margin-top: 100px; border-top: 1px solid var(--line); padding-top: 44px; padding-bottom: 56px; display: flex; gap: 48px; flex-wrap: wrap; font-size: 13px; line-height: 1.6; color: var(--muted); }
.foot .brand { display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.foot p { margin: 0; max-width: 820px; }

/* ---------- motion ---------- */
@keyframes rf-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes rf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rf-ping { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,.65); } 75%, 100% { box-shadow: 0 0 0 10px rgba(61,220,151,0); } }
@keyframes rf-draw { from { stroke-dashoffset: var(--len, 1400); } to { stroke-dashoffset: 0; } }
@keyframes rf-pop { 0% { transform: scale(0); } 70% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes rf-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); } }
@keyframes rf-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes rf-shine-text { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes rf-streak { from { transform: translateX(-400px); } to { transform: translateX(110vw); } }
@keyframes rf-sweep { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(320%) skewX(-20deg); } }
@keyframes rf-flash { 0% { background: rgba(255, 178, 26, 0.3); } 100% { background: transparent; } }
@keyframes rf-flash2 { 0% { background: rgba(255, 178, 26, 0.3); } 100% { background: transparent; } }
@keyframes rf-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes rf-travel { 0% { left: 0; opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes rf-lit { 0%, 22%, 100% { border-color: var(--line-2); box-shadow: none; } 5% { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 18px 60px rgba(255,178,26,.18); } }
@keyframes rf-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,178,26,0), 0 30px 80px rgba(255,178,26,.08); } 50% { box-shadow: 0 0 0 6px rgba(255,178,26,.10), 0 30px 90px rgba(255,178,26,.22); } }
@keyframes rf-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes rf-bolt { 0%, 100% { opacity: 1; transform: scale(1); } 8% { opacity: .4; transform: scale(1.35); } 16% { opacity: 1; transform: scale(1); } }
@keyframes rf-dash { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes rf-newrow { 0%, 100% { background: rgba(255,178,26,0); } 12%, 40% { background: rgba(255,178,26,.12); } }

.in { animation: rf-up .9s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .25s; } .d4 { animation-delay: .35s; } .d5 { animation-delay: .45s; } .d6 { animation-delay: .6s; }
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--delay, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
.flash { border-radius: 6px; animation: rf-flash .9s ease-out; }
.flash2 { border-radius: 6px; animation: rf-flash2 .9s ease-out; }
.skel { background: linear-gradient(90deg, #2a2f3a 0%, #4a505e 50%, #2a2f3a 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rf-skel 2.4s linear infinite; }
.draw { stroke-dasharray: var(--len, 1400); animation: rf-draw 2.4s cubic-bezier(.35,.6,.2,1) .4s both; }
.area-in { animation: rf-fade 1.2s ease 1.6s both; }
.end-dot { transform-box: fill-box; transform-origin: center; animation: rf-pop .5s 2.6s both, rf-beat 1.6s 3.1s ease-in-out infinite; }
.bolt { transform-box: fill-box; transform-origin: center; animation: rf-bolt 2.2s ease-in-out infinite; }
.glow { animation: rf-glow 3s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .raftar-word { color: var(--amber) !important; background: none !important; }
}
