/* ==========================================================================
   Elite Forex Trade Pro — design system
   Dark-first, built around a navy trading-floor ground, a single blue action
   colour and a restrained gold accent for data and eyebrows.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens — light is the base, dark overrides only the values.
   -------------------------------------------------------------------------- */
:root {
    --ground:        #ffffff;
    --ground-alt:    #f5f8fc;
    --ground-deep:   #0b1424;   /* the dark band stays dark in both themes */
    --surface:       #ffffff;
    --surface-alt:   #f7f9fd;
    --line:          rgba(11, 20, 36, .10);
    --line-strong:   rgba(11, 20, 36, .18);

    --text-strong:   #0b1424;
    --text:          #43516b;
    --text-muted:    #6b7994;

    --brand:         #007fff;
    --brand-deep:    #0059b8;
    --brand-soft:    rgba(0, 127, 255, .10);
    --gold:          #d99a22;
    --gold-soft:     rgba(217, 154, 34, .12);

    --up:            #16a34a;
    --down:          #dc2626;

    --nav-h:         4.75rem;
    --rail-w:        17.5rem;

    --shadow-sm:     0 1px 2px rgba(11, 20, 36, .06);
    --shadow-md:     0 14px 34px -20px rgba(11, 20, 36, .45);
}

.dark {
    --ground:        #060b14;
    --ground-alt:    #0b1424;
    --ground-deep:   #060b14;
    --surface:       #101b2e;
    --surface-alt:   #0d1626;
    --line:          rgba(150, 172, 205, .14);
    --line-strong:   rgba(150, 172, 205, .26);

    --text-strong:   #f4f7fc;
    --text:          #a9b6cd;
    --text-muted:    #7f8ea8;

    --brand:         #3398ff;
    --brand-deep:    #007fff;
    --brand-soft:    rgba(51, 152, 255, .14);
    --gold:          #f2b33d;
    --gold-soft:     rgba(242, 179, 61, .14);

    --shadow-md:     0 20px 50px -26px rgba(0, 0, 0, .9);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--ground);
    color: var(--text);
    font-feature-settings: "cv05" 1;
    overflow-x: hidden;
}

[x-cloak] { display: none !important; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: .35rem;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Archivo', 'Inter', system-ui, sans-serif;
    color: var(--text-strong);
    text-wrap: balance;
    letter-spacing: -0.02em;
}

.num, table td, table th, .font-mono {
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.rock-rail {
    width: min(var(--rail-w), 86vw);
    box-shadow: 0 0 60px rgba(0, 0, 0, .45);
    background-color: var(--ground-alt);
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.rock-rail::-webkit-scrollbar { width: 5px; }
.rock-rail::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9999px; }

.rock-main { min-width: 0; }
/* The rail is an overlay at every breakpoint, so content is always full width. */

.rock-shellbar {
    background-color: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.rock-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    border-radius: .6rem;
    padding: .5rem .7rem;
    font-size: .845rem;
    font-weight: 500;
    color: var(--text);
    transition: background-color .16s ease, color .16s ease;
}
.rock-nav-link:hover { background-color: var(--brand-soft); color: var(--brand); }
.rock-nav-link.active {
    background-color: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--brand);
}

.rock-toplink {
    position: relative;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    transition: color .16s ease;
}
.rock-toplink:hover,
.rock-toplink.active { color: var(--text-strong); }
.rock-toplink.active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1.6rem;
    height: 2px;
    background: var(--brand);
}

.rock-railgroup {
    font-family: 'JetBrains Mono', monospace;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Bands — full-bleed horizontal sections
   -------------------------------------------------------------------------- */
.band          { background-color: var(--ground); }
.band-alt      { background-color: var(--ground-alt); border-block: 1px solid var(--line); }
.band-deep {
    position: relative;
    isolation: isolate;
    background-color: var(--ground-deep);
    color: #cfd9ea;
    overflow: hidden;
}
.band-deep h1, .band-deep h2, .band-deep h3 { color: #ffffff; }

/* Animated market canvas that sits inside .band-deep */
.market-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: .85;
    pointer-events: none;
}
.band-deep::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(0, 127, 255, .22), transparent 60%),
        linear-gradient(to bottom, rgba(6, 11, 20, .35), rgba(6, 11, 20, .82));
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
}
.band-deep .eyebrow { color: #f2b33d; }

.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: .55;
}

.lede { color: var(--text); font-size: 1.0625rem; line-height: 1.75; }
.band-deep .lede { color: #b9c6dc; }

.rule-top { border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: .75rem;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.card-lift:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card-flat { background-color: var(--surface-alt); border: 1px solid var(--line); border-radius: .75rem; }

.band-deep .card {
    background-color: rgba(16, 27, 46, .72);
    border-color: rgba(150, 172, 205, .18);
    backdrop-filter: blur(8px);
}

.icon-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .55rem;
    background: var(--brand-soft);
    color: var(--brand);
}
.icon-tile-gold { background: var(--gold-soft); color: var(--gold); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .5rem;
    padding: .7rem 1.35rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brand-deep); color: #fff; }
.btn-primary:hover { background: var(--brand); }

.btn-gold { background: var(--gold); color: #1a1305; }
.btn-gold:hover { filter: brightness(1.06); }

.btn-line {
    border: 1px solid var(--line-strong);
    color: var(--text-strong);
    background: transparent;
}
.btn-line:hover { border-color: var(--brand); color: var(--brand); }
.band-deep .btn-line { color: #fff; border-color: rgba(255, 255, 255, .3); }
.band-deep .btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* --------------------------------------------------------------------------
   Data display
   -------------------------------------------------------------------------- */
.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: -.02em;
}
.band-deep .stat-value { color: #fff; }

.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
}

.up   { color: var(--up); }
.down { color: var(--down); }

.quote-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
    font-family: 'JetBrains Mono', monospace;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}
.quote-row:last-child { border-bottom: 0; }

table.data { width: 100%; font-size: .875rem; border-collapse: collapse; }
table.data thead th {
    padding: .8rem 1.25rem;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data tbody td {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-alt); }
table.data .sym { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text-strong); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 9999px;
    padding: .2rem .6rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .04em;
}
.pill-live { background: rgba(22, 163, 74, .12); color: var(--up); }
.pill-soft { background: var(--brand-soft); color: var(--brand); }
.pill-gold { background: var(--gold-soft); color: var(--gold); }

.dot-live {
    position: relative;
    display: inline-block;
    width: .4rem; height: .4rem;
    border-radius: 9999px;
    background: var(--up);
}
.dot-live::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 9999px;
    background: var(--up);
    animation: pulse-ring 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes pulse-ring { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* --------------------------------------------------------------------------
   Ticker
   -------------------------------------------------------------------------- */
.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker__track {
    display: flex;
    gap: 2.75rem;
    width: max-content;
    animation: marquee 46s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal-in { animation: rise .55s cubic-bezier(.22, .8, .3, 1) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-strong);
}

.field {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: .5rem;
    background: var(--surface);
    padding: .7rem .9rem;
    font-size: .9rem;
    color: var(--text-strong);
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field::placeholder { color: var(--text-muted); }
.field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
select.field { appearance: none; background-image: none; }

.note {
    border-left: 3px solid var(--gold);
    background: var(--gold-soft);
    border-radius: .5rem;
    padding: 1rem 1.15rem;
    font-size: .8125rem;
    line-height: 1.7;
    color: var(--text);
}
.note-ok   { border-left-color: var(--up);    background: rgba(22, 163, 74, .10); }
.note-bad  { border-left-color: var(--down);  background: rgba(220, 38, 38, .10); }
.note-info { border-left-color: var(--brand); background: var(--brand-soft); }

/* --------------------------------------------------------------------------
   Long-form (legal pages)
   -------------------------------------------------------------------------- */
.prose h2 { margin: 2.25rem 0 .75rem; font-size: 1.15rem; font-weight: 700; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text); line-height: 1.8; font-size: .9375rem; }
.prose p { margin-bottom: 1rem; }
.prose ul { margin: 0 0 1rem 1.15rem; list-style: disc; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text-strong); }

/* --------------------------------------------------------------------------
   Live quotes
   -------------------------------------------------------------------------- */
table.data th.text-right,
table.data td.text-right { text-align: right; }

/* Brief highlight when a price changes on refresh. */
@keyframes quote-tick {
    0%   { background-color: rgba(51, 152, 255, .22); }
    100% { background-color: transparent; }
}
.quote-tick {
    animation: quote-tick 1.1s ease-out;
    border-radius: .25rem;
    padding-inline: .15rem;
}

@media (prefers-reduced-motion: reduce) {
    .quote-tick { animation: none; }
}
