/* ==========================================================================
   Fontes (servidas deste domínio; licença OFL)
   ========================================================================== */
@font-face { font-family: "Dosis"; font-style: normal; font-weight: 200; font-display: swap; src: url("../fonts/dosis-latin-200-normal.woff2") format("woff2"); }
@font-face { font-family: "Dosis"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/dosis-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Dosis"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/dosis-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/lato-latin-700-normal.woff2") format("woff2"); }

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #0d1214;
  --ink: #e1e8e9;
  --dim: #8a9ca1;
  --line: #243138;
  --accent: #f2b45a;
  --accent-ink: #1a1204;
  --dot: rgba(111, 211, 217, 0.16);   /* pontos do fundo (ciano discreto) */

  --f-thin: "Dosis", system-ui, sans-serif;
  --f-body: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1.25rem, 6vw, 2.5rem);   /* margem lateral no layout vertical */
  --gutter-h: clamp(3rem, 8vw, 8rem);      /* margem lateral no layout horizontal */
  --n: 5;                                   /* número de painéis (mantenha igual ao HTML) */
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Fundo fixo: um brilho discreto no canto, para o preto não ficar chapado */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(110% 80% at 88% -10%, #16262a 0%, rgba(13, 18, 20, 0) 60%);
  pointer-events: none;
}

/* Fundo de pontos: fixo, atrás de todas as seções. O JS o desloca com o mouse e a rolagem. */
.dot-grid {
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 26px 26px;
  will-change: transform;
}

a { color: inherit; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }

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

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

/* ==========================================================================
   Régua de navegação
   Vertical (padrão): barra fixa no topo. Horizontal (.h-mode): base da tela.
   ========================================================================== */
.rail {
  position: fixed;
  z-index: 20;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.35rem var(--gutter) 0.35rem;
  background: rgba(13, 18, 20, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.rail__bar {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.rail__fill {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.rail__brand {
  display: none;
  font: 300 1.05rem/1 var(--f-thin);
  color: var(--dim);
  letter-spacing: 0.02em;
}

.rail nav { width: 100%; }
.rail ul { display: flex; justify-content: space-between; gap: 0.5rem; }
.rail a {
  display: inline-block;
  padding: 0.7rem 0.15rem;
  font: 300 1.05rem/1 var(--f-thin);
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s;
}
.rail a:hover { color: var(--ink); }
.rail a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.rail__home { display: none; }

@media (min-width: 640px) {
  .rail { padding-left: var(--gutter-h); padding-right: var(--gutter-h); }
  .rail__brand { display: block; white-space: nowrap; }
  .rail nav { width: auto; }
  .rail ul { gap: clamp(1.25rem, 3vw, 2.5rem); }
  .rail__home { display: block; }
}

.h-mode .rail {
  top: auto; bottom: 0;
  padding-top: 0.5rem; padding-bottom: 0.9rem;
  background: linear-gradient(to top, var(--bg) 45%, rgba(13, 18, 20, 0));
  border-bottom: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.h-mode .rail__bar { bottom: auto; top: 0; background: var(--line); height: 1px; }
.h-mode .rail__fill { height: 1px; }

/* ==========================================================================
   Painéis: layout vertical (celular, telas baixas, movimento reduzido)
   ========================================================================== */
.panel {
  position: relative;
  padding: 5.5rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--line);
}
.panel:first-child { border-top: 0; }

.panel__inner { width: 100%; max-width: 70rem; }

.title {
  font: 200 clamp(3.25rem, 15vw, 5rem)/1 var(--f-thin);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

/* ----- Início ----- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-bottom: 12rem;
  overflow: hidden;
}
.hero__copy { position: relative; z-index: 1; }

.kicker {
  font: 200 clamp(1.5rem, 6vw, 2.2rem)/1 var(--f-thin);
  color: var(--dim);
  margin-bottom: 0.9rem;
  animation: tracking 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}

.hero h1 {
  font: 400 clamp(3.4rem, 17vw, 6rem)/1.02 var(--f-body);
  letter-spacing: -0.025em;
}
.mask { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.name { display: inline-block; animation: rise 1.15s cubic-bezier(0.16, 0.9, 0.2, 1) 0.3s both; }
.name--2 { animation-delay: 0.45s; }

.role {
  max-width: 28rem;
  margin-top: 1.75rem;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--dim);
  animation: settle 1.2s ease 1.1s both;
}

.hero__links {
  display: flex;
  gap: 0.35rem;
  margin: 1.5rem 0 0 -0.6rem;
  animation: settle 1.2s ease 1.3s both;
}
.hero__links a {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  font-size: 1.35rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.hero__links a:hover { color: var(--ink); transform: translateY(-2px); }

/* Terminal decorativo ao fundo */
.term {
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  bottom: 3rem;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.term pre {
  margin: 0;
  font: 400 0.78rem/1.7 var(--f-mono);
  color: var(--dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 8.5rem;
}
.cursor {
  display: inline-block;
  width: 0.55em; height: 1.1em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.hint {
  position: absolute;
  left: var(--gutter);
  bottom: 1rem;
  font: 300 0.95rem/1 var(--f-thin);
  color: var(--dim);
  animation: settle 1.2s ease 2.6s both;
}
.hint__h { display: none; }

/* ----- Sobre ----- */
.about { display: grid; gap: 2rem; }
.about__text { max-width: 36rem; }
.about__text p + p { margin-top: 1rem; color: var(--dim); }
.lead { font-weight: 300; font-size: clamp(1.3rem, 5vw, 1.65rem); line-height: 1.4; }

.facts { display: grid; gap: 1.1rem; max-width: 34rem; }
.facts > div { padding-left: 1rem; border-left: 1px solid var(--line); }
.facts dt { font: 300 1.05rem/1.2 var(--f-thin); color: var(--accent); margin-bottom: 0.15rem; }
.facts dd { font-size: 0.98rem; line-height: 1.5; }

/* ----- Experiência ----- */
.jobs { display: grid; gap: 1.5rem 3rem; }
.jobs li { padding-left: 1rem; border-left: 1px solid var(--line); }
.jobs h3 { font: 700 1.05rem/1.35 var(--f-body); }
.jobs .where { font: 300 1.05rem/1.3 var(--f-thin); color: var(--accent); margin: 0.1rem 0 0.4rem; }
.jobs li > p:not(.where) { color: var(--dim); font-size: 0.98rem; line-height: 1.55; }
.jobs li > p:not(.where) + p:not(.where) { margin-top: 0.5rem; }

/* ----- Projetos ----- */
.showcase { display: grid; gap: 2.25rem; grid-template-columns: 1fr; }
.tile { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0f11;
}
.tile img.tile__logo {
  object-fit: contain;
  padding: 0.6rem 0;
  background: #e9eeee;          /* o logo tem texto azul-escuro: precisa de fundo claro */
  border-color: #e9eeee;
}
.tile h3 { font: 400 clamp(1.3rem, 5vw, 1.55rem)/1.25 var(--f-body); }
.tile p { margin-top: 0.3rem; color: var(--dim); font-size: 0.96rem; line-height: 1.5; }
.tile .credit { margin-top: 0.5rem; font-size: 0.8rem; color: var(--dim); opacity: 0.75; }
.work__year { font: 300 1.05rem/1 var(--f-thin); color: var(--dim); margin-left: 0.4rem; }
.work__link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s;
}
.work__link:hover { background-size: 100% 1px; }

/* ----- Contato ----- */
.contact { display: grid; gap: 2.25rem; }

.form { display: grid; gap: 1.25rem; max-width: 34rem; }
.field { display: grid; gap: 0.2rem; }
.field label { font: 300 1.05rem/1.2 var(--f-thin); color: var(--dim); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.55rem 0;
  font: 400 1.05rem/1.5 var(--f-body);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.2s;
  resize: vertical;
}
.field input:hover, .field textarea:hover { border-bottom-color: var(--dim); }
.field input:focus, .field textarea:focus { outline: 0; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.3rem;
  font: 700 1rem/1 var(--f-body);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.status { min-height: 1.5em; font-size: 0.98rem; color: var(--dim); }
.status[data-kind="ok"] { color: var(--accent); }
.status[data-kind="error"] { color: #ff9b8f; }

.direct { display: grid; gap: 0.25rem; align-content: start; }
.direct a {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: var(--ink);
}
.direct a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.direct i { width: 1.5rem; text-align: center; color: var(--accent); font-size: 1.15rem; }

.blessing { margin-top: 0.5rem; font: 200 1.25rem/1.4 var(--f-thin); color: var(--dim); max-width: 26rem; }

/* ==========================================================================
   Layout horizontal (desktop): o JS liga .h-mode e o GSAP move a faixa
   ========================================================================== */
/* O snap do GSAP controla a rolagem; "smooth" no CSS faria os dois brigarem e pularem painéis.
   A rolagem suave dos links da régua é pedida pelo JS (behavior: 'smooth'). */
.h-mode { scroll-behavior: auto; }
.h-mode body { overflow-x: hidden; }

.h-mode .stage { height: 100svh; overflow: clip; }
.h-mode .track { display: flex; width: calc(100% * var(--n)); height: 100%; will-change: transform; }

.h-mode .panel {
  flex: 0 0 calc(100% / var(--n));
  height: 100svh;
  padding: 0 var(--gutter-h) 5rem;
  display: flex;
  align-items: center;
  border-top: 0;
  border-left: 1px solid var(--line);
}
.h-mode .panel:first-child { border-left: 0; }

.h-mode .title { font-size: clamp(3.25rem, min(7vw, 12vh), 7rem); margin-bottom: clamp(1.5rem, 4vh, 3rem); }

/* Início */
.h-mode .hero { padding-bottom: 5rem; }
.h-mode .kicker { font-size: clamp(2rem, 3.2vw, 3rem); margin-bottom: 1.2rem; }
.h-mode .hero h1 { font-size: clamp(5rem, 9vw, 9.5rem); }
.h-mode .mask { display: inline-block; margin-right: 0.06em; }
.h-mode .role { font-size: 1.3rem; max-width: 30rem; margin-top: 2.25rem; }
.h-mode .term {
  left: auto; right: var(--gutter-h);
  bottom: 14vh;
  width: min(34rem, 38vw);
}
.h-mode .term pre { font-size: 0.88rem; min-height: 9.5rem; }
.h-mode .hint { left: var(--gutter-h); bottom: 4.75rem; }
.h-mode .hint__h { display: inline; }
.h-mode .hint__v { display: none; }

/* Sobre */
.h-mode .about { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.h-mode .lead { font-size: clamp(1.5rem, 2.2vw, 2rem); }

/* Experiência */
.h-mode .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.85rem, 2.2vh, 1.5rem) clamp(2rem, 4vw, 3rem); }

/* Projetos: 4 imagens lado a lado. O tamanho respeita a altura (nada corta no topo) e a largura da tela. */
.h-mode .proj {
  --gap: clamp(1.25rem, 2.6vw, 2.75rem);
  --tile: min(22rem, calc(27vh * 16 / 9), calc((100vw - 1rem - 2 * var(--gutter-h) - 3 * var(--gap)) / 4));
}
.h-mode .showcase {
  grid-template-columns: repeat(4, var(--tile));
  gap: var(--gap);
  align-items: start;
}

/* Contato: formulário à esquerda; contatos diretos e a bênção à direita. Compacta conforme a altura. */
.h-mode .contact {
  grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0 clamp(2rem, 8vw, 8rem);
  align-items: start;
}
.h-mode .contact .form { grid-column: 1; grid-row: 1 / span 2; gap: clamp(0.75rem, 2vh, 1.25rem); }
.h-mode .contact .direct { grid-column: 2; grid-row: 1; }
.h-mode .contact .blessing { grid-column: 2; grid-row: 2; align-self: end; margin: 0; }
.h-mode .field textarea { height: clamp(5rem, 15vh, 9rem); }

/* ==========================================================================
   Telas médias e largas no layout vertical (ex.: tablet)
   ========================================================================== */
@media (min-width: 640px) {
  .panel { padding-left: var(--gutter-h); padding-right: var(--gutter-h); }
  .term { left: var(--gutter-h); right: var(--gutter-h); }
  .hint { left: var(--gutter-h); }
  .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
}

/* ==========================================================================
   Animações
   ========================================================================== */
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@keyframes tracking { from { opacity: 0; letter-spacing: 0.45em; } to { opacity: 1; letter-spacing: 0.01em; } }
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kicker, .name, .role, .hero__links, .hint { animation: none; }
  .cursor { animation: none; }
  * { transition: none !important; }
}
