/*
 * BridgeBrain OE — main stylesheet.
 * Ported from bridgebrain-oe-modern-chat-v4.html. Design system preserved;
 * adapted for WordPress (admin bar offsets, skip link, theme-relative assets).
 */

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #0f0f12;
    color: #ecedee;
    overflow-x: hidden;
}

.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; overflow: hidden;
    padding: 0; position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
    clip: auto; clip-path: none; height: auto; width: auto;
    position: fixed !important; left: 12px; top: 12px; z-index: 100000;
    background: #3b82f6; color: #fff; padding: .6rem 1rem; border-radius: 10px;
    font-weight: 600; text-decoration: none;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: radial-gradient(circle at 20% 30%, #16161f, #0a0a0e);
}
body.admin-bar .app-container { height: calc(100vh - 32px); margin-top: 32px; }

.app-container.no-home-sidebar .main-chat-area { width: 100%; }

@media (max-width: 782px) {
    body.admin-bar .app-container { height: calc(100vh - 46px); margin-top: 46px; }
}

/* ========= SIDEBAR ========= */
.chat-sidebar {
    width: 280px;
    background-color: #121217;
    backdrop-filter: blur(2px);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    flex-shrink: 0;
    overflow-y: auto;
    z-index: 20;
}
.chat-sidebar.collapsed { width: 72px; }

.sidebar-header {
    padding: 1.2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo-area { display: flex; align-items: center; gap: 0.65rem; overflow: hidden; }
.logo-area a { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.logo-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    width: 30px; height: 30px; border-radius: 50px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; flex: 0 0 auto;
}
.logo-icon img, .logo-area .custom-logo { width: 30px; height: 30px; border-radius: 50px; display: block; }
.logo-text {
    font-weight: 700; font-size: 1.1rem; white-space: nowrap;
    background: linear-gradient(135deg, #fff, #a0c0ff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.collapse-btn {
    background: rgba(255,255,255,0.05);
    border: none; color: #a1a1aa; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px; transition: 0.2s;
}
.collapse-btn:hover { background: #2c2c36; color: white; }

.history-list { flex: 1; padding: 0 0.75rem; display: flex; flex-direction: column; gap: 0.3rem; }
.history-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.75rem 0.9rem; border-radius: 12px;
    color: #d1d5db; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    background: none; border: none; width: 100%; text-align: left;
    font-family: inherit;
}
.history-item i { width: 22px; color: #6b7280; }
.history-item:hover, .history-item.active { background: rgba(59,130,246,0.12); color: white; }
.chat-sidebar.collapsed .history-item span,
.chat-sidebar.collapsed .logo-text,
.chat-sidebar.collapsed .sub { display: none; }
.chat-sidebar.collapsed .history-item { justify-content: center; }
.sidebar-footer { padding: 1rem; color: #7c7f8c; font-size: .85rem; }
.sidebar-footer .menu, .sidebar-footer ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.sidebar-footer a { color: #9aa3b5; text-decoration: none; font-size: .82rem; }
.sidebar-footer a:hover { color: #fff; }

.sub {
    font-size: 12px; font-weight: 600; text-align: center;
    margin: -10px 0 20px 0; color: #9ca3af;
}

/* ========= MAIN AREA ========= */
.main-chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.scroll-container { flex: 1; overflow-y: auto; scroll-behavior: smooth; position: relative; }

/* CHAT HEADER */
.chat-header {
    background: linear-gradient(145deg, #101014, #0c0c10);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    z-index: 30;
}
/* Sticky mode marker for the expanded home-page chat. */
.chat-header.sticky-active { }

.chat-expanded { max-width: 980px; margin: 0 auto; width: 100%; padding: 2rem 1.5rem 2rem 1.5rem; display: block; }

/* Compact bar: hidden until home-page scroll sticky mode; inner pages override it in the header. */
.chat-compact {
    position: absolute; top: 0; left: 0; right: 0; z-index: 60;
    display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem 1.5rem;
    background: rgba(12, 12, 18, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59,130,246,0.5);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.22s ease;
}
.chat-compact.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.chat-compact.always-visible {
    position: relative;
    flex: 1 1 auto;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) { .chat-compact { transition: none; } }

/* Inner-page top header */
.bboe-inner-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    background: rgba(12, 12, 18, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59,130,246,0.5);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    z-index: 70;
}
.bboe-inner-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
    min-width: 260px;
    text-decoration: none;
}
.bboe-inner-brand-copy { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.bboe-inner-sub {
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.bboe-inner-header .chat-compact {
    position: relative;
    inset: auto;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.compact-input-group { flex: 1; display: flex; gap: 0.75rem; align-items: center; }
.compact-input-wrapper { flex: 1; background: #1e1e28; border-radius: 40px; border: 1px solid #2d2d36; transition: all 0.2s; }
.compact-input-wrapper:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.3); }
.compact-input-wrapper textarea {
    width: 100%; background: transparent; border: none;
    padding: 0.82rem 1.2rem 0.56rem; font-family: 'Inter', monospace; font-size: 0.9rem;
    resize: none; color: #ecedee; outline: none; line-height: 1.35;
    min-height: 44px; max-height: 90px; display: block;
}
.compact-send {
    background: linear-gradient(100deg, #3b82f6, #2563eb);
    border: none; padding: 0.5rem 1.2rem; border-radius: 40px;
    color: white; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.compact-close-btn {
    background: rgba(255,255,255,0.08); border: 1px solid #6b7280; color: #cbd5e1;
    padding: 0.5rem 1rem; border-radius: 40px; font-size: 0.75rem; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.15s;
}
.compact-close-btn:hover { background: #3b82f6; border-color: #3b82f6; color: white; }

/* Full chat input */
.chat-input-wrapper {
    background: #1e1e24; border-radius: 32px; border: 1px solid #2d2d36;
    transition: all 0.2s; box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.chat-input-wrapper:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
textarea.chat-expand {
    width: 100%; background: transparent; border: none;
    padding: 1.12rem 1.5rem 0.78rem; font-family: 'Inter', monospace; font-size: 1rem;
    resize: none; color: #ecedee; outline: none; line-height: 1.35;
    min-height: 60px; max-height: 200px; display: block;
}
.input-actions {
    display: flex; justify-content: space-between;
    padding: 0.6rem 1rem 1rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.chat-icon-btn { background: #2a2a32; border: none; color: #b9c3d4; width: 34px; height: 34px; border-radius: 28px; cursor: pointer; }
.chat-icon-btn:hover { background: #3b82f6; color: white; }
.send-btn {
    background: linear-gradient(100deg, #3b82f6, #2563eb);
    border: none; padding: 0.5rem 1.3rem; border-radius: 32px;
    color: white; font-weight: 600; cursor: pointer;
}

/* ANSWER OVERLAY */
.answer-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 8, 12, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100100;
    display: flex; align-items: center; justify-content: center;
    visibility: hidden; opacity: 0;
    transition: visibility 0.2s, opacity 0.25s ease;
}
.answer-overlay.active { visibility: visible; opacity: 1; }
.answer-card {
    background: #13131f; border-radius: 40px;
    max-width: 700px; width: 90%;
    border: 1px solid #2e3a5c;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
    overflow: hidden; transform: scale(0.96); transition: transform 0.2s ease;
}
.answer-overlay.active .answer-card { transform: scale(1); }
.answer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 1.8rem; border-bottom: 1px solid #262e42; background: #0f0f18;
}
.answer-header h3 { font-weight: 600; font-size: 1.2rem; }
.close-answer { background: none; border: none; color: #9ca3af; font-size: 1.4rem; cursor: pointer; }
.close-answer:hover { color: white; }
.answer-body { padding: 1.8rem; font-size: 1rem; line-height: 1.6; color: #e2e8f0; max-height: 60vh; overflow-y: auto; }
.typing-cursor::after { content: '▋'; animation: bboe-blink 1s infinite; margin-left: 2px; }
@keyframes bboe-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* CONTENT STYLES */
.below-content { padding: 0.5rem 1.5rem 3rem; background: #0c0c12; }
.content-grid { max-width: 1200px; margin: 0 auto; }
.modern-card {
    background: #13131b; border-radius: 28px; border: 1px solid #262631;
    padding: 1.6rem; margin-bottom: 2rem;
}
.badge {
    background: #1f2a48; color: #8bb4ff; font-size: 0.7rem; font-weight: 600;
    padding: 0.2rem 0.8rem; border-radius: 30px; display: inline-block;
}
h2 {
    font-size: 1.9rem; font-weight: 700; margin: 0.75rem 0 1rem;
    background: linear-gradient(135deg, #eef2ff, #b9d0ff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.story-tile { background: #1a1a24; border-radius: 20px; padding: 1.2rem; border: 1px solid #2a2a34; }
.story-tile i { font-size: 1.8rem; color: #3b82f6; margin-bottom: 0.75rem; }
.rail-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 2rem 0; }
.rail-card { background: #111117; border-radius: 24px; border: 1px solid #272730; padding: 1.2rem; flex: 1 1 240px; }
.btn-primary {
    background: linear-gradient(95deg, #3b82f6, #2563eb);
    padding: 0.6rem 1.3rem; border-radius: 40px; font-weight: 600;
    color: white; display: inline-block; text-decoration: none;
}
.site-footer, footer.site-footer { text-align: center; padding: 2rem 1rem; color: #7c7f8c; }

@media (max-width: 780px) {
    .chat-sidebar { width: 240px; }
    .chat-sidebar.collapsed { width: 68px; }

    .bboe-inner-header { align-items: stretch; flex-direction: column; padding: 0.75rem 0.85rem; gap: 0.65rem; }
    .bboe-inner-brand { min-width: 0; width: 100%; }
    .chat-compact { padding: 0.65rem 0.85rem; gap: 0.6rem; }
    .bboe-inner-header .chat-compact { padding: 0; }
    .compact-input-wrapper textarea { min-height: 40px; padding: 0.78rem 1rem 0.5rem; }
    .compact-input-group { flex-wrap: wrap; }
    .compact-send { padding: 0.4rem 0.9rem; font-size: 0.75rem; }
}

/* ============================================================
   OE CONTENT SYSTEM — full-content build
   ============================================================ */
.welcome-message { text-align: center; margin-bottom: 1.5rem; }
.welcome-message h1 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.02em; }
.welcome-message .subhead { max-width: 62ch; margin: .6rem auto 0; line-height: 1.6; font-size: .98rem; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: 1rem; }
.hero-chips span { font-size: .72rem; font-weight: 600; color: #aecbff; background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.32); padding: .3rem .75rem; border-radius: 30px; }

h2 { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -.015em; line-height: 1.18; }
.modern-card { padding: clamp(1.5rem, 3.5vw, 2.4rem); }
.modern-card p { color: #b4bac7; line-height: 1.7; margin-top: .7rem; max-width: 72ch; }
.modern-card p strong.hl { color: #dbe6ff; font-weight: 600; }
.pull-line { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.15rem; color: #dbe6ff !important; border-left: 3px solid #3b82f6; padding-left: 1rem; }
.section-lede { margin-inline: auto; }
.card-center { text-align: center; }
.card-center .cta-row { justify-content: center; }
.below-content [id] { scroll-margin-top: 92px; }

.ph-img { width: 100%; height: auto; display: block; border-radius: 18px; border: 1px solid #262636; }
.banner-card { padding: 0; overflow: hidden; position: relative; }
.banner-card .ph-img { border: none; border-radius: 0; }
.banner-caption { position: absolute; inset: auto 0 0 0; padding: 2.4rem 1.8rem 1.3rem; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: clamp(1rem, 2.4vw, 1.45rem); color: #eef2ff; background: linear-gradient(180deg, transparent, rgba(7,7,12,.9)); }

.story-tile { transition: transform .2s ease, border-color .2s ease; }
.story-tile:hover { transform: translateY(-3px); border-color: rgba(59,130,246,.5); }
.story-tile i { display: block; }
.story-tile strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.12rem; color: #eef2ff; margin-bottom: .15rem; }
.story-tile span { color: #9ca3af; font-size: .9rem; }

.split-card { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: clamp(1.4rem, 3vw, 2.4rem); align-items: center; }
.split-card--media-right { grid-template-columns: 7fr minmax(280px, 5fr); }

.rail-feature { background: #111118; border: 1px solid #262631; border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; margin-bottom: 2rem; transition: border-color .2s ease, transform .2s ease; }
.rail-feature:hover { border-color: rgba(59,130,246,.45); transform: translateY(-2px); }
.rail-feature:nth-of-type(even) { grid-template-columns: 3fr minmax(260px, 2fr); }
.rail-feature:nth-of-type(even) .rail-media { order: 2; }
.rail-media { min-height: 220px; }
.rail-media .ph-img { width: 100%; height: 100%; object-fit: cover; border: none; border-radius: 0; }
.rail-body { padding: clamp(1.4rem, 3vw, 2.1rem); }
.rail-num { font-family: 'Space Grotesk', sans-serif; color: #3b82f6; font-weight: 700; letter-spacing: .2em; font-size: .72rem; }
.rail-body h3 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1.4rem, 2.4vw, 1.7rem); margin: .35rem 0 .05rem; color: #eef2ff; }
.rail-tag { color: #8bb4ff; font-weight: 600; margin-top: .1rem !important; }
.rail-body p { color: #b4bac7; line-height: 1.65; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip-row--lg { margin-top: 1.4rem; }
.chip { font-size: .73rem; font-weight: 600; color: #cdd6e4; background: #1b1b26; border: 1px solid #2c2c3a; padding: .34rem .75rem; border-radius: 30px; }
.chip-row--lg .chip { font-size: .8rem; padding: .45rem .95rem; color: #c7d2fe; border-color: rgba(59,130,246,.35); background: rgba(59,130,246,.08); }
.rail-link { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.15rem; color: #8bb4ff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.rail-link:hover { color: #d7e5ff; }
.rail-link i { font-size: .75rem; transition: transform .18s ease; }
.rail-link:hover i { transform: translateX(3px); }

.question-cloud { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 .4rem; }
.question-cloud span { background: #161622; border: 1px solid #2b2b3a; color: #c7d2fe; padding: .55rem 1.05rem; border-radius: 30px; font-size: .85rem; font-weight: 500; }

.orbit { position: relative; max-width: 560px; aspect-ratio: 1.2; margin: 2.4rem auto .8rem; }
.orbit::before { content: ''; position: absolute; inset: 9% 12%; border: 1.5px dashed rgba(59,130,246,.35); border-radius: 50%; }
.orbit-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(46%, 215px); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle at 32% 26%, #2f5fd0, #1d3a8a 58%, #131f44); border: 1px solid rgba(139,180,255,.45); box-shadow: 0 0 46px rgba(59,130,246,.28), inset 0 0 34px rgba(6,10,26,.55); padding: 1rem; }
.orbit-center strong { font-family: 'Space Grotesk', sans-serif; font-size: clamp(1rem, 2.6vw, 1.3rem); line-height: 1.05; }
.orbit-center span { font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: #aecbff; margin-top: .3rem; }
.orbit-node { position: absolute; transform: translate(-50%, -50%); background: #161620; border: 1px solid #2e2e40; color: #e6ecff; padding: .55rem 1.05rem; border-radius: 30px; font-weight: 600; font-size: .85rem; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.orbit-node i { color: #3b82f6; margin-right: .45rem; }
.foundation-line { text-align: center; color: #7d86a0; letter-spacing: .16em; text-transform: uppercase; font-size: .7rem; margin-top: 1.4rem !important; max-width: none !important; }

.check-list { list-style: none; margin: 1.1rem 0 .4rem; padding: 0; display: grid; gap: .65rem; }
.check-list li { display: flex; gap: .7rem; color: #c3cad6; line-height: 1.55; }
.check-list i { color: #3b82f6; margin-top: .22rem; flex: 0 0 auto; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.5rem; }
.btn-primary { transition: filter .18s ease, transform .18s ease; }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-secondary { border: 1px solid rgba(59,130,246,.65); color: #8bb4ff; padding: .58rem 1.3rem; border-radius: 40px; font-weight: 600; text-decoration: none; display: inline-block; transition: background .18s ease, color .18s ease; }
.btn-secondary:hover { background: rgba(59,130,246,.16); color: #fff; }

.site-footer .foot-tag { margin-top: .4rem; font-size: .78rem; color: #5e6577; }

@media (max-width: 860px) {
    .split-card, .split-card--media-right { grid-template-columns: 1fr; }
    .rail-feature, .rail-feature:nth-of-type(even) { grid-template-columns: 1fr; }
    .rail-feature:nth-of-type(even) .rail-media { order: 0; }
    .rail-media { min-height: 190px; max-height: 240px; }
}
@media (max-width: 640px) {
    .below-content { padding: 1rem .9rem 2.5rem; }
    .orbit { aspect-ratio: auto; max-width: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
    .orbit::before { display: none; }
    .orbit-center { position: static; transform: none; width: 100%; aspect-ratio: auto; border-radius: 22px; flex-direction: row; gap: .7rem; justify-content: center; padding: .9rem 1rem; }
    .orbit-center span { margin-top: 0; }
    .orbit-node { position: static; transform: none; }
    .banner-caption { padding: 1.6rem 1.1rem .9rem; }
}

/* Title font carried over from the source design (graceful fallback stack) */
.welcome-message h1 {
    font-family: 'Chunky Block', 'Porcine', 'Arial Black', Impact, 'Space Grotesk', sans-serif;
    font-weight: 900;
    letter-spacing: .02em;
}
figcaption { text-align: center; font-size: 12px; font-weight: 400; }
.oe { color: #7fadb1; font-size: 28px; letter-spacing: 8px; }

#proof {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/moving.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
#why {
    background-image: url('../img/matters.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
}

/* Inner pages (blog / page / 404) share the shell */
.bboe-entry h1, .bboe-entry .entry-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 1rem; color: #eef2ff; }
.bboe-entry a { color: #8bb4ff; }
.bboe-entry img { max-width: 100%; height: auto; border-radius: 18px; }
.bboe-entry ul, .bboe-entry ol { margin: .8rem 0 .8rem 1.4rem; color: #b4bac7; line-height: 1.7; }

:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .scroll-container { scroll-behavior: auto; }
    .story-tile, .rail-feature, .btn-primary, .answer-card { transition: none; }
}
