/* ============================================================
   PROJETOS.CSS — CoudFy Portfolio Showcase
   Paleta: Preto & Branco (inspirado na Barbearia)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg      : #080808;
    --s1      : #0a0a0a;
    --s2      : #0f0f0f;
    --s3      : #161616;
    --b1      : #1a1a1a;
    --b2      : #222;
    --b3      : #2e2e2e;
    --text    : #f0f0f0;
    --text2   : #aaa;
    --text3   : #555;

    --white   : #ffffff;
    --offwhite: #e8e8e8;
    --border  : rgba(255,255,255,.07);
    --bordmd  : rgba(255,255,255,.14);
    --bordstr : rgba(255,255,255,.26);

    --orange  : #ff6b35;
    --orl     : #ff8a5b;

    --sw      : 300px;
    --font    : 'Outfit', sans-serif;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ══ LOADING (original CoudFy) ════════════════════════════ */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: #000;
    display: flex; align-items: center; justify-content: center;
}
.logo-container { position: relative; z-index: 1; }
.loading-logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.loading-particle {
    position: absolute; border-radius: 50%;
    background: rgba(59,130,246,.6);
    animation: particle-float 3s ease-in-out infinite;
}
@keyframes particle-float {
    0%,100%{opacity:0;transform:translateY(0)}
    50%{opacity:1;transform:translateY(-20px)}
}

/* ══ CANVAS FULL SCREEN ════════════════════════════════════ */
.full-canvas {
    position: fixed; inset: 0;
    background: var(--bg);
    z-index: 1;
}
#sc {
    width: 100%; height: 100%;
    transition: opacity .22s ease, transform .22s ease;
}
#sc.sw { opacity: 0; transform: translateY(8px); }

/* ══ WELCOME SCREEN ════════════════════════════════════════ */
.welcome-sc {
    width: 100%; height: 100%; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 35% 45%, #111 0%, #060606 100%);
}
.welcome-bg-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 80px 80px;
}
.welcome-thumbs {
    position: absolute; inset: 0;
    display: grid; grid-template-columns: repeat(4,1fr); grid-template-rows: repeat(2,1fr);
    gap: 2px; opacity: .06; pointer-events: none;
    filter: blur(1px) saturate(0);
}
.welcome-thumbs img { width:100%; height:100%; object-fit:cover; display:block; }
.welcome-thumbs div { background: var(--b1); }
.welcome-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    align-items: center; gap: 14px; text-align: center; padding: 40px;
}
.welcome-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: rgba(255,255,255,.05); border: 1px solid var(--bordmd);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--offwhite); margin-bottom: 6px;
}
.welcome-content h2 {
    font-size: 24px; font-weight: 700; color: var(--offwhite); letter-spacing: -.3px;
}
.welcome-content p {
    font-size: 14px; color: var(--text3); max-width: 300px; line-height: 1.7;
}
.welcome-content strong { color: var(--text2); }
.welcome-hint {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
    padding: 7px 18px;
    background: rgba(255,255,255,.04); border: 1px solid var(--bordmd);
    border-radius: 50px; font-size: 11px; font-weight: 600; color: var(--text2);
    animation: hint-pulse 2.5s ease infinite;
}
@keyframes hint-pulse { 0%,100%{opacity:.45} 50%{opacity:1} }

/* ══ SLIDESHOW ═════════════════════════════════════════════ */
.slide-section { width: 100%; height: 100%; background: #000; }
#slideMedia {
    width: 100%; height: 100%;
    overflow-y: auto; overflow-x: hidden;
    scroll-behavior: smooth; scrollbar-width: none;
}
#slideMedia::-webkit-scrollbar { display: none; }
.slide-img {
    width: 100%; height: auto; display: block;
    transition: opacity .42s cubic-bezier(.4,0,.2,1), transform .42s cubic-bezier(.4,0,.2,1);
}
.slide-img.fade-exit  { opacity: 0; transform: scale(1.025); }
.slide-img.fade-enter { opacity: 0; transform: scale(.975); }
.slide-img.fade-in    { opacity: 1; transform: scale(1); }
.slide-video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ══ HEADER PILL FLUTUANTE ══════════════════════════════════ */
.proj-header {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 100;
    width: min(680px, calc(100vw - 24px));
    display: flex; flex-direction: column; align-items: center; gap: 0;
    transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.proj-header.hidden {
    transform: translateX(-50%) translateY(calc(-100% - 34px));
    opacity: 0; pointer-events: none;
}

.header-pill {
    display: flex; align-items: center; gap: 2px;
    padding: 8px 10px 8px 18px;
    background: rgba(8,8,8,.94);
    border: 1px solid var(--bordmd);
    border-radius: 60px;
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    box-shadow:
        0 4px 30px rgba(0,0,0,.7),
        0 0 0 1px rgba(255,255,255,.04),
        inset 0 1px 0 rgba(255,255,255,.05);
    white-space: nowrap;
    width: 100%;
    justify-content: space-between;
}

/* Voltar */
.hpill-back {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600; color: var(--text2);
    text-decoration: none; padding: 7px 12px; border-radius: 30px;
    transition: all .2s; flex-shrink: 0;
}
.hpill-back:hover { color: var(--offwhite); background: rgba(255,255,255,.06); }
.hpill-back i { font-size: 9px; }

/* Separadores */
.hpill-sep {
    width: 1px; height: 20px;
    background: var(--bordmd); margin: 0 6px; flex-shrink: 0;
}
.hpill-sep-sm {
    width: 1px; height: 14px;
    background: var(--border); margin: 0 4px; flex-shrink: 0;
}

/* Info: badge + nome */
.hpill-info {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 0; padding: 0 4px;
    overflow: hidden;
}
.hpill-badge {
    font-size: 9px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
    border: 1px solid; flex-shrink: 0; display: none;
}
.hpill-name {
    font-size: 13px; font-weight: 600; color: var(--offwhite);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Navegação de slides */
.hpill-nav {
    display: none;
    align-items: center; gap: 4px; flex-shrink: 0;
}
.hpill-nav.visible { display: flex; }
.hpill-nav-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.12); border: 1px solid var(--bordstr);
    color: var(--white); font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s;
}
.hpill-nav-btn:hover {
    background: rgba(255,255,255,.25); border-color: var(--white);
    transform: scale(1.1);
}
.hpill-nav-count {
    font-size: 12px; font-weight: 700; color: var(--offwhite);
    min-width: 40px; text-align: center; letter-spacing: .5px;
}

/* Ações direita */
.hpill-actions {
    display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.hpill-icon-btn {
    width: 34px; height: 34px; border-radius: 50%;
    background: transparent; border: none;
    color: var(--text2); font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s;
}
.hpill-icon-btn:hover { background: rgba(255,255,255,.08); color: var(--offwhite); }
.hpill-icon-btn.active { color: var(--white); background: rgba(255,255,255,.1); }

.hpill-projects-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px; margin-left: 4px;
    background: var(--white); color: #000;
    border: none; border-radius: 30px;
    font-size: 12px; font-weight: 700; font-family: var(--font);
    cursor: pointer; transition: all .2s;
    box-shadow: 0 4px 14px rgba(255,255,255,.12);
}
.hpill-projects-btn:hover {
    background: var(--offwhite);
    box-shadow: 0 6px 20px rgba(255,255,255,.2);
    transform: translateY(-1px);
}
.hpill-projects-btn i { font-size: 11px; }

/* ══ PAINEL DE DETALHES ════════════════════════════════════ */
.hdr-details {
    width: 100%;
    max-height: 0; overflow: hidden;
    transition: max-height .45s cubic-bezier(.16,1,.3,1), margin-top .3s ease;
    margin-top: 0;
}
.hdr-details.open {
    max-height: 68vh;
    overflow-y: auto;
    margin-top: 10px;
    scrollbar-width: none;
}
.hdr-details.open::-webkit-scrollbar { display: none; }

.hdr-details-body {
    background: rgba(8,8,8,.97);
    border: 1px solid var(--bordmd); border-radius: 18px;
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 8px 40px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.04);
    overflow: hidden;
}

.det-thumb-wrap {
    position: relative; height: 170px; overflow: hidden;
    border-radius: 17px 17px 0 0;
}
.det-thumb {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top;
    display: block; filter: brightness(.72);
}
.det-thumb-grad {
    position: absolute; bottom: 0; left: 0; right: 0; height: 75%;
    background: linear-gradient(to top, rgba(8,8,8,.97) 0%, transparent 100%);
    pointer-events: none;
}
.det-close-btn {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.18);
    color: var(--offwhite); font-size: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; z-index: 5;
}
.det-close-btn:hover { background: rgba(0,0,0,.88); color: var(--white); }

.det-inner { padding: 18px 22px 22px; }
.det-niche {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; padding: 4px 11px;
    border-radius: 20px; border: 1px solid; margin-bottom: 10px;
}
.det-title {
    font-size: clamp(17px, 2.4vw, 26px); font-weight: 800;
    color: var(--offwhite); line-height: 1.15; letter-spacing: -.3px;
    margin-bottom: 6px;
}
.det-sub { font-size: 13px; color: var(--text2); line-height: 1.65; margin-bottom: 18px; }

.det-metrics { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.det-metric {
    flex: 1; min-width: 80px; padding: 10px 12px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 10px; display: flex; flex-direction: column; gap: 3px;
    transition: border-color .2s;
}
.det-metric:hover { border-color: var(--bordmd); }
.det-m-lbl { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); }
.det-m-val { font-size: 13px; font-weight: 700; color: var(--offwhite); }

.det-block {
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    border-radius: 12px; padding: 15px; margin-bottom: 10px;
}
.det-block-ttl {
    font-size: 9px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
    color: var(--text2); margin-bottom: 12px;
    display: flex; align-items: center; gap: 7px;
}
.feat-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.feat-list li {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13px; color: rgba(240,240,240,.7); line-height: 1.4;
}
.feat-list li::before {
    content: ''; width: 4px; height: 4px; border-radius: 50%;
    background: var(--text2); flex-shrink: 0; margin-top: 5px; opacity: .5;
}
.stags { display: flex; flex-wrap: wrap; gap: 6px; }
.stag {
    padding: 5px 11px; background: rgba(255,255,255,.05);
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 11px; font-weight: 500; color: var(--text2);
    display: flex; align-items: center; gap: 5px; transition: all .18s;
}
.stag:hover { border-color: var(--bordmd); color: var(--offwhite); }
.stag i { font-size: 11px; color: var(--text3); }
.det-desc {
    font-size: 13px; color: var(--text3); line-height: 1.75;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.det-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.btn-solid {
    padding: 11px 22px; background: var(--orange); color: #fff;
    border: none; border-radius: 50px; font-size: 13px; font-weight: 700;
    font-family: var(--font); cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    transition: all .2s; text-decoration: none;
    box-shadow: 0 6px 20px rgba(255,107,53,.35);
}
.btn-solid:hover { background: var(--orl); transform: translateY(-2px); }
.btn-outline {
    padding: 11px 18px; background: transparent; color: var(--text2);
    border: 1px solid var(--bordmd); border-radius: 50px; font-size: 13px;
    font-family: var(--font); cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    transition: all .2s; text-decoration: none;
}
.btn-outline:hover { border-color: var(--bordstr); color: var(--offwhite); }

/* ══ BOTÃO RESTAURAR HEADER ════════════════════════════════ */
.restore-btn {
    position: fixed; top: 14px; left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 99;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 20px;
    background: rgba(8,8,8,.92); border: 1px solid var(--bordmd);
    border-radius: 50px; color: var(--text2); font-size: 12px; font-weight: 600;
    font-family: var(--font); cursor: pointer;
    transition: transform .38s cubic-bezier(.16,1,.3,1), opacity .3s ease;
    backdrop-filter: blur(16px);
    opacity: 0; pointer-events: none;
}
.restore-btn.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1; pointer-events: all;
}
.restore-btn:hover { color: var(--offwhite); border-color: var(--bordstr); }

/* ══ OVERLAY + SIDEBAR ══════════════════════════════════════ */
.ov {
    display: none; position: fixed; inset: 0; z-index: 149;
    background: rgba(0,0,0,.72); backdrop-filter: blur(3px);
}
.ov.on { display: block; }

.sidebar {
    position: fixed; top: 0; right: 0; height: 100vh;
    width: var(--sw);
    background: rgba(10,10,10,.98);
    border-left: 1px solid var(--bordmd);
    display: flex; flex-direction: column;
    overflow: hidden; z-index: 150;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: -20px 0 60px rgba(0,0,0,.85);
}
.sidebar.open { transform: translateX(0); }

.sb-head {
    padding: 18px 16px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sb-head-top {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.sb-head-title {
    font-size: 11px; font-weight: 700; color: var(--offwhite);
    letter-spacing: 2px; text-transform: uppercase;
}
.sb-close-btn {
    width: 28px; height: 28px; border-radius: 7px;
    background: rgba(255,255,255,.05); border: 1px solid var(--border);
    color: var(--text3); font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s;
}
.sb-close-btn:hover { color: var(--text2); background: rgba(255,255,255,.1); }

.sb-search { position: relative; }
.sb-search input {
    width: 100%; padding: 8px 12px 8px 30px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 13px;
    font-family: var(--font); outline: none; transition: border-color .2s;
}
.sb-search input:focus { border-color: var(--bordmd); }
.sb-search input::placeholder { color: var(--text3); }
.sb-search i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text3); font-size: 11px; pointer-events: none;
}

.sb-cats { padding: 12px 8px 0; flex-shrink: 0; }
.sb-cats-lbl {
    font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text3); padding: 0 8px; margin-bottom: 6px; display: block;
}
.cat-list { display: flex; flex-direction: column; gap: 1px; }
.cat-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px; border-radius: 7px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--text2);
    transition: all .15s; border: 1px solid transparent; user-select: none;
}
.cat-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.cat-item.active {
    background: rgba(255,255,255,.07); color: var(--offwhite); border-color: var(--bordmd);
}
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; opacity: .5; }
.cat-item.active .cat-dot, .cat-item:hover .cat-dot { opacity: 1; }
.cat-n {
    margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text3);
    background: rgba(255,255,255,.05); padding: 2px 7px; border-radius: 20px;
    min-width: 22px; text-align: center;
}
.cat-item.active .cat-n { background: rgba(255,255,255,.1); color: var(--text2); }

.sb-divider { height: 1px; background: var(--border); margin: 8px; flex-shrink: 0; }
.sb-count { padding: 0 16px 6px; font-size: 11px; color: var(--text3); flex-shrink: 0; }
.sb-count b { color: var(--offwhite); font-weight: 600; }

.proj-list { flex: 1; overflow-y: auto; padding: 2px 6px 6px; }
.proj-list::-webkit-scrollbar { width: 3px; }
.proj-list::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 3px; }
.proj-list::-webkit-scrollbar-thumb:hover { background: var(--b3); }

.pi {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 8px; border-radius: 9px; cursor: pointer;
    border: 1px solid transparent; transition: all .15s; margin-bottom: 2px;
}
.pi:hover { background: rgba(255,255,255,.04); }
.pi.active { background: rgba(255,255,255,.07); border-color: var(--bordmd); }
.pi-img {
    width: 48px; height: 32px; border-radius: 5px; object-fit: cover; flex-shrink: 0;
    background: var(--s3); border: 1px solid var(--border); transition: border-color .15s;
}
.pi.active .pi-img { border-color: var(--bordmd); }
.pi-info { flex: 1; min-width: 0; }
.pi-nome {
    font-size: 12px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.pi-tipo { font-size: 11px; color: var(--text3); }
.pi-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.pi-sk {
    height: 52px; border-radius: 9px;
    background: rgba(255,255,255,.04); margin-bottom: 3px;
    animation: sk 1.5s ease infinite;
}
@keyframes sk { 0%,100%{opacity:.4} 50%{opacity:.7} }
.sb-empty { padding: 24px 12px; text-align: center; color: var(--text3); font-size: 12px; }

/* ══ EMPTY STATE ════════════════════════════════════════════ */
.empty-sc {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; text-align: center; padding: 40px;
}
.empty-sc .ei {
    width: 64px; height: 64px; border-radius: 16px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--text3); margin-bottom: 4px;
}
.empty-sc h3 { font-size: 16px; font-weight: 600; color: var(--text2); }
.empty-sc p { font-size: 13px; color: var(--text3); max-width: 220px; line-height: 1.6; }

/* ══ MOBILE ═════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .header-pill { padding: 7px 8px 7px 12px; gap: 1px; }
    .hpill-back span { display: none; }
    .hpill-back { padding: 7px 10px; }
    .hpill-name { font-size: 12px; }
    .hpill-icon-btn { width: 30px; height: 30px; font-size: 12px; }
    .hpill-projects-btn span { display: none; }
    .hpill-projects-btn { padding: 9px 14px; margin-left: 2px; }
    .hpill-sep { margin: 0 3px; }
    .hpill-nav-count { min-width: 28px; font-size: 10px; }
    .sidebar { width: 100%; max-width: 310px; }
    .det-inner { padding: 14px 16px 18px; }
    .det-thumb-wrap { height: 130px; }
    .hdr-details.open { max-height: 72vh; }

    /* Centralizar imagem verticalmente no mobile */
    #slideMedia {
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    .slide-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
    }
    .slide-section { overflow: hidden; }
}

@media (max-width: 380px) {
    .hpill-badge { display: none !important; }
    .hpill-sep:first-of-type { display: none; }
    .hpill-projects-btn { padding: 8px 12px; }
    .det-metrics { gap: 6px; }
}