/* Página inicial: intro da logo, hero, caso em destaque, stack e trajetória. */

/* Intro: a meia-lua entra como pincelada, o V se desenha e a cortina sobe.
   Só aparece quando o <head> marca o <html> com .intro-play (uma vez por sessão
   e nunca com movimento reduzido). Sem essa classe, a página abre direto. */

.intro {
    display: none;
}

.intro-play .intro {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg) var(--bg-gradient);
    box-shadow: 0 30px 60px rgba(4, 10, 18, 0.5);
    animation: intro-out 0.7s cubic-bezier(0.76, 0, 0.24, 1) 1.75s forwards;
}

.intro-stage {
    display: grid;
    justify-items: center;
}

.intro-mark {
    width: clamp(132px, 24vw, 196px);
    overflow: visible;
}

.intro-mark .mark-v {
    stroke-width: 5.6;
}

.intro-word {
    margin-top: 30px;
    font-family: var(--display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.intro-word b {
    color: var(--accent);
    font-weight: inherit;
}

.intro-line {
    margin-top: 14px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.intro-play .intro .mark-sweep {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: mark-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}

.intro-play .intro .mark-v {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: mark-draw 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.6s forwards;
}

.intro-play .intro-word,
.intro-play .intro-line {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.5s var(--ease-out) 0.95s forwards;
}

.intro-play .intro-line {
    animation-delay: 1.08s;
}

/* Quem clica, rola ou aperta uma tecla pula a intro. */
.intro-play .intro.is-skipped {
    opacity: 0;
    animation: none;
    transition: opacity 0.25s ease;
}

@keyframes intro-out {
    to {
        transform: translateY(-100%);
    }
}

@keyframes mark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

/* Hero */

.hero {
    padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 72px);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}

.hero h1 {
    margin-top: 22px;
    font-size: clamp(2.15rem, 4.3vw, 3.5rem);
    line-height: 1.12;
}

.hero .lead {
    margin-top: 26px;
    font-size: clamp(1.05rem, 1.4vw, 1.18rem);
}

.hero .actions {
    margin-top: 36px;
}

.hero .social {
    margin-top: 30px;
}

/* A foto ocupa o lugar do V: a meia-lua da logo passa em volta dela. */
.portrait {
    position: relative;
    justify-self: end;
    width: min(100%, 400px);
    aspect-ratio: 1;
}

.portrait img {
    position: absolute;
    inset: 10.5%;
    width: 79%;
    height: 79%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--line-strong), var(--shadow);
}

.portrait svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

@media (prefers-reduced-motion: no-preference) {
    .portrait .mark-sweep {
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        animation: mark-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.25s forwards;
    }

    .portrait img {
        opacity: 0;
        transform: scale(0.96);
        animation: portrait-in 0.8s var(--ease-out) 0.1s forwards;
    }

    /* Com a intro na frente, a entrada do hero espera a cortina subir. */
    .intro-play .portrait .mark-sweep {
        animation-delay: 1.95s;
    }

    .intro-play .portrait img {
        animation-delay: 1.8s;
    }
}

@keyframes portrait-in {
    to {
        opacity: 1;
        transform: none;
    }
}

/* Projetos selecionados: três colunas, com o destaque ocupando a linha inteira */

.projects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Stack: quatro áreas, cada uma com o que eu faço nela */

.stack {
    margin: 0;
}

.stack div {
    padding-block: 26px;
    border-top: 1px solid var(--line);
}

.stack div:last-child {
    border-bottom: 1px solid var(--line);
}

.stack dt {
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stack dd {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.stack .chips {
    margin-top: 16px;
}

/* Trajetória: uma linha por cargo */

.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 6px 24px;
    padding-block: 22px;
    border-top: 1px solid var(--line);
}

.timeline li:last-child {
    border-bottom: 1px solid var(--line);
}

.timeline time {
    padding-top: 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8rem;
}

.timeline h3 {
    font-size: 1.15rem;
}

.timeline h3 span {
    color: var(--soft);
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
}

.timeline p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.98rem;
}

.timeline-more {
    margin-top: 32px;
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    /* No celular a foto vem antes do texto, menor. */
    .portrait {
        order: -1;
        justify-self: start;
        width: min(62vw, 240px);
        margin-left: -4%;
    }

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

    .timeline li {
        grid-template-columns: 1fr;
    }

    .timeline time {
        padding-top: 0;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
