/* ============================================================
   ALVIN RIVELINO — PORTFOLIO CSS
   ============================================================ */

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

:root {
    --bg: #07080f;
    --surface: #0f1117;
    --surface2: #161922;
    --border: rgba(255,255,255,0.07);
    --accent: #6366f1;
    --accent2: #8b5cf6;
    --green: #10b981;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 72px;
    --glow-accent: rgba(99,102,241,0.4);
    --glow-green: rgba(16,185,129,0.3);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1,h2,h3,h4,h5 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--green) 60%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── LAYOUT ── */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: 100px 0; }
.section-dark { background: var(--surface); }

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--text);
}

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 24px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.5); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 100px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn-outline:hover { border-color: var(--accent); background: rgba(99,102,241,0.08); transform: translateY(-2px); }

.btn-large { padding: 16px 36px; font-size: 1rem; }

/* ── ANIMATIONS ── */
.fade-in { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── NAV ── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-h);
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
    background: rgba(7,8,15,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.04em;
    margin-right: auto;
}
.dot { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}
.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); }

.nav-cta {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.35);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.nav-cta:hover { background: var(--accent); color: #fff; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(7,8,15,0.97);
    backdrop-filter: blur(16px);
    z-index: 999;
    transform: translateY(-110%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    border-bottom: 1px solid var(--border);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu ul { list-style: none; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.mobile-menu a {
    display: block;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}
.mobile-menu a:hover { background: rgba(99,102,241,0.1); color: var(--accent); }

/* ── HERO ── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: var(--nav-h);
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 30%, transparent 100%);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.glow-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    top: -100px; left: -150px;
}
.glow-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
    bottom: 0; right: -100px;
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding: 80px 24px 120px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--green);
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 28px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-family: 'Space Grotesk', sans-serif;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
}
.plus { color: var(--accent); font-size: 1.4rem; }

.stat-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 48px;
    background: var(--border);
}

.scroll-down {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-dim);
    animation: bounce 2s ease-in-out infinite;
    text-decoration: none;
    transition: color 0.2s;
}
.scroll-down:hover { color: var(--accent); }
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ── AI BANNER ── */
.ai-banner {
    background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(16,185,129,0.08) 100%);
    border-top: 1px solid rgba(99,102,241,0.2);
    border-bottom: 1px solid rgba(16,185,129,0.15);
    padding: 48px 0;
}

.ai-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}

.ai-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(16,185,129,0.2));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.ai-banner-content { flex: 1; min-width: 240px; }
.ai-banner-content h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 8px;
}
.ai-banner-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }

.ai-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}
.ai-tags span {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── ABOUT ── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.75;
    font-size: 1rem;
}
.about-text p strong { color: var(--text); }
.about-text .btn-primary { margin-top: 8px; }

.about-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.card-ai .card-icon { background: rgba(99,102,241,0.12); color: var(--accent); border: 1px solid rgba(99,102,241,0.2); }
.card-ai:hover { border-color: rgba(99,102,241,0.4); }
.card-eng .card-icon { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.card-eng:hover { border-color: rgba(16,185,129,0.4); }
.card-lead .card-icon { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.card-lead:hover { border-color: rgba(245,158,11,0.35); }
.card-mobile .card-icon { background: rgba(236,72,153,0.1); color: #ec4899; border: 1px solid rgba(236,72,153,0.2); }
.card-mobile:hover { border-color: rgba(236,72,153,0.35); }

.about-card h4 { font-size: 0.95rem; color: var(--text); margin-bottom: 6px; }
.about-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; }

/* ── SKILLS ── */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.skill-category {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.25s;
}
.skill-category:hover { border-color: rgba(99,102,241,0.3); }

.skill-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--accent);
}
.skill-cat-header h3 { font-size: 1rem; color: var(--text); font-weight: 600; }

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.skill-tags span {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 13px;
    border-radius: 100px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.skill-tags span:hover {
    background: rgba(99,102,241,0.12);
    color: var(--accent);
    border-color: rgba(99,102,241,0.3);
}

/* ── TIMELINE ── */
.timeline {
    position: relative;
    padding-left: 32px;
    max-width: 860px;
    margin: 0 auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), rgba(99,102,241,0.1));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-bottom: 48px;
    padding-left: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid rgba(99,102,241,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: border-color 0.25s;
}
.timeline-item.featured .timeline-marker {
    border-color: var(--accent);
    background: rgba(99,102,241,0.12);
    box-shadow: 0 0 20px rgba(99,102,241,0.3);
}

.marker-inner { display: flex; align-items: center; justify-content: center; }

.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.timeline-item.featured .timeline-content {
    border-color: rgba(99,102,241,0.25);
    box-shadow: 0 0 40px rgba(99,102,241,0.08);
}
.timeline-content:hover {
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.timeline-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--green);
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 100px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.timeline-content h3 { font-size: 1.3rem; color: var(--text); margin-bottom: 4px; }
.timeline-company { font-size: 0.88rem; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.timeline-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }

.timeline-highlights {
    list-style: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timeline-highlights li {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}
.timeline-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.timeline-tech span {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
}

/* ── PROJECTS ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
}

.project-featured {
    grid-column: span 3;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(16,185,129,0.05) 100%);
    border-color: rgba(99,102,241,0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 20px;
    align-items: start;
}

.project-featured .project-label { grid-column: 1 / -1; }
.project-featured h3 { font-size: 1.6rem; }
.project-featured .project-highlights { display: flex; flex-direction: column; gap: 10px; grid-row: 3 / 4; }

.project-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.project-card h3 { font-size: 1.1rem; color: var(--text); }
.project-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.highlight-item svg { color: var(--green); flex-shrink: 0; margin-top: 2px; }

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}
.project-tech span {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 100px;
}

/* ── PARTNERS ── */
.partners-section { padding: 72px 0; }

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.partner-badge {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius);
    letter-spacing: 0.04em;
    transition: border-color 0.25s, color 0.25s, transform 0.25s;
}
.partner-badge:hover {
    border-color: rgba(99,102,241,0.4);
    color: var(--text);
    transform: translateY(-2px);
}

/* ── CONTACT ── */
.contact-section { position: relative; overflow: hidden; }

.contact-inner {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
}

.contact-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.contact-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 40px;
}

.contact-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 28px;
}

.contact-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.contact-note svg { flex-shrink: 0; }

/* ── FOOTER ── */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

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

.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.04em;
}

.footer-copy { font-size: 0.82rem; color: var(--text-dim); }

.footer-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
.footer-link:hover { opacity: 0.75; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .project-featured {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section { padding: 72px 0; }
    .nav-links, .nav-cta { display: none; }
    .nav-toggle { display: flex; }

    .hero-inner { padding: 48px 24px 100px; }
    .hero-title { font-size: clamp(2.5rem, 10vw, 4rem); }

    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-cards { grid-template-columns: 1fr 1fr; }

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

    .timeline { padding-left: 20px; }
    .timeline-item { padding-left: 36px; }
    .timeline-marker { left: -16px; width: 32px; height: 32px; }

    .projects-grid { grid-template-columns: 1fr; }
    .project-featured { grid-column: 1; grid-template-columns: 1fr; }

    .hero-stats { gap: 24px; }
    .stat-divider { display: none; }

    .ai-banner-inner { flex-direction: column; }
    .ai-tags { flex-direction: row; }
}

@media (max-width: 480px) {
    .about-cards { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .contact-actions { flex-direction: column; align-items: center; }
    .footer-inner { flex-direction: column; text-align: center; }
}
