/* =========================================================
   Heitor Klippel · v2 · "Sala de controle"
   ========================================================= */
:root {
  --bg: #07090d;
  --bg-2: #0b0f15;
  --panel: #0f141c;
  --panel-2: #151c27;
  --line: #1d2633;
  --line-2: #2a3546;
  --text: #e9eef5;
  --soft: #c7d0dc;
  --muted: #8b97a8;
  --dim: #5d6879;
  --amber: #ffb000;
  --amber-2: #ffc94d;
  --ink: #140d00;
  --green: #39e58c;
  --red: #ff5a52;
  --max: 1240px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  -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(--amber); color: var(--ink); }

/* Language toggle: elements carry lang="pt" or lang="en" */
html[data-lang="pt"] [lang="en"]:not(html),
html[data-lang="en"] [lang="pt"]:not(html) { display: none !important; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

.led {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(57,229,140,.18), 0 0 12px rgba(57,229,140,.6);
  animation: blink 2.4s infinite;
}
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 80;
  background: var(--amber); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* ---------- Top bar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.top.scrolled {
  background: rgba(7, 9, 13, .78);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font: 600 13px var(--mono); letter-spacing: .14em;
}
.brand b { color: var(--amber); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav a {
  position: relative; text-decoration: none;
  font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  transition: color .2s; padding: 6px 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::after { transform: scaleX(1); }
.nav a.nav-cta { color: var(--amber); border: 1px solid rgba(255,176,0,.45); border-radius: 4px; padding: 7px 12px; }
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { background: var(--amber); color: var(--ink); }
.lang {
  font: 700 11px var(--mono); letter-spacing: .12em; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); border-radius: 4px; padding: 7px 10px;
}
.lang:hover { border-color: var(--amber); color: var(--amber); }
.menu-btn { display: none; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); transition: transform .3s var(--ease), top .3s; }
.menu-btn span:first-child { top: 15px; } .menu-btn span:last-child { top: 23px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- Process rail ---------- */
.rail {
  position: fixed; left: 22px; top: 50%; transform: translateY(-50%); z-index: 50;
  display: none; flex-direction: column; gap: 18px;
}
.rail::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.rail a { position: relative; display: flex; align-items: center; gap: 10px; text-decoration: none; height: 10px; }
.rail i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--dim); transition: all .3s; }
.rail span { font: 500 10px var(--mono); color: var(--dim); opacity: 0; transform: translateX(-4px); transition: all .3s; }
.rail:hover span, .rail a.active span { opacity: 1; transform: none; }
.rail a.active i { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px rgba(255,176,0,.7); }
.rail a.active span { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font: 700 13px var(--font); font-stretch: 112%; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  padding: 14px 20px; border-radius: 4px; border: 1px solid var(--line-2); background: transparent;
  transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.primary:hover { background: var(--amber-2); }
.btn.ghost { background: rgba(255,255,255,.03); backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--text); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -4; filter: saturate(.75) contrast(1.05); }
.hero-shade {
  position: absolute; inset: 0; z-index: -3;
  background:
    linear-gradient(90deg, rgba(7,9,13,.96) 0%, rgba(7,9,13,.82) 42%, rgba(7,9,13,.55) 70%, rgba(7,9,13,.75) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(7,9,13,0) 35%),
    linear-gradient(180deg, rgba(7,9,13,.85) 0%, rgba(7,9,13,0) 22%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 50%, #000 30%, transparent 85%);
}
.hero-spot {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 40%), rgba(255,176,0,.10), transparent 70%);
}
.hero-inner {
  display: grid; grid-template-columns: 1.35fr .75fr; gap: 56px; align-items: end;
  padding: 130px 0 48px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font: 500 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--amber);
}
.eyebrow .tick { width: 28px; height: 1px; background: var(--amber); }
.name {
  margin: 0 0 28px; font-family: var(--font); font-stretch: 125%; font-weight: 850;
  font-size: clamp(54px, 8.4vw, 136px); line-height: .86; letter-spacing: -.025em; text-transform: uppercase;
}
.name .ln { display: block; animation: rise 1s var(--ease) both; }
.name .ln:nth-child(2) { animation-delay: .08s; }
.name .ln:nth-child(3) { animation-delay: .16s; }
.name .outline { color: transparent; -webkit-text-stroke: 1.5px rgba(233,238,245,.85); }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--soft); max-width: 46ch; margin: 0 0 34px; animation: rise 1s .25s var(--ease) both; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; animation: rise 1s .35s var(--ease) both; }

/* HMI window with portrait */
.hmi {
  margin: 0; justify-self: end; width: min(360px, 100%);
  background: rgba(15,20,28,.82); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,176,0,.06);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s var(--ease);
  animation: rise 1.1s .2s var(--ease) both;
}
.hmi-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  font: 500 10.5px var(--mono); letter-spacing: .1em; color: var(--muted);
  border-bottom: 1px solid var(--line-2); background: rgba(7,9,13,.6);
}
.hmi-bar .rec { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.4s infinite; }
.hmi-bar-r { margin-left: auto; color: var(--dim); }
.hmi-body { position: relative; }
.hmi-body img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.br { position: absolute; width: 18px; height: 18px; border-color: var(--amber); border-style: solid; border-width: 0; pointer-events: none; }
.br.tl { top: 12px; left: 12px; border-top-width: 2px; border-left-width: 2px; }
.br.tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; }
.br.bl { bottom: 12px; left: 12px; border-bottom-width: 2px; border-left-width: 2px; }
.br.bm { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; }
.hmi-tag { padding: 14px 16px; border-top: 1px solid var(--line-2); font: 500 12px/1.5 var(--mono); color: var(--muted); }
.hmi-tag b { display: block; font: 700 15px var(--font); color: var(--text); margin-bottom: 2px; }

/* HUD row */
.hud {
  display: flex; align-items: center; gap: 36px; flex-wrap: wrap;
  padding: 18px 0 26px; border-top: 1px solid rgba(255,255,255,.08);
  font: 500 12px var(--mono); color: var(--soft);
}
.hud-item { display: flex; align-items: center; gap: 10px; }
.hud-item small { color: var(--dim); letter-spacing: .14em; font-size: 10px; }
.hud-item.sys span { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.hud-item.sys i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s infinite; }
.hud-item.sys span:nth-child(3) i { animation-delay: .4s; }
.hud-item.sys span:nth-child(4) i { animation-delay: .8s; }
.hud-item.sys span:nth-child(5) i { animation-delay: 1.2s; }
.hud-scroll {
  margin-left: auto; display: flex; align-items: center; gap: 12px; text-decoration: none;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-size: 11px;
}
.hud-scroll i { position: relative; width: 1px; height: 34px; background: var(--line-2); overflow: hidden; }
.hud-scroll i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--amber); animation: drip 1.8s infinite var(--ease); }
@keyframes drip { to { top: 100%; } }

/* =========================================================
   TICKER
   ========================================================= */
.ticker { background: var(--amber); color: var(--ink); border-block: 1px solid #000; }
.ticker-track { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.ticker-set { display: grid; grid-template-columns: repeat(5, 1fr); list-style: none; margin: 0; padding: 0; }
.ticker-set li {
  display: flex; align-items: center; gap: 12px; padding: 20px 18px;
  border-left: 1px solid rgba(20,13,0,.22);
  font: 800 clamp(13px, 1.15vw, 16px)/1.25 var(--font); font-stretch: 115%; text-transform: uppercase; letter-spacing: .01em;
}
.ticker-set li:first-child { border-left: 0; padding-left: 0; }
.ticker-set li::before { content: "◆"; flex: none; font-size: .6em; }

/* =========================================================
   SECTIONS
   ========================================================= */
section.block { padding: 150px 0 0; }
.sec-head { margin-bottom: 56px; }
.sec-num { display: block; font: 500 12px var(--mono); letter-spacing: .2em; color: var(--amber); margin-bottom: 14px; }
.sec-num::after { content: " /"; color: var(--dim); }
.sec-head h2 {
  margin: 0; font-stretch: 125%; font-weight: 850; text-transform: uppercase;
  font-size: clamp(36px, 5.6vw, 76px); line-height: .92; letter-spacing: -.02em;
}
.sec-head p { color: var(--muted); max-width: 60ch; margin: 18px 0 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; }
.focus { position: relative; margin: 0; }
.focus img { border-radius: 6px; aspect-ratio: 4/5; object-fit: cover; object-position: 20% center; filter: saturate(.9); }
.focus .br { width: 22px; height: 22px; }
.focus figcaption { font: 400 11px var(--mono); color: var(--dim); margin-top: 12px; letter-spacing: .04em; }
.datasheet { margin: 28px 0 0; border-top: 1px solid var(--line); }
.datasheet div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.datasheet dt { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding-top: 3px; }
.datasheet dd { margin: 0; font-size: 15px; color: var(--soft); }
.about-text p { color: var(--soft); margin: 0 0 20px; }
.about-text p strong { color: var(--text); }
.about-text .statement {
  font-size: clamp(22px, 2.4vw, 31px); line-height: 1.32; color: var(--muted); letter-spacing: -.01em;
  margin-bottom: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--line);
}
.about-text .statement strong { color: var(--text); font-weight: 700; }

/* ---------- Pipeline (sensor → decision) ---------- */
.pipeline { list-style: none; margin: 0 0 64px; padding: 0; display: flex; align-items: stretch; }
.node {
  position: relative; flex: 1 1 0; min-width: 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 8px; padding: 22px 18px 20px;
  transition: border-color .3s, transform .3s var(--ease);
}
.node:hover { border-color: rgba(255,176,0,.6); transform: translateY(-4px); }
.node svg { width: 30px; height: 30px; color: var(--amber); margin-bottom: 16px; }
.node-ix { position: absolute; top: 14px; right: 14px; font: 500 10px var(--mono); color: var(--dim); }
.node h3 { margin: 0 0 8px; font-stretch: 118%; font-weight: 800; font-size: 19px; text-transform: uppercase; letter-spacing: .01em; }
.node p { margin: 0; font: 400 12px/1.55 var(--mono); color: var(--muted); }
.pipe { position: relative; flex: 0 0 34px; align-self: center; height: 2px; }
.pipe::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px);
}
.pipe i {
  position: absolute; top: 50%; left: 0; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 10px var(--amber);
  animation: packet 1.6s linear infinite;
}
.pipeline .pipe:nth-child(4) i { animation-delay: .3s; }
.pipeline .pipe:nth-child(6) i { animation-delay: .6s; }
.pipeline .pipe:nth-child(8) i { animation-delay: .9s; }
.pipeline .pipe:nth-child(10) i { animation-delay: 1.2s; }
@keyframes packet { from { left: -4px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { left: calc(100% - 4px); opacity: 0; } }
@keyframes packet-v { from { top: -4px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { top: calc(100% - 4px); opacity: 0; } }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 48px; }
.skill { border-top: 1px solid var(--line); padding: 26px 0 30px; }
.skill h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; font-size: 17px; font-weight: 700; }
.skill h3 .n { font: 500 11px var(--mono); color: var(--amber); }
.skill ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skill li { font: 400 12.5px var(--mono); color: var(--soft); border: 1px solid var(--line-2); border-radius: 3px; padding: 5px 9px; }

/* ---------- Featured project (TubIA) ---------- */
.feature {
  position: relative; display: grid; grid-template-columns: .95fr 1.25fr; gap: 24px;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 64px;
  background:
    radial-gradient(700px 400px at 85% 30%, rgba(255,176,0,.10), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--bg-2));
}
.feature-txt { padding: 52px 8px 52px 48px; display: flex; flex-direction: column; align-items: flex-start; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin: 0 0 16px; }
.feature h3 { margin: 0 0 18px; font-stretch: 112%; font-weight: 800; font-size: clamp(28px, 3vw, 40px); line-height: 1.08; letter-spacing: -.015em; }
.feature-txt > p { color: var(--soft); margin: 0 0 22px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 0 0 22px; }
.mini-stats div { border: 1px solid var(--line-2); border-radius: 6px; padding: 14px 16px; background: rgba(7,9,13,.4); }
.mini-stats b { display: block; font-stretch: 120%; font-weight: 800; font-size: 30px; line-height: 1.1; color: var(--amber); }
.mini-stats span { font: 400 12px var(--mono); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 28px; }
.chips li { font: 500 11.5px var(--mono); color: var(--soft); border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 9px; }
.feature-stage { position: relative; perspective: 1600px; min-height: 480px; }
.scr {
  position: absolute; border-radius: 8px; border: 1px solid var(--line-2); cursor: zoom-in;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.85);
  transition: transform .8s var(--ease), box-shadow .3s;
}
.scr.main { width: 92%; top: 48px; right: -6%; transform: rotateY(-16deg) rotateX(6deg); transform-origin: left center; }
.scr.s1 { width: 50%; left: 2%; bottom: 46px; transform: rotateY(-10deg) translateZ(80px); }
.scr.s2 { width: 54%; right: 2%; bottom: 14px; transform: rotateY(-12deg) translateZ(120px); }
.feature:hover .scr.main { transform: rotateY(-8deg) rotateX(3deg); }
.feature:hover .scr.s1 { transform: rotateY(-4deg) translateZ(100px) translateY(-8px); }
.feature:hover .scr.s2 { transform: rotateY(-6deg) translateZ(150px) translateY(-6px); }
.scr:hover { box-shadow: 0 0 0 1px var(--amber), 0 30px 60px -20px rgba(0,0,0,.85); }

/* ---------- Filters + bento ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filters button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px;
  transition: all .2s;
}
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button em { font-style: normal; font-size: 10px; color: var(--dim); }
.filters button.on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.filters button.on em { color: rgba(20,13,0,.6); }

.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; grid-auto-flow: dense; }
.card {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.card:hover, .card:focus-visible {
  outline: none; border-color: rgba(255,176,0,.6); transform: translateY(-4px);
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.9), 0 0 0 1px rgba(255,176,0,.2);
}
.card.hide { display: none; }
.thumb { position: relative; height: 190px; overflow: hidden; background: #05070a; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .4s; filter: saturate(.85); }
.card:hover .thumb img { transform: scale(1.06); filter: saturate(1.05); }
.thumb::after {
  content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,176,0,.22) 85%, rgba(255,176,0,.7));
  opacity: 0;
}
.card:hover .thumb::after { animation: scan 1.1s var(--ease); }
@keyframes scan { 0% { top: -30%; opacity: 1; } 100% { top: 100%; opacity: 0; } }
.thumb.graphic { background: linear-gradient(180deg, #0d131c, #05070a); }
.thumb.graphic svg { width: 100%; height: 100%; display: block; }
.thumb.graphic .trace { stroke-dasharray: 600; stroke-dashoffset: 0; }
.card:hover .thumb.graphic .trace { animation: draw 1.4s var(--ease); }
@keyframes draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
.card .body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.badge {
  align-self: flex-start; margin-bottom: 12px;
  font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber); background: rgba(255,176,0,.1); border: 1px solid rgba(255,176,0,.25); border-radius: 3px; padding: 3px 8px;
}
.card .where { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.card h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
.card p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.card .more { margin-top: auto; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.card.big { grid-column: span 2; flex-direction: row; }
.card.big .thumb { height: auto; flex: 0 0 56%; min-height: 300px; }
.card.big h3 { font-size: 22px; font-stretch: 108%; }
.card.big .body { padding: 26px 26px 24px; }

.others { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.others h3 { grid-column: 1/-1; font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.others div { padding: 18px 0; border-top: 1px solid var(--line); }
.others b { display: block; font-size: 16px; margin-bottom: 4px; }
.others div > span { color: var(--muted); font-size: 14.5px; }

/* ---------- Journey (experience) ---------- */
.journey { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.year-board { position: sticky; top: 110px; }
.year {
  font-stretch: 125%; font-weight: 900; font-size: clamp(80px, 10.5vw, 168px); line-height: .85; letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1.5px var(--amber);
}
.year.flip { animation: flip .5s var(--ease); }
@keyframes flip { 0% { opacity: 0; transform: translateY(16px); filter: blur(4px); } 100% { opacity: 1; transform: none; filter: none; } }
.year-to { font: 500 14px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.year-to::before { content: "→ "; color: var(--amber); }
.year-org { font-stretch: 115%; font-weight: 800; font-size: 26px; text-transform: uppercase; }
.belt {
  margin-top: 34px; height: 16px; border-radius: 3px; border: 1px solid var(--line-2); overflow: hidden; position: relative;
  background: repeating-linear-gradient(90deg, #1a222e 0 14px, #10161f 14px 28px);
  background-size: 28px 100%; animation: belt 1.2s linear infinite;
}
.belt i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%); }
@keyframes belt { to { background-position: 28px 0; } }

.jobs { position: relative; padding-left: 40px; }
.jobs .line { position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.jobs .line i { position: absolute; left: 0; top: 0; width: 100%; height: var(--fill, 0%); background: linear-gradient(180deg, var(--amber), var(--amber-2)); box-shadow: 0 0 10px rgba(255,176,0,.5); }
.job {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px 30px; margin-bottom: 20px; transition: border-color .3s;
}
.job::before {
  content: ""; position: absolute; left: -36px; top: 34px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2); transition: all .3s;
}
.job.active { border-color: rgba(255,176,0,.45); }
.job.active::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px var(--amber); }
.job .when { font: 500 12px var(--mono); color: var(--dim); margin-bottom: 10px; }
.job .when b { color: var(--soft); margin-right: 10px; font-weight: 600; }
.job h3 { margin: 0 0 4px; font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.job .org { color: var(--amber); font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.job p { color: var(--soft); margin: 0 0 12px; }
.job ul:not(.chips) { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.job ul:not(.chips) li { margin-bottom: 6px; }
.job ul:not(.chips) li::marker { color: var(--amber); }
.job .chips { margin: 14px 0 0; }

/* ---------- Recognition ---------- */
.recog { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.rc { grid-column: span 4; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .3s; }
.rc:hover { border-color: var(--line-2); }
.rc.wide { grid-column: span 8; }
.rc img { width: 100%; aspect-ratio: 16/10; object-fit: cover; cursor: zoom-in; filter: grayscale(.35) saturate(.9); transition: filter .5s; }
.rc:hover img { filter: none; }
.rc.wide img { aspect-ratio: 16/8; }
.rc img.on-white { object-fit: contain; background: #fff; filter: none; }
.rc .mosaic { display: grid; grid-template-columns: 1.45fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 3px; height: clamp(240px, 28vw, 360px); background: var(--line); }
.rc .mosaic img { aspect-ratio: auto; width: 100%; height: 100%; min-height: 0; }
.rc .body { padding: 18px 22px 22px; }
.rc .when { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.rc h3 { margin: 6px 0 6px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.rc p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ---------- Field: loops + strips ---------- */
.loops { display: grid; grid-template-columns: 2fr 1fr; grid-template-areas: "a b" "c b"; gap: 16px; }
.loops figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #05070a; border: 1px solid var(--line); }
.loops .a { grid-area: a; } .loops .b { grid-area: b; } .loops .c { grid-area: c; }
.loops video { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 16/9; }
.loops .b video { aspect-ratio: auto; position: absolute; inset: 0; }
.loops figcaption {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 3px; background: rgba(5,7,10,.7); backdrop-filter: blur(4px);
  font: 500 11px var(--mono); letter-spacing: .06em; color: #dfe6f1;
}
.loops figcaption i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink 1.4s infinite; }
.strips { margin-top: 16px; display: grid; gap: 16px; }
.strip { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.strip-track { display: flex; width: max-content; animation: slide 70s linear infinite; }
.strip.reverse .strip-track { animation-direction: reverse; animation-duration: 80s; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip figure { position: relative; margin: 0 16px 0 0; height: 250px; border-radius: 8px; overflow: hidden; cursor: zoom-in; flex: none; }
.strip img { height: 100%; width: auto; max-width: none; filter: grayscale(.4); transition: filter .4s, transform .6s var(--ease); }
.strip figure:hover img { filter: none; transform: scale(1.04); }
.strip figcaption {
  position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  font: 500 11px var(--mono); color: #dfe6f1; opacity: 0; transition: opacity .25s;
}
.strip figure:hover figcaption { opacity: 1; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.edu h3 { font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.edu .item { padding: 18px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.edu .item b { display: block; font-weight: 650; }
.edu .item div > span { color: var(--muted); font-size: 15px; }
.edu .item time { font: 500 12px var(--mono); color: var(--amber); white-space: nowrap; }

/* ---------- Contact ---------- */
.contact { position: relative; overflow: hidden; margin-top: 160px; padding: 150px 0 130px; border-top: 1px solid var(--line); isolation: isolate; }
.contact-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(7,9,13,.82) 40%, rgba(7,9,13,.92) 100%),
    url("img/porto-aereo.webp") center/cover no-repeat;
}
.contact h2 {
  margin: 0 0 20px; max-width: 20ch; font-stretch: 125%; font-weight: 850; text-transform: uppercase;
  font-size: clamp(32px, 4.4vw, 64px); line-height: .95; letter-spacing: -.02em;
}
.contact p { color: var(--soft); margin: 0 0 40px; max-width: 46ch; }
.mail {
  display: inline-flex; align-items: center; gap: 14px; text-decoration: none; position: relative;
  font-stretch: 110%; font-weight: 750; font-size: clamp(22px, 4.4vw, 62px); letter-spacing: -.02em; color: var(--amber);
  word-break: break-all;
}
.mail svg { width: .7em; height: .7em; flex: none; transition: transform .3s var(--ease); }
.mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--amber); transform: scaleX(.15); transform-origin: left; transition: transform .5s var(--ease); }
.mail:hover::after { transform: scaleX(1); }
.mail:hover svg { transform: translate(4px, -4px); }
.contact-links { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 500 13px var(--mono); color: var(--soft); border: 1px solid var(--line-2); border-radius: 4px; padding: 12px 16px;
  background: rgba(7,9,13,.5); transition: border-color .2s, color .2s;
}
.contact-links a:hover { border-color: var(--amber); color: var(--amber); }
.contact-links svg { width: 18px; height: 18px; }
footer { padding: 26px 0 36px; border-top: 1px solid var(--line); font: 400 11px var(--mono); letter-spacing: .08em; color: var(--dim); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =========================================================
   DIALOGS
   ========================================================= */
dialog {
  width: min(940px, 100% - 24px); max-height: calc(100dvh - 40px); padding: 0;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9);
}
dialog[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(3,5,8,.82); backdrop-filter: blur(5px); }
dialog .inner { padding: 40px 44px 44px; }
dialog .close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 2;
  width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font-size: 20px; cursor: pointer; line-height: 1;
}
dialog .close:hover { border-color: var(--amber); color: var(--amber); }
dialog .kicker { margin-bottom: 12px; }
dialog h3 { font-stretch: 112%; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.015em; line-height: 1.12; margin: 0 0 16px; }
dialog p { color: var(--soft); margin: 0 0 14px; }
dialog ul { color: var(--soft); padding-left: 20px; margin: 0 0 14px; }
dialog li { margin-bottom: 6px; }
dialog li::marker { color: var(--amber); }
dialog .pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0 8px; }
dialog .pics figure { margin: 0; }
dialog .pics img { border-radius: 8px; width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; background: #05070a; border: 1px solid var(--line); }
dialog .pics img.contain { object-fit: contain; }
dialog .pics .full { grid-column: 1/-1; }
dialog .pics .full img { aspect-ratio: auto; }
dialog .pics video { width: 100%; aspect-ratio: 16/9; border-radius: 8px; background: #05070a; display: block; }
dialog .cap { font: 400 11px var(--mono); color: var(--dim); margin-top: 8px; }
.proj { display: none; }
.proj.active { display: block; }

#lightbox { width: auto; max-width: calc(100vw - 24px); background: transparent; border: 0; box-shadow: none; }
#lightbox img { max-height: calc(100dvh - 70px); max-width: 100%; border-radius: 8px; margin: auto; }
#lightbox p { text-align: center; font: 500 12px var(--mono); color: var(--soft); margin: 12px 0 0; }

/* =========================================================
   BOOT SEQUENCE
   ========================================================= */
#boot {
  position: fixed; inset: 0; z-index: 200; background: #05070a;
  display: grid; place-items: center; transition: opacity .45s ease, visibility .45s;
  font: 500 13px/1.9 var(--mono); color: var(--soft); cursor: pointer;
}
#boot.done { opacity: 0; visibility: hidden; }
#boot pre { margin: 0; min-width: min(360px, 90vw); white-space: pre-wrap; font: inherit; }
#boot .ok { color: var(--green); }
#boot .hd { color: var(--amber); }
#boot .bar { display: block; height: 2px; margin-top: 14px; background: var(--line); position: relative; overflow: hidden; }
#boot .bar::after { content: ""; position: absolute; inset: 0; background: var(--amber); transform-origin: left; animation: load 1.1s var(--ease) forwards; }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 1440px) { .rail { display: flex; } }

@media (max-width: 1100px) {
  .nav { gap: 18px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .pipeline { flex-direction: column; }
  .node { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: start; }
  .node svg { grid-row: span 2; margin: 2px 0 0; }
  .pipe { flex: 0 0 30px; width: 2px; height: auto; align-self: flex-start; margin-left: 36px; }
  .pipe::before { background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 10px); }
  .pipe i { left: 50%; top: 0; margin: 0 0 0 -4px; animation-name: packet-v; }
  .skills { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .feature-txt { padding: 40px 32px 8px; }
  .feature-stage { min-height: 420px; margin: 0 24px 24px; }
}

@media (max-width: 980px) {
  .ticker-set { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .ticker-set li { border-left: 0; padding: 14px 0; border-top: 1px solid rgba(20,13,0,.22); }
  .ticker-set li:nth-child(-n+2) { border-top: 0; }
  .ticker-set li:last-child { grid-column: 1/-1; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 120px; }
  .hmi { justify-self: start; width: min(300px, 80%); }
  .about { grid-template-columns: 1fr; gap: 48px; }
  .about-media { order: 2; }
  .journey { grid-template-columns: 1fr; }
  .year-board { display: none; }
  .rc, .rc.wide { grid-column: span 6; }
  .edu { grid-template-columns: 1fr; gap: 32px; }
  .others { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .menu-btn { display: block; margin-left: 4px; }
  .lang { margin-left: auto; }
  .nav {
    position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7,9,13,.97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 16px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav a.nav-cta { margin-top: 14px; text-align: center; }
  .top { background: rgba(7,9,13,.6); backdrop-filter: blur(10px); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  section.block { padding-top: 104px; }
  .sec-head h2, .contact h2 { font-stretch: 105%; font-size: clamp(26px, 8vw, 40px); hyphens: auto; overflow-wrap: break-word; }
  .name { font-size: clamp(40px, 13vw, 64px); }
  .sec-head { margin-bottom: 40px; }
  .hud { gap: 14px 22px; }
  .hmi-bar-r { display: none; }
  .hmi-bar span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-scroll { display: none; }
  .bento { grid-template-columns: 1fr; }
  .card.big { grid-column: auto; flex-direction: column; }
  .card.big .thumb { flex: none; height: 200px; min-height: 0; }
  .card.big h3 { font-size: 19px; }
  .skills { grid-template-columns: 1fr; }
  .feature-txt { padding: 32px 22px 4px; }
  .feature-stage { min-height: 0; margin: 8px 16px 20px; display: grid; gap: 10px; perspective: none; }
  .scr, .scr.main, .scr.s1, .scr.s2, .feature:hover .scr { position: static; width: 100%; transform: none; }
  .rc, .rc.wide { grid-column: 1/-1; }
  .rc.wide img { aspect-ratio: 16/10; }
  .rc .mosaic { height: 300px; }
  .rc .mosaic img { aspect-ratio: auto; }
  .loops { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c"; }
  .loops .b video { aspect-ratio: 4/5; position: static; }
  .strip figure { height: 180px; }
  .jobs { padding-left: 28px; }
  .jobs .line { left: 5px; }
  .job { padding: 22px 20px; }
  .job::before { left: -28px; }
  .datasheet div { grid-template-columns: 96px 1fr; }
  dialog .inner { padding: 24px 20px 30px; }
  dialog .pics { grid-template-columns: 1fr; }
  .edu .item { flex-direction: column; gap: 4px; }
  .contact { padding: 110px 0 90px; margin-top: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .strip { overflow-x: auto; }
  .pipe i { display: none; }
}
