/* ===================================================================
   Portfólio — Leonardo Braz
   Tema: Dark + gradientes roxo/azul + glassmorphism (estilo Apple)
   =================================================================== */

:root {
    --bg: #0a0a14;
    --bg-2: #0f0f1f;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.10);
    --text: #eef0f6;
    --text-dim: #a6a8bd;
    --text-faint: #6c6f86;

    --violet: #8b5cf6;
    --indigo: #6366f1;
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3b82f6 100%);
    --grad-soft: linear-gradient(135deg, rgba(139,92,246,.18), rgba(59,130,246,.10));

    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --blur: saturate(180%) blur(20px);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- Fundo animado (orbs) --- */
.bg-orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(1200px 700px at 80% -10%, rgba(99,102,241,.18), transparent 60%), radial-gradient(900px 600px at 0% 100%, rgba(139,92,246,.14), transparent 55%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: float 18s ease-in-out infinite; }
.orb-1 { width: 480px; height: 480px; background: #6366f1; top: -120px; right: -80px; }
.orb-2 { width: 420px; height: 420px; background: #8b5cf6; bottom: -150px; left: -100px; animation-delay: -6s; }
.orb-3 { width: 360px; height: 360px; background: #3b82f6; top: 40%; left: 55%; animation-delay: -11s; opacity: .35; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-40px) scale(1.08); } }

/* --- Glass helper --- */
.glass {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* --- Navbar --- */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10,10,20,.55);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--surface-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 16px rgba(139,92,246,.8); }
.brand i { font-size: 1.45rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-dim); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { padding: 8px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--surface-border); color: var(--text) !important; }
.nav-cta:hover { border-color: var(--violet); }

/* --- Botões --- */
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.btn-sm { padding: 9px 18px; font-size: .88rem; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px rgba(99,102,241,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(99,102,241,.5); }
.btn-ghost { background: var(--surface); border-color: var(--surface-border); color: var(--text); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--violet); }

/* --- Hero --- */
.hero { padding: clamp(70px, 14vw, 150px) 0 80px; }
.hero-inner { text-align: center; }
.hero-eyebrow { color: var(--text-dim); font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; }
.hero-title { font-size: clamp(2.8rem, 8vw, 5.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; background: linear-gradient(120deg,#fff 30%, #b9b3ff 70%, #7dd3fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-role { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 700; margin-top: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--text-dim); font-size: 1.1rem; margin-top: 12px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero-stats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 56px; }
.stat { padding: 18px 26px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--surface-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); min-width: 150px; }
.stat strong { display: block; font-size: 1.15rem; font-weight: 800; }
.stat span { color: var(--text-faint); font-size: .82rem; }

/* --- Seções --- */
.section { padding: 80px 0; }
.section-alt { }
.section-head { text-align: center; margin-bottom: 42px; }
.section-title { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; }
.section-desc { color: var(--text-dim); margin-top: 10px; max-width: 620px; margin-inline: auto; }

/* --- Filtros --- */
.filters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 38px; }
.filter-btn { padding: 9px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--surface-border); color: var(--text-dim); font-weight: 600; font-size: .9rem; cursor: pointer; transition: all .2s; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 24px rgba(99,102,241,.35); }

/* --- Grid de projetos --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--surface-border);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border-radius: var(--radius); overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(139,92,246,.5); }
.card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--grad-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.4rem; color: rgba(255,255,255,.35); background: var(--grad-soft); }
.card-cat { position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: rgba(10,10,20,.6); border: 1px solid var(--surface-border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-shots { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(10,10,20,.6); border: 1px solid var(--surface-border); display: inline-flex; gap: 5px; align-items: center; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { font-size: 1.18rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title i { color: var(--violet); }
.card-tagline { color: var(--text-dim); font-size: .92rem; flex: 1; }
.card-tech { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25); color: #cbb9ff; }
.tag-more { background: var(--surface); color: var(--text-faint); border-color: var(--surface-border); }
.card-link { margin-top: 6px; font-weight: 600; font-size: .9rem; color: var(--cyan); display: inline-flex; align-items: center; gap: 7px; transition: gap .2s; }
.card:hover .card-link { gap: 12px; }
.card-featured { border-color: rgba(139,92,246,.35); }

/* --- Sobre --- */
.about { padding: 48px; }
.about p { color: var(--text-dim); margin-top: 14px; font-size: 1.05rem; }
.about strong { color: var(--text); }
.skills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }

/* --- Contato --- */
.contact { padding: 56px 40px; text-align: center; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--surface-border); padding: 30px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--text-faint); font-size: .9rem; }
.footer-links { display: flex; gap: 16px; font-size: 1.3rem; }
.footer-links a { color: var(--text-dim); transition: color .2s; }
.footer-links a:hover { color: var(--violet); }

/* ===================================================================
   Página de projeto
   =================================================================== */
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-weight: 600; margin-bottom: 26px; transition: color .2s; }
.back-link:hover { color: var(--text); }

.detail-head { display: flex; gap: 24px; align-items: center; padding: 32px; margin-bottom: 26px; }
.detail-icon { flex-shrink: 0; width: 76px; height: 76px; border-radius: 18px; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 2.1rem; color: #fff; box-shadow: 0 12px 30px rgba(99,102,241,.4); }
.detail-head-text h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; margin: 8px 0; }
.detail-tagline { color: var(--text-dim); font-size: 1.05rem; }
.detail-actions { display: flex; gap: 12px; margin-top: 16px; }

.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.detail-main { padding: 36px; }
.detail-main h2 { font-size: 1.4rem; font-weight: 700; margin: 28px 0 14px; }
.detail-main h2:first-child { margin-top: 0; }
.detail-main p { color: var(--text-dim); margin-bottom: 12px; }
.detail-summary { font-size: 1.1rem; color: var(--text) !important; }

.detail-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
.side-block { padding: 24px; }
.side-block h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }
.highlights { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.highlights li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-dim); font-size: .95rem; }
.highlights i { color: var(--cyan); margin-top: 3px; }

/* --- Galeria --- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery-item { border: 1px solid var(--surface-border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--grad-soft); aspect-ratio: 16/10; padding: 0; transition: transform .25s, border-color .25s; }
.gallery-item:hover { transform: scale(1.03); border-color: var(--violet); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--surface-border); border-radius: var(--radius-sm); color: var(--text-faint); }
.gallery-empty i { font-size: 2.4rem; opacity: .5; }
.gallery-empty p { margin: 10px 0; }
.gallery-empty code { background: rgba(139,92,246,.12); padding: 5px 12px; border-radius: 8px; color: #cbb9ff; font-size: .85rem; }

/* --- Lightbox --- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,12,.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 40px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.lightbox-close, .lightbox-nav { position: absolute; background: var(--surface); border: 1px solid var(--surface-border); color: #fff; width: 50px; height: 50px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: background .2s; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(139,92,246,.4); }
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* --- 404 --- */
.error-page { min-height: 60vh; display: flex; align-items: center; }
.error-box { text-align: center; padding: 60px 40px; width: 100%; }
.error-box h1 { font-size: 5rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.error-box p { color: var(--text-dim); margin: 12px 0 24px; }

/* --- Animação de entrada --- */
.card, .glass, .stat { animation: rise .6s ease backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Responsivo --- */
@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .nav-links a:not(.nav-cta) { display: none; }
    .about, .detail-main, .detail-head { padding: 26px; }
    .detail-head { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .project-grid { grid-template-columns: 1fr; }
    .hero-stats { flex-direction: column; align-items: center; }
}
