/* ============================================================
   Elton Carvalho — Portfolio V7 (home)
   Minimal: fundo neutro, tipografia como protagonista, uma cor de
   destaque só no ponto de status. Espaçamentos na grade de 4px.
   Anima só transform/opacity.
============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --bg:     #fafaf9;
  --bg-2:   #f0f0ee;   /* fundo das imagens */
  --ink:    #111110;
  --ink-2:  #55554f;   /* texto secundário */
  --ink-3:  #8c8c85;   /* rótulos */
  --line:   #e4e4e0;
  --accent: #3fb950;   /* só o ponto de "disponível" */

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 24px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

[data-theme="dark"] {
  --bg:    #0f0f0e;
  --bg-2:  #1a1a18;
  --ink:   #ededea;
  --ink-2: #a3a39c;
  --ink-3: #6f6f69;
  --line:  #262624;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -48px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  z-index: 50;
}
.skip:focus { top: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.nav[data-scrolled] { border-bottom-color: var(--line); }
.nav__in {
  display: flex; align-items: center; gap: 32px;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; letter-spacing: -0.01em;
}
.brand__mark { width: 24px; height: 24px; }
.nav__links {
  display: flex; gap: 28px;
  margin-left: auto;
  font-size: 14px; color: var(--ink-2);
}
.nav__links a { transition: color 160ms var(--ease); }
.nav__links a:hover { color: var(--ink); }

.theme {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--ink-2);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.theme:hover { color: var(--ink); background: var(--bg-2); }
.theme svg { width: 16px; height: 16px; }
.theme__moon { display: none; }
[data-theme="dark"] .theme__sun { display: none; }
[data-theme="dark"] .theme__moon { display: block; }

@media (max-width: 767px) {
  .nav__links { gap: 20px; }
  .nav__links a:not([href="#contact"]) { display: none; }
  .theme { margin-left: -8px; }
}

/* ---------- Hero ---------- */
.hero {
  display: grid; gap: 48px;
  padding-top: 32px;   /* celular e tablet: o topo já tem o menu fixo; no desktop vira 48px */
  padding-bottom: 32px;
}

/* Retrato recortado sobre um painel neutro, preso à base */
.hero__photo {
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 2 / 3;   /* alto o bastante para caber o iPad */
  background: var(--bg-2);   /* navegadores sem color-mix (iPhone antigo, Instagram) */
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--ink) 7%, var(--bg-2)), var(--bg-2) 70%);
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 45%;
  user-select: none; -webkit-user-drag: none;
}
/* celular: caixa horizontal em cima do texto, e o recorte "sai" pela borda de cima.
   A foto tem fundo transparente: a cabeça passa 30% da altura da caixa acima dela,
   o corpo é cortado embaixo com os cantos arredondados (clip-path com topo negativo). */
@media (max-width: 767px) {
  .hero { gap: 32px; container-type: inline-size; overflow-x: clip; grid-template-columns: minmax(0, 1fr); }   /* a coluna nunca passa da tela */
  .hero > * { min-width: 0; }   /* a foto larga não cria rolagem lateral */
  /* título proporcional à largura: "Product Designer" sempre numa linha, como no desktop */
  .hero .hero__title { font-size: min(calc(12.8vw - 6px), 60px); font-size: min(12.8cqi, 60px); }   /* vw antes: motor sem container query */
  .hero__photo {
    order: -1; position: relative; width: 100%; max-width: 480px;
    aspect-ratio: 16 / 10;
    margin-top: calc(min(100%, 480px) * 0.1875 + 8px);   /* a cabeça sobe 30% da altura da caixa (18,75% da largura): sempre abaixo do menu */
    overflow: visible;
    clip-path: inset(-100% 0 0 0 round 16px);
  }
  /* a foto tem a largura exata da caixa: não transborda dos lados, então não depende de overflow-x: clip
     (o navegador do Instagram em iPhone antigo ignora o clip e a página ficava mais larga que a tela) */
  .hero__photo img {
    position: absolute; left: 0; top: -54.5%;
    width: 100%; height: auto; max-width: 100%;
    object-fit: initial; transform: none;
  }
}
/* a partir do tablet: texto e foto lado a lado */
@media (min-width: 768px) {
  .hero { grid-template-columns: 7fr 4fr; align-items: center; gap: clamp(32px, 5vw, 64px); padding-top: 48px; }
}
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-2);
  margin-bottom: 32px;
}
.status__dot {
  position: relative;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: 0.6; }
  to   { transform: scale(3); opacity: 0; }
}

.hero__title {
  font-size: clamp(48px, 9.2vw, 136px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
@media (min-width: 768px) {
  .hero__title { font-size: clamp(44px, 6.4vw, 96px); }
}
.hero__lead {
  margin-top: clamp(32px, 5vh, 48px);
  max-width: 40ch;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}
.hero__meta { display: flex; flex-wrap: wrap; gap: 16px 48px; margin-top: 32px; font-size: 14px; }
.hero__meta dt { color: var(--ink-3); margin-bottom: 4px; }

/* ---------- Logos ---------- */
.clients { padding-bottom: 0; }
.clients__band {
  overflow: hidden;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.clients__track { display: flex; width: max-content; animation: clients 48s linear infinite; }
.clients__band:hover .clients__track { animation-play-state: paused; }
.clients__list { display: flex; align-items: center; gap: 88px; padding-right: 88px; }
.logo {
  flex: none;
  height: calc(15px * var(--h, 1));
  background: var(--ink-3);
  -webkit-mask: var(--l) center / contain no-repeat;
          mask: var(--l) center / contain no-repeat;
}
@keyframes clients { to { transform: translateX(-50%); } }
@media (max-width: 767px) {
  .clients__list { gap: 64px; padding-right: 64px; }
  .logo { height: calc(14px * var(--h, 1)); }
}
@media (prefers-reduced-motion: reduce) {
  .clients__track { animation: none; }
}

/* ---------- Seções ---------- */
.sec { padding-bottom: clamp(96px, 14vh, 160px); }
.sec__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 16px;
  margin-bottom: 40px;
  border-top: 1px solid var(--line);
}
.sec__title { font-size: 14px; font-weight: 500; }
.sec__meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ---------- Cases ---------- */
.cases { display: grid; gap: 48px 24px; }
.cases + .cases { margin-top: 64px; }
@media (min-width: 768px) {
  .cases--2 { grid-template-columns: repeat(2, 1fr); }
  .cases--3 { grid-template-columns: repeat(3, 1fr); }
}

.case { display: block; }
.case__media {
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-2);
  aspect-ratio: 16 / 10;
}
.cases--3 .case__media { aspect-ratio: 4 / 3; }
.case__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.case__info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  margin-top: 16px;
}
.case__name { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.cases--3 .case__name { font-size: 16px; }
.case__tags {
  align-self: center;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  white-space: nowrap;
}
.case__desc {
  grid-column: 1 / -1;
  max-width: 48ch;
  font-size: 15px; color: var(--ink-2);
}
.cases--3 .case__desc { font-size: 14px; }

/* Capa em movimento: vídeo por cima da imagem, só aparece quando já está tocando */
.case__media, .cover { position: relative; }
.motion {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease), transform 600ms var(--ease);
}
.motion.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .motion { display: none; } }

@media (hover: hover) {
  .case:hover .case__media img,
  .case:hover .case__media .motion { transform: scale(1.03); }
}
@media (max-width: 1100px) {
  .cases--3 .case__tags { display: none; }
}

/* ---------- Sobre ---------- */
.about { display: grid; gap: 40px; }
.about__photo {
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-2);
  aspect-ratio: 4 / 5;
  max-width: 440px;
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.about__lead {
  max-width: 28ch;
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.about__text {
  max-width: 56ch;
  margin-top: 24px;
  color: var(--ink-2);
}
.pillars {
  display: grid; gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pillars h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.pillars p { font-size: 14px; color: var(--ink-2); }
.links { display: flex; gap: 24px; margin-top: 40px; font-size: 15px; }
.links a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 160ms var(--ease);
}
.links a:hover { border-bottom-color: var(--ink); }

/* a partir do tablet: foto e texto lado a lado; os três pilares em colunas só no desktop */
@media (min-width: 768px) {
  .about { grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
  .about__photo { max-width: none; }
}
@media (min-width: 900px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Experiência ---------- */
.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.job:first-child { padding-top: 0; }
.job__when {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.job__role { font-weight: 500; }
.job__co { color: var(--ink-2); text-align: right; }
@media (min-width: 768px) {
  .job { grid-template-columns: 200px 1fr auto; align-items: baseline; }
  .job__when { grid-column: auto; font-size: 13px; }
}

/* ---------- Contato ---------- */
.contact { padding-bottom: clamp(96px, 14vh, 160px); }
.contact__in { padding-top: 64px; border-top: 1px solid var(--line); }
.contact__title {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  margin-bottom: 24px;
}
.contact__mail {
  display: inline-block;
  font-size: clamp(18px, 5.4vw, 80px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  padding-bottom: 4px;
  transition: background-size 400ms var(--ease);
}
.contact__mail:hover { background-size: 100% 2px; }
/* só no computador (home.js cria): dica que aparece no hover e confirma a cópia, sem empurrar nada */
.contact__hint {
  display: block; height: 20px; margin-top: 8px;
  font-size: 14px; line-height: 20px; color: var(--ink-2);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.contact__mail:hover + .contact__hint, .contact__mail:focus-visible + .contact__hint, .contact__hint.is-done { opacity: 1; transform: none; }
.contact__hint.is-done { color: var(--ink); }
.contact__hint + .contact__links { margin-top: 12px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding-inline: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 15px; font-weight: 500;
  transition: border-color 160ms var(--ease), opacity 160ms var(--ease);
}
.btn:hover { border-color: var(--ink-3); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { opacity: 0.88; border-color: var(--ink); }

@media (max-width: 767px) {
  .contact__links { display: grid; grid-template-columns: 1fr 1fr; }
  .contact__links .btn--solid { grid-column: 1 / -1; height: 52px; }
}

/* ---------- Rodapé ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding-top: 24px; padding-bottom: 32px;
  font-size: 13px; color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Card para a página do processo (home e case Clickmax): escuro, horizontal no desktop e vertical no celular */
.pbanner {
  --pb-ink: #f4f3ee; --pb-mute: rgba(244, 243, 238, 0.62); --pb-line: rgba(244, 243, 238, 0.12); --pb-stop: #ffd400;
  display: grid; gap: 32px; align-items: center;
  margin-top: 48px; padding: clamp(24px, 4vw, 48px);
  border-radius: 16px; color: var(--pb-ink);
  background: radial-gradient(120% 120% at 100% 0%, #2a2a24 0%, #111110 58%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
@media (min-width: 900px) { .pbanner { grid-template-columns: 1.15fr 1fr; gap: 48px; } }
.pbanner__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--pb-mute); }
.pbanner__eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pb-stop); }
.pbanner h3 { margin-top: 16px; max-width: 18ch; font-size: clamp(28px, 3.2vw, 40px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.pbanner p { margin-top: 16px; font-size: 16px; color: var(--pb-mute); text-wrap: pretty; }
.pbanner p b { color: var(--pb-ink); font-weight: 500; }
.pbanner__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; }
.pbanner__btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding-inline: 20px;
  border-radius: 999px; background: var(--pb-ink); color: #111110; font-size: 15px; font-weight: 500;
  transition: opacity 160ms var(--ease);
}
.pbanner__btn svg { width: 14px; height: 14px; transition: transform 200ms var(--ease); }
.pbanner__note { font-family: var(--mono); font-size: 12px; color: var(--pb-mute); }
.pbanner__flow { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--pb-line); }
.pbanner__step { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; padding: 4px 8px; border-radius: 8px; font-size: 14px; opacity: 0.2; transition: opacity 400ms var(--ease); transition-delay: calc(var(--i) * 90ms + 200ms); }
.pbanner__step i { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--pb-mute); }
.pbanner__step em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--pb-stop); }
.pbanner__step--stop { background: rgba(255, 212, 0, 0.12); box-shadow: inset 2px 0 0 var(--pb-stop); }
.pbanner__step--stop i { color: var(--pb-stop); }
.is-in .pbanner__step { opacity: 0.9; }
.is-in .pbanner__step--stop { opacity: 1; }
@media (hover: hover) {
  .pbanner:hover .pbanner__btn { opacity: 0.9; }
  .pbanner:hover .pbanner__btn svg { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) { .pbanner__step { transition: none; } }
.pbanner-wrap .pbanner { margin-top: 0; }

/* ---------- Celular: menu de app embaixo e ajustes de ritmo ---------- */
/* A barra é criada pelo home.js em todas as páginas com o menu do topo (home, cases, processo, 404). */
.tabbar { display: none; }
@media (max-width: 767px) {
  .nav__links { display: none; }
  .theme { margin-left: auto; }
  body.has-tabbar { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  /* atrás do menu: o conteúdo desfoca e some num degradê da cor do fundo, como em app */
  body.has-tabbar::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 49; pointer-events: none;
    height: calc(128px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(250, 250, 249, 0), var(--bg) 78%);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    -webkit-mask: linear-gradient(to bottom, transparent, #000 45%); mask: linear-gradient(to bottom, transparent, #000 45%);
  }
  [data-theme="dark"] body.has-tabbar::after { background: linear-gradient(to bottom, rgba(15, 15, 14, 0), var(--bg) 78%); }

  .tabbar {
    position: fixed; z-index: 50;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 4px; border-radius: 20px;
    /* preto nos dois temas, com o destaque branco */
    background: rgba(17, 17, 16, 0.94);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  }
  .tabbar__pill {
    position: absolute; top: 4px; bottom: 4px; left: 4px;
    width: calc((100% - 8px) / 4); border-radius: 16px;
    background: #f4f3ef;
    transform: translateX(calc(var(--i, 0) * 100%));
    opacity: 0;
    transition: transform 520ms cubic-bezier(0.34, 1.4, 0.64, 1), opacity 200ms var(--ease);
  }
  .tabbar[data-on] .tabbar__pill { opacity: 1; }
  .tabbar a {
    position: relative; z-index: 1;
    display: grid; justify-items: center; gap: 4px;
    padding: 8px 0 6px; border-radius: 16px;
    font-size: 12px; font-weight: 500; line-height: 1; color: #a3a39c;
    -webkit-tap-highlight-color: transparent;
    transition: color 240ms var(--ease), transform 160ms var(--ease);
  }
  .tabbar a:active { transform: scale(0.92); }
  .tabbar a[aria-current] { color: #111110; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.is-pop svg { animation: tabpop 520ms cubic-bezier(0.34, 1.6, 0.64, 1); }
  @keyframes tabpop { 0% { transform: scale(0.7) translateY(2px); } 60% { transform: scale(1.12) translateY(-2px); } 100% { transform: none; } }

  /* ritmo: seções menos espaçadas, alvos de toque com 44px */
  .sec, .contact { padding-bottom: 72px; }
  .links { gap: 8px; margin-top: 32px; }
  .links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; }
  .contact__mail { padding-block: 8px; }
  .ch__back { display: inline-flex; align-items: center; min-height: 44px; }
  /* faixa de logos mais baixa: menos vão antes e menos respiro dentro */
  .hero { padding-bottom: 32px; }
  .clients__band { padding: 12px 0; }
  .clients__list { gap: 48px; padding-right: 48px; }
  /* botões com largura total, como em app (o principal ocupa a linha; os secundários dividem a de baixo) */
  .btn { width: 100%; height: 48px; }
  .contact__links { gap: 8px; }
  .contact__links .btn { flex: 1 1 0; }
  .contact__links .btn--solid { flex-basis: 100%; }
  .links a { flex: 1 1 0; justify-content: center; }
  .pbanner__foot { flex-direction: column; align-items: stretch; text-align: center; }
  .pbanner__btn { justify-content: center; height: 48px; }
  .foot { padding-bottom: 24px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .tabbar__pill, .tabbar a { transition: none; }
  .tabbar a.is-pop svg { animation: none; }
}
