/**
 * Buying Eyes — "Signal" Theme
 * Dark data-visualization aesthetic for GTM due diligence research.
 * Bloomberg terminal meets modern analytics dashboard.
 */

/* ========================================================================
   CSS CUSTOM PROPERTIES
   ======================================================================== */

:root {
    --bg-deep:       #0B1120;
    --bg-surface:    #111827;
    --bg-card:       #F8FAFC;
    --bg-card-alt:   #F1F5F9;
    --primary:       #3B82F6;
    --primary-dim:   #2563EB;
    --secondary:     #06B6D4;
    --secondary-dim: #0891B2;
    --accent-glow:   rgba(59, 130, 246, 0.15);
    --accent-glow-cyan: rgba(6, 182, 212, 0.15);
    --text-light:    #F8FAFC;
    --text-muted:    #94A3B8;
    --text-dark:     #1E293B;
    --text-body:     #334155;
    --border-dark:   #1E293B;
    --border-light:  #E2E8F0;
    --border-glow:   rgba(59, 130, 246, 0.3);
    --font-heading:  'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body:     'Inter', system-ui, -apple-system, sans-serif;
    --max-width:     860px;
    --nav-height:    56px;
    --radius:        8px;
    --radius-sm:     4px;
    --radius-lg:     12px;
}

/* ========================================================================
   RESET / NORMALIZE
   ======================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-deep);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary);
}

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0 none;
}

/* ========================================================================
   TYPOGRAPHY
   ======================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
}

h1 { font-size: 2rem;   margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-top: 2rem;   margin-bottom: 0.5rem; }
h4 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.5rem; font-weight: 600; }
h5 { font-size: 0.95rem; margin-top: 1.25rem; margin-bottom: 0.4rem; font-weight: 600; }
h6 { font-size: 0.85rem; margin-top: 1rem; margin-bottom: 0.4rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 600;
}

blockquote {
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--bg-card-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-body);
    font-style: italic;
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
    font-size: 0.875em;
    background: var(--bg-card-alt);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--bg-surface);
    color: var(--text-muted);
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-dark);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2.5rem 0;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.35rem;
}

li > ul, li > ol {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

/* ========================================================================
   NAVIGATION
   ======================================================================== */

.signal-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dark);
    height: var(--nav-height);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-glyph {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--bg-deep);
    background: var(--primary);
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    letter-spacing: -0.02em;
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-light);
    letter-spacing: -0.01em;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: background 0.2s;
}

.nav-toggle:hover span {
    background: var(--text-light);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: block;
    padding: 0 1rem;
    height: var(--nav-height);
    line-height: var(--nav-height);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

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

.nav-links .active a {
    color: var(--primary);
    box-shadow: inset 0 -2px 0 var(--primary);
}

/* ========================================================================
   HERO SECTIONS
   ======================================================================== */

.signal-hero {
    position: relative;
    background: var(--bg-deep);
    overflow: hidden;
    padding: 4rem 1.5rem 3.5rem;
}

.hero-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    pointer-events: none;
}

.hero-glow-cyan {
    background: radial-gradient(circle, var(--accent-glow-cyan) 0%, transparent 70%);
}

.hero-inner {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
    z-index: 1;
}

.hero-signal-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.signal-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

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

.hero-deck {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 640px;
}

/* Hero breadcrumb */
.hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.hero-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.hero-breadcrumb a:hover {
    color: var(--primary);
}

.bc-sep {
    color: rgba(148, 163, 184, 0.4);
}

.bc-current {
    color: var(--text-muted);
}

/* Hero stats (homepage) */
.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-dark);
}

.stat-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Specific hero variants */
.landscape-hero {
    padding-bottom: 3rem;
}

.glossary-entry-hero .hero-deck,
.comparison-hero .hero-deck {
    font-size: 1rem;
}

/* ========================================================================
   MAIN CONTENT AREA
   ======================================================================== */

.content-wrap {
    flex: 1;
    background: var(--bg-card);
    padding: 3rem 1.5rem 4rem;
}

.content {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* First element in content should not have extra top margin */
.content > *:first-child {
    margin-top: 0;
}

.content > h1:first-child {
    display: none; /* Hidden because hero already shows the title */
}

/* Content links */
.content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 246, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s, color 0.2s;
}

.content a:hover {
    color: var(--primary-dim);
    text-decoration-color: var(--primary);
}

/* Images in content */
.content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--border-light);
}

/* ========================================================================
   TABLES
   ======================================================================== */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.content thead {
    background: var(--bg-surface);
}

.content th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-dark);
    white-space: nowrap;
}

.content th:not(:first-child) {
    text-align: center;
}

.content td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.content td:not(:first-child) {
    text-align: center;
}

.content tr:last-child td {
    border-bottom: none;
}

.content tbody tr:hover {
    background: var(--bg-card-alt);
}

/* ========================================================================
   HARVEY BALLS
   ======================================================================== */

.hb {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    vertical-align: middle;
}

.hb-1 {
    border: 2px solid var(--text-muted);
    background: transparent;
}

.hb-2 {
    border: 2px solid var(--primary);
    background: linear-gradient(to top, var(--primary) 25%, transparent 25%);
}

.hb-3 {
    border: 2px solid var(--primary);
    background: linear-gradient(to top, var(--primary) 50%, transparent 50%);
}

.hb-4 {
    border: 2px solid var(--primary);
    background: linear-gradient(to top, var(--primary) 75%, transparent 75%);
}

.hb-5 {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* ========================================================================
   GLOSSARY INDEX
   ======================================================================== */

.glossary-index h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

.glossary-index ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.glossary-index li {
    margin: 0;
}

.glossary-index li a {
    display: block;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.glossary-index li a:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 2px 8px rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* ========================================================================
   GLOSSARY ENTRY
   ======================================================================== */

.glossary-entry h2 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-top: 2.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.glossary-entry ul {
    padding-left: 1.25rem;
}

.glossary-entry li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ========================================================================
   COMPARISON PAGES
   ======================================================================== */

.compare-index p strong a,
.compare-index p > strong:first-child a {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.compare-index p strong a:hover {
    color: var(--primary);
}

.compare-index > p {
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 1rem;
}

.comparison-detail h2 {
    font-size: 1.3rem;
    margin-top: 2.5rem;
}

.comparison-detail h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-top: 1.75rem;
}

/* ========================================================================
   LANDSCAPE PAGE
   ======================================================================== */

.landscape-detail h2 {
    font-size: 1.3rem;
    margin-top: 2.5rem;
    padding-bottom: 0.3rem;
}

.landscape-detail h3 {
    font-size: 1.1rem;
    margin-top: 2rem;
    color: var(--text-dark);
}

.landscape-detail table {
    font-size: 0.8rem;
}

/* ========================================================================
   ABOUT PAGE
   ======================================================================== */

.about-content h2 {
    font-size: 1.25rem;
}

.about-content img {
    display: none; /* Hide placeholder images */
}

/* ========================================================================
   FOOTER
   ======================================================================== */

.signal-footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--border-dark);
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-brand .brand-glyph {
    font-size: 0.7rem;
}

.footer-disclosure {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.footer-edition {
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.6);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(11, 17, 32, 0.98);
        border-bottom: 1px solid var(--border-dark);
        flex-direction: column;
        padding: 0.5rem 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        height: auto;
        line-height: 1;
        padding: 0.85rem 1.5rem;
    }

    .nav-links .active a {
        box-shadow: inset 3px 0 0 var(--primary);
    }

    .signal-hero {
        padding: 3rem 1.25rem 2.5rem;
    }

    .signal-hero h1 {
        font-size: 1.75rem;
    }

    .hero-deck {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .content-wrap {
        padding: 2rem 1.25rem 3rem;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    .content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .glossary-index ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .signal-hero h1 {
        font-size: 1.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-block {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }
}

/* ========================================================================
   PRINT
   ======================================================================== */

@media print {
    .signal-nav,
    .nav-toggle,
    .hero-grid-overlay,
    .hero-glow,
    .signal-footer {
        display: none !important;
    }

    .signal-hero {
        background: white !important;
        padding: 1rem 0;
    }

    .signal-hero h1 {
        color: black !important;
        font-size: 1.5rem;
    }

    .hero-signal-badge {
        border-color: #999;
        color: #666;
        background: none;
    }

    .hero-deck {
        color: #333;
    }

    .content-wrap {
        padding: 1rem 0;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .content table {
        border: 1px solid #ccc;
    }

    .content th {
        background: #eee;
        color: #333;
        border-bottom-color: #999;
    }

    .content td {
        border-bottom-color: #ddd;
    }

    .hb-5 {
        box-shadow: none;
    }
}
