/* --- Hard-E v3.0 — "Digital Genesis" Theme --- */

:root {
    --primary-color: #4CAF50;
    --primary-glow: rgba(76, 175, 80, 0.4);
    --secondary-color: #00aaff;
    --secondary-glow: rgba(0, 170, 255, 0.3);
    --background-dark: #0a0f19;
    --background-card: rgba(22, 29, 47, 0.5);
    --text-light: #e0e5f0;
    --text-headline: #ffffff;
    --text-muted: #8892b0;
    --border-color: rgba(0, 170, 255, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.7;
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* --- UTILITY --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.text-center { text-align: center; }
.section { padding: 100px 0; }
.section-alt { background-color: #101623; }

.section-title {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-headline);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 3rem auto;
}

/* --- BUTTONS --- */
.button {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.button-primary {
    background-color: var(--primary-color);
    color: var(--text-headline);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.button-secondary {
    background-color: transparent;
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.3);
}

.button-secondary:hover {
    background-color: var(--text-light);
    color: var(--background-dark);
}

/* --- HEADER --- */
.header {
    background-color: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-headline);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-mark {
    color: var(--primary-color);
    font-weight: 400;
    opacity: 0.7;
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
}

.nav a:not(.nav-button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav a:not(.nav-button):hover::after { width: 100%; }
.nav-button { padding: 8px 20px; border-width: 1px; }

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}

.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: 0.3s;
}

/* --- HERO --- */
.hero {
    position: relative;
    padding: 160px 0 100px 0;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: var(--text-headline);
}

.hero .subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    color: var(--text-muted);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* (unused legacy styles removed) */

/* --- FEATURES --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 3rem;
}

.feature-card {
    background-color: var(--background-card);
    padding: 32px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.feature-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    background: rgba(0, 170, 255, 0.1);
    color: var(--secondary-color);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    margin-top: 0;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.93rem;
    margin-bottom: 0;
}

/* (steps section unused) */

.step h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.step p {
    color: var(--text-muted);
    font-size: 0.93rem;
}

/* --- STACK --- */
.stack-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stack-badge {
    padding: 8px 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.stack-note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stack-note a {
    color: var(--primary-color);
    text-decoration: none;
}

.stack-note a:hover { text-decoration: underline; }

/* --- DEMO SECTION --- */
.demo-container {
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(16, 22, 35, 0.8);
    backdrop-filter: blur(8px);
}

.demo-gate {
    padding: 48px 32px;
    text-align: center;
}

.demo-gate-icon {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.demo-gate h3 {
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-headline);
}

.demo-gate p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.demo-email-form {
    display: flex;
    gap: 10px;
    max-width: 460px;
    margin: 0 auto;
}

.demo-email-form input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--background-dark);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.demo-email-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.demo-note {
    display: block;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- DEMO CHAT --- */
.demo-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(10, 15, 25, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.demo-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-light);
}

.demo-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 6px var(--primary-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.demo-msg-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.demo-chat-messages {
    height: 380px;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease-out;
}

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

.demo-msg.user {
    align-self: flex-end;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.demo-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-msg-sender {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.demo-msg.user .demo-msg-sender { color: var(--primary-color); }

.demo-msg-text {
    font-size: 0.93rem;
    line-height: 1.5;
    color: var(--text-light);
}

.demo-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 15, 25, 0.6);
}

.demo-chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--background-dark);
    color: var(--text-light);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.demo-chat-input-area input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.demo-send-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.demo-chat-limit {
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(76, 175, 80, 0.04);
}

.demo-chat-limit p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.demo-msg.bot.typing .demo-msg-text::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--secondary-color);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink-cursor 0.8s step-end infinite;
}

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

/* --- FOOTER --- */
.footer {
    background-color: #060910;
    color: var(--text-muted);
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.footer p { margin: 0.5rem 0; }
.footer a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
}
.footer a:hover { text-decoration: underline; }

/* --- ANIMATIONS --- */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card.animate-in:nth-child(2) { transition-delay: 0.1s; }
.feature-card.animate-in:nth-child(3) { transition-delay: 0.15s; }
.feature-card.animate-in:nth-child(4) { transition-delay: 0.2s; }
.feature-card.animate-in:nth-child(5) { transition-delay: 0.25s; }
.feature-card.animate-in:nth-child(6) { transition-delay: 0.3s; }

.step.animate-in:nth-child(2) { transition-delay: 0.15s; }
.step.animate-in:nth-child(3) { transition-delay: 0.3s; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .section-title { font-size: 2.4rem; }
    .hero-title { font-size: 3rem; }
    /* responsive tweaks */
}

@media (max-width: 768px) {
    .section { padding: 70px 0; }
    .section-title { font-size: 2rem; }
    .hero-title { font-size: 2.4rem; }
    .hero { padding: 140px 0 80px; min-height: auto; }

    .nav { display: none; }
    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 15, 25, 0.95);
        backdrop-filter: blur(12px);
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        gap: 16px;
    }

    .mobile-nav-toggle { display: flex; }

    .cta-buttons { flex-direction: column; align-items: center; }
    /* mobile adjustments */

    .demo-email-form { flex-direction: column; }
    .demo-chat-messages { height: 300px; }

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

@media (max-width: 400px) {
    .hero-title { font-size: 1.9rem; }
    .demo-container { border-radius: 12px; }
}
