/* =========================================================
   AI Stock Intelligence — light professional theme
   Clean, institutional look: white surfaces, soft shadows,
   blue/cyan accents, dark readable text.
   ========================================================= */

:root {
    --primary-color: #2563eb;   /* blue  */
    --primary-dark:  #1d4ed8;
    --secondary-color: #0891b2; /* cyan  */
    --accent-color:  #0ea5e9;

    --bg:        #f6f8fc;        /* page background   */
    --bg-alt:    #eef2f9;        /* alternating band  */
    --surface:   #ffffff;        /* cards             */

    --text-primary:   #0f172a;   /* near-black        */
    --text-secondary: #52607a;   /* muted slate       */
    --text-muted:     #7c8aa5;

    --border:      #e2e8f0;
    --border-soft: #eef1f6;

    --success-color: #059669;
    --danger-color:  #dc2626;
    --warning-color: #d97706;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-md: 0 6px 20px rgba(15, 23, 42, .07);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .10);
    --ring: 0 0 0 4px rgba(37, 99, 235, .15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Subtle static grid — no animation, very light */
.grid-background {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 130, 246, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 130, 246, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    z-index: -1;
    pointer-events: none;
}

/* ---------- Navigation ---------- */
nav {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    padding: .75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-links {
    display: flex;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    transition: color .2s;
    position: relative;
}

.nav-links a:hover { color: var(--primary-color); }

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width .25s;
}

.nav-links a:hover::after { width: 100%; }

.menu-toggle {
    display: none;
    font-size: 26px;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1;
}

/* ---------- Container ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---------- Ticker ---------- */
.ticker {
    background: var(--surface);
    padding: .7rem 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.ticker-content {
    display: flex;
    width: max-content;
    animation: ticker 32s linear infinite;
}

.ticker-item {
    padding: 0 2.2rem;
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: .92rem;
}

.ticker-item .up   { color: var(--success-color); }
.ticker-item .down { color: var(--danger-color); }

@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero {
    padding: 5.5rem 0 4.5rem;
    text-align: center;
    background:
        radial-gradient(900px 380px at 50% -10%, rgba(37, 99, 235, .08), transparent 70%),
        linear-gradient(180deg, #ffffff, var(--bg));
    border-bottom: 1px solid var(--border-soft);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(37, 99, 235, .08);
    color: var(--primary-dark);
    border: 1px solid rgba(37, 99, 235, .2);
    padding: .4rem 1rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-ai-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    animation: float 4s ease-in-out infinite;
    display: block;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.hero h1 {
    font-size: 3.1rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -.02em;
    color: var(--text-primary);
}

.hero h1 .accent {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 1rem;
    font-weight: 500;
}

.hero .sub {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.25rem;
}

/* Search box */
.search-box {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1.15rem 1.6rem;
    font-size: 1.05rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    outline: none;
    transition: box-shadow .2s, border-color .2s;
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--ring);
}

.search-btn {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    padding: .95rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.search-btn:hover {
    transform: translateY(-50%) translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ---------- Section headings ---------- */
.section-title {
    text-align: center;
    font-size: 2.1rem;
    letter-spacing: -.01em;
    margin-bottom: .6rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- How it works ---------- */
.how {
    padding: 4.5rem 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(37, 99, 235, .1);
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 1.1rem;
}

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: .5rem;
    color: var(--text-primary);
}

.step-card p { color: var(--text-secondary); font-size: .96rem; }

/* ---------- Features ---------- */
.features {
    padding: 4.5rem 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, .35);
}

.feature-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(8, 145, 178, .1));
    margin-bottom: 1.2rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: .5rem;
    color: var(--text-primary);
}

.feature-card p { color: var(--text-secondary); }

/* ---------- Stats ---------- */
.stats { padding: 4.5rem 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.8rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: .3rem;
    letter-spacing: -.01em;
}

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

/* ---------- Market data tables ---------- */
.market-data {
    padding: 4.5rem 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.table-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.table-title {
    font-size: 1rem;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

th {
    background: transparent;
    padding: .6rem .5rem;
    text-align: left;
    color: var(--text-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: .8rem .5rem;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-secondary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(37, 99, 235, .04); }

.rank   { font-weight: 700; color: var(--text-muted); }
.symbol { font-weight: 700; color: var(--primary-color); }
.score  { font-weight: 700; color: var(--success-color); }

/* ---------- Insights ---------- */
.insights { padding: 4.5rem 0; }

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.insight-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.insight-card h3 {
    font-size: 1.2rem;
    margin-bottom: .6rem;
    color: var(--secondary-color);
}

.insight-card p {
    color: var(--text-secondary);
    line-height: 1.75;
}

/* ---------- Risk disclosure band ---------- */
.disclosure {
    padding: 3rem 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-soft);
}

.disclosure-inner {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning-color);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
}

.disclosure-inner h4 {
    color: var(--warning-color);
    font-size: 1.05rem;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.disclosure-inner p {
    color: var(--text-secondary);
    font-size: .92rem;
    line-height: 1.7;
}

/* ---------- CTA ---------- */
.cta {
    padding: 5rem 0;
    text-align: center;
    background:
        radial-gradient(800px 300px at 50% 120%, rgba(8, 145, 178, .1), transparent 70%),
        var(--bg);
}

.cta h2 {
    font-size: 2.1rem;
    margin-bottom: .75rem;
    color: var(--text-primary);
}

.cta p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-btn {
    padding: 1.05rem 2.6rem;
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--shadow-md);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ---------- Footer ---------- */
footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-content > div { flex: 1; min-width: 240px; }

.footer-content h3, .footer-content h4 { color: #fff; margin-bottom: 1rem; }
.footer-content p { color: #94a3b8; font-size: .95rem; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color .2s;
    font-size: .95rem;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #64748b;
    font-size: .88rem;
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
    animation: modalFadeIn .25s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 520px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn .3s ease-out;
    text-align: center;
}

@keyframes modalSlideIn {
    from { transform: translateY(-24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 1.7rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: color .2s, transform .2s;
}

.modal-close:hover { color: var(--primary-color); transform: rotate(90deg); }

.modal-ai-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.modal-title {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.25;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-notice {
    color: var(--warning-color);
    font-size: .85rem;
    margin-bottom: 1.5rem;
    padding: .85rem 1rem;
    background: rgba(217, 119, 6, .08);
    border-radius: 10px;
    border: 1px solid rgba(217, 119, 6, .25);
    line-height: 1.5;
}

.modal-btn {
    padding: 1.05rem 2.4rem;
    font-size: 1.02rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.modal-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn .6s ease-out; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .footer-content { gap: 2rem; }
}

@media (max-width: 768px) {
    .hero { padding: 3.5rem 0; }
    .hero h1 { font-size: 2.1rem; }
    .hero .lead { font-size: 1.05rem; }

    .container, .nav-container { padding: 0 1.25rem; }

    .nav-links {
        position: absolute;
        top: 60px;
        right: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        align-items: flex-start;
        width: 200px;
        padding: .75rem;
        border-radius: 12px;
        display: none;
        z-index: 20;
    }

    .nav-links li { width: 100%; }
    .nav-links a { display: block; width: 100%; padding: .6rem .5rem; }

    .menu-toggle { display: block; }

    .search-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: .8rem;
    }
    .search-input { padding: 1rem 1.4rem; }

    .tables-grid, .features-grid, .insights-grid, .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .menu-toggle { display: none !important; }
}
