/* ============================================================
   Murilo Lympius — Design system
   Editorial-técnico: midnight blue + âmbar, bento grid,
   display geométrica + mono para dados.
   ============================================================ */

:root {
  /* Superfícies — jewel tone, não preto puro */
  --bg:         #0A0E14;
  --bg-2:       #0D131B;
  --surface:    #121B25;
  --surface-2:  #17222E;
  --surface-3:  #1C2937;
  --border:     #223040;
  --border-2:   #2E4054;

  /* Texto */
  --text:   #E9F0F7;
  --text-2: #A8B8CA;
  --text-3: #718498;

  /* Accent único — âmbar quente */
  --accent:      #F2A33C;
  --accent-2:    #FFC072;
  --accent-soft: rgba(242, 163, 60, 0.10);
  --accent-line: rgba(242, 163, 60, 0.28);

  /* Secundário, só em dados/diagrama */
  --teal:      #4FD1C5;
  --teal-soft: rgba(79, 209, 197, 0.10);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans:    "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --r:    14px;
  --r-sm: 9px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.14; margin: 0; letter-spacing: -0.022em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.38em;
  color: var(--accent-2);
}
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--accent); color: #0A0E14; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilidades ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #0A0E14; padding: 12px 20px;
  font-weight: 600; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.kicker::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent-line);
  flex: none;
}

section { padding-block: clamp(64px, 8vw, 104px); position: relative; }
.sec-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.sec-head h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); }
.sec-head .note { color: var(--text-3); margin-top: 12px; font-size: 0.95rem; }

.rule { height: 1px; background: linear-gradient(90deg, var(--border) 0%, transparent 70%); border: 0; margin: 0; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.hdr.scrolled { border-bottom-color: var(--border); }
.hdr-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 64px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap;
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}
.brand .sep { color: var(--text-3); }
.brand .sub { color: var(--text-3); font-weight: 400; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-3);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); }

/* Link em destaque no menu (Laboratório / ← Currículo): mesma linguagem do
   botão do laboratório — pílula âmbar com uma luz percorrendo a borda. */
@property --nav-hl-a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.nav a.nav-hl {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 13px 6px 11px;
  margin-right: 6px;
  white-space: nowrap;
}
.nav a.nav-hl::before {   /* borda base + luz girando */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--nav-hl-a),
    var(--accent-line) 0deg, var(--accent-line) 250deg,
    var(--accent-2) 320deg, #fff 340deg, var(--accent-2) 352deg, var(--accent-line) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: nav-hl-spin 4s linear infinite;
  pointer-events: none;
}
.nav a.nav-hl::after {    /* halo suave que aparece no hover */
  content: ""; position: absolute; inset: -6px; border-radius: inherit; z-index: -1;
  background: radial-gradient(closest-side, rgba(242, 163, 60, 0.35), transparent);
  opacity: 0; transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.nav a.nav-hl:hover { color: #fff; background: rgba(242, 163, 60, 0.16); }
.nav a.nav-hl:hover::after, .nav a.nav-hl:focus-visible::after { opacity: 1; }
.nav-hl-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--accent);
  animation: nav-hl-pulse 2.4s ease-out infinite;
}
@keyframes nav-hl-spin { to { --nav-hl-a: 360deg; } }
@keyframes nav-hl-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(242, 163, 60, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(242, 163, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 163, 60, 0); }
}

.lang {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
  flex: none;
}
.lang button {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  background: none; border: 0; cursor: pointer;
  color: var(--text-3);
  padding: 5px 11px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #0A0E14; }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 6vw, 76px); padding-bottom: clamp(40px, 5vw, 60px); position: relative; }
.hero::before {
  content: "";
  position: absolute; inset: -140px 0 auto 0; height: 460px;
  background: radial-gradient(ellipse 70% 100% at 22% 0%, rgba(242,163,60,0.075), transparent 65%);
  pointer-events: none; z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

/* PixelBlast (fx.js) atrás do card do laboratório */
.fx-host { overflow: hidden; }
.fx-host > .wrap { position: relative; z-index: 1; }
.pixel-fx {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  pointer-events: none;
  /* aura em volta do card do laboratório: forte perto dele, some nas bordas */
  -webkit-mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 35%, transparent 100%);
          mask-image: radial-gradient(ellipse 62% 72% at 50% 50%, #000 35%, transparent 100%);
}

/* a mesma rede do hero, discreta, fechando a página no contato */
.contact-fx {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
}

/* rede de partículas (fx.js) — some suavemente na base do hero */
.hero-fx {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 11px;
  margin-bottom: 26px;
}
.status .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); flex: none;
  box-shadow: 0 0 0 0 rgba(79,209,197,0.5);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,209,197,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(79,209,197,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,209,197,0); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.05rem);
  letter-spacing: -0.035em;
  margin-bottom: 12px;
}
.hero .role {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.hero .pitch {
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--text-2);
  line-height: 1.68;
  max-width: 58ch;
  margin-bottom: 32px;
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-size: 0.9rem; font-weight: 600;
  padding: 11px 19px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent-line); background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #0A0E14;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* Cartão de perfil */
.profile {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.profile .photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-3);
}
.profile .photo img { width: 100%; height: 100%; object-fit: cover; }
.profile .photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(10,14,20,0.72) 100%);
}
.profile .facts { padding: 4px 0; }
.profile .facts li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.83rem;
}
.profile .facts li:first-child { border-top: 0; }
.profile .facts .k {
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); flex: none;
}
.profile .facts .v { color: var(--text-2); text-align: right; }

/* ---------- Faixa de métricas ---------- */
.metrics { padding-block: clamp(40px, 5vw, 56px); background: var(--bg-2); border-block: 1px solid var(--border); }
.metrics-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.metrics-head h2 { font-size: 1.12rem; letter-spacing: -0.01em; }
.metrics-head .note { color: var(--text-3); font-size: 0.83rem; max-width: 52ch; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.metric::before {
  content: "";
  position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
}
.metric:hover { border-color: var(--border-2); transform: translateY(-3px); }
.metric .v {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.metric .l { font-size: 0.86rem; color: var(--text); line-height: 1.4; margin-bottom: 5px; }
.metric .d { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); }

/* ---------- Case principal ---------- */
.case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.case-top { padding: clamp(26px, 3.4vw, 38px); border-bottom: 1px solid var(--border); }
.case-top h3 { font-size: clamp(1.3rem, 2.6vw, 1.85rem); margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono); font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}
.tag.hl { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.case-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.case-block {
  padding: clamp(24px, 3vw, 32px);
  border-bottom: 1px solid var(--border);
}
.case-block:nth-child(odd) { border-right: 1px solid var(--border); }
.case-block h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
  margin-bottom: 12px;
}
.case-block p { color: var(--text-2); font-size: 0.94rem; line-height: 1.72; }

.case-did { padding: clamp(24px, 3vw, 34px); border-bottom: 1px solid var(--border); }
.case-did h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; margin-bottom: 20px;
}
.did-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 34px; }
.did-list li {
  position: relative;
  padding-left: 30px;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.62;
}
.did-list li::before {
  counter-increment: did;
  content: counter(did, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  color: var(--accent);
}
.did-list { counter-reset: did; }

.case-result {
  padding: clamp(24px, 3vw, 34px);
  background: linear-gradient(100deg, var(--accent-soft), transparent 62%);
  border-left: 2px solid var(--accent);
}
.case-result h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 12px;
}
.case-result p { color: var(--text-2); font-size: 1rem; line-height: 1.68; max-width: 78ch; }

/* ---------- Capacidades ---------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 26px 22px 24px;
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.cap:hover { border-color: var(--accent-line); transform: translateY(-3px); background: var(--surface-2); }
.cap-n {
  font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 14px;
}
.cap h3 { font-size: 1.1rem; margin-bottom: 10px; letter-spacing: -0.015em; }
.cap p { font-size: 0.9rem; color: var(--text-2); line-height: 1.66; }

/* ---------- Bloco de perfil / narrativa ---------- */
.about-block {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  padding: clamp(26px, 3.4vw, 36px);
}
.about-block .kicker { margin-bottom: 10px; }
.about-block h3 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
.about-block p {
  font-size: clamp(0.96rem, 1.35vw, 1.06rem);
  color: var(--text-2);
  line-height: 1.78;
  max-width: 68ch;
}

/* ---------- Bloco de transferência do case ---------- */
.case-transfer {
  padding: clamp(22px, 3vw, 30px) clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.case-transfer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--teal); font-weight: 600; margin-bottom: 11px;
}
.case-transfer p { color: var(--text-2); font-size: 0.95rem; line-height: 1.7; max-width: 82ch; }

/* ---------- Diagrama ---------- */
.diagram-wrap { margin-top: 24px; }
.diagram-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.diagram-head h4 { font-size: 1rem; }
.diagram-head .note { color: var(--text-3); font-size: 0.82rem; max-width: 56ch; }
.diagram {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  overflow-x: auto;
}
.diagram { scrollbar-color: var(--border-2) transparent; scrollbar-width: thin; }
.diagram svg { width: 100%; min-width: 660px; height: auto; display: block; }

/* ---------- Stack ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.stack-card:hover { border-color: var(--border-2); transform: translateY(-3px); }
/* "Em desenvolvimento" fecha a grade ocupando a linha inteira */
@media (min-width: 1001px) { .stack-card:last-child { grid-column: 1 / -1; } }
.stack-card h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
  margin-bottom: 15px;
  display: flex; align-items: center; gap: 8px;
}
.stack-card h3::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 11px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--border-2); }
.chip::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal); flex: none;
}
.chip.learning { color: var(--text-3); }
.chip.learning::before { background: var(--text-3); }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; }
.legend span {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 7px;
}
.legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.legend .i-prod { background: var(--teal); }
.legend .i-learn { background: var(--text-3); }

/* ---------- Agentes de IA ---------- */
.ai-sec { background: var(--bg-2); border-block: 1px solid var(--border); }
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
.ai-lead { font-size: 1.02rem; color: var(--text-2); line-height: 1.72; }

/* ---------- ThoughtLine — agente de validação (fx.js) ---------- */
.thought {
  margin-top: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}
.thought.working { border-color: var(--accent-line); }
.tl-head {
  width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: none; border: 0; color: var(--text); cursor: pointer; text-align: left;
  padding: 14px 18px; font: inherit; font-size: 1rem;
}
.thought.working .tl-head { cursor: default; }
.tl-glyph { width: 18px; height: 18px; color: var(--accent); flex: none; display: grid; place-items: center; }
.tl-glyph svg { width: 18px; height: 18px; }
.thought.working .tl-glyph { animation: tl-breath var(--tl-period) ease-in-out infinite; }
@keyframes tl-breath {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50%      { opacity: var(--tl-depth); transform: scale(0.82) rotate(45deg); }
}
.tl-label { font-family: var(--font-display); font-weight: 700; }
.thought.working .tl-label { animation: tl-breath-txt var(--tl-period) ease-in-out infinite; }
@keyframes tl-breath-txt { 50% { opacity: var(--tl-depth); } }
.tl-step { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); flex: 1 1 200px; min-width: 0; }
.tl-time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl-chev { width: 8px; height: 8px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform 0.25s var(--ease); flex: none; margin-left: 4px; }
.thought.open .tl-chev { transform: rotate(45deg); }
.thought.working .tl-chev { display: none; }

/* assentar: um borrão rápido que some quando o agente termina */
.thought.settling .tl-head { animation: tl-settle var(--tl-settle) var(--ease); }
@keyframes tl-settle { from { filter: blur(var(--tl-blur)); opacity: 0.6; } to { filter: blur(0); opacity: 1; } }

.tl-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease); }
.thought.open .tl-body { grid-template-rows: 1fr; }
.tl-body > * { min-height: 0; overflow: hidden; }
.tl-body { border-top: 1px solid transparent; }
.thought.open .tl-body { border-top-color: var(--border); }
.tl-list { padding: 6px 18px 6px; }
.tl-item {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; row-gap: 2px;
  padding: 9px 0; border-top: 1px solid var(--border);
}
.tl-item:first-child { border-top: 0; }
@keyframes tl-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tl-t { font-size: 0.88rem; color: var(--text); }
.tl-r { grid-column: 2; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.tl-ico { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; }
.tl-item.is-ok .tl-ico { background: var(--teal-soft); color: var(--teal); }
.tl-item.is-ok .tl-ico::before { content: "✓"; }
.tl-item.is-warn .tl-ico { background: var(--accent-soft); color: var(--accent); }
.tl-item.is-warn .tl-ico::before { content: "!"; }
.tl-item.is-warn .tl-r { color: var(--accent-2); }
.tl-item.is-run .tl-ico { border: 1.5px solid var(--border-2); border-top-color: var(--accent); animation: tl-spin 0.8s linear infinite; }
.tl-item.is-run { animation: tl-in 0.35s var(--ease); }
.tl-item.is-run .tl-t { color: var(--text-2); }
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px 12px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3);
  border-top: 1px solid var(--border);
}
.tl-rerun {
  font-family: var(--font-mono); font-size: 0.7rem; cursor: pointer;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-2); border-radius: 999px; padding: 5px 12px;
}
.tl-rerun:hover { color: var(--text); border-color: var(--accent-line); }
.ai-points { display: grid; gap: 12px; }
.ai-point {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--teal);
  border-radius: var(--r-sm);
  padding: 16px 18px;
}
.ai-point h4 { font-size: 0.95rem; margin-bottom: 6px; }
.ai-point p { font-size: 0.87rem; color: var(--text-3); line-height: 1.6; }

/* ---------- Laboratório (link para simulador.html) ---------- */
.lab-card {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--accent-line); border-radius: var(--r);
  padding: clamp(26px, 3.6vw, 42px);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.lab-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.lab-card h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 14px; }

/* destaque da home: o laboratório vem logo depois das métricas */
.lab-sec-home { padding-block: clamp(72px, 9vw, 128px); }
.lab-sec-home .lab-card { padding: clamp(28px, 4.4vw, 56px); }
.lab-sec-home .lab-card h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.03em; }
.lab-sec-home .lab-card-txt > p { font-size: clamp(1rem, 1.3vw, 1.08rem); }

/* ---------- StarfieldButton (fx.js) ----------
   Botão escuro com uma luz percorrendo a borda; no hover do card acende
   um campo de pontos piscando por dentro e um brilho na borda interna. */
.sf-btn {
  --sf-light: #FFC072;     /* luz que percorre a borda */
  --sf-glow: #F2A33C;      /* brilho interno */
  position: relative; display: inline-grid;
  padding: 1px; border-radius: 999px;
  cursor: pointer; user-select: none;
  transition: transform 0.6s cubic-bezier(0.44, 0, 0.56, 1);
}
.lab-card:active .sf-btn { transform: scale(0.97); transition-duration: 0.15s; }
.sf-track, .sf-band {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.sf-track { padding: 1px; background: rgba(255, 255, 255, 0.14); }
.sf-band { inset: -0.5px; padding: 2px; overflow: hidden; }
.sf-light {
  position: absolute; top: 0; left: 0;
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  background: radial-gradient(circle, var(--sf-light) 0%, var(--sf-light) 30%, rgba(255, 192, 114, 0) 72%);
  will-change: transform;
}
.sf-face {
  position: relative; z-index: 1; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 28px 15px 24px; border-radius: inherit;
  background: #0A0A0A; color: #fff;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600; white-space: nowrap;
}
.sf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sf-glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  border: 3px solid var(--sf-glow); filter: blur(8px); opacity: 0;
}
.sf-ico, .sf-label { position: relative; z-index: 2; }
.sf-ico { font-size: 1.3rem; line-height: 1; color: var(--sf-light); transition: transform 0.6s cubic-bezier(0.44, 0, 0.56, 1); }
.lab-card:hover .sf-ico, .lab-card:focus-visible .sf-ico { transform: translateX(3px); }

/* ---------- BorderGlow (fx.js) ----------
   --glow-angle: direção do ponteiro a partir do centro do card
   --glow-edge:  0..1, proximidade do ponteiro com a borda */
.glow-card {
  --glow-angle: 315deg;
  --glow-edge: 0;
  --glow-spread: 25deg;
  --glow-c1: var(--accent);
  --glow-c2: var(--accent-2);
  --glow-c3: var(--teal);
  --glow-color: rgba(242, 163, 60, 0.55);
  position: relative;   /* sem isolation: o halo (z-index -1) fica atrás do card */
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 28px;
}
.glow-card:hover { border-color: var(--border-2); transform: none; }
/* anel colorido na borda */
.glow-card::before,
.glow-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  pointer-events: none;
  opacity: var(--glow-edge);
  transition: opacity 0.25s var(--ease);
}
.glow-card::before {
  padding: 1.5px;
  background: conic-gradient(from calc(var(--glow-angle) - var(--glow-spread)),
    transparent 0deg, var(--glow-c1) 8deg, var(--glow-c2) 25deg, var(--glow-c3) 42deg,
    transparent 50deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* halo por fora, atrás do card */
.glow-card::after {
  z-index: -1;
  background: conic-gradient(from calc(var(--glow-angle) - var(--glow-spread)),
    transparent 0deg, var(--glow-color) 25deg, transparent 50deg, transparent 360deg);
  filter: blur(20px);
}
/* sem ponteiro (touch): brilho estático no canto superior esquerdo */
@media (hover: none) {
  .glow-card { --glow-edge: 0.55; }
}
.lab-card-txt > p { color: var(--text-2); line-height: 1.68; margin-bottom: 18px; max-width: 62ch; }
.lab-card-go { display: grid; gap: 18px; justify-items: start; }
.lab-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab-flow i {
  font-style: normal; font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(79,209,197,0.25);
  border-radius: 6px; padding: 5px 9px;
}
.lab-flow i:not(:last-child)::after { content: " →"; color: var(--text-3); }
.lab-flow i:last-child { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

/* ---------- Projetos ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.proj {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(22px, 3vw, 30px);
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.proj:hover { border-color: var(--border-2); transform: translateY(-3px); }
.proj .meta { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.proj h3 { font-size: 1.18rem; }
.proj p { color: var(--text-2); font-size: 0.91rem; line-height: 1.68; flex: 1; }

/* ---------- Formação ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
.edu-list { display: grid; }
.edu-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.edu-item:first-child { border-top: 0; padding-top: 0; }
.edu-when {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-3); letter-spacing: 0.02em; padding-top: 3px;
}
.edu-item h3 { font-size: 1.02rem; margin-bottom: 4px; }
.edu-item .org { font-size: 0.86rem; color: var(--accent); margin-bottom: 9px; }
.edu-item p { font-size: 0.88rem; color: var(--text-3); line-height: 1.65; }

.langs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
}
.langs h3 {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; margin-bottom: 16px;
}
.langs li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.langs li:first-of-type { border-top: 0; }
.langs .lvl { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); }

/* ---------- Contato ---------- */
.contact-sec { background: var(--bg-2); border-top: 1px solid var(--border); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.contact-lead h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 16px; }
.contact-lead p { color: var(--text-2); font-size: 1.02rem; line-height: 1.7; max-width: 46ch; }
.contact-cards { display: grid; gap: 12px; }
.ccard {
  display: flex; align-items: center; gap: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 17px 20px;
  transition: border-color 0.22s, transform 0.22s var(--ease), background 0.22s;
}
a.ccard:hover { border-color: var(--accent-line); transform: translateX(4px); background: var(--surface-2); }
.ccard .ico {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent);
}
.ccard .ico svg { width: 17px; height: 17px; }
.ccard .k {
  font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3); display: block; margin-bottom: 3px;
}
.ccard .v { font-size: 0.92rem; color: var(--text); word-break: break-word; }

/* ---------- Rodapé ---------- */
.ftr { border-top: 1px solid var(--border); padding-block: 30px; }
.ftr-in {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3);
}

/* ---------- Scroll reveal ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ============================================================
   Responsivo
   ============================================================ */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .profile { max-width: 380px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .about-block { grid-template-columns: 1fr; gap: 18px; }
  .ai-grid, .edu-grid, .contact-grid { grid-template-columns: 1fr; }
  .did-list { grid-template-columns: 1fr; }
  .nav a:not(.nav-hl) { display: none; }   /* no celular, só o destaque fica */
}

@media (max-width: 700px) {
  .wrap { padding-inline: 18px; }
  .hdr-in { height: 58px; }
  .brand .sub, .brand .sep { display: none; }
  .hdr-in { gap: 10px; }
  .nav a.nav-hl { padding: 5px 10px 5px 9px; margin-right: 0; font-size: 0.7rem; gap: 6px; }
  .lang button { padding: 5px 9px; }
  .case-body { grid-template-columns: 1fr; }
  .case-block:nth-child(odd) { border-right: 0; }
  .proj-grid { grid-template-columns: 1fr; }
  .lab-card { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .edu-item { grid-template-columns: 1fr; gap: 8px; }
  .cta { gap: 8px; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .metric { padding: 18px 16px; }
  .diagram { padding: 14px; }
}

@media (max-width: 420px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

/* ---------- Preferências do sistema ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ---------- Impressão ---------- */
@media print {
  .hdr, .lang, .cta, .ftr { display: none !important; }
  body { background: #fff; color: #000; }
  .case, .metric, .stack-card, .proj, .langs, .ccard { border-color: #ccc; background: #fff; }
  * { color: #000 !important; }
}
