/* ————— João Mota · paleta editorial clara ————— */

:root {
  --bg: #eae6dd;
  --bg-soft: #f1eee7;
  --ink: #131313;
  --ink-dim: #67635b;
  --accent: #f05235;
  --line: rgba(19, 19, 19, 0.14);
  --font-display: "Archivo Black", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-hand: "Caveat", cursive;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain subtil sobre tudo */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-3%, -3%); }
  80% { transform: translate(2%, 2%); }
}

/* ————— nav ————— */
.nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 2.4rem));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.7rem 0.6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(234, 230, 221, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: navIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.45s backwards;
}
@keyframes navIn {
  from { transform: translate(-50%, -130%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}
.nav__logoimg {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  display: block;
}
.nav__wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 0.35rem 0;
}
.nav__dot { color: var(--accent); }
.nav__links {
  display: flex;
  gap: 1.8rem;
  align-items: center;
}
.nav__links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.25s;
}
.nav__links a:hover { color: var(--accent); }
.nav__cta {
  background: var(--ink);
  color: var(--bg) !important;
  border-radius: 8px;
  padding: 0.55rem 1.15rem;
}
.nav__cta:hover { background: var(--accent); color: var(--bg) !important; }

/* ————— hero ————— */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: var(--bg);
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  transition: transform 1.9s cubic-bezier(0.22, 1, 0.36, 1);
  /* a borda esquerda do vídeo funde-se com o creme — nunca há linha de separação */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 24%);
}
.hero.is-final .hero__video { transform: translateX(9%) scale(1.03); }

/* overlay creme que entra pela esquerda quando o vídeo termina */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    100deg,
    rgba(234, 230, 221, 1) 0%,
    rgba(234, 230, 221, 0.97) 22%,
    rgba(234, 230, 221, 0.86) 38%,
    rgba(234, 230, 221, 0.35) 58%,
    rgba(234, 230, 221, 0) 80%
  );
  /* já visível desde o arranque — esconde a emenda quando o vídeo desliza */
  opacity: 0.55;
  transition: opacity 1.9s ease;
  pointer-events: none;
}
.hero.is-final .hero__overlay { opacity: 1; }

/* texto à esquerda */
.hero__copy {
  position: absolute;
  z-index: 3;
  left: clamp(1.2rem, 6vw, 6.5rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: min(46rem, 54vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hero.is-final .hero__copy {
  opacity: 1;
  pointer-events: auto;
}
.hero__kicker {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--accent);
  margin-bottom: 0.6rem;
  transform: rotate(-2deg);
  transform-origin: left bottom;
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 8.8vw, 7.8rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
/* padding-top dá espaço ao til do Ã dentro do overflow:hidden da animação */
.hero__name .line {
  display: block;
  overflow: hidden;
  padding-top: 0.14em;
  margin-top: -0.08em;
}
.hero__name .word {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__name .line:nth-child(2) .word { transition-delay: 0.12s; }
.word--accent { color: var(--accent); }

.hero__tag {
  margin-top: 1.3rem;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 34rem;
}
.hero__tag em {
  color: var(--ink);
  font-style: normal;
  border-bottom: 2px solid var(--accent);
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.1rem;
}
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.85rem 1.6rem;
  transition: transform 0.25s, background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid {
  background: var(--ink);
  color: var(--bg);
}
.btn--solid:hover { background: var(--accent); color: #fff; }
.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(241, 238, 231, 0.6);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* reveal com stagger */
.reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero.is-final .word { transform: translateY(0); }
.hero.is-final .reveal-item { opacity: 1; transform: translateY(0); }
.hero.is-final .hero__kicker { transition-delay: 0.25s; transform: rotate(-2deg) translateY(0); }
.hero.is-final .hero__tag { transition-delay: 0.55s; }
.hero.is-final .hero__actions { transition-delay: 0.75s; }

/* replay */
.hero__replay {
  position: absolute;
  z-index: 5;
  right: 1.6rem;
  bottom: 1.6rem;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(234, 230, 221, 0.6);
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s, border-color 0.25s, color 0.25s;
  backdrop-filter: blur(6px);
}
.hero.is-final .hero__replay { opacity: 1; pointer-events: auto; }
.hero__replay:hover { border-color: var(--accent); color: var(--accent); }

/* scroll hint */
.hero__scroll {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  width: 1px;
  height: 3.4rem;
  background: var(--line);
  overflow: hidden;
}
.hero__scroll span {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--accent);
  animation: scrollhint 2.2s ease-in-out infinite;
}
@keyframes scrollhint {
  0% { top: -40%; }
  60%, 100% { top: 110%; }
}
/* ————— secções ————— */
.section {
  padding: clamp(5rem, 12vh, 9rem) clamp(1.2rem, 6vw, 6.5rem);
  max-width: 1200px;
  margin: 0 auto;
}
.section__label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}
/* traço laranja que se desenha quando a secção entra */
.section__label::before {
  content: "";
  display: inline-block;
  width: 1.8rem;
  height: 2px;
  background: var(--accent);
  margin-right: 0.6rem;
  vertical-align: middle;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}
.section.in-view .section__label::before { transform: scaleX(1); }
.section__head { margin-bottom: 3rem; }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

/* reveal on scroll */
.section .section__label,
.section .manifesto__note,
.section .section__title,
.section .card,
.section .about__quote,
.section .about__bio,
.section .contact__title,
.section .contact__btn {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
/* variações com mais personalidade */
.section .card { transform: translateY(44px) rotate(1.2deg); }
.section .card:nth-child(2) { transform: translateY(44px) rotate(-1.2deg); }
.section .about__quote { transform: translateY(30px) scale(0.965); }
.section .contact__title { transform: translateY(30px) scale(0.94); letter-spacing: 0.06em; }
.section.in-view .section__label,
.section.in-view .manifesto__note,
.section.in-view .section__title,
.section.in-view .card,
.section.in-view .about__quote,
.section.in-view .about__bio,
.section.in-view .contact__title,
.section.in-view .contact__btn {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
}
.section.in-view .contact__title { letter-spacing: 0.005em; }
.section.in-view .card:nth-child(2) { transition-delay: 0.1s; }
.section.in-view .card:nth-child(3) { transition-delay: 0.2s; }
.section.in-view .manifesto__note { transition-delay: 0.25s; }
.section.in-view .about__bio { transition-delay: 0.15s; }
.section.in-view .contact__btn { transition-delay: 0.2s; }

/* manifesto — as palavras acendem uma a uma com o scroll */
.manifesto { padding-top: clamp(3rem, 7vh, 5rem); }
.manifesto__text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  max-width: 26ch;
}
.manifesto__text em {
  font-style: normal;
  color: var(--accent);
}
.manifesto__text .w {
  opacity: 0.13;
  transition: opacity 0.45s ease;
}
.section.in-view .manifesto__text .w { opacity: 1; }
.manifesto__note {
  margin-top: 2.2rem;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--ink-dim);
  transform: rotate(-1.5deg);
  transform-origin: left top;
}

/* trabalho */
.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--bg-soft);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(19, 19, 19, 0.08);
}
.card__idx {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0.9rem 0 0.6rem;
}
.card__desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-bottom: 1.4rem;
}
.card__tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.card--accent { background: linear-gradient(160deg, rgba(240, 82, 53, 0.09), var(--bg-soft) 55%); }

/* percurso */
.cv__list {
  border-top: 1px solid var(--line);
}
.cv__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.cv__when {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.cv__role {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.cv__org {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.cv__desc {
  margin-top: 0.55rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 40rem;
}
.cv__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 2.2rem;
}
.chip {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.chip--hot {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 82, 53, 0.07);
}
.cv__note {
  margin-top: 1.8rem;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--ink-dim);
  transform: rotate(-1.5deg);
  transform-origin: left top;
}

/* reveal do percurso */
.section .cv__item,
.section .cv__skills,
.section .cv__note {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.section.in-view .cv__item,
.section.in-view .cv__skills,
.section.in-view .cv__note {
  opacity: 1;
  transform: translateY(0);
}
.section.in-view .cv__item:nth-child(2) { transition-delay: 0.1s; }
.section.in-view .cv__item:nth-child(3) { transition-delay: 0.2s; }
.section.in-view .cv__item:nth-child(4) { transition-delay: 0.3s; }
.section.in-view .cv__skills { transition-delay: 0.4s; }
.section.in-view .cv__note { transition-delay: 0.55s; }

/* sobre */
.about__quote {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
.about__quote em { font-style: normal; color: var(--accent); }
.about__bio {
  margin-top: 1.8rem;
  max-width: 44rem;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-dim);
}
.about__linkedin {
  display: inline-block;
  margin-top: 1.6rem;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease 0.3s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}
.section.in-view .about__linkedin { opacity: 1; transform: translateY(0); }

/* contacto */
.contact { text-align: center; padding-bottom: clamp(4rem, 10vh, 7rem); }
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin-bottom: 2.4rem;
}
.contact__title em { font-style: normal; color: var(--accent); }
.contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.contact__btn { display: inline-block; }
.section .contact__actions {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease 0.2s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.section.in-view .contact__actions { opacity: 1; transform: translateY(0); }

/* footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3.2rem);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ————— responsive ————— */
@media (max-width: 900px) {
  .hero__copy {
    max-width: 90vw;
    top: auto;
    bottom: 9vh;
    transform: none;
  }
  .hero__overlay {
    background: linear-gradient(
      to top,
      rgba(234, 230, 221, 1) 0%,
      rgba(234, 230, 221, 0.8) 38%,
      rgba(234, 230, 221, 0.25) 68%,
      rgba(234, 230, 221, 0) 100%
    );
  }
  .hero__name { font-size: clamp(3.6rem, 16vw, 6rem); }
  /* navbar compacta em mobile — mantém todas as opções visíveis */
  .nav { padding: 0.5rem 0.6rem 0.5rem 0.8rem; }
  .nav__links { gap: 0.9rem; }
  .nav__links a { font-size: 0.72rem; letter-spacing: 0.03em; }
  .nav__cta { padding: 0.45rem 0.8rem; }
  .nav__logoimg { width: 1.8rem; height: 1.8rem; }
  .hero.is-final .hero__video { transform: none; }
  .work__grid { grid-template-columns: 1fr; }
  .cv__item { grid-template-columns: 1fr; gap: 0.3rem; }
  .footer { flex-direction: column; gap: 0.4rem; }
}

/* ecrãs muito pequenos: só o ícone, sem wordmark */
@media (max-width: 480px) {
  .nav__wordmark { display: none; }
  .nav__links { gap: 0.7rem; }
}
