/* ═══════════════════════════════════════════════════════════════════
   i.ar — Inteligencia Avanzada Randazzo
   Static landing page
   Aesthetic: dark terminal / matrix vibes
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0e0a;
    --bg-alt: #0d130d;
    --bg-card: #0f1a0f;
    --green: #00ff41;
    --green-dim: #008f24;
    --green-bright: #39ff14;
    --green-glow: rgba(0, 255, 65, 0.4);
    --green-faint: rgba(0, 255, 65, 0.08);
    --text: #c8d8c8;
    --text-dim: #6a7a6a;
    --text-bright: #e0f0e0;
    --border: rgba(0, 255, 65, 0.2);
    --border-bright: rgba(0, 255, 65, 0.5);
    --red: #ff0040;
    --yellow: #ffd700;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    --max-width: 960px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ── Matrix Rain Canvas ────────────────────────────────────── */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
}

/* ── CRT Scanlines ─────────────────────────────────────────── */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ── Boot Overlay ──────────────────────────────────────────── */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.8s ease-out;
}

#boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#boot-text {
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 14px;
    white-space: pre;
    text-shadow: 0 0 8px var(--green-glow);
    max-width: 90%;
    overflow: hidden;
    text-align: left;
    padding: 0 20px;
}

/* ── Navigation ────────────────────────────────────────────── */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(10, 14, 10, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-brand {
    color: var(--green);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 10px var(--green-glow);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s, text-shadow 0.2s;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--green);
    text-shadow: 0 0 8px var(--green-glow);
}

.nav-source {
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 2px;
}

.nav-source:hover {
    border-color: var(--border-bright);
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    position: relative;
    z-index: 2;
    padding: 100px 0;
}

/* ── Section Titles ────────────────────────────────────────── */
.section-title {
    font-size: 28px;
    color: var(--green);
    margin-bottom: 48px;
    text-shadow: 0 0 12px var(--green-glow);
    letter-spacing: 1px;
}

.section-prompt {
    color: var(--green-bright);
    margin-right: 8px;
}

/* ── Hero ──────────────────────────────────────────────────── */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    padding-top: 60px;
}

.hero-content {
    max-width: 800px;
    padding: 0 24px;
}

.hero-prompt {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.3s forwards;
}

.prompt-symbol {
    color: var(--green);
}

.hero-content h1 {
    font-size: clamp(48px, 10vw, 96px);
    color: var(--green);
    text-shadow: 
        0 0 20px var(--green-glow),
        0 0 40px var(--green-glow);
    letter-spacing: 4px;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.6s forwards;
}

.typewriter {
    font-size: 17px;
    color: var(--text);
    min-height: 84px;
    margin-bottom: 32px;
    letter-spacing: 0.5px;
    white-space: pre-line;
}

.typewriter::after {
    content: '_';
    color: var(--green);
    animation: blink 1s steps(1) infinite;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    animation: fadeIn 0.5s ease 2s forwards;
}

.badge {
    border: 1px solid var(--border);
    padding: 4px 14px;
    font-size: 12px;
    color: var(--green-dim);
    border-radius: 2px;
    background: var(--green-faint);
    letter-spacing: 0.5px;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-dim);
    font-size: 11px;
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s ease 3s forwards;
}

.arrow-down {
    font-size: 16px;
    margin-top: 4px;
    animation: bounce 2s infinite;
}

/* ── Glitch Effect ─────────────────────────────────────────── */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: var(--red);
    z-index: -1;
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    color: var(--green-bright);
    z-index: -2;
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

.glitch-small {
    color: var(--green);
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 8px var(--green-glow);
}

/* ── Terminal Window ───────────────────────────────────────── */
.terminal-window {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(0, 255, 65, 0.08),
        0 4px 20px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    margin-left: 12px;
    color: var(--text-dim);
    font-size: 12px;
}

.terminal-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.8;
}

.terminal-body p {
    margin-bottom: 12px;
}

.cmd-prompt {
    color: var(--green);
    margin-right: 8px;
}

.terminal-output {
    color: var(--text);
    padding-left: 20px;
    border-left: 2px solid var(--border);
    margin-bottom: 16px;
}

/* ── Architecture Diagram ──────────────────────────────────── */
.arch-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.arch-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.arch-box {
    width: 100%;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.arch-box:hover {
    border-color: var(--border-bright);
    box-shadow: 0 0 20px var(--green-glow);
    transform: translateX(4px);
}

.arch-label {
    display: block;
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-shadow: 0 0 6px var(--green-glow);
}

.arch-desc {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
}

.arch-arrow {
    color: var(--green-dim);
    font-size: 20px;
    padding: 8px 0;
    animation: pulse-arrow 2s infinite;
}

/* ── Features Grid ─────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--green);
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover {
    border-color: var(--border-bright);
    box-shadow: 0 0 20px var(--green-glow);
    transform: translateY(-2px);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    color: var(--green);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 0 6px var(--green-glow);
}

.feature-card h3 {
    color: var(--text-bright);
    font-size: 15px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
}

/* ── Philosophy Quotes ─────────────────────────────────────── */
.quotes {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.quote {
    padding: 0;
    border: none;
    position: relative;
    padding-left: 32px;
}

.quote::before {
    content: '>';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--green);
    font-size: 24px;
    text-shadow: 0 0 8px var(--green-glow);
}

.quote p {
    color: var(--text-bright);
    font-size: 20px;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

/* ── Tech Stack ────────────────────────────────────────────── */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.stack-item {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.stack-item:hover {
    border-color: var(--border-bright);
    background: rgba(0, 255, 65, 0.05);
}

.stack-name {
    color: var(--green);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 0 6px var(--green-glow);
}

.stack-desc {
    color: var(--text-dim);
    font-size: 12px;
}

/* ── Footer ────────────────────────────────────────────────── */
#footer {
    border-top: 1px solid var(--border);
    padding: 48px 0;
    position: relative;
    z-index: 2;
    background: rgba(10, 14, 10, 0.9);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    color: var(--green);
}

.footer-meta {
    text-align: center;
    flex: 1;
}

.footer-meta p {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 4px;
}

.footer-meta a {
    color: var(--green-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-meta a:hover {
    color: var(--green);
    text-shadow: 0 0 6px var(--green-glow);
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--green);
}

/* ── Reveal Animation ──────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
    to { opacity: 1; }
}

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

.cursor-blink {
    animation: blink 1s steps(1) infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 0); }
    20% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(-1px, 0); }
    60% { clip-path: inset(10% 0 80% 0); transform: translate(1px, 0); }
    80% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 0); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(2px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
    20% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 0); }
    40% { clip-path: inset(50% 0 30% 0); transform: translate(1px, 0); }
    60% { clip-path: inset(90% 0 5% 0); transform: translate(-1px, 0); }
    80% { clip-path: inset(30% 0 70% 0); transform: translate(2px, 0); }
    100% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    #nav {
        padding: 12px 16px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 11px;
    }

    .nav-brand {
        font-size: 15px;
    }

    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 22px;
    }

    .terminal-body {
        padding: 16px;
        font-size: 13px;
    }

    .terminal-output {
        padding-left: 12px;
    }

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

    .arch-box {
        padding: 16px;
    }

    .arch-label {
        font-size: 12px;
    }

    .arch-desc {
        font-size: 11px;
    }

    .quote p {
        font-size: 16px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .hero-content h1 {
        font-size: 42px;
        letter-spacing: 2px;
    }

    .typewriter {
        font-size: 14px;
    }

    .hero-badges {
        gap: 8px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

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

    #matrix {
        display: none;
    }

    .scanlines {
        display: none;
    }
}