/* ==========================================================================
   Junior Fernandes — página inicial

   Depende de main.css.

   1. Seções
   2. Animações
   3. Responsivo
   ========================================================================== */


/* 1. Seções
   ========================================================================== */

/* Hero */

.hero {
    position: relative;
    margin-top: calc(var(--header-height) * -1);
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    z-index: -1;
    width: 60vw;
    aspect-ratio: 1;
    background: radial-gradient(circle, var(--color-glow), transparent 65%);
}

.hero__inner {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
    gap: var(--space-lg);
    min-height: min(100svh, 56rem);
}

.hero__text {
    display: grid;
    justify-items: start;
    gap: var(--space-md);
    align-self: center;
    padding-block: var(--space-xl);
}

.hero__quote blockquote {
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 6.2vw, 5.25rem);
    line-height: 1;
    letter-spacing: -0.015em;
}

.hero__quote em {
    color: var(--color-accent);
}

.hero__quote figcaption,
.about__quote figcaption {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.hero__quote figcaption::before,
.about__quote figcaption::before {
    content: "";
    width: 2.5rem;
    height: 1px;
    background-color: var(--color-accent);
}

.hero__lead {
    max-width: 34ch;
    font-size: var(--text-lg);
    color: var(--color-text-muted);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Recortes P&B: um disco atrás da pessoa e a base esmaecendo no fundo */
.hero__portrait,
.about__portrait {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hero__portrait::before,
.about__portrait::before {
    content: "";
    position: absolute;
    bottom: 12%;
    left: 50%;
    width: 88%;
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 40%, var(--color-portrait-backdrop), transparent 70%);
    border-radius: 50%;
    translate: -50% 0;
}

.hero__portrait img,
.about__portrait img {
    position: relative;
    max-height: min(78svh, 44rem);
    width: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
    mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

/* Sobre */

.about {
    background-color: var(--color-surface);
    border-block: 1px solid var(--color-border);
}

.about__inner {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    align-items: center;
    gap: var(--space-xl);
}

.about__text {
    display: grid;
    gap: var(--space-lg);
}

.about__quote blockquote {
    display: grid;
    gap: var(--space-md);
    max-width: 62ch;
    color: var(--color-text-muted);
}

.about__quote-opening {
    position: relative;
    font-family: var(--font-serif);
    font-size: clamp(1.875rem, 3.4vw, 2.75rem);
    line-height: 1.12;
    color: var(--color-text);
}

.about__quote-opening::before {
    content: "\201C";
    position: absolute;
    top: -0.2em;
    left: -0.55em;
    font-size: 2em;
    line-height: 1;
    color: var(--color-accent);
    opacity: 0.6;
}

/* Conteúdo */

.topics__inner {
    display: grid;
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: var(--space-xl);
}

.topics__portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-md);
    filter: grayscale(0.15);
}

.topics__more {
    margin-top: var(--space-md);
}

/* Produtos */

.products {
    position: relative;
    overflow: hidden;
}

.products::before {
    content: "";
    position: absolute;
    top: 25%;
    left: 50%;
    z-index: -1;
    width: 70vw;
    aspect-ratio: 1;
    background: radial-gradient(circle, var(--color-glow), transparent 60%);
    translate: -50% 0;
}

.products__showcase {
    max-width: 48rem;
    margin: 0 auto var(--space-xl);
}

.products__showcase img {
    filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.35));
}


/* 2. Animações
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .hero__text > * {
        animation: rise 0.9s var(--ease-out) both;
    }

    .hero__text > :nth-child(2) { animation-delay: 0.08s; }
    .hero__text > :nth-child(3) { animation-delay: 0.16s; }
    .hero__text > :nth-child(4) { animation-delay: 0.24s; }

    .hero__portrait {
        animation: fade 1.4s var(--ease-out) 0.2s both;
    }

    /* A frase de abertura do Sobre "se escreve" linha por linha conforme a rolagem */
    @supports (animation-timeline: view()) {
        .ink-on-scroll {
            color: transparent;
            background-image: linear-gradient(var(--color-text), var(--color-text)),
                              linear-gradient(var(--color-text-faint), var(--color-text-faint));
            background-size: 0% 100%, 100% 100%;
            background-repeat: no-repeat;
            -webkit-background-clip: text;
            background-clip: text;
            animation: ink linear both;
            animation-timeline: view();
            animation-range: entry 40% cover 60%;
        }
    }
}

@keyframes ink {
    to { background-size: 100% 100%, 100% 100%; }
}


/* 3. Responsivo
   ========================================================================== */

@media (max-width: 60rem) {
    .hero__inner,
    .about__inner,
    .topics__inner {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .hero__inner {
        min-height: auto;
    }

    .hero__text {
        padding-block: var(--space-xl) 0;
    }

    .hero__portrait img,
    .about__portrait img {
        max-height: 30rem;
    }

    .about__portrait {
        order: 2;
    }

    /* Mantém o retrato inteiro: no formato largo o rosto era cortado */
    .topics__portrait {
        width: 100%;
        max-width: 26rem;
    }

    .card--product {
        aspect-ratio: 16 / 8;
    }
}
