/* ============================================
   Cogninance — Design System & Styles
   Tech / AI / Minimal Dark Theme
   ============================================ */

:root {
    --bg-base: #06080d;
    --bg-card: #0b0d14;
    --bg-elevated: #10131b;
    --bg-surface: #161922;
    --accent: #00d9ff;
    --accent-dim: rgba(0, 217, 255, 0.12);
    --accent-glow: rgba(0, 217, 255, 0.06);
    --accent-secondary: #6366f1;
    --text-primary: #e2e4e9;
    --text-secondary: #8b8f9a;
    --text-muted: #454955;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --gradient-accent: linear-gradient(135deg, #00d9ff 0%, #6366f1 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(0, 217, 255, 0.06) 0%, transparent 70%);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --max-width: 1120px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg-base); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }

/* Background */
.bg-grid {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 72px 72px;
}
.bg-glow {
    position: fixed; top: -30%; left: 50%; transform: translateX(-50%);
    width: 900px; height: 900px;
    background: radial-gradient(ellipse, rgba(0,217,255,0.04) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* Nav */
.nav { position: fixed; top: 0; width: 100%; z-index: 100; background: rgba(6,8,13,0.88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.nav-logo-mark { width: 26px; height: 26px; background: var(--gradient-accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.nav-logo-mark svg { width: 14px; height: 14px; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.875rem; font-weight: 450; color: var(--text-secondary); transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta { padding: 0.5rem 1.2rem; background: var(--accent); color: var(--bg-base); font-weight: 600; font-size: 0.8rem; border-radius: 6px; transition: all 0.2s; }
.nav-cta:hover { box-shadow: 0 0 20px rgba(0,217,255,0.3); background: #1ae0ff; }
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 5px; }
.mobile-menu-btn span { width: 20px; height: 1.5px; background: var(--text-primary); }

/* Shared */
section { position: relative; z-index: 1; }
.section-inner { max-width: var(--max-width); margin: 0 auto; padding: 7rem 2rem; }
.section-tag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 1rem; }
.section-heading { font-family: var(--font-serif); font-size: clamp(2.25rem, 4.5vw, 3.25rem); font-weight: 400; line-height: 1.1; margin-bottom: 1rem; }
.section-desc { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.7; max-width: 560px; }
.section-header-center { text-align: center; max-width: 620px; margin: 0 auto 4rem; }
.section-header-center .section-desc { margin: 0 auto; }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.75rem; background: var(--accent); color: var(--bg-base); font-weight: 600; font-size: 0.9rem; border-radius: 8px; transition: all 0.2s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,217,255,0.3); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-secondary { display: inline-flex; align-items: center; padding: 0.85rem 1.75rem; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); font-weight: 500; font-size: 0.9rem; border-radius: 8px; transition: all 0.2s; }
.btn-secondary:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.04); }

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8rem 2rem 5rem; }
.hero-inner { max-width: 780px; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.35rem 1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 100px; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 2.5rem; opacity: 0; animation: fadeUp 0.7s ease forwards; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hero h1 { font-family: var(--font-serif); font-size: clamp(3rem, 7.5vw, 5.5rem); font-weight: 400; line-height: 1.05; margin-bottom: 1.5rem; opacity: 0; animation: fadeUp 0.7s ease 0.1s forwards; }
.hero h1 em { font-style: italic; background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--text-secondary); max-width: 540px; margin: 0 auto 2.5rem; line-height: 1.75; opacity: 0; animation: fadeUp 0.7s ease 0.2s forwards; }
.hero-cta { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 4rem; opacity: 0; animation: fadeUp 0.7s ease 0.3s forwards; }
.hero-trust { display: flex; justify-content: center; gap: 2.5rem; opacity: 0; animation: fadeUp 0.7s ease 0.4s forwards; }
.hero-trust-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }
.hero-trust-item svg { width: 14px; height: 14px; opacity: 0.5; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Stats Bar */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-bar-inner { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { text-align: center; padding: 2.5rem 1rem; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-value { font-family: var(--font-mono); font-size: 2.25rem; font-weight: 500; margin-bottom: 0.25rem; }
.stat-value .accent { color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* About */
.about { background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-card) 50%, var(--bg-base) 100%); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.about-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.about-card { padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.3s; }
.about-card:hover { border-color: var(--border-hover); }
.about-card:nth-child(2) { transform: translateY(1.5rem); }
.about-card:nth-child(3) { transform: translateY(-1.5rem); }
.about-card-icon { width: 36px; height: 36px; background: var(--accent-dim); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; color: var(--accent); }
.about-card-icon svg { width: 18px; height: 18px; }
.about-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.about-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* FIONA Section */
.fiona { border-top: 1px solid var(--border); }
.fiona-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.fiona-intro-content .section-desc { margin-bottom: 2rem; }
.fiona-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.fiona-badge { padding: 0.3rem 0.75rem; background: var(--accent-dim); border-radius: 100px; font-size: 0.72rem; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }

/* Chat Mockup */
.chat-mockup { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.4); }
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.chat-avatar { width: 28px; height: 28px; background: var(--gradient-accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chat-avatar svg { width: 14px; height: 14px; }
.chat-name { font-size: 0.82rem; font-weight: 600; }
.chat-status { font-size: 0.68rem; color: var(--accent); display: flex; align-items: center; gap: 0.3rem; }
.chat-status::before { content: ''; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.chat-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; min-height: 280px; }
.chat-msg { max-width: 82%; padding: 0.65rem 0.9rem; border-radius: 10px; font-size: 0.82rem; line-height: 1.55; opacity: 0; transform: translateY(6px); transition: opacity 0.4s ease, transform 0.4s ease; }
.chat-msg.visible { opacity: 1; transform: translateY(0); }
.chat-msg.bot { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); align-self: flex-start; border-bottom-left-radius: 3px; }
.chat-msg.user { background: var(--accent-dim); border: 1px solid rgba(0,217,255,0.15); color: var(--text-primary); align-self: flex-end; border-bottom-right-radius: 3px; }
.chat-msg.nudge { background: rgba(245,166,35,0.06); border: 1px solid rgba(245,166,35,0.15); color: #d4a24e; align-self: flex-start; border-bottom-left-radius: 3px; font-size: 0.78rem; }
.chat-msg .msg-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 0.25rem; opacity: 0.7; }
.chat-input-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); }
.chat-input-bar span { flex: 1; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem; color: var(--text-muted); font-size: 0.78rem; }
.chat-send-btn { width: 32px; height: 32px; background: var(--accent); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.chat-send-btn svg { width: 14px; height: 14px; color: var(--bg-base); }

/* Features Grid */
.features { background: var(--bg-card); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.feature-cell { padding: 2rem; background: var(--bg-card); transition: background 0.3s; }
.feature-cell:hover { background: var(--bg-elevated); }
.feature-cell-icon { width: 36px; height: 36px; background: var(--accent-dim); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; color: var(--accent); }
.feature-cell-icon svg { width: 18px; height: 18px; }
.feature-cell h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature-cell p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }

/* FRI Section */
.fri { border-top: 1px solid var(--border); }
.fri-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.fri-visual { position: relative; height: 380px; }
.fri-ring { position: absolute; border: 1px solid rgba(0,217,255,0.12); border-radius: 50%; animation: spin 40s linear infinite; }
.fri-ring:nth-child(1) { width: 100%; height: 100%; top: 0; left: 0; }
.fri-ring:nth-child(2) { width: 72%; height: 72%; top: 14%; left: 14%; animation-direction: reverse; animation-duration: 30s; border-style: dashed; }
.fri-ring:nth-child(3) { width: 46%; height: 46%; top: 27%; left: 27%; animation-duration: 22s; }
.fri-ring-dot { position: absolute; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px rgba(0,217,255,0.5); }
.fri-ring:nth-child(1) .fri-ring-dot { top: -3px; left: 50%; }
.fri-ring:nth-child(2) .fri-ring-dot { bottom: -3px; right: 18%; }
.fri-ring:nth-child(3) .fri-ring-dot { top: 18%; left: -3px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fri-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 140px; height: 140px; background: var(--bg-elevated); border: 2px solid rgba(0,217,255,0.25); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 60px rgba(0,217,255,0.08); }
.fri-score { font-family: var(--font-mono); font-size: 2.75rem; font-weight: 500; background: var(--gradient-accent); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.fri-score-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; }
.fri-content .section-heading { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.fri-content .section-desc { margin-bottom: 2rem; }

/* Dimensions */
.dimensions-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dimension-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.3s; }
.dimension-item:hover { border-color: var(--border-hover); }
.dimension-icon { width: 38px; height: 38px; background: var(--accent-dim); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.dimension-icon svg { width: 18px; height: 18px; }
.dimension-text h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.15rem; }
.dimension-text p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* How It Works */
.how { background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-card) 50%, var(--bg-base) 100%); }
.steps { max-width: 700px; margin: 0 auto; position: relative; }
.steps-line { position: absolute; left: 23px; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, var(--accent), var(--accent-secondary), transparent); }
.step { display: flex; gap: 2rem; padding: 1.75rem 0; position: relative; }
.step-num { width: 48px; height: 48px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; color: var(--accent); flex-shrink: 0; position: relative; z-index: 1; }
.step-body { padding-top: 0.35rem; }
.step-body h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; }
.step-body p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; max-width: 480px; }

/* Research */
.research { background: var(--bg-card); border-top: 1px solid var(--border); }
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.research-card { padding: 2rem; background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.3s; }
.research-card:hover { border-color: var(--border-hover); }
.research-card .num { font-family: var(--font-mono); font-size: 2.25rem; font-weight: 500; color: var(--accent-secondary); margin-bottom: 0.75rem; }
.research-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.research-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.research-card .source { display: inline-block; margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); opacity: 0.6; }

/* CTA */
.cta { text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; height: 600px; background: var(--gradient-glow); pointer-events: none; }
.cta .section-heading { position: relative; }
.cta .section-desc { max-width: 460px; margin: 0 auto 2.5rem; position: relative; }
.cta-buttons { display: flex; justify-content: center; gap: 0.75rem; position: relative; }

/* Footer */
.footer { border-top: 1px solid var(--border); position: relative; z-index: 1; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.footer-logo { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 1rem; }
.footer-logo .nav-logo-mark { width: 20px; height: 20px; border-radius: 5px; }
.footer-logo .nav-logo-mark svg { width: 11px; height: 11px; }
.footer-links { display: flex; gap: 1.75rem; }
.footer-links a { font-size: 0.8rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1024px) {
    .about-grid, .fiona-intro, .fri-layout { grid-template-columns: 1fr; gap: 3rem; }
    .fri-visual { height: 300px; max-width: 380px; margin: 0 auto; }
    .features-grid, .research-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero { padding: 6rem 1.5rem 3rem; }
    .hero h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
    .hero-cta { flex-direction: column; align-items: center; }
    .hero-trust { flex-wrap: wrap; justify-content: center; gap: 1rem 2rem; }
    .stats-bar-inner { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.75rem; }
    .about-visual { grid-template-columns: 1fr 1fr; }
    .about-card:nth-child(2), .about-card:nth-child(3) { transform: none; }
    .features-grid, .research-grid { grid-template-columns: 1fr; }
    .steps-line { left: 16px; }
    .step { gap: 1.25rem; }
    .step-num { width: 36px; height: 36px; font-size: 0.75rem; }
    .footer-inner { flex-direction: column; gap: 1.25rem; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
    .section-inner { padding: 4.5rem 1.5rem; }
}
