/* ═══════════════════════════════════════════════════════════════
   INDEX — Portfolio Home
   ───────────────────────────────────────────────────────────────
    1.  Hero Section (text, header, name)
    2.  Companies Carousel
    3.  About & Skills
    4.  Experience
    5.  Certifications
    6.  Responsive — Index
   ═══════════════════════════════════════════════════════════════ */


/* ─── 1. HERO SECTION ──────────────────────────────────────────── */

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 60px;
    width: 100%;
    z-index: 10;
    overflow: hidden;
    height: 100vh;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: start;
    text-align: start;
    width: 100%;
}

.hero-header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-name {
    font-size: 24px;
    font-weight: 500;
}

.hero-text h1 {
    font-size: clamp(56px, 10vw, 140px);
    font-weight: 500;
    white-space: pre-line;
    text-align: left;
    line-height: 0.95;
}

#home .hero-text h1 {
    visibility: hidden;
}

#home .hero-text h1.hero-type-ready {
    visibility: visible;
}

.hero-text p {
    font-size: 20px;
    font-weight: 500;
    color: rgba(250, 249, 246, 0.9);
    max-width: 800px;
    line-height: 1.4;
}

#home .hero-text .hero-header,
#home .hero-text > p {
    opacity: 0;
    transform: translateY(14px);
}

#home .hero-text .hero-header.hero-fade-visible,
#home .hero-text > p.hero-fade-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent hero paragraph from breaking into multiple lines on wide (desktop) viewports */
@media (min-width: 992px) {
    .hero-text p {
        white-space: nowrap;
        max-width: none;
        overflow: visible;
    }
}


/* ─── 2. COMPANIES CAROUSEL ────────────────────────────────────── */

#my-work .section-title {
    margin-bottom: 0;
}

#my-work .card-description {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.22s ease, margin-top 0.22s ease;
}

#my-work .card:hover .card-description,
#my-work .card:focus-within .card-description {
    max-height: 120px;
    opacity: 1;
    margin-top: 4px;
}

#my-work .card-full .card-image {
    aspect-ratio: 21 / 6;
}

.companies {
    display: flex;
    gap: 32px;
    align-items: center;
    width: 100%;
}

.companies-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.companies-logos {
    position: relative;
    overflow: hidden;
    width: 100%;
    flex: 1;
    padding: 0 0 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 88px, black calc(100% - 88px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 88px, black calc(100% - 88px), transparent 100%);
}

.companies-track {
    display: flex;
    gap: 40px;
    align-items: center;
    width: max-content;
    animation: companies-scroll 28s linear infinite;
}

@keyframes companies-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.company-logo {
    height: 42px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

/* Carousel logos: white by default */
.companies-track .company-logo {
    filter: grayscale(100%) brightness(0) invert(1);
    opacity: 0.7;
}

/* Small company logos (experience) + cert logos keep original color */
.company-logo-small {
    width: auto;
    height: 32px;
    object-fit: contain;
}

.company-logo-small,
.cert-logo {
    filter: none;
}

/* Alura logo exception — keep white */
img[alt="Alura"] {
    filter: brightness(0) invert(1);
}


/* ─── 3. ABOUT & SKILLS ───────────────────────────────────────── */

.about-header {
    display: grid;
    grid-template-columns: .7fr 1fr;
    gap: 40px;
    width: 100%;
    align-items: start;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.about-description {
    font-size: 14px;
    color: rgba(250, 249, 246, 0.8);
    line-height: 1.6;
}

.about-availability {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(250, 249, 246, 0.9);
    margin: -12px 0 0;
}

.about-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: online-badge-pulse 1.8s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
}

.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.about-skills {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-skills-title {
    font-size: 20px;
    font-weight: 500;
    color: #faf9f6;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
}

.skill-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(23, 23, 23, 0.70);
    border: 1px solid rgba(250, 249, 246, 0.08);
    width: 100%;
    min-width: 0;
}

.skill-title {
    display: flex;
    gap: 4px;
    align-items: center;
}

.skill-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.skill-icon svg {
    width: 14px;
    height: 14px;
}

.skill-title h3 {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.skill-description {
    font-size: 13px;
    color: rgba(250, 249, 246, 0.8);
    line-height: 1.5;
}


/* ─── 4. EXPERIENCE ────────────────────────────────────────────── */

#experience{
    gap: 80px;
}

:root {
    --section-sticky-top: 55px;
}

#my-work .section-title,
#about > h2,
#experience > h2,
#certifications > h2 {
    position: sticky;
    top: var(--section-sticky-top);
    z-index: 20;
    isolation: isolate;
    background: #121212;
    width: 100%;
    padding: 8px 0;
}

#my-work .section-title::before,
#about > h2::before,
#experience > h2::before,
#certifications > h2::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--section-sticky-top) * -1);
    height: var(--section-sticky-top);
    background: #121212;
    z-index: -1;
    pointer-events: none;
}

#my-work .section-title::after,
#about > h2::after,
#experience > h2::after,
#certifications > h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100vw;
    transform: translateX(-50%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

#my-work .section-title.sticky-active::after,
#about > h2.sticky-active::after,
#experience > h2.sticky-active::after,
#certifications > h2.sticky-active::after {
    opacity: 1;
}

.experience-card {
    display: grid;
    grid-template-columns: .7fr 1fr;
    gap: 40px;
    width: 100%;
    align-items: start;
    background: transparent;
    border: none;
    border-radius: 0;
}

.experience-skills {
    order: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.experience-skills .tag {
    white-space: normal;
}

.experience-tags-toggle {
    border: none;
    background: #faf9f6;
    padding: 4px 12px;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #242424;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.experience-tags-toggle:hover {
    background: #e7e5e0;
}

.experience-tag-hidden {
    display: none !important;
}

.experience-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.experience-position {
    order: 1;
    font-size: 24px;
    font-weight: 500;
}

.experience-company {
    order: 2;
    display: flex;
    gap: 8px;
    align-items: center;
}

.experience-tags {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.experience-company {
    display: flex;
    gap: 8px;
    align-items: center;
}

.company-name {
    font-size: 16px;
    font-weight: 500;
}

.experience-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    justify-content: start;
    align-items: start;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(23, 23, 23, 0.70);
    border: 1px solid rgba(250, 249, 246, 0.08);
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-self: stretch;
}

.stat-item h4 {
    font-size: 24px;
    font-weight: 500;
}

.stat-item p {
    font-size: 13px;
    color: rgba(250, 249, 246, 0.8);
    line-height: 1.4;
}

.experience-list {
    display: flex;
    flex-direction: column;
}

.experience-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.experience-list ul {
    list-style: disc;
    padding-left: 21px;
    color: rgba(250, 249, 246, 0.8);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.experience-list li {
    padding: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    :root {
        --section-sticky-top: 55px;
    }

    .experience-card {
        display: flex;
        flex-direction: column;
    }

    .experience-body {
        width: 100%;
    }

    .experience-list {
        grid-column: auto;
    }
}


/* ─── 5. CERTIFICATIONS ───────────────────────────────────────── */

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    align-items: start;
}

.cert-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cert-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: start;
    width: 100%;
    padding: 12px;
    background: rgba(23, 23, 23, 0.70);
    border: 1px solid rgba(250, 249, 246, 0.08);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
}

.cert-header {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cert-logo {
    width: auto;
    height: 32px;
    object-fit: contain;
}

.cert-header h3 {
    font-size: 24px;
    font-weight: 500;
}

.cert-header .tag {
    font-weight: 500;
}

.cert-year {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    width: 100%;
}

.cert-year ul {
    list-style: disc;
    padding-left: 21px;
    color: rgba(250, 249, 246, 0.8);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cert-year li {
    padding: 0;
    line-height: 1.6;
}

.cert-year li a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.cert-year li a:hover {
    opacity: 0.7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cert-year li a.cert-tight {
    letter-spacing: -0.01em;
}


/* ─── 6. RESPONSIVE — INDEX ───────────────────────────────────── */

@media (max-width: 1024px) {
    #my-work .card-full .card-image {
        aspect-ratio: 16 / 9;
    }

    .about-header { grid-template-columns: 1fr; gap: 80px; }
    .skills-grid        { grid-template-columns: repeat(2, 1fr); }
    .certifications-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cert-card {
        gap: 12px;
    }
    #experience { gap: 64px; }
    .experience-card { padding: 64px 0; }
    .experience-stats    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #my-work .card-description {
        max-height: none;
        opacity: 1;
        overflow: visible;
        margin-top: 4px;
        pointer-events: auto;
    }

    .hero {
        height: 100vh;           /* fallback */
        height: 100dvh;          /* exclui chrome do browser no mobile */
        padding-top: 100px;
        padding-bottom: 40px;
        overflow: hidden;
    }

    .hero-text h1 {
        font-size: clamp(36px, 11vw, 64px);
        line-height: 1;
    }
    .hero-text p  { font-size: 16px; }

    .companies {
        flex-direction: column;
        gap: 12px;
    }

    .companies-logos {
        width: 100%;
        justify-content: flex-start;
    }

    .about-header { gap: 80px; }
    .skills-grid      { grid-template-columns: 1fr; }
    .certifications-grid { grid-template-columns: 1fr; }
    #experience { gap: 40px; }
    .experience-card { padding: 40px 0; }
    .experience-stats { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
    #experience { gap: 32px; }
}

@media (max-width: 500px) {
    .about-header .section-title h2 {
        width: 100%;
    }
}
