/* ═════════════════════════════════════════════════════════════════════════
   stockInvesting.com — Master Design System
   Editorial financial aesthetic. Serif display + clean sans body.
   Single accent color. Considered spacing. No SaaS generics.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── RESET ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; }
input, textarea { font: inherit; }

/* ── DESIGN TOKENS ────────────────────────────────────────────────────── */
:root {
    /* Fonts — Fraunces for editorial display, IBM Plex Sans for body,
       IBM Plex Mono for data/tickers */
    --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --font-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

    /* Colors — editorial financial palette */
    --ink:          #15191F;   /* primary text, deep near-black */
    --ink-soft:     #3A4049;   /* secondary text */
    --sub:          #6B7380;   /* tertiary text, captions */
    --rule:         #D6DCE3;   /* borders and dividers */
    --rule-soft:    #EAEDF1;   /* lighter borders */

    --paper:        #FAFAF7;   /* body background — warm off-white */
    --paper-deep:   #F2F1EC;   /* slight contrast panels */
    --card:         #FFFFFF;   /* elevated cards */
    --ink-surface:  #0D1014;   /* dark hero sections */
    --ink-surface-2:#181C23;   /* slightly lighter dark */

    --accent:       #0F4FD4;   /* bold electric blue — primary CTA */
    --accent-dark:  #0B3AA3;
    --accent-soft:  #E7EEFC;   /* soft blue backgrounds */

    --bull:         #1B7F37;   /* green — data positive */
    --bear:         #CF222E;   /* red — data negative */
    --warn:         #9A6700;   /* amber — caution */

    /* Spacing scale */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.5rem;
    --sp-6:  2rem;
    --sp-7:  3rem;
    --sp-8:  4rem;
    --sp-9:  6rem;
    --sp-10: 8rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(17, 25, 40, 0.04);
    --shadow-md: 0 4px 16px rgba(17, 25, 40, 0.08);
    --shadow-lg: 0 20px 50px rgba(17, 25, 40, 0.10);

    --container: 1200px;
    --container-narrow: 820px;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────────────────── */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sub);
}
.eyebrow--accent { color: var(--accent); }
.eyebrow--light  { color: rgba(255,255,255,0.6); }

h1, .h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    line-height: 1.02;
    letter-spacing: -0.025em;
    font-variation-settings: "opsz" 144, "SOFT" 20;
}
h2, .h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 120, "SOFT" 10;
}
h3, .h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
h4, .h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.005em;
}

.lede {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 1.6vw, 1.45rem);
    line-height: 1.5;
    color: var(--ink-soft);
    letter-spacing: -0.01em;
}
p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

.small    { font-size: 0.9rem; color: var(--sub); line-height: 1.55; }
.xs       { font-size: 0.8rem; color: var(--sub); }
.mono     { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.serif    { font-family: var(--font-display); }
.italic   { font-style: italic; }

/* ── LAYOUT ──────────────────────────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}
.container--narrow { max-width: var(--container-narrow); }

.section {
    padding: var(--sp-9) 0;
}
.section--tight { padding: var(--sp-7) 0; }
.section--dark  { background: var(--ink-surface); color: #EDEEF0; }
.section--paper { background: var(--paper-deep); }

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

/* ── HEADER / NAV ────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(250, 250, 247, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule-soft);
    z-index: 100;
}
.site-header__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
}
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}
.site-logo__mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}
.site-nav a {
    font-size: 0.95rem;
    color: var(--ink-soft);
    transition: color 150ms ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--ink); font-weight: 500; }
.site-header__cta {
    display: flex;
    gap: var(--sp-3);
    align-items: center;
}
@media (max-width: 820px) {
    .site-nav { display: none; }
    .site-header__cta .btn--ghost { display: none; }
}

/* ── BUTTONS ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: -0.005em;
    border-radius: var(--radius-sm);
    transition: all 180ms cubic-bezier(0.2, 0.8, 0.3, 1);
    cursor: pointer;
    white-space: nowrap;
}
.btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn--dark {
    background: var(--ink);
    color: var(--paper);
}
.btn--dark:hover { background: var(--ink-surface-2); transform: translateY(-1px); }
.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
}
.btn--ghost:hover { border-color: var(--ink); background: var(--card); }
.btn--large { padding: 1rem 2rem; font-size: 1rem; }
.btn--on-dark {
    background: var(--paper);
    color: var(--ink);
}
.btn--on-dark:hover { background: #fff; transform: translateY(-1px); }

.btn svg { width: 16px; height: 16px; }

/* ── FOOTER ──────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--ink-surface);
    color: rgba(255,255,255,0.72);
    padding: var(--sp-8) 0 var(--sp-6);
    font-size: 0.92rem;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--sp-7);
    padding-bottom: var(--sp-7);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-footer__brand .site-logo { color: #fff; }
.site-footer__brand p { color: rgba(255,255,255,0.55); max-width: 300px; margin-top: var(--sp-4); }
.site-footer__col h5 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: var(--sp-4);
}
.site-footer__col ul { list-style: none; }
.site-footer__col li { margin-bottom: var(--sp-3); }
.site-footer__col a { color: rgba(255,255,255,0.7); transition: color 150ms ease; }
.site-footer__col a:hover { color: #fff; }
.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--sp-5);
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
    gap: var(--sp-4);
}
@media (max-width: 820px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-6);
    }
    .site-footer__brand { grid-column: 1 / -1; }
}

/* ── CARDS ───────────────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--rule-soft);
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    transition: all 200ms ease;
}
.card:hover {
    border-color: var(--rule);
    box-shadow: var(--shadow-md);
}
.card--flush { padding: 0; overflow: hidden; }

/* ── BADGES ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--card);
    color: var(--ink-soft);
}
.badge--accent {
    color: var(--accent);
    border-color: var(--accent-soft);
    background: var(--accent-soft);
}
.badge--bull { color: var(--bull); border-color: #D4F3DB; background: #EDFBEF; }
.badge--bear { color: var(--bear); border-color: #FDE0E3; background: #FEF3F4; }
.badge--warn { color: var(--warn); border-color: #F8EDBA; background: #FEFBEC; }

/* ── TABLES (for sample report preview etc.) ─────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--rule-soft);
}
.table th {
    background: var(--paper-deep);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sub);
}
.table tbody tr:hover { background: var(--paper-deep); }
.table .num { font-family: var(--font-mono); text-align: right; }

/* ── UTILITY ─────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── ENTRANCE ANIMATION ──────────────────────────────────────────────── */
@keyframes rise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 700ms cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.rise[data-delay="1"] { animation-delay: 100ms; }
.rise[data-delay="2"] { animation-delay: 200ms; }
.rise[data-delay="3"] { animation-delay: 300ms; }
.rise[data-delay="4"] { animation-delay: 400ms; }

/* ── DIVIDERS (editorial flair) ──────────────────────────────────────── */
.divider-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    margin: var(--sp-7) auto;
    color: var(--sub);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.divider-mark::before,
.divider-mark::after {
    content: "";
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: var(--rule);
}
