/* ============================================
   MATRIX FORGE V5 — AI PREMIUM + HERO CHAT
   Dark Tech + Warm Accents
   ============================================ */

:root {
    --void: #06080C;
    --deep: #0A0E14;
    --surface: #12161E;
    --surface-light: #1A1F2A;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --accent: #FF6B35;
    --accent-soft: #FF8F66;
    --accent-glow: rgba(255, 107, 53, 0.15);
    --cyan: #00D4FF;
    --cyan-soft: #66E5FF;
    --cyan-glow: rgba(0, 212, 255, 0.12);
    --emerald: #10B981;
    --emerald-glow: rgba(16, 185, 129, 0.12);
    --violet: #8B5CF6;
    --violet-glow: rgba(139, 92, 246, 0.12);
    --red: #EF4444;
    --red-glow: rgba(239, 68, 68, 0.15);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --font-display: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --glow-accent: 0 0 60px var(--accent-glow);
    --glow-cyan: 0 0 60px var(--cyan-glow);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-display);
    background: var(--void);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: 1.25rem; }

.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 50%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

section {
    padding: clamp(5rem, 12vw, 8rem) 0;
    position: relative;
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(6, 8, 12, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--deep);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.logo-icon span {
    position: relative;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

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

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

.nav-cta {
    background: linear-gradient(135deg, var(--accent) 0%, #FF8855 100%);
    color: white !important;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.3);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.9rem 1.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #FF8855 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.3);
}

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

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

/* HERO */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    top: -300px;
    right: -200px;
    pointer-events: none;
    animation: pulse-glow 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 60%);
    bottom: -200px;
    left: -100px;
    pointer-events: none;
    animation: pulse-glow 8s ease-in-out infinite reverse;
}

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

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--emerald);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-eyebrow span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--emerald);
    letter-spacing: 0.1em;
}

.hero h1 { margin-bottom: 1.5rem; }

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* HERO CARD */
.hero-card {
    width: 100%;
    max-width: 580px;
    background: rgba(18, 22, 30, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transform: translateZ(0);
    will-change: transform;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--red), var(--accent), var(--emerald));
    z-index: 10;
    transition: background 0.6s var(--transition-smooth);
}

.hero-card.chat-mode::before {
    background: linear-gradient(90deg, var(--accent), var(--cyan), var(--violet));
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}

.card-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: opacity 0.3s, transform 0.3s;
}

.transform-toggle {
    display: flex;
    background: var(--surface);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    transition: opacity 0.3s, transform 0.3s;
}

.hero-card.chat-mode .transform-toggle {
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    position: absolute;
}

.toggle-btn {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    letter-spacing: 0.05em;
}

.toggle-btn.active {
    background: var(--accent);
    color: white;
}

.toggle-btn:hover:not(.active) { color: var(--text-primary); }

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.25s var(--transition-smooth);
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    position: absolute;
    right: 1.25rem;
}

.back-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--surface-light);
}

.hero-card.chat-mode .back-btn {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
    right: auto;
}

.content-wrapper {
    position: relative;
    overflow: hidden;
}

.animation-view {
    transition: opacity 0.5s var(--transition-smooth), 
                transform 0.5s var(--transition-smooth),
                filter 0.5s var(--transition-smooth);
    transform-origin: center center;
}

.hero-card.chat-mode .animation-view {
    opacity: 0;
    transform: scale(0.92) translateY(-10px);
    filter: blur(8px);
    pointer-events: none;
    position: absolute;
    inset: 0;
}

.split-container {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.panel-before,
.panel-after {
    position: absolute;
    inset: 0;
    padding: 1.25rem;
    transition: opacity 0.5s var(--transition-smooth), 
                transform 0.5s var(--transition-smooth);
    will-change: transform, opacity;
}

.panel-before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
}

.panel-before.hidden {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

.panel-after {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.panel-after.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.panel-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.panel-label.before {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.panel-label.after {
    background: var(--emerald-glow);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.label-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.label-dot.red { background: var(--red); }
.label-dot.green { background: var(--emerald); }

.chaos-grid, .flow-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chaos-item, .flow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.chaos-item {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    animation: slideInChaos 0.4s var(--transition-smooth) both;
}

.flow-item {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
    opacity: 0;
    transform: translateX(20px);
}

.chaos-item::before, .flow-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    opacity: 0.6;
}

.chaos-item::before { background: var(--red); }
.flow-item::before { background: var(--emerald); }

.chaos-icon, .flow-icon { font-size: 1rem; flex-shrink: 0; }
.chaos-content, .flow-content { flex: 1; min-width: 0; }

.chaos-title, .flow-title {
    font-size: 0.75rem;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.chaos-desc, .flow-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chaos-badge, .flow-badge {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.chaos-badge { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.flow-badge { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }

.chaos-item:nth-child(1) { animation-delay: 0.05s; }
.chaos-item:nth-child(2) { animation-delay: 0.1s; }
.chaos-item:nth-child(3) { animation-delay: 0.15s; }
.chaos-item:nth-child(4) { animation-delay: 0.2s; }
.chaos-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInChaos {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

.panel-after.visible .flow-item {
    animation: slideInFlow 0.35s var(--transition-smooth) forwards;
}

.panel-after.visible .flow-item:nth-child(1) { animation-delay: 0.05s; }
.panel-after.visible .flow-item:nth-child(2) { animation-delay: 0.1s; }
.panel-after.visible .flow-item:nth-child(3) { animation-delay: 0.15s; }
.panel-after.visible .flow-item:nth-child(4) { animation-delay: 0.2s; }
.panel-after.visible .flow-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInFlow {
    to { opacity: 1; transform: translateX(0); }
}

.stress-meter, .success-meter {
    margin-top: 0.6rem;
    padding: 8px 10px;
    border-radius: 8px;
}

.stress-meter {
    background: rgba(239, 68, 68, 0.08);
    border: 1px dashed rgba(239, 68, 68, 0.2);
}

.success-meter {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.2);
    opacity: 0;
}

.panel-after.visible .success-meter {
    animation: fadeIn 0.4s 0.4s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.stress-header, .success-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.stress-label, .success-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
}

.stress-label { color: var(--red); }
.success-label { color: var(--emerald); }

.stress-value, .success-value {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
}

.stress-value { color: var(--red); }
.success-value { color: var(--emerald); }

.stress-bar, .success-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.stress-fill, .success-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    will-change: width;
}

.stress-fill {
    background: linear-gradient(90deg, var(--accent), var(--red));
    animation: fillStress 1.5s 0.5s var(--transition-smooth) forwards;
}

.success-fill {
    background: linear-gradient(90deg, var(--cyan), var(--emerald));
}

.panel-after.visible .success-fill {
    animation: fillSuccess 1.2s 0.6s var(--transition-smooth) forwards;
}

@keyframes fillStress { to { width: 87%; } }
@keyframes fillSuccess { to { width: 94%; } }

.transform-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
}

.stat-item {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--border);
    transition: background 0.2s;
}

.stat-item:last-child { border-right: none; }
.stat-item:hover { background: rgba(255, 255, 255, 0.02); }

.stat-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    transition: color 0.4s var(--transition-smooth);
}

.stat-value.negative { color: var(--red); }
.stat-value.positive { color: var(--emerald); }

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

.cta-container {
    padding: 0.875rem 1.25rem 1rem;
    transition: opacity 0.4s, transform 0.4s, max-height 0.4s;
    max-height: 100px;
    overflow: hidden;
}

.hero-card.chat-mode .cta-container {
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    padding: 0 1.25rem;
    pointer-events: none;
}

.transform-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, #FF8855 100%);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.25s var(--transition-bounce), box-shadow 0.25s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.transform-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.transform-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.35);
}

.transform-cta:hover::before { opacity: 1; }
.transform-cta:active { transform: translateY(0); }

.cta-arrow { transition: transform 0.25s var(--transition-bounce); }
.transform-cta:hover .cta-arrow { transform: translateX(4px); }

.autoplay-bar {
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    width: 0%;
    transition: opacity 0.3s;
}

.hero-card.playing .autoplay-bar {
    animation: autoplayProgress 4s linear infinite;
}

.hero-card.chat-mode .autoplay-bar { opacity: 0; }

@keyframes autoplayProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* CHAT VIEW */
.chat-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(1.05) translateY(10px);
    filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.5s var(--transition-smooth), 
                transform 0.5s var(--transition-smooth),
                filter 0.5s var(--transition-smooth);
    background: rgba(18, 22, 30, 0.95);
    height: 480px;
}

.hero-card.chat-mode .chat-view {
    position: relative;
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    pointer-events: auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }

.chat-welcome {
    text-align: center;
    padding: 0.75rem 0 1.25rem;
    animation: fadeInUp 0.5s var(--transition-smooth);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-welcome-icon { font-size: 2.25rem; margin-bottom: 0.875rem; }
.chat-welcome h3 { color: var(--text-primary); font-size: 1rem; margin-bottom: 0.4rem; }
.chat-welcome p { font-size: 0.8rem; color: var(--text-muted); max-width: 300px; margin: 0 auto; line-height: 1.5; }

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 1rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-display);
    text-align: left;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    animation: fadeInUp 0.4s var(--transition-smooth) both;
}

.suggestion-btn:nth-child(1) { animation-delay: 0.1s; }
.suggestion-btn:nth-child(2) { animation-delay: 0.2s; }
.suggestion-btn:nth-child(3) { animation-delay: 0.3s; }

.suggestion-btn:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.3);
    color: var(--text-primary);
    transform: translateX(4px);
}

.suggestion-icon { font-size: 1rem; flex-shrink: 0; }

.message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: messageIn 0.35s var(--transition-smooth);
}

.message.assistant { max-width: 95%; }

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.message.assistant .message-avatar { background: linear-gradient(135deg, var(--accent), var(--violet)); }
.message.user .message-avatar { background: var(--surface-light); }

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.message.assistant .message-content {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent), #FF8855);
    color: white;
    border-top-right-radius: 4px;
}

/* Markdown in messages */
.message-content p { margin: 0 0 0.5em 0; }
.message-content p:last-child { margin-bottom: 0; }
.message-content strong { color: var(--text-primary); font-weight: 600; }
.message-content em { font-style: italic; color: var(--text-primary); }
.message-content ul, .message-content ol { margin: 0.5em 0; padding-left: 1.25em; }
.message-content li { margin: 0.25em 0; line-height: 1.4; }
.message-content li strong { color: var(--accent); }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 {
    color: var(--text-primary);
    margin: 0.75em 0 0.35em 0;
    font-weight: 600;
    line-height: 1.3;
}
.message-content h1 { font-size: 1.1em; }
.message-content h2 { font-size: 1.05em; }
.message-content h3 { font-size: 1em; }
.message-content h4 { font-size: 0.95em; color: var(--accent); }
.message-content h1:first-child, .message-content h2:first-child, .message-content h3:first-child, .message-content h4:first-child { margin-top: 0; }
.message-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--cyan);
}
.message-content pre { background: rgba(0, 0, 0, 0.3); padding: 0.75em; border-radius: 6px; overflow-x: auto; margin: 0.5em 0; }
.message-content pre code { background: none; padding: 0; }
.message-content blockquote { border-left: 3px solid var(--accent); padding-left: 0.75em; margin: 0.5em 0; color: var(--text-muted); font-style: italic; }
.message-content hr { border: none; border-top: 1px solid var(--border); margin: 0.75em 0; }
.message-content a { color: var(--cyan); text-decoration: underline; }
.message-content a:hover { color: var(--cyan-soft); }

.typing-indicator { display: flex; gap: 4px; padding: 6px 0; }
.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input-container {
    padding: 0.875rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    background: rgba(10, 14, 20, 0.5);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    padding: 8px 10px;
    outline: none;
    min-width: 0;
}

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

.chat-send-btn {
    background: linear-gradient(135deg, var(--accent), #FF8855);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s var(--transition-bounce), box-shadow 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.chat-send-btn:active:not(:disabled) { transform: scale(0.98); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.chat-powered span { color: var(--accent); }
.session-indicator { font-size: 0.5rem; color: var(--text-muted); opacity: 0.5; }

/* SECTIONS */
.section-header { text-align: center; max-width: 700px; margin: 0 auto 4rem; }
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}
.section-header p { color: var(--text-secondary); font-size: 1.1rem; margin-top: 1rem; }

/* PROFILES */
.profiles { background: linear-gradient(180deg, var(--void) 0%, var(--deep) 100%); position: relative; }
.profiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}
.profile-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.profile-card:hover::before { opacity: 1; }

.profile-card.freelance::before { background: var(--cyan); }
.profile-card.freelance .profile-icon { background: var(--cyan-glow); color: var(--cyan); }
.profile-card.freelance:hover { box-shadow: 0 20px 60px var(--cyan-glow); }

.profile-card.independant::before { background: var(--accent); }
.profile-card.independant .profile-icon { background: var(--accent-glow); color: var(--accent); }
.profile-card.independant:hover { box-shadow: 0 20px 60px var(--accent-glow); }

.profile-card.artisan::before { background: var(--emerald); }
.profile-card.artisan .profile-icon { background: var(--emerald-glow); color: var(--emerald); }
.profile-card.artisan:hover { box-shadow: 0 20px 60px var(--emerald-glow); }

.profile-card.pme::before { background: var(--violet); }
.profile-card.pme .profile-icon { background: var(--violet-glow); color: var(--violet); }
.profile-card.pme:hover { box-shadow: 0 20px 60px var(--violet-glow); }

.profile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}
.profile-card h3 { margin-bottom: 0.75rem; }
.profile-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.25rem; flex-grow: 1; }
.profile-benefits { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.profile-benefit { font-size: 0.75rem; color: var(--text-secondary); padding-left: 1rem; position: relative; }
.profile-benefit::before { content: '→'; position: absolute; left: 0; color: var(--text-muted); }
.profile-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    transition: color 0.2s;
}
.profile-cta-arrow { transition: transform 0.2s; }
.profile-card:hover .profile-cta-arrow { transform: translateX(4px); }

/* SERVICES */
.services { background: var(--deep); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.service-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}
.service-block:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}
.service-block.automation .service-icon { background: var(--accent-glow); }
.service-block.visibility .service-icon { background: var(--cyan-glow); }
.service-block.formation .service-icon { background: var(--emerald-glow); }
.service-block h3 { margin-bottom: 0.75rem; }
.service-block p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.service-features { display: flex; flex-direction: column; gap: 0.6rem; }
.service-feature { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--text-secondary); }
.service-feature-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* APPROACH */
.approach { background: linear-gradient(180deg, var(--deep) 0%, var(--void) 100%); }
.approach-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.approach-content h2 { margin-bottom: 1.5rem; }
.approach-content > p { font-size: 1.05rem; margin-bottom: 2rem; }
.approach-steps { display: flex; flex-direction: column; gap: 1.25rem; }
.approach-step { display: flex; gap: 1rem; align-items: flex-start; }
.step-number {
    width: 32px;
    height: 32px;
    background: var(--accent-glow);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}
.step-content h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.step-content p { font-size: 0.9rem; color: var(--text-muted); }
.approach-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: center;
    transition: all 0.3s;
}
.metric-card:hover { border-color: var(--border-hover); transform: scale(1.02); }
.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.metric-label { font-size: 0.85rem; color: var(--text-muted); }

/* LOCAL */
.local { background: var(--void); text-align: center; }
.local h2 { margin-bottom: 1rem; }
.local-badges { display: flex; justify-content: center; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.local-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s;
}
.local-badge:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.local-badge-icon { font-size: 1.5rem; }
.local-badge span { font-size: 0.9rem; color: var(--text-primary); }

/* ZDR */
.zdr-section { background: linear-gradient(180deg, var(--void) 0%, var(--deep) 50%, var(--void) 100%); }
.zdr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.zdr-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}
.zdr-card:hover { border-color: rgba(16, 185, 129, 0.3); transform: translateY(-4px); }
.zdr-icon { font-size: 2.5rem; margin-bottom: 1.25rem; }
.zdr-card h3 { margin-bottom: 0.75rem; }
.zdr-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.zdr-highlight {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--emerald-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--emerald);
    letter-spacing: 0.1em;
}
.zdr-highlight-dot { width: 8px; height: 8px; background: var(--emerald); border-radius: 50%; animation: blink 2s infinite; }

/* CTA SECTION */
.cta-section { background: var(--deep); text-align: center; padding: 6rem 0; }
.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { max-width: 500px; margin: 0 auto 2rem; font-size: 1.05rem; }

/* FOOTER */
footer { background: var(--void); border-top: 1px solid var(--border); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); margin-top: 1rem; max-width: 280px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 1.25rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 1100px) { .profiles-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 900px) {
    .hero-grid, .approach-layout { grid-template-columns: 1fr; gap: 3rem; }
    .services-grid, .zdr-grid { grid-template-columns: 1fr; }
    .approach-metrics { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding-top: 6rem; text-align: center; }
    .hero-subtitle { margin: 0 auto 2rem; }
    .hero-buttons { justify-content: center; }
    .profiles-grid { grid-template-columns: 1fr; }
    .approach-metrics { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .local-badges { flex-direction: column; align-items: center; gap: 1.5rem; }
    
    .hero-card { border-radius: 16px; }
    .card-header { padding: 0.875rem 1rem; min-height: 54px; }
    .card-title { font-size: 0.6rem; }
    .toggle-btn { padding: 4px 8px; font-size: 0.55rem; }
    .split-container { height: 300px; }
    .panel-before, .panel-after { padding: 1rem; }
    .chaos-grid, .flow-grid { gap: 5px; }
    .chaos-item, .flow-item { padding: 7px 9px; gap: 8px; }
    .chaos-icon, .flow-icon { font-size: 0.9rem; }
    .chaos-title, .flow-title { font-size: 0.7rem; }
    .chaos-desc, .flow-desc { font-size: 0.6rem; }
    .chaos-badge, .flow-badge { font-size: 0.5rem; padding: 2px 5px; }
    .stat-value { font-size: 0.9rem; }
    .stat-label { font-size: 0.55rem; }
    .transform-cta { padding: 11px 16px; font-size: 0.8rem; }
    .chat-view { height: 440px; }
    .chat-messages { padding: 1rem; }
    .chat-welcome-icon { font-size: 2rem; }
    .chat-welcome h3 { font-size: 0.95rem; }
    .chat-welcome p { font-size: 0.75rem; }
    .suggestion-btn { padding: 9px 11px; font-size: 0.75rem; }
    .message-content { padding: 9px 12px; font-size: 0.8rem; }
    .chat-input { font-size: 0.8rem; padding: 7px 9px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    
    .hero-card { border-radius: 14px; }
    .card-header { padding: 0.75rem; min-height: 48px; }
    .card-title { font-size: 0.55rem; letter-spacing: 0.08em; }
    .toggle-btn { padding: 4px 7px; font-size: 0.5rem; }
    .back-btn { padding: 5px 10px; font-size: 0.6rem; }
    .split-container { height: 280px; }
    .panel-before, .panel-after { padding: 0.875rem; }
    .panel-label { font-size: 0.55rem; padding: 4px 8px; margin-bottom: 0.75rem; }
    .chaos-grid, .flow-grid { gap: 4px; }
    .chaos-item, .flow-item { padding: 6px 8px; gap: 7px; border-radius: 6px; }
    .chaos-icon, .flow-icon { font-size: 0.85rem; }
    .chaos-title, .flow-title { font-size: 0.65rem; }
    .chaos-desc, .flow-desc { font-size: 0.55rem; }
    .chaos-badge, .flow-badge { font-size: 0.48rem; padding: 2px 4px; }
    .stress-meter, .success-meter { padding: 6px 8px; margin-top: 0.5rem; }
    .stress-label, .success-label { font-size: 0.5rem; }
    .stress-value, .success-value { font-size: 0.55rem; }
    .stat-item { padding: 0.6rem 0.25rem; }
    .stat-value { font-size: 0.85rem; }
    .stat-label { font-size: 0.5rem; }
    .cta-container { padding: 0.75rem 1rem 0.875rem; }
    .transform-cta { padding: 10px 14px; font-size: 0.75rem; border-radius: 8px; }
    .chat-view { height: 400px; }
    .chat-messages { padding: 0.875rem; gap: 0.75rem; }
    .chat-welcome { padding: 0.5rem 0 1rem; }
    .chat-welcome-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
    .chat-welcome h3 { font-size: 0.9rem; }
    .chat-welcome p { font-size: 0.7rem; max-width: 260px; }
    .chat-suggestions { gap: 5px; margin-top: 0.875rem; }
    .suggestion-btn { padding: 8px 10px; font-size: 0.7rem; gap: 8px; border-radius: 8px; }
    .suggestion-icon { font-size: 0.9rem; }
    .message { max-width: 92%; gap: 8px; }
    .message-avatar { width: 26px; height: 26px; font-size: 0.75rem; }
    .message-content { padding: 8px 10px; font-size: 0.75rem; border-radius: 10px; }
    .chat-input-container { padding: 0.75rem 1rem 1rem; }
    .chat-input-wrapper { padding: 4px; border-radius: 10px; }
    .chat-input { font-size: 0.75rem; padding: 6px 8px; }
    .chat-send-btn { padding: 7px 12px; font-size: 0.85rem; border-radius: 6px; }
    .chat-powered { font-size: 0.5rem; margin-top: 6px; }
}

@media (max-width: 360px) {
    .chaos-desc, .flow-desc { display: none; }
    .split-container { height: 240px; }
    .chat-view { height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
