:root {
    /* Light Mode (Default) */
    --bg-color: #f8f9fc;
    --text-primary: #121316;
    --text-secondary: #5a5d6e;
    --accent-glow: rgba(0, 184, 148, 0.2);
    --accent-solid: #00b894;
    --accent-secondary: #6c5ce7;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --nav-bg: rgba(248, 249, 252, 0.8);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg-color: #050508;
        --text-primary: #f0f0f5;
        --text-secondary: #9aa0a6;
        --accent-glow: rgba(0, 255, 200, 0.4);
        --accent-solid: #00ffc8;
        --accent-secondary: #7e3fff;
        --glass-bg: rgba(15, 15, 20, 0.5);
        --glass-border: rgba(255, 255, 255, 0.08);
        --card-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        --nav-bg: rgba(5, 5, 8, 0.3);
    }
}

[data-theme='dark'] {
    --bg-color: #050508;
    --text-primary: #f0f0f5;
    --text-secondary: #9aa0a6;
    --accent-glow: rgba(0, 255, 200, 0.4);
    --accent-solid: #00ffc8;
    --accent-secondary: #7e3fff;
    --glass-bg: rgba(15, 15, 20, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(5, 5, 8, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4, .logo {
    font-family: 'Space Grotesk', sans-serif;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    background: var(--nav-bg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-mark {
    width: 28px;
    height: 28px;
}

.logo span {
    color: var(--accent-solid);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

main {
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

.glass-section {
    min-height: 100vh;
    padding: 6rem 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content-block {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    max-width: 600px;
    box-shadow: var(--card-shadow);
    transform: translateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.content-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 40px 80px var(--accent-glow);
}

.split-section {
    align-items: flex-start;
}

.right-aligned {
    align-items: flex-end;
}

.centered {
    align-items: center;
    text-align: center;
}

.centered .content-block {
    max-width: 800px;
}

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 10%;
    min-height: calc(100vh - 80px);
}

.hero-content {
    max-width: 700px;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(126, 63, 255, 0.15);
    border: 1px solid rgba(126, 63, 255, 0.3);
    color: #b592ff;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

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

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

h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-solid);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn.primary {
    background: var(--accent-solid);
    color: var(--bg-color);
    border: 1px solid var(--accent-solid);
}

.btn.primary:hover, .btn.primary.glow:hover {
    background: transparent;
    color: var(--accent-solid);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    margin-left: 1rem;
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.stat-box {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--accent-solid);
}

.stat-num {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.alert-box {
    background: rgba(0, 255, 200, 0.05);
    border-left: 4px solid var(--accent-solid);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-top: 2rem;
    font-size: 0.95rem;
}

.feature-list {
    list-style: none;
    margin-top: 2rem;
}

.feature-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-solid);
    font-weight: bold;
}

.feature-list li strong {
    color: var(--text-primary);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
}

.grid-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-card:hover {
    transform: translateY(-10px);
    border-color: rgba(126, 63, 255, 0.3);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.grid-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.grid-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ==========================================================================
   API Explorer — FinanceSec Interactive Demo
   ========================================================================== */

/* --- Status Indicator --- */
.api-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--accent-solid);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.offline {
    background: #e17055;
    box-shadow: 0 0 8px rgba(225, 112, 85, 0.4);
}

.status-dot.checking {
    background: #fdcb6e;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.api-base-url {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

[data-theme='dark'] .api-base-url,
:root:not([data-theme='light']) .api-base-url {
    background: rgba(255, 255, 255, 0.05);
}

/* --- API Explorer Container --- */
.api-explorer {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Query Bar --- */
.query-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Top row: endpoint label + entity selector */
.query-section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.query-section-top .query-header {
    margin-bottom: 0;
}

/* Entity Targeting */
.entity-targeting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entity-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    opacity: 0.75;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}

.entity-selector-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.company-selector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.35rem 1.8rem 0.35rem 0.6rem;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    outline: none;
    min-width: 160px;

    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2388888888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 10px 6px;
}

.company-selector:hover {
    border-color: var(--accent-solid);
    background-color: var(--surface-light, var(--bg-color));
}

.company-selector:focus {
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.company-selector option {
    background: var(--bg-color);
    color: var(--text-primary);
    padding: 0.35rem;
}

/* Active entity indicator — green dot when a company is selected */
.selector-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.selector-indicator.active {
    background: var(--accent-solid);
    box-shadow: 0 0 6px var(--accent-glow);
}

@media (max-width: 600px) {
    .query-section-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .entity-targeting {
        width: 100%;
    }
    .company-selector {
        flex: 1;
        min-width: 0;
        width: 100%;
    }
}

.query-header {
    margin-bottom: 1rem;
}

.api-endpoint-label {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-solid);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.query-bar {
    display: flex;
    gap: 0.75rem;
}

.query-bar input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.query-bar input:focus {
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.query-bar input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.query-submit-btn {
    white-space: nowrap;
    padding: 1rem 1.5rem !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
}

/* --- Example Queries --- */
.example-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.example-query-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-query-btn:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    background: rgba(0, 184, 148, 0.05);
}

/* --- Response Panel --- */
.response-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    min-height: 120px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.response-panel.answered::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.response-panel.active.answered::before {
    opacity: 1;
    animation: pulse-resonance 3s ease-out infinite;
}

@keyframes pulse-resonance {
    0% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(0.8); opacity: 0.3; }
}

.response-panel.answered {
    border-color: rgba(0, 184, 148, 0.4);
}

.response-panel.refusal {
    border-color: rgba(253, 203, 110, 0.4);
}

.response-panel.preview {
    border-color: rgba(108, 92, 231, 0.3);
}

.response-placeholder {
    text-align: center;
    padding: 2rem 0;
}

.response-placeholder p {
    margin-bottom: 0.5rem;
}

.response-placeholder-sub {
    font-size: 0.85rem !important;
    opacity: 0.7;
}

/* Response header */
.response-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.response-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'Space Grotesk', sans-serif;
}

.response-badge.answered {
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-solid);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.response-badge.refusal {
    background: rgba(253, 203, 110, 0.15);
    color: #fdcb6e;
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.response-source {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Answer value */
.answer-value-block {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.answer-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    animation: answer-crystallize 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    z-index: 2;
}

/* --- Physics Log (Terminal) --- */
.physics-log {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 200, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #00ffc8;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    box-shadow: inset 0 0 10px rgba(0, 255, 200, 0.1);
}

.physics-log.active {
    display: block;
    animation: terminal-expand 0.4s ease-out;
}

@keyframes terminal-expand {
    from { opacity: 0; transform: translateY(10px) scaleY(0.8); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.log-entry {
    margin-bottom: 0.2rem;
    opacity: 0.8;
}

.log-entry .timestamp { color: #5a5d6e; margin-right: 0.5rem; }
.log-entry .status-msg { color: #f0f0f5; }
.log-entry.highlight { color: #00ffc8; opacity: 1; }

/* --- Trace Badge --- */
.trace-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid var(--accent-solid);
    border-radius: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-solid);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
}

.trace-badge.active { opacity: 1; }
.trace-badge .pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-solid);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* --- Document Preview --- */
.document-evidence {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    z-index: 1;
}

.document-evidence.active { opacity: 1; }

.evidence-snippet {
    position: absolute;
    top: 20%;
    right: -10%;
    width: 50%;
    height: 60%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(5deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

.snippet-line {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.snippet-line.highlight {
    background: var(--accent-solid);
    width: 60% !important;
    box-shadow: 0 0 10px var(--accent-glow);
}

@keyframes answer-crystallize {
    from { opacity: 0; transform: scale(0.8) translateY(10px); filter: blur(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.answer-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Confidence bar */
.confidence-bar {
    position: relative;
    height: 28px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

[data-theme='dark'] .confidence-bar,
:root:not([data-theme='light']) .confidence-bar {
    background: rgba(255, 255, 255, 0.06);
}

.confidence-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-solid), var(--accent-secondary));
    border-radius: 8px;
    transition: width 0.6s ease;
}

.confidence-bar span {
    position: relative;
    z-index: 1;
    padding-left: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Provenance chain */
.provenance-chain {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

[data-theme='dark'] .provenance-chain,
:root:not([data-theme='light']) .provenance-chain {
    background: rgba(255, 255, 255, 0.03);
}

.provenance-chain h5 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-solid);
    margin-bottom: 0.75rem;
}

.provenance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.prov-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}


.prov-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.prov-value {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
    position: relative;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: rgba(0, 184, 148, 0.05);
    animation: prov-field-entry 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes prov-field-entry {
    from { opacity: 0; transform: translateX(-10px); background: var(--accent-solid); }
    to { opacity: 1; transform: translateX(0); background: rgba(0, 184, 148, 0.05); }
}

.provenance-grid .prov-field:nth-child(1) .prov-value { animation-delay: 0.1s; }
.provenance-grid .prov-field:nth-child(2) .prov-value { animation-delay: 0.2s; }
.provenance-grid .prov-field:nth-child(3) .prov-value { animation-delay: 0.3s; }
.provenance-grid .prov-field:nth-child(4) .prov-value { animation-delay: 0.4s; }
.provenance-grid .prov-field:nth-child(5) .prov-value { animation-delay: 0.5s; }
.provenance-grid .prov-field:nth-child(6) .prov-value { animation-delay: 0.6s; }

.response-method {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* Safe refusal */
.refusal-body {
    padding: 1rem 0;
}

.refusal-reason {
    font-size: 1.05rem !important;
    color: var(--text-primary) !important;
    margin-bottom: 1rem !important;
}

.refusal-note {
    font-size: 0.85rem !important;
    font-style: italic;
    opacity: 0.7;
    border-left: 3px solid #fdcb6e;
    padding-left: 1rem;
}

/* --- Tentative Match --- */
.response-panel.tentative {
    border-color: rgba(255, 159, 67, 0.4);
}

.response-badge.tentative {
    background: rgba(255, 159, 67, 0.15);
    color: #ff9f43;
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.tentative-caveat {
    background: rgba(255, 159, 67, 0.06);
    border: 1px solid rgba(255, 159, 67, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.tentative-caveat p {
    font-size: 0.88rem !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
    line-height: 1.5;
}

.tentative-bar {
    background: rgba(255, 159, 67, 0.08) !important;
}

.tentative-fill {
    background: linear-gradient(90deg, #ff9f43, #ee5a24) !important;
}

/* --- Refusal Suggestions --- */
.refusal-suggestions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.suggestions-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-solid);
    margin-bottom: 0.75rem;
}

.suggestions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.suggestion-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.suggestion-btn:hover {
    border-color: var(--accent-solid);
    background: rgba(0, 184, 148, 0.06);
    color: var(--accent-solid);
    transform: translateX(4px);
}


/* Loading / Preview */
.response-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem 0;
    color: var(--text-secondary);
    font-weight: 500;
}

.pulse-ring {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-solid);
    animation: pulse-dot 0.8s ease-in-out infinite;
}

.response-error {
    color: #e17055;
    text-align: center;
    padding: 1.5rem 0;
    font-weight: 500;
}

.preview-banner {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.json-viewer {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #9affde;
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.8rem;
    padding: 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    white-space: pre;
    margin: 1rem 0;
}

/* --- Lattice Data Grid (Spreadsheet) --- */
.data-explorer-section {
    margin-top: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.spreadsheet-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    box-shadow: var(--card-shadow);
}

.spreadsheet-header {
    display: grid;
    grid-template-columns: 140px 2fr 100px 120px 140px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid var(--accent-solid);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-solid);
}

.spreadsheet-body {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.spreadsheet-row {
    display: grid;
    grid-template-columns: 140px 2fr 100px 120px 140px;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    align-items: stretch;
}

.spreadsheet-row:last-child { border-bottom: none; }

.spreadsheet-row:hover {
    background: rgba(0, 184, 148, 0.05);
}

.spreadsheet-row.active {
    background: rgba(0, 184, 148, 0.1);
    border-left: 3px solid var(--accent-solid);
}

.cell {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

.cell:last-child { border-right: none; }
.section-subhead {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    margin-top: 3rem;
    text-align: center;
}

.company-count {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- API Reference --- */
.api-reference-section {
    max-width: 900px;
    margin: 0 auto;
}

.endpoint-reference {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.endpoint-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: border-color 0.2s;
}

.endpoint-row:hover {
    border-color: rgba(0, 184, 148, 0.3);
}

.endpoint-method {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

.method-get, .endpoint-method.method-get {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.method-post, .endpoint-method.method-post {
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent-solid);
}

.endpoint-path {
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.endpoint-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* --- Stats Dashboard --- */
.stats-section {
    max-width: 900px;
    margin: 0 auto;
}

.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.stat-card-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-solid);
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}



/* --- Other Products --- */
.other-products {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Product cards (Upcoming APIs) --- */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.status-badge.live {
    background: rgba(0, 255, 200, 0.1);
    color: var(--accent-solid);
    border-color: rgba(0, 255, 200, 0.3);
}

.code-block {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
    font-size: 0.8rem;
    color: #9affde;
    overflow-x: auto;
    white-space: pre;
    margin: 1rem 0;
}

.btn.small {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    margin-top: auto;
    align-self: flex-start;
}

footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

footer p {
    font-size: 0.8rem;
    margin: 0;
    color: var(--text-secondary);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        padding-top: 40px;
        text-align: center;
    }
    
    .hero-stats {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stat-box {
        flex: 1;
        min-width: 200px;
        text-align: left;
    }

    .cta-buttons {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .btn.secondary {
        margin-left: 0;
    }

    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .provenance-grid {
        grid-template-columns: 1fr;
    }

    .endpoint-desc {
        display: none;
    }

}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .glass-section {
        padding: 4rem 5%;
    }
    
    .content-block {
        padding: 2rem;
    }

    .hero-stats {
        flex-direction: column;
    }

    .query-bar {
        flex-direction: column;
    }

    .answer-value {
        font-size: 1.8rem;
    }

    .stats-dashboard {
        grid-template-columns: 1fr;
    }


    .suggestions-grid {
        gap: 0.5rem;
    }

    .api-status {
        flex-wrap: wrap;
        justify-content: center;
    }
}

