/* BASE STYLES & LAYOUT */
/* tokens.css loaded via <link> in HTML — no @import needed */

/* ACCESSIBILITY UTILITIES */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 10000;
    padding: var(--space-2) var(--space-4);
    background: var(--accent-primary);
    color: #fff;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: top 0.15s;
}

.skip-link:focus {
    top: var(--space-2);
}

/* FOCUS STYLES */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--surface-bg);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-primary-hover);
}

/* LAYOUT UTILITIES */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-16) 0;
}

.grid {
    display: grid;
    gap: var(--space-8);
}

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

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* COMPONENTS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: var(--font-medium);
    font-size: var(--text-base);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* NAVIGATION */
.navbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-default);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
}

.nav-links {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.logo {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

/* HERO (Chatbot Fail) */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 10;
    max-width: 800px;
}

.chat-interface {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    width: 100%;
    height: 100%;
    opacity: 0.1;
    /* Fade into background */
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to bottom, transparent 0%, var(--surface-bg) 80%),
        repeating-linear-gradient(45deg, #1e293b 0, #1e293b 10px, transparent 10px, transparent 20px);
}

.typing-animation {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    margin-bottom: var(--space-6);
    font-size: var(--text-lg);
    min-height: 1.5em;
    display: inline-block;
}

.typing-animation::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: var(--accent-primary);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* CARDS */
.card {
    background: var(--surface-panel);
    border: 1px solid var(--border-default);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-focus);
}

.card h3 {
    margin-bottom: var(--space-2);
}

/* FOOTER */
.footer {
    border-top: 1px solid var(--border-default);
    padding: var(--space-12) 0;
    margin-top: var(--space-20);
    text-align: center;
    color: var(--text-muted);
}

/* TEXT UTILITIES */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* MOBILE HAMBURGER */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* RESPONSIVE */
@media (max-width: 768px) {
    h1 {
        font-size: var(--text-3xl);
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--surface-bg);
        flex-direction: column;
        padding: var(--space-6) var(--space-4);
        gap: var(--space-4);
        border-bottom: 1px solid var(--border-default);
        z-index: 100;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .btn-primary {
        text-align: center;
    }
}
