/* ==========================================================================
   Investing & stock trading — design system
   Light theme: white pages, one blue action colour, slate text, and green / red
   reserved for gains and losses.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens — light is the base, dark overrides only the values.
   -------------------------------------------------------------------------- */
:root {
    --ground:        #ffffff;
    --ground-alt:    #f5f8fc;
    --ground-deep:   #eff5ff;   /* hero / feature band: soft blue tint */
    --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:         #2563eb;
    --brand-deep:    #1d4ed8;
    --brand-soft:    rgba(37, 99, 235, .09);
    --gold:          #2563eb;   /* eyebrows use the brand blue in the light theme */
    --gold-soft:     rgba(37, 99, 235, .08);

    --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: 'Inter', system-ui, -apple-system, 'Segoe 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(15, 23, 42, .18);
    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: 'Inter', system-ui, sans-serif;
    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:
        radial-gradient(90% 70% at 85% 0%, rgba(37, 99, 235, .12), transparent 60%),
        linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%);
    color: var(--text);
    overflow: hidden;
}
.band-deep h1, .band-deep h2, .band-deep h3 { color: var(--text-strong); }

/* Decorative canvas is not used in the light theme. */
.market-canvas { display: none; }

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
}

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

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

.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; }

.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); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--brand-deep); }

.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); }

/* --------------------------------------------------------------------------
   Data display
   -------------------------------------------------------------------------- */
.stat-value {
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: -.02em;
}

.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: 'Inter', system-ui, sans-serif;
    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: 'Inter', system-ui, sans-serif;
    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: 'Inter', system-ui, sans-serif; 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; }
}

/* Header: keep links and quotes on one line */
.rock-shellbar a, .rock-shellbar [data-hq] { white-space: nowrap; }

.rock-rail.-translate-x-full { box-shadow: none; }
.rock-shellbar a[aria-label] { flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   Scroll reveal (see assets/js/reveal.js). Hidden state only applies once JS
   has confirmed it is running, so content never depends on it.
   --------------------------------------------------------------------------- */
.js-reveal [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity .9s cubic-bezier(.22, .8, .3, 1), transform .9s cubic-bezier(.22, .8, .3, 1);
    transition-delay: var(--rd, 0ms);
    will-change: opacity, transform;
}
.js-reveal [data-reveal="down"]  { transform: translate3d(0, -28px, 0); }
.js-reveal [data-reveal="left"]  { transform: translate3d(-36px, 0, 0); }
.js-reveal [data-reveal="right"] { transform: translate3d(36px, 0, 0); }
.js-reveal [data-reveal="zoom"]  { transform: scale(.94); }
.js-reveal [data-reveal="fade"]  { transform: none; }
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; will-change: auto; }
[data-shellbar], .rock-page-header { transition: box-shadow .3s ease; }
[data-shellbar].is-scrolled, .rock-page-header.is-scrolled { box-shadow: 0 8px 24px -14px rgba(15, 23, 42, .28); }
@media (prefers-reduced-motion: reduce) { .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; } }

