/* ==========================================================
   Portfólio — Flavio Bertolotti Ferreira
   Estética: minimalista, monocromática (preto, branco, cinzas)
   ========================================================== */

:root {
  --black: #050505;
  --ink: #0c0c0c;
  --panel: #111111;
  --panel-2: #171717;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --dim: #5f5f5f;
  --white: #ffffff;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.22, .8, .24, 1);

  /* atualizada pelo JS: 0 (topo) → 1 (fim da página) */
  --page: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--white); color: var(--black); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); letter-spacing: .02em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Degradê que acompanha o scroll ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at calc(85% - var(--page) * 70%) calc(-10% + var(--page) * 110%),
      rgba(255, 255, 255, calc(.07 + var(--page) * .05)), transparent 62%),
    radial-gradient(45vmax 45vmax at calc(10% + var(--page) * 60%) calc(100% - var(--page) * 60%),
      rgba(255, 255, 255, .045), transparent 60%),
    linear-gradient(180deg,
      hsl(0 0% calc(2% + var(--page) * 3%)) 0%,
      hsl(0 0% calc(4% + var(--page) * 5%)) 100%);
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,.2), #fff);
  transform-origin: 0 50%; transform: scaleX(var(--page));
}

/* ---------- Navegação ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 5, 5, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.nav-brand img { width: 36px; height: 36px; mix-blend-mode: screen; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--muted); transition: color .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.lang {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-family: var(--mono); font-size: 12px;
}
.lang span { color: var(--dim); transition: color .25s; }
.lang .sep { color: var(--dim); }
html[lang="pt-BR"] .lang [data-lang="pt"], html[lang="en"] .lang [data-lang="en"] { color: var(--text); }
.lang:hover { border-color: var(--white); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
  border: 1px solid var(--white);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-solid { background: var(--white); color: var(--black); }
.btn-solid:hover { background: transparent; color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--white); background: rgba(255,255,255,.06); }
.btn:active { transform: scale(.97); }
.btn-lg { padding: 16px 28px; font-size: 15px; }

/* ---------- INTRO (scroll-driven) ---------- */
.intro { position: relative; height: 320vh; --p: 0; }
.intro-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; place-items: center; overflow: hidden;
}
.intro-banner {
  --b: clamp(0, var(--p) / .38, 1);           /* fase 1: banner sai */
  position: absolute; margin: 0;
  width: min(92vw, 1400px); aspect-ratio: 3 / 1;
  border-radius: calc(4px + var(--b) * 28px);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
  transform: translateY(calc(var(--b) * -8vh)) scale(calc(1 - var(--b) * .38));
  opacity: calc(1 - var(--b) * 1.15);
  filter: blur(calc(var(--b) * 6px));
  will-change: transform, opacity;
}
.intro-banner img { width: 100%; height: 100%; object-fit: cover; }

.intro-reveal {
  --c: clamp(0, (var(--p) - .26) / .3, 1);    /* fase 2: brasão entra */
  --t: clamp(0, (var(--p) - .5) / .32, 1);    /* fase 3: textos entram */
  position: relative; width: min(1200px, 100%); padding: 0 var(--gutter);
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  gap: calc(var(--t) * clamp(24px, 4vw, 64px));
}
.intro-crest {
  width: clamp(180px, 34vw, 440px); height: auto; mix-blend-mode: screen;
  opacity: var(--c);
  transform:
    translateX(calc((1 - var(--t)) * min(28vw, 380px)))
    scale(calc(.72 + var(--c) * .28 - var(--t) * .22))
    rotate(calc((1 - var(--c)) * -8deg));
  filter: drop-shadow(0 0 calc(var(--c) * 40px) rgba(255, 255, 255, .12));
  will-change: transform, opacity;
}
.intro-text { opacity: var(--t); transform: translateY(calc((1 - var(--t)) * 40px)); }
.intro-text > * { opacity: clamp(0, var(--t) * 2.2 - var(--i, 0) * .25, 1); }
.intro-name { --i: 0; margin: 6px 0 14px; font-size: clamp(36px, 6.4vw, 92px); line-height: .98; font-weight: 700; letter-spacing: -.035em; }
.intro-name span { display: inline-block; }
.intro-name span:nth-child(2) { color: transparent; -webkit-text-stroke: 1.2px var(--white); }
.eyebrow { --i: 0; margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.intro-role { --i: 1; margin: 0 0 8px; font-size: clamp(15px, 1.5vw, 19px); color: #d8d8d8; max-width: 620px; }
.intro-meta { --i: 2; margin: 0 0 28px; font-size: 13px; color: var(--muted); }
.intro-cta { --i: 3; display: flex; flex-wrap: wrap; gap: 12px; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em; color: var(--muted);
  text-decoration: none; opacity: calc(1 - var(--p) * 4);
}
.scroll-hint i { width: 1px; height: 44px; background: linear-gradient(var(--white), transparent); animation: drip 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Seções ---------- */
.section { position: relative; padding: clamp(90px, 14vw, 170px) 0; }
.title { margin: 14px 0 22px; font-size: clamp(30px, 4.6vw, 60px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.title em { font-style: normal; color: transparent; -webkit-text-stroke: 1px var(--white); }
.lead { margin: 0 0 28px; font-size: clamp(16px, 1.4vw, 18px); color: #cfcfcf; max-width: 640px; font-weight: 400; }

/* Revelar ao rolar */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Sobre ---------- */
.about-grid { display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-photo { position: sticky; top: 100px; }
.photo-stack { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.photo-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s var(--ease), transform 1.2s var(--ease), filter .8s; }
/* Recorte em rosto e tronco: a foto original mostra o corpo inteiro,
   então ampliamos a partir do ponto do rosto (≈ 50% x, 30% y). */
.photo-real { --zoom: 1.75; filter: grayscale(1) contrast(1.05); object-position: 50% 0; transform-origin: 51% 24%; transform: scale(var(--zoom)); }
.photo-art { opacity: 0; transform: scale(1.06); }
.photo-stack:hover .photo-art, .photo-stack.flip .photo-art { opacity: 1; transform: scale(1); }
.photo-stack:hover .photo-real, .photo-stack.flip .photo-real { opacity: 0; transform: scale(calc(var(--zoom) * 1.04)); }
.photo-hint { margin: 12px 0 0; font-size: 11px; color: var(--dim); }

.facts { list-style: none; margin: 0 0 40px; padding: 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding-top: 2px; }
.facts strong { font-weight: 500; }

.services h3 { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 14px; }
.services ol { margin: 0 0 36px; padding: 0; list-style: none; counter-reset: s; }
.services li { counter-increment: s; display: flex; gap: 18px; align-items: baseline; padding: 10px 0; font-size: clamp(17px, 1.7vw, 22px); font-weight: 500; letter-spacing: -.01em; }
.services li::before { content: "0" counter(s); font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- Skills ---------- */
.skills { margin-top: clamp(90px, 12vw, 160px); }
.skills-rule { position: relative; height: 40px; display: grid; place-items: center; margin-bottom: clamp(44px, 6vw, 72px); }
.skills-rule::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-strong);
  transform: scaleX(0); transition: transform 1.3s var(--ease);
}
.skills-rule h3 {
  position: relative; margin: 0; padding: 9px 22px; border-radius: 999px;
  background: var(--white); color: var(--black); font-size: 13px; font-weight: 600; letter-spacing: .01em;
  transform: rotate(-5deg) scale(.6); opacity: 0; transition: transform .8s var(--ease) .35s, opacity .5s var(--ease) .35s;
}
.skills-rule.in { opacity: 1; transform: none; }
.skills-rule.in::before { transform: scaleX(1); }
.skills-rule.in h3 { transform: rotate(-5deg); opacity: 1; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(40px, 5vw, 64px) clamp(28px, 4vw, 56px); }
.skill { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.skill.reveal { opacity: 1; transform: none; }
.sk-ico {
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--white);
  opacity: 0; transform: scale(.55) rotate(-10deg);
  transition: opacity .6s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}
.sk-ico i { display: block; width: 100%; height: 100%; background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.sk-ico svg { width: 100%; height: 100%; }
.sk-txt { width: auto; height: 26px; margin: 4px 0; padding: 0 8px; border: 1.6px solid currentColor; border-radius: 7px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; }
.sk-text { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease) calc(var(--d, 0s) + .22s), transform .7s var(--ease) calc(var(--d, 0s) + .22s); }
.sk-text h4 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sk-text p { margin: 0; font-size: 14px; color: var(--muted); max-width: 300px; }
.skill.in .sk-ico, .skill.in .sk-text { opacity: 1; transform: none; }

/* ---------- Destaque ---------- */
.feat-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 5vw, 80px); align-items: end; margin-bottom: 40px; }
.feat-head .title { font-size: clamp(48px, 9vw, 130px); margin: 0; }
.feat-head .lead { margin: 0 0 12px; }
.feat-shots { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.feat-shots img { width: 100%; height: 100%; object-fit: cover; object-position: top left; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); background: var(--panel); filter: grayscale(1); transition: filter .6s var(--ease), transform .6s var(--ease); }
.feat-shots img:hover { filter: grayscale(0); }
.feat-shots .shot-main { grid-row: span 2; aspect-ratio: 16 / 10; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(28px, 3.5vw, 48px); margin: 28px 0 44px; }
.feat-card { padding: 20px 0 0; border-top: 1px solid var(--line-strong); }
.feat-card span { font-size: 11px; color: var(--dim); }
.feat-card h3 { margin: 10px 0 8px; font-size: 17px; font-weight: 600; }
.feat-card p { margin: 0; font-size: 14px; color: #bdbdbd; }
.feat-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Projetos / abas ---------- */
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.sync { font-size: 12px; color: var(--muted); margin: 0 0 26px; display: flex; align-items: center; gap: 8px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.sync.loading::before { animation: blink 1s infinite; }
.sync.offline::before { background: var(--dim); box-shadow: none; }
@keyframes blink { 50% { opacity: .2; } }

.tabs {
  position: relative; display: flex; gap: 4px; padding: 5px; 
  border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong);
  width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background .35s var(--ease), color .35s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--white); color: var(--black); }
.tabs sup { font-family: var(--mono); font-size: 10px; font-weight: 500; margin-left: 2px; opacity: .7; }
/* Indicador de arrastar: borda esmaecida + seta tocável quando há abas escondidas */
.tabs-wrap { position: relative; width: max-content; max-width: 100%; margin-bottom: 36px; }
.tabs-wrap .tabs { margin-bottom: 0; }
.tabs-wrap.can-right .tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent calc(100% - 8px)); mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent calc(100% - 8px)); }
.tabs-wrap.can-left .tabs { -webkit-mask-image: linear-gradient(90deg, transparent 8px, #000 72px); mask-image: linear-gradient(90deg, transparent 8px, #000 72px); }
.tabs-wrap.can-left.can-right .tabs { -webkit-mask-image: linear-gradient(90deg, transparent 8px, #000 72px, #000 calc(100% - 72px), transparent calc(100% - 8px)); mask-image: linear-gradient(90deg, transparent 8px, #000 72px, #000 calc(100% - 72px), transparent calc(100% - 8px)); }
.tabs-arrow {
  position: absolute; top: 50%; z-index: 2; width: 34px; height: 34px; margin-top: -17px;
  display: grid; place-items: center; padding: 0 0 3px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(10, 10, 10, .9); color: var(--white);
  font-size: 22px; line-height: 1; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.tabs-arrow.prev { left: -4px; transform: translateX(6px); }
.tabs-arrow.next { right: -4px; transform: translateX(-6px); }
.tabs-wrap.can-left .tabs-arrow.prev, .tabs-wrap.can-right .tabs-arrow.next { opacity: 1; pointer-events: auto; transform: none; }
.tabs-wrap.can-right .tabs-arrow.next { animation: nudge 1.8s var(--ease) 3; }
@keyframes nudge { 50% { transform: translateX(4px); } }

.panel { animation: panelIn .6s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } }
.panel-intro { color: var(--muted); margin: 0 0 28px; max-width: 640px; }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.repo-grid:empty { display: none; }
#workflowList + .repo-grid, #siteList + .repo-grid { margin-top: 14px; }
.repo {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; border-radius: var(--radius); background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px var(--line); text-decoration: none;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), background .35s;
}
.repo:hover { box-shadow: inset 0 0 0 1px var(--line-strong); background: rgba(255,255,255,.05); transform: translateY(-3px); }
.repo { overflow: hidden; isolation: isolate; }
.repo > :not(.repo-mark) { position: relative; z-index: 1; }
/* Logo de fundo (linguagem ou projeto), grande e discreta no canto */
.repo-mark {
  position: absolute; right: -22px; bottom: -26px; z-index: 0; width: 170px; height: 170px;
  color: var(--white); opacity: .07; pointer-events: none;
  transform: rotate(-8deg); transition: opacity .5s var(--ease), transform .8s var(--ease);
}
.repo-mark svg { width: 100%; height: 100%; }
.repo-mark-mask { display: block; background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.repo-mark-img { object-fit: contain; filter: grayscale(1) contrast(1.1); opacity: .16; }
.repo:hover .repo-mark { opacity: .12; transform: rotate(-4deg) scale(1.04); }
.repo:hover .repo-mark-img { opacity: .24; }
.repo-links a { display: inline-flex; align-items: center; gap: 7px; }
.repo-links a.primary { background: var(--white); color: var(--black); border-color: var(--white); }
.repo-links a.primary:hover { background: transparent; color: var(--white); }
.gh { width: 14px; height: 14px; background: currentColor; -webkit-mask: url("../assets/icons/github.svg") center / contain no-repeat; mask: url("../assets/icons/github.svg") center / contain no-repeat; }
.repo-cover { margin: -24px -24px 6px; aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); }
.repo-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: grayscale(1) contrast(1.05); transition: filter .5s, transform .8s var(--ease); }
.repo:hover .repo-cover img { filter: grayscale(0); transform: scale(1.03); }
.repo-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.repo h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.repo p { margin: 0; font-size: 14px; color: #bdbdbd; flex: 1; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.repo-meta .lang-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--white); margin-right: 6px; }
.repo-links { display: flex; gap: 8px; flex-wrap: wrap; }
.repo-links a { font-size: 12px; font-weight: 600; text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); transition: background .25s, color .25s, border-color .25s; }
.repo-links a:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- Workflow (demonstração animada) ---------- */
.wf { border-radius: calc(var(--radius) + 6px); background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px var(--line); padding: clamp(20px, 3vw, 36px); margin-bottom: 14px; }
.wf-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 26px; }
.wf-head h3 { margin: 4px 0 8px; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; }
.wf-head p { margin: 0; color: #bdbdbd; max-width: 640px; font-size: 15px; }
.wf-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wf-tags span { font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.wf-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.wf-controls .btn { padding: 10px 18px; font-size: 13px; }
.badge-demo { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border: 1px dashed var(--line-strong); padding: 4px 8px; border-radius: 6px; }

.wf-body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: stretch; }
.wf-pipeline { display: flex; flex-direction: column; gap: 0; }
.node {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .5s var(--ease), background .5s var(--ease), transform .5s var(--ease);
}
.node-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-strong); transition: background .5s, border-color .5s; }
.node-ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: color .5s; }
.node strong { display: block; font-size: 14px; font-weight: 600; }
.node small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.node-tool { font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; text-align: right; }
.node.active { background: #1a1a1a; box-shadow: inset 0 0 0 1px var(--white), 0 0 40px rgba(255,255,255,.08); transform: translateX(6px); }
.node.active .node-ico { background: var(--white); border-color: var(--white); color: var(--black); }
.node.done .node-ico { border-color: var(--white); }
.node.done::after { content: "✓"; position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); color: var(--black); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.link { position: relative; height: 22px; margin-left: 37px; width: 2px; background: var(--line-strong); overflow: hidden; }
.link::after { content: ""; position: absolute; left: 0; top: -100%; width: 100%; height: 100%; background: var(--white); }
.link.flow::after { animation: flow .55s var(--ease) forwards; }
.link.filled::after { top: 0; }
@keyframes flow { to { top: 0; } }

.wf-side { display: flex; flex-direction: column; gap: 14px; }
.phone { flex: 1; min-height: 380px; border-radius: 28px; padding: 12px; background: #000; box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; }
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); }
.phone-bar .av { width: 30px; height: 30px; border-radius: 50%; background: #222; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.phone-bar b { font-size: 13px; display: block; }
.phone-bar small { font-size: 11px; color: var(--muted); }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 4px 4px; overflow-y: auto; scrollbar-width: none; }
.chat::-webkit-scrollbar { display: none; }
.chat > :first-child { margin-top: auto; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45; white-space: pre-line; animation: pop .45s var(--ease); }
.msg.in { align-self: flex-start; background: #1c1c1c; border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--white); color: var(--black); border-bottom-right-radius: 4px; }
.msg.sys { align-self: center; font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); }
.msg time { display: block; text-align: right; font-size: 10px; opacity: .55; margin-top: 2px; }
.voice { display: flex; align-items: center; gap: 8px; }
.voice i { width: 22px; height: 22px; border-radius: 50%; background: var(--white); position: relative; flex: none; }
.voice i::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid #000; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.wave b { width: 2px; border-radius: 2px; background: #bbb; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

.console { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; background: #000; border-radius: 14px; padding: 14px; color: #bdbdbd; box-shadow: inset 0 0 0 1px var(--line); min-height: 120px; max-height: 180px; overflow: auto; }
.console div { animation: pop .3s var(--ease); white-space: pre-wrap; word-break: break-word; }
.console .k { color: var(--white); }
.console .c { color: var(--dim); }

.wf-prompt { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.wf-prompt > div { padding: 18px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: var(--ink); }
.wf-prompt h4 { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.wf-prompt p { margin: 0; font-size: 13.5px; color: #d0d0d0; white-space: pre-line; }
.wf-prompt .ex { font-family: var(--mono); font-size: 12px; }
.wf-prompt-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin: 0 0 -2px; }

/* ---------- WebSites ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.site { border-radius: calc(var(--radius) + 4px); overflow: hidden; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .35s, transform .35s var(--ease); }
.site:hover { box-shadow: inset 0 0 0 1px var(--line-strong); transform: translateY(-3px); }
.browser { background: #0e0e0e; border-bottom: 1px solid var(--line); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #333; }
.browser-bar span { margin-left: 10px; flex: 1; font-family: var(--mono); font-size: 11px; color: var(--muted); background: #1a1a1a; padding: 4px 10px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #111; }
.frame iframe { position: absolute; top: 0; left: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; pointer-events: none; filter: grayscale(1); transition: filter .6s; }
.site:hover .frame iframe { filter: grayscale(0); }
.frame .frame-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.frame .frame-fallback img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .6s; }
.site:hover .frame-fallback img { filter: grayscale(0); }
.site-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.site-body h3 { margin: 0; font-size: 20px; }
.site-body p { margin: 0; color: #bdbdbd; font-size: 14px; }
.role { display: flex; flex-wrap: wrap; gap: 6px; }
.role span { font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }

/* ---------- Contato ---------- */
.contact { text-align: center; padding-bottom: clamp(100px, 14vw, 180px); }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-crest { width: 120px; mix-blend-mode: screen; margin-bottom: 26px; }
.contact-title { margin: 18px 0 16px; font-size: clamp(32px, 6vw, 78px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; max-width: 1000px; }
.contact .lead { margin-left: auto; margin-right: auto; }
.contact-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.contact-mail { margin: 26px 0 0; font-size: 13px; color: var(--muted); }

.footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.footer-inner img { width: 28px; height: 28px; mix-blend-mode: screen; }
.footer-inner .mono { margin-left: auto; font-size: 11px; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .wf-body { grid-template-columns: 1fr; }
  .phone { min-height: 340px; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .wf-prompt { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .lang { margin-left: auto; }

  /* ---------- Abertura no celular ----------
     Linha do tempo própria, sem trechos "mortos":
       0.00–0.30  o cartão do banner percorre a imagem: brasão → nome
       0.30–0.50  o cartão sobe e some
       0.40–0.62  o brasão surge no lugar (sem cruzar o texto)
       0.58–0.85  nome, cargo e botões entram em sequência          */
  .intro { height: 240vh; height: 240svh; }
  .intro-banner {
    --pan: clamp(0, var(--p) / .3, 1);
    --b: clamp(0, (var(--p) - .3) / .2, 1);
    width: calc(100vw - 32px); aspect-ratio: 3 / 2;
    border-radius: 18px;
    transform: translateY(calc(var(--b) * -14svh)) scale(calc(1 - var(--b) * .12));
    opacity: calc(1 - var(--b));
    filter: none;
  }
  .intro-banner img { object-position: calc(var(--pan) * 100%) 50%; }

  .intro-reveal {
    --c: clamp(0, (var(--p) - .4) / .22, 1);
    --t: clamp(0, (var(--p) - .58) / .27, 1);
    grid-template-columns: 1fr; justify-items: center; text-align: center;
    gap: clamp(12px, 2.5svh, 24px);
  }
  .intro-crest {
    width: min(42vw, 24svh);
    transform: translateY(calc((1 - var(--c)) * 24px)) scale(calc(.86 + var(--c) * .14));
    filter: none;
  }
  .intro-text { transform: translateY(calc((1 - var(--t)) * 24px)); }
  .intro-text > * { opacity: clamp(0, var(--t) * 2 - var(--i, 0) * .3, 1); }
  .intro-name { font-size: clamp(34px, 10.5vw, 48px); margin: 4px 0 10px; }
  .intro-role { font-size: 15px; }
  .intro-meta { margin-bottom: 20px; font-size: 12px; }
  .intro-cta { justify-content: center; }
  .intro-cta .btn { padding: 12px 20px; }
  .scroll-hint { bottom: max(20px, env(safe-area-inset-bottom)); opacity: calc(1 - var(--p) * 6); }

  /* Revelações mais curtas, para não "atrasar" o conteúdo no celular */
  .reveal { transform: translateY(18px); transition-duration: .7s; }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { position: relative; top: 0; max-width: 420px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .feat-head { grid-template-columns: 1fr; }
  .feat-shots { grid-template-columns: 1fr; grid-template-rows: auto; }
  .feat-shots .shot-main { grid-row: auto; }
  .feat-shots img:not(.shot-main) { display: none; }
  .feat-grid { grid-template-columns: 1fr; gap: 28px; }
  .skills-grid { grid-template-columns: 1fr 1fr; gap: 36px 20px; }
  .sk-text h4 { font-size: 16px; }
  .sk-text p { font-size: 13px; }

  /* ---------- Workflow no celular ----------
     Etapas viram uma linha de ícones com legenda da etapa atual, e o
     celular de demonstração fica entre as etapas e o console, para
     acompanhar o resultado sem rolar enquanto clica nos botões.      */
  .wf-body, .wf-body > div:first-child { display: contents; }
  .wf-pipeline { order: 1; flex-direction: row; align-items: center; padding: 10px 2px; }
  .wf-caption { order: 2; }
  .wf-side { order: 3; }
  .console { order: 4; margin-top: 0 !important; min-height: 96px; max-height: 110px; }
  .wf-controls { order: 5; margin-top: 0; flex-wrap: nowrap; }
  .wf-controls .btn { padding: 10px 14px; font-size: 12.5px; white-space: nowrap; }
  .wf-controls .btn:first-child { flex: 1; }
  .wf-controls .lbl { display: none; }
  .wf-body { display: flex; flex-direction: column; gap: 12px; }

  .node { display: block; padding: 0; background: none; box-shadow: none; border-radius: 12px; }
  .node > span:not(.node-ico) { display: none; }
  .node-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--ink); }
  .node-ico svg { width: 19px; height: 19px; }
  .node.active { background: none; box-shadow: none; transform: translateY(-3px); }
  .node.active .node-ico { box-shadow: 0 0 24px rgba(255,255,255,.18); }
  .node.done::after { width: 15px; height: 15px; font-size: 9px; right: -5px; top: -5px; }
  .link { flex: 1; height: 2px; width: auto; margin: 0 3px; }
  .link::after { top: 0; left: -100%; }
  .link.flow::after { animation-name: flowX; }
  .link.filled::after { left: 0; }

  .phone { flex: none; min-height: 0; height: clamp(280px, 44svh, 340px); border-radius: 22px; padding: 8px; }
  .phone-bar { padding: 4px 6px 8px; }
  .chat { padding-top: 8px; }
  .msg { max-width: 95%; font-size: 12px; padding: 8px 10px; }
  .wf-prompt { margin-top: 18px; }
  .footer-inner .mono { margin-left: 0; }
}
@keyframes flowX { to { left: 0; } }

/* Legenda da etapa atual (só aparece no celular) */
.wf-caption { display: none; }
@media (max-width: 760px) {
  .wf-caption { display: block; min-height: 54px; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--ink); }
  .wf-caption strong { display: block; font-size: 14px; }
  .wf-caption small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
  .wf-caption .mono { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
}
