/* ===== VARIÁVEIS ===== */
:root {
  --bg: #0b0b0d;
  --surface: #131316;
  --line: #232329;
  --line-strong: #34343c;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #8a8a93;

  /* Um único acento: azul dessaturado. */
  --accent: #3a6fd1;
  --accent-hover: #3163bd;
  --accent-text: #9dbcf2;

  --font: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --container: 1180px;
  --header-h: 4rem;

  --z-float: 10;
  --z-header: 20;
  --z-skip: 30;
  --z-grain: 40;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  scrollbar-color: var(--line-strong) var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 70% 45% at 70% -5%, rgba(255, 255, 255, 0.05), transparent 70%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Grão fixo por cima de tudo: tira a cara de tela "chapada". */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-skip);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ===== BOTÕES E LINKS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.35rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 8px 24px -8px rgba(58, 111, 209, 0.6);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn--sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 200ms ease;
}

.link-arrow .fa-arrow-right,
.link-arrow .fa-arrow-up-right-from-square {
  font-size: 0.75em;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: var(--accent-hover);
  }

  .link-arrow:hover {
    color: var(--accent-text);
  }

  .link-arrow:hover .fa-arrow-right {
    transform: translateX(3px);
  }

  .link-arrow:hover .fa-arrow-up-right-from-square {
    transform: translate(2px, -2px);
  }
}

/* ===== HEADER / NAV ===== */
.header {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-h);
  z-index: var(--z-header);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.header.scrolled {
  background: rgba(11, 11, 13, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--line);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__logo,
.footer__logo {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav__logo {
  margin-right: auto;
}

.nav__logo span,
.footer__logo span {
  color: var(--accent-text);
}

.nav__menu {
  display: flex;
  gap: 0.25rem;
}

.nav__link {
  display: block;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 200ms ease, background-color 200ms ease;
}

.nav__link.active {
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }
}

.nav__toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: -0.5rem;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 4rem;
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 4rem;
}

.hero__status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c373;
  box-shadow: 0 0 0 3px rgba(52, 195, 115, 0.18);
}

.hero__name {
  font-size: clamp(3rem, 8.5vw, 6rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero__role {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

.hero__description {
  margin-top: 1rem;
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2.25rem;
}

.hero__social {
  display: flex;
  gap: 0.5rem;
  margin-top: 2.5rem;
  margin-left: -0.6rem;
  font-size: 1.15rem;
  color: var(--text-faint);
}

.hero__social a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  transition: color 200ms ease, background-color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero__social a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
  }
}

.hero__image {
  justify-self: end;
}

.hero__avatar {
  width: min(340px, 100%);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

/* Entrada do hero: o único momento coreografado da página. */
.js .intro {
  animation: intro 900ms var(--ease-out) both;
}

.js .intro:nth-child(2) { animation-delay: 60ms; }
.js .intro:nth-child(3) { animation-delay: 120ms; }
.js .intro:nth-child(4) { animation-delay: 180ms; }
.js .intro:nth-child(5) { animation-delay: 240ms; }
.js .intro:nth-child(6) { animation-delay: 300ms; }
.js .hero__image.intro { animation-delay: 150ms; }

@keyframes intro {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
}

/* ===== SEÇÕES ===== */
.section {
  padding-top: 8rem;
}

.section__title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 3.5rem;
}

.subhead {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags li {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ===== PROJETOS ===== */
.works {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 7rem;
}

/* Cada projeto é um cartão: foto e texto ficam presos no mesmo bloco. */
.work {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3.5rem;
  align-items: center;
  padding: 1.25rem 3rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.work:nth-child(even) {
  padding: 1.25rem 1.25rem 1.25rem 3rem;
}

/* Zig-zag: projetos pares com a imagem à direita. */
.work:nth-child(even) .work__media {
  order: 2;
}

.work__media {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.75rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.work__cover {
  width: 100%;
  border-radius: 10px;
}

.gallery {
  display: grid;
  gap: 0.6rem;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
}

.gallery--erp {
  grid-template-columns: 1fr 2fr 2fr 1fr;
}

.gallery--erp img:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

/* Prints do celular inteiros, centralizados abaixo do painel. */
.gallery--erp img:nth-child(2) {
  grid-column: 2;
}

.gallery--erp img:not(:first-child) {
  aspect-ratio: 480 / 1040;
}

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

.gallery--phones img {
  aspect-ratio: 9 / 17;
}

/* Cada cartão sobe já com foto e texto quando entra na tela. */
.js .work {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 600ms ease, transform 800ms var(--ease-out);
}

.js .work.is-visible {
  opacity: 1;
  transform: none;
}

.work__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
}

.work__info h3 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.work__info > p,
.other > p {
  color: var(--text-muted);
  max-width: 62ch;
}

.work__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.work__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.others {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 4rem;
}

.other {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 2rem;
}

.other h4 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.other > :last-child {
  margin-top: auto;
}

/* ===== SOBRE ===== */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 4rem;
  align-items: start;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 62ch;
}

.about__text p:first-child {
  color: var(--text);
}

.stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.stack__group h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.stack__group ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ===== TRAJETÓRIA ===== */
.entries {
  margin-bottom: 4rem;
}

.entry {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.entry__period {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  padding-top: 0.3rem;
}

.entry h4 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.entry__place {
  color: var(--accent-text);
  font-size: 0.95rem;
  margin: 0.2rem 0 0.9rem;
}

.entry__place + p {
  color: var(--text-muted);
  max-width: 65ch;
}

/* ===== CONTATO ===== */
.contact {
  padding-bottom: 2rem;
}

.contact__title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.contact__text {
  margin: 1.5rem 0 2.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line-strong);
  transition: color 200ms ease, border-color 200ms ease;
}

.contact__email i {
  font-size: 0.7em;
  transition: transform 200ms var(--ease-out);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 2.5rem;
  color: var(--text-muted);
}

.contact__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .contact__email:hover {
    color: var(--accent-text);
    border-color: var(--accent-text);
  }

  .contact__email:hover i {
    transform: translateX(4px);
  }

  .contact__links a:hover {
    color: var(--text);
  }
}

/* ===== FOOTER ===== */
/* Sem padding lateral: a linha do topo acompanha a largura do conteúdo. */
.footer {
  width: calc(100% - 2rem);
  max-width: calc(var(--container) - 2rem);
  padding-left: 0;
  padding-right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 6rem;
  padding-top: 2rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ===== WHATSAPP FLUTUANTE ===== */
.whatsapp-float {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: var(--z-float);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #fff;
  border-radius: 16px;
  font-size: 1.6rem;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.5);
  transition: transform 160ms var(--ease-out);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
  .whatsapp-float:hover {
    transform: translateY(-2px);
  }
}

/* ===== MOVIMENTO REDUZIDO ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .intro {
    animation: fade 300ms ease both;
  }

  .js .work {
    transform: none;
    transition: opacity 300ms ease;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ===== RESPONSIVO ===== */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: auto;
    padding-top: calc(var(--header-h) + 2.5rem);
  }

  .hero__image {
    order: -1;
    justify-self: start;
  }

  .hero__avatar {
    width: 132px;
    border-radius: 16px;
  }

  .work,
  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .work:nth-child(even) .work__media {
    order: 0;
  }

  .work,
  .work:nth-child(even) {
    padding: 0.75rem 0.75rem 1.75rem;
  }

  .work__info {
    padding: 0 0.75rem;
  }

  .works {
    gap: 1.5rem;
    margin-bottom: 5rem;
  }

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

@media (max-width: 768px) {
  .nav__cta {
    display: none;
  }

  .nav__toggle {
    display: grid;
    place-items: center;
  }

  /* Menu sai do botão (canto superior direito), não do centro. */
  .nav__menu {
    position: absolute;
    top: calc(var(--header-h) - 0.25rem);
    right: 1rem;
    min-width: 12rem;
    flex-direction: column;
    padding: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96) translateY(-4px);
    transition: opacity 150ms ease, transform 150ms var(--ease-out), visibility 150ms;
  }

  .nav__menu.show-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-duration: 200ms;
  }

  .nav__link {
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
  }

  .section {
    padding-top: 6rem;
  }

  .section__title {
    margin-bottom: 2.5rem;
  }

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

  .entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.5rem 0;
  }

  .footer {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}
