/* ============================================
   HOME v2 — Figma "Portfolio base" (node 143:5110)
   Só a home usa este arquivo. Tokens (--blue, --yellow…) vêm do style.css.
   Classes com prefixo hm- para não colidir com about/contact/work.
   ============================================ */

:root {
  --hm-sky: #4f73a6;
  --hm-navy: #323278;
  --hm-ease: cubic-bezier(.2,.8,.2,1);
  --hm-pixel: 'Pixelify Sans', monospace;
  --hm-slab: 'Arbutus Slab', Georgia, serif;
}
body.home { background: var(--hm-sky); color: #fff; }
.home img { max-width: none; }

/* ---------- fundo: camada mais alta que a tela, o JS a desloca com o scroll
   (sempre cobre a viewport inteira, do topo ao rodapé) ---------- */
.home .page-bg { overflow: hidden; }
.home .page-bg img { position: absolute; left: -2%; top: 0; width: 104%; height: 175%; object-fit: cover; will-change: transform; }

/* scroll suave (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- entrada ---------- */
.hm-rise { display: inline-block; opacity: 0; transform: translateY(18px); animation: hmRise .8s var(--hm-ease) forwards; animation-delay: var(--d, 0s); }
@keyframes hmRise { to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s var(--hm-ease), transform .8s var(--hm-ease); }
.reveal.in { opacity: 1; transform: none; }

.page { display: flex; flex-direction: column; align-items: center; gap: 148px; }

/* ---------- HERO ---------- */
.hm-hero {
  width: 100%; max-width: 1440px; padding: 264px 64px 0; /* Figma: nav → conteúdo = 160px */
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 48px;
}
.hm-hero__line { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
/* Figma "New phrase and font": saudação e frase em Arbutus Slab 40px, entrelinha 67,2px */
.hm-hi, .hm-im { font-family: var(--hm-slab); font-size: 40px; line-height: 1.68; white-space: nowrap; }
.hm-avatar-wrap { position: relative; display: inline-block; outline: none; }
.hm-avatar {
  display: block; width: 70px; height: 70px; border-radius: 50%; overflow: hidden; border: 3px solid var(--yellow);
  transition: transform .5s var(--hm-ease);
}
.hm-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.hm-avatar-wrap:hover .hm-avatar, .hm-avatar-wrap:focus-visible .hm-avatar { transform: rotate(-12deg) scale(1.12); }

/* balão "montréal - QC" (Figma): SÓ no hover (ou foco por teclado) sobre a foto */
.hm-tip { position: absolute; left: -35px; bottom: calc(100% + 9px); width: 140px; height: 46.78px; pointer-events: none; opacity: 0; transform: translateY(10px) scale(.8); transform-origin: 50% 100%; transition: opacity .2s, transform .4s cubic-bezier(.34,1.56,.64,1); z-index: 5; filter: drop-shadow(1px 4px 12px rgba(0,0,0,.12)); }
.hm-tip__bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-tip b { position: absolute; left: 15px; top: 12px; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--blue); white-space: nowrap; }
.hm-tip span { position: absolute; left: 109px; top: 12px; font-size: 16px; line-height: 16px; }
.hm-avatar-wrap:hover .hm-tip, .hm-avatar-wrap:focus-visible .hm-tip { opacity: 1; transform: none; }
.hm-role { display: inline-flex; align-items: center; gap: 12px; }

.hm-typer {
  display: inline-flex; align-items: center; gap: 4px; justify-content: flex-start; text-align: left;
  font-family: var(--hm-pixel); font-size: 42px; line-height: 1.2; color: var(--yellow);
  white-space: nowrap;
}
.hm-typer__caret { width: 2px; height: 61px; background: var(--yellow); border-radius: 2px; flex: none; animation: hmBlink 1s steps(1) infinite; }
.hm-typer.is-typing .hm-typer__caret { animation: none; opacity: 1; }
@keyframes hmBlink { 50% { opacity: 0; } }

.hm-sub { margin-top: -48px; font-family: var(--hm-slab); font-size: 40px; line-height: 1.68; max-width: 1312px; text-wrap: balance; }
.hm-about { font-size: 20px; line-height: 35px; max-width: 900px; }
.hm-cta {
  font-size: 20px; color: var(--yellow);
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .35s var(--hm-ease);
}
.hm-cta img { width: 16px; height: 16px; }
.hm-cta:hover { transform: translateY(-3px) rotate(-6deg); } /* hover padrão do site */

/* ---------- FEATURED ---------- */
/* A "cena": um palco (stage) fixo na tela enquanto o scroll percorre a cena.
   Fases (JS, em unidades U = 70vh de scroll): 0→1→2→3 cada card entra por baixo e o anterior
   recua; 3→4 a pilha sai e a frase "There's more…" entra NO MESMO PALCO (sem vazio no meio);
   4→4.5 pausa de leitura; depois o palco se solta e o scroll segue para o rodapé. */
.hm-scene {
  --U: 70vh;
  position: relative; width: 100%;
  height: calc(100vh + 4.5 * var(--U));
  /* o card 1 começa 80px abaixo do link "explore…" (Figma) e o palco vaza sobre o hero (transparente) */
  margin-top: calc(80px - 148px - (100vh - 439px) / 2);
  /* aproxima o rodapé: 148px depois do botão "see all my work" */
  margin-bottom: calc(-1 * (100vh - 580px) / 2);
  pointer-events: none;
}
.hm-stage { position: sticky; top: 0; height: 100vh; }
.hm-stack { position: absolute; inset: 0; }
.hm-stack__item {
  position: absolute; left: 50%; top: calc((100vh - 439px) / 2);
  width: min(1202px, calc(100vw - 40px)); margin-left: calc(min(1202px, calc(100vw - 40px)) / -2);
  transform-origin: 50% 0; will-change: transform, opacity; pointer-events: auto;
}
.hm-feature { position: relative; }
.hm-feature::after { /* escurecimento dos cards já cobertos: overlay é mais barato que filter */
  content: ''; position: absolute; inset: 0; background: #000b3d; opacity: var(--dim, 0); pointer-events: none;
}
.hm-feature {
  background: #fff; color: var(--blue); border-radius: 40px; height: 439px; padding: 0;
  display: flex; gap: 32px; overflow: hidden; box-shadow: 1px -4px 15px 10px rgba(0,0,0,.05);
}
.hm-feature__body { flex: 0 0 586px; max-width: 586px; padding: 36px 0 36px 40px; display: flex; flex-direction: column; justify-content: space-between; }
.hm-feature__top { display: flex; flex-direction: column; gap: 24px; }
.hm-feature__meta { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 500; }
.hm-tag { background: var(--yellow); padding: 4px 12px; border-radius: 8px; font-weight: 400; white-space: nowrap; }
.hm-feature__text { display: flex; flex-direction: column; gap: 16px; }
.hm-feature__title { font-family: var(--hm-slab); font-weight: 400; font-size: 24px; line-height: normal; }
.hm-feature__sub { font-size: 16px; font-weight: 400; line-height: normal; }
.hm-feature__bottom { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.hm-tools { display: flex; }
.hm-tool { width: 39px; height: 39px; border-radius: 50%; background: #fff; border: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: center; }
.hm-tool + .hm-tool { margin-left: -8px; }
.hm-feature__media { flex: 1; min-width: 0; position: relative; overflow: hidden; border-radius: 0 0 20px 0; }
.hm-feature__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform .9s var(--hm-ease); }
.hm-feature:hover .hm-feature__media img { transform: scale(1.04); }

/* ---------- botões ---------- */
.hm-btn {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  padding: 12px 16px 12px 24px; border-radius: 8px; border: 2px solid; font-size: 20px; font-weight: 500;
  transition: background .3s, color .3s, transform .3s var(--hm-ease), opacity .8s var(--hm-ease);
}
.hm-btn img { width: 20px; height: 20px; transition: transform .35s var(--hm-ease), filter .3s; }
.hm-btn:hover { transform: translateY(-2px); }
.hm-btn:hover img { transform: translateX(6px); }
.hm-btn--blue { color: var(--blue); border-color: var(--blue); }
.hm-btn--blue:hover { background: var(--blue); color: #fff; }
.hm-btn--blue:hover img { filter: brightness(0) invert(1); }
.hm-btn--yellow { color: var(--yellow); border-color: var(--yellow); }
.hm-btn--yellow:hover { background: var(--yellow); color: var(--hm-sky); }
.hm-btn--yellow:hover img { filter: brightness(0) saturate(100%) invert(42%) sepia(23%) saturate(1188%) hue-rotate(174deg); }

/* ---------- MORE ---------- */
.hm-more {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; padding: 0 20px;
  opacity: 0; visibility: hidden; will-change: transform, opacity; pointer-events: auto;
}
.hm-more__head { display: flex; flex-direction: column; gap: 16px; }
.hm-more__head h2 { font-weight: 400; font-size: 28px; }
.hm-more__head p { font-size: 20px; }

/* leque de 4 cards (Figma "New cards", 925 × 359): cada card (239 × 322) fica no mesmo centro que no
   Figma e gira em volta dele (giro CSS = −giro do Figma). A ordem no HTML é a ordem das camadas. */
.hm-fan { position: relative; width: 925px; max-width: 100%; height: 359px; margin: 12px auto 4px; }
.hm-fan__slot { position: absolute; width: 239px; height: 322px; transition: transform .6s var(--hm-ease); }
.hm-fan__slot--1 { left: 26.1px; top: 18.3px; --rot: -10deg; }    /* centro 145,6 · 179,3 */
.hm-fan__slot--2 { left: 241.3px; top: 0; --rot: 0deg; }           /* centro 360,8 · 161 */
.hm-fan__slot--3 { left: 456.4px; top: 18.3px; --rot: 10deg; }     /* centro 575,9 · 179,3 */
.hm-fan__slot--4 { left: 678.7px; top: 5.2px; --rot: -2.59deg; }   /* centro 798,2 · 166,2 */
/* telas médias: o quadro de 925px não cabe; reduz o leque inteiro, mantendo a composição */
@media (min-width: 761px) and (max-width: 1000px) { .hm-fan { zoom: .8; } }
.hm-mcard { display: block; width: 239px; height: 322px; padding: 20px; border-radius: 40px; background: #fff; box-shadow: 1px 4px 15px rgba(0,0,0,.05); transform: rotate(var(--rot, 0deg)); transition: transform .6s var(--hm-ease), box-shadow .4s; }
.hm-fan:hover .hm-fan__slot--1 { transform: translateX(-40px); }
.hm-fan:hover .hm-fan__slot--2 { transform: translateX(-14px); }
.hm-fan:hover .hm-fan__slot--3 { transform: translateX(14px); }
.hm-fan:hover .hm-fan__slot--4 { transform: translateX(40px); }
.hm-fan__slot:hover { z-index: 5; }
.hm-fan__slot:hover .hm-mcard { transform: rotate(0) translateY(-14px) scale(1.05); box-shadow: 0 24px 50px rgba(0,30,80,.28); }
.hm-mcard__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* "coming soon!": o mesmo balão amarelo das interações da about me (pílula + bico), em cima do card */
.hm-soon {
  position: absolute; left: 50%; top: -6px; z-index: 6; pointer-events: none;
  height: 38px; padding: 0 16px; border-radius: 19px; background: var(--yellow);
  display: flex; align-items: center; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--blue);
  transform: translate(-50%, calc(-100% - 8px)) scale(.6); transform-origin: 50% calc(100% + 8px);
  opacity: 0; transition: opacity .18s, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.hm-soon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 14px; height: 9px; margin-left: -7px; background: var(--yellow); clip-path: polygon(0 0, 100% 0, 58% 88%, 42% 88%); border-radius: 0 0 3px 3px; }
.hm-fan__slot.is-soon:hover .hm-soon, .hm-fan__slot.is-soon:focus-within .hm-soon { opacity: 1; transform: translate(-50%, calc(-100% - 8px)); }
.hm-mcard__in { position: relative; width: 199px; height: 281px; overflow: hidden; border-radius: 20px; background: linear-gradient(to bottom, #fff 21%, #a0c2e4); }
.hm-mcard__title { position: absolute; left: 50%; top: 57px; transform: translateX(-50%); text-align: center; color: var(--hm-navy); font-size: 20px; font-weight: 500; white-space: nowrap; }
.hm-mcard__badge { position: absolute; left: 86px; top: 14px; width: 25px; height: 25px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.hm-eye { display: grid; }
.hm-eye img { grid-area: 1 / 1; }
.hm-eye img:last-child { margin: 10.4px 0 0 1.8px; }
.hm-mcard__shot, .hm-mcard__bar, .hm-mcard__laptop, .hm-mcard__phone { position: absolute; }
.hm-mcard__shot { overflow: hidden; }
.hm-mcard__shot img { position: absolute; transition: transform .8s var(--hm-ease); }
.hm-mcard__shot--phone { border-radius: 0 0 10px 10px; }
.hm-mcard__laptop { width: 187px; height: 144px; }
.hm-mcard__laptop img { position: absolute; left: 50%; top: 50%; width: 144px; height: 187px; transform: translate(-50%, -50%) rotate(-90deg); }
.hm-mcard__phone { width: 56px; height: 113px; }
.hm-mcard__phone img { width: 100%; height: 100%; }
.hm-mcard__bar { height: 12px; }
.hm-mcard__bar--r { border-radius: 19px; }
.hm-mcard:hover .hm-mcard__shot:not(.hm-mcard__shot--phone) img { transform: scale(1.05); }

/* ---------- FOOTER ---------- */
.hm-footer { width: 100%; display: flex; flex-direction: column; gap: 24px; } /* a página termina no amarelo */
.hm-marquee { position: relative; display: block; width: 100%; overflow: hidden; white-space: nowrap; font-family: var(--hm-pixel); font-size: 28px; color: var(--yellow); text-align: left; background: none; border: 0; cursor: pointer; }
.hm-marquee__track { display: inline-flex; animation: hmMarquee 38.5s linear infinite; /* duração real: home.js [E] (~110px/s) */ will-change: transform; }
.hm-marquee:hover .hm-marquee__track { animation-play-state: paused; }
.hm-marquee__item { display: inline-block; padding-right: .6em; }
@keyframes hmMarquee { to { transform: translateX(-50%); } }
/* estado "copied": camada amarela (criada pelo JS) cobre a faixa com um wipe,
   com o texto azul correndo no sentido contrário. Não mexe no marquee original. */
.hm-copied-layer { position: absolute; inset: 0; background: var(--yellow); color: var(--blue); overflow: hidden; pointer-events: none; clip-path: inset(0 100% 0 0); display: flex; align-items: center; }
.hm-copied-track { display: inline-flex; white-space: nowrap; animation: hmMarquee 9s linear infinite reverse; will-change: transform; }
.hm-copied-unit { display: inline-flex; align-items: center; gap: .35em; padding-right: 1.1em; }
.hm-copied-unit svg { width: .8em; height: .8em; stroke: currentColor; fill: none; stroke-width: 3.2; stroke-linecap: square; stroke-linejoin: miter; }
.hm-copied-unit svg path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: hmCheck .45s .25s ease-out forwards; }
@keyframes hmCheck { to { stroke-dashoffset: 0; } }

.hm-footer__panel { background: var(--yellow); color: var(--blue); padding: 32px 64px 24px; min-height: 447px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.hm-footer__top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.hm-footer__cta { display: flex; flex-direction: column; gap: 32px; }
.hm-footer__ask { font-size: 24px; line-height: normal; }
.hm-footer__ask strong { font-weight: 700; }
.hm-icons { display: flex; gap: 16px; }
.hm-icon { width: 39px; height: 39px; border-radius: 50%; border: 1.5px solid var(--blue); display: flex; align-items: center; justify-content: center; transition: transform .35s var(--hm-ease); }
.hm-icon img { width: 16px; height: 16px; }
.hm-icon:hover { transform: translateY(-3px) rotate(-6deg); } /* hover padrão do site: só o tilt */
.hm-footer__cat { position: absolute; right: 16px; top: -58px; width: 465px; height: 326px; transform-origin: 70% 90%; transition: transform .7s var(--hm-ease); cursor: pointer; }
.hm-footer__panel:hover .hm-footer__cat { transform: translate(-8px, 8px) rotate(-3deg); }
.hm-footer__cat.is-wiggle { animation: hmWiggle .7s var(--hm-ease); }
/* gato: default (rosto segue o mouse, via home.js [F]) ⇄ piscadinha ao copiar o e-mail (.is-winking).
   A piscadinha (Figma, estado "clicked") é um pouco maior e fica 42px à esquerda e 28px abaixo
   do default: em % do desenho default (465×326), para valer também no tamanho do celular. */
.hm-footer__cat { display: block; }
.hm-cat__default { display: block; width: 100%; height: 100%; transition: opacity .16s; }
.hm-cat__wink {
  position: absolute; left: -9.03%; top: 8.59%; width: 110.75%; height: auto; max-width: none;
  opacity: 0; transform: scale(.9) rotate(4deg); transform-origin: 45% 60%; pointer-events: none;
  transition: opacity .16s, transform .5s cubic-bezier(.34,1.56,.64,1);
}
.hm-footer__cat.is-winking .hm-cat__default { opacity: 0; }
.hm-footer__cat.is-winking .hm-cat__wink { opacity: 1; transform: none; }
@keyframes hmWiggle { 20% { transform: rotate(-5deg) translateY(-6px); } 50% { transform: rotate(4deg); } 80% { transform: rotate(-2deg); } }
.hm-footer__bottom { display: flex; flex-direction: column; gap: 24px; }
.hm-footer__mark { width: min(490px, 70vw); height: auto; }
.hm-footer__copy { font-size: 16px; }
.hm-footer__copy em { font-style: italic; }

/* ---------- sem cena (telas pequenas / baixas / movimento reduzido): tudo vira fluxo normal ---------- */
@media (max-width: 1100px), (max-height: 620px), (prefers-reduced-motion: reduce) {
  .hm-scene { height: auto; margin: -68px 0 0; pointer-events: auto; }
  .hm-stage { position: static; height: auto; display: flex; flex-direction: column; gap: 32px; align-items: center; }
  .hm-stack { position: static; display: flex; flex-direction: column; gap: 32px; width: 100%; align-items: center; }
  .hm-stack__item { position: static; margin: 0; width: min(1202px, calc(100vw - 40px)); transform: none !important; opacity: 1 !important; }
  .hm-more { position: static; transform: none !important; opacity: 1 !important; visibility: visible !important; margin-top: 80px; }
}

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .hm-feature { flex-direction: column; height: auto; gap: 0; }
  .hm-feature__body { flex: none; max-width: none; padding: 32px 28px; gap: 28px; }
  .hm-feature__media { min-height: 260px; border-radius: 0; }
}
@media (max-width: 900px) {
  .hm-hero { padding: 120px 24px 0; }
}
@media (max-width: 760px) {
  .page { gap: 80px; }
  .hm-hi, .hm-im { font-size: 24px; }
  .hm-typer { font-size: 28px; }
  .hm-typer__caret { height: 38px; }
  .hm-sub { font-size: 22px; line-height: 1.45; }
  .hm-about { font-size: 16px; line-height: 26px; }
  .hm-more__head h2 { font-size: 22px; }
  .hm-more__head p { font-size: 16px; }
  .hm-more__head p br { display: none; }
  /* celular: os 4 cards numa grade 2 × 2, menores e sem sobreposição */
  .hm-fan { display: grid; grid-template-columns: repeat(2, 150px); justify-content: center; gap: 22px 16px; width: auto; height: auto; margin: 8px 0 0; }
  .hm-fan__slot, .hm-fan__slot--1, .hm-fan__slot--2, .hm-fan__slot--3, .hm-fan__slot--4 { position: relative; left: auto; top: auto; width: 150px; height: 214px; margin: 0; }
  .hm-fan:hover .hm-fan__slot { transform: none; }
  .hm-mcard { zoom: .628; }
  .hm-footer__panel { padding: 28px 20px 20px; }
  .hm-footer__cat { width: 240px; height: auto; top: -10px; right: -40px; }
  .hm-marquee { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
  .hm-rise, .reveal { opacity: 1; transform: none; }
  .hm-marquee__track { animation: none; }
}

/* nav compartilhada: some ao rolar p/ baixo na home (fica ilegível sobre o card branco) */
.home .nav { transition: transform .45s var(--hm-ease), opacity .3s; }
.home .nav.is-hidden { transform: translateY(-120%); opacity: 0; pointer-events: none; }

/* "see all my work" some quando o rodapé entra na tela */
.hm-btn--yellow { transition: background .3s, color .3s, transform .3s var(--hm-ease), opacity .4s var(--hm-ease); }
.hm-btn--yellow.is-away { opacity: 0; transform: translateY(12px); pointer-events: none; }
