/* ==========================================================
   thiagobrucezziia.com — DevOps portfolio
   ========================================================== */
:root {
  --bg: #05070d;
  --bg-2: #0a0f1c;
  --panel: rgba(16, 22, 38, 0.72);
  --panel-solid: #0e1424;
  --border: rgba(120, 160, 255, 0.14);
  --text: #e6ebff;
  --muted: #8b95b8;
  --dim: #56607f;
  --green: #3ef0a1;
  --cyan: #38d6ff;
  --violet: #8b6bff;
  --pink: #ff5fa2;
  --amber: #ffc24b;
  --red: #ff5f6d;
  --grad: linear-gradient(110deg, var(--cyan), var(--violet) 45%, var(--pink));
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--violet); color: #fff; }

/* ---------- global fx ---------- */
#bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; width: 520px; height: 520px; border-radius: 50%;
  left: 0; top: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, rgba(139,107,255,.16), transparent 62%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
}
main, header, footer { position: relative; z-index: 2; }

/* deploy progress bar = scroll progress */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 50;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--grad);
  box-shadow: 0 0 12px var(--violet);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 40; display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 999px;
  background: rgba(10, 14, 26, .6); backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px;
}
.nav a, .nav button {
  padding: 7px 13px; border-radius: 999px; color: var(--muted);
  transition: color .2s, background .2s;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.nav a:hover, .nav a.active { color: var(--text); background: rgba(139,107,255,.16); }
.nav .logo { color: var(--green); font-weight: 700; }
.nav .lang { color: var(--cyan); border: 1px solid var(--border); }
@media (max-width: 760px) { .nav .hide-sm { display: none; } }

/* ---------- layout ---------- */
section { padding: 120px 24px; max-width: 1180px; margin: 0 auto; }
.eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--green);
  letter-spacing: .08em; margin-bottom: 14px; display: inline-flex; gap: 8px; align-items: center;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
h2 {
  font-size: clamp(32px, 5vw, 54px); line-height: 1.08; margin: 0 0 18px;
  letter-spacing: -.03em; font-weight: 800;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 18px; max-width: 680px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; display: grid; place-items: center; text-align: center;
  padding-top: 90px; max-width: none; position: relative;
}
@media (max-width: 560px) {
  .hero > div { max-width: 100%; }
  .status-pill { font-size: 11px; max-width: 92vw; text-align: left; }
  .role { font-size: 12.5px; white-space: nowrap; }
  .hero h1 { font-size: 64px; }
  section { padding: 84px 20px; }
}
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(62,240,161,.05);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62,240,161,.7); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(62,240,161,.6); } 80%,100% { box-shadow: 0 0 0 12px rgba(62,240,161,0); } }

.hero h1 {
  font-size: clamp(48px, 10vw, 128px); line-height: .95; margin: 28px 0 10px;
  letter-spacing: -.05em; font-weight: 900;
}
.hero h1 .line { display: block; overflow: hidden; padding: 0 .04em .12em; margin-bottom: -.12em; }
.hero h1 .line span { display: inline-block; transform: translateY(110%); animation: rise 1.1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) span { animation-delay: .15s; }
@keyframes rise { to { transform: none; } }

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: 0;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch:hover::before { opacity: .8; animation: glitch 0.4s steps(2) infinite; color: var(--cyan); -webkit-text-fill-color: var(--cyan); }
.glitch:hover::after { opacity: .8; animation: glitch 0.4s steps(2) infinite reverse; color: var(--pink); -webkit-text-fill-color: var(--pink); }
@keyframes glitch {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 2px); }
  50% { clip-path: inset(60% 0 10% 0); transform: translate(4px, -2px); }
  100% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 1px); }
}

.role {
  font-family: var(--mono); font-size: clamp(16px, 2.4vw, 22px); color: var(--muted);
  min-height: 1.6em;
}
.role .prompt { color: var(--green); }
.role .typed { color: var(--text); }
.caret { display: inline-block; width: .6em; height: 1.1em; background: var(--cyan); vertical-align: -0.18em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border); background: var(--panel); backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  will-change: transform;
}
.btn:hover { border-color: rgba(139,107,255,.6); box-shadow: 0 10px 40px -10px rgba(139,107,255,.6); }
.btn.primary { background: var(--grad); border: 0; color: #060812; }
.btn svg { width: 18px; height: 18px; }

.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint .mouse { width: 22px; height: 36px; border: 2px solid var(--dim); border-radius: 12px; position: relative; }
.scroll-hint .mouse::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; background: var(--cyan); border-radius: 2px; transform: translateX(-50%); animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- terminal window ---------- */
.term {
  background: rgba(8, 11, 20, .86); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.02) inset;
  font-family: var(--mono); font-size: 13.5px; text-align: left;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; color: var(--dim); font-size: 12px; }
.term-body { padding: 18px 20px; min-height: 220px; white-space: pre-wrap; word-break: break-word; }
.t-green { color: var(--green); } .t-cyan { color: var(--cyan); } .t-violet { color: var(--violet); }
.t-pink { color: var(--pink); } .t-amber { color: var(--amber); } .t-red { color: var(--red); } .t-dim { color: var(--dim); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: center; }
.about-grid > *, .cluster-grid > * { min-width: 0; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } .photo { max-width: 420px; margin: 0 auto; } }

/* photo card: spinning gradient border + scan line + pod tag */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.photo { margin: 0; position: relative; transition: transform .2s ease-out; }
.photo-frame {
  position: relative; border-radius: 22px; padding: 2px; overflow: hidden;
  background: conic-gradient(from var(--ang), var(--cyan), var(--violet), var(--pink), var(--green), var(--cyan));
  animation: ang 6s linear infinite;
  box-shadow: 0 40px 100px -40px rgba(139,107,255,.7);
}
@keyframes ang { to { --ang: 360deg; } }
.photo-frame img {
  display: block; width: 100%; height: auto; border-radius: 20px;
  filter: grayscale(.35) contrast(1.05) brightness(.92);
  transition: filter .6s var(--ease), transform .8s var(--ease);
}
.photo:hover .photo-frame img { filter: none; transform: scale(1.03); }
.photo-frame::after {
  content: ""; position: absolute; inset: 2px; border-radius: 20px; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(5,7,13,.85));
}
.scan {
  position: absolute; left: 2px; right: 2px; height: 70px; top: -80px; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(62,240,161,.25), transparent);
  border-bottom: 1px solid rgba(62,240,161,.7);
}
.photo.in .scan { animation: scan 2.2s var(--ease) .4s 1 forwards; }
@keyframes scan { 0% { top: -80px; } 100% { top: 105%; } }
.pod-tag {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3;
  display: flex; flex-direction: column; gap: 3px;
  font-family: var(--mono); font-size: 12px; padding: 11px 14px; border-radius: 12px;
  background: rgba(5,7,13,.72); backdrop-filter: blur(10px); border: 1px solid var(--border);
}
.pod-tag .dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; vertical-align: 1px; }
.about-grid p { color: var(--muted); font-size: 17px; }
.about-grid p strong { color: var(--text); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 60px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: 26px 22px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease); }
.stat.in::after { transform: scaleX(1); }
.stat .num { font-size: clamp(34px, 4.4vw, 50px); font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); }
.stat .lbl { color: var(--muted); font-size: 14px; }

/* ---------- pipeline ---------- */
.pipeline-wrap { margin-top: 56px; position: relative; }
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; position: relative; }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
.pipeline::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 37px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 14px);
}
@media (max-width: 900px) { .pipeline::before { display: none; } }
.stage {
  position: relative; padding: 18px 14px; border-radius: 14px; text-align: center;
  background: var(--panel); border: 1px solid var(--border);
  transition: border-color .4s, box-shadow .4s, transform .4s var(--ease);
}
.stage .ico {
  width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel-solid);
  border: 2px solid var(--dim); font-size: 16px; color: var(--dim);
  transition: all .4s var(--ease); position: relative; z-index: 1;
}
.stage .name { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.stage .desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.stage .time { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 8px; }
.stage.running { border-color: rgba(255,194,75,.5); }
.stage.running .ico { border-color: var(--amber); color: var(--amber); animation: spin 1s linear infinite; border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage.done { border-color: rgba(62,240,161,.35); box-shadow: 0 0 40px -16px rgba(62,240,161,.6); }
.stage.done .ico { border-color: var(--green); color: #05070d; background: var(--green); }
.pipe-log { margin-top: 22px; }
.pipe-log .term-body { min-height: 150px; max-height: 190px; overflow: hidden; font-size: 12.5px; }

/* ---------- stack ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 50px; }
.stack-card {
  padding: 22px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transform-style: preserve-3d; transition: transform .2s ease-out, border-color .3s;
}
.stack-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139,107,255,.18), transparent 45%);
}
.stack-card:hover { border-color: rgba(139,107,255,.45); }
.stack-card:hover::before { opacity: 1; }
.stack-card h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.stack-card h3 .k { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; position: relative; }
.chip {
  font-family: var(--mono); font-size: 12px; padding: 5px 10px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--text);
  transition: transform .2s, border-color .2s, color .2s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--cyan); color: var(--cyan); }

/* marquee */
.marquee { margin-top: 70px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 46px; width: max-content; animation: marquee 40s linear infinite; font-family: var(--mono); font-size: clamp(22px, 3vw, 34px); font-weight: 700; color: var(--dim); }
.marquee-track span:nth-child(3n) { color: var(--text); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- highlights ---------- */
.hl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 50px; }
@media (max-width: 860px) { .hl-grid { grid-template-columns: 1fr; } }
.hl {
  padding: 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  position: relative; overflow: hidden; transition: transform .35s var(--ease), border-color .35s;
}
.hl:hover { transform: translateY(-6px); border-color: rgba(56,214,255,.4); }
.hl .tag { font-family: var(--mono); font-size: 11.5px; color: var(--cyan); }
.hl h3 { margin: 8px 0 10px; font-size: 21px; letter-spacing: -.01em; }
.hl p { margin: 0; color: var(--muted); font-size: 15px; }
.hl .metric { font-family: var(--mono); font-size: 13px; color: var(--green); margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.hl .glow { position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -90px; top: -90px; filter: blur(50px); opacity: .25; transition: opacity .4s; }
.hl:hover .glow { opacity: .5; }

/* ---------- k8s cluster viz ---------- */
.cluster-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; margin-top: 30px; }
@media (max-width: 900px) { .cluster-grid { grid-template-columns: 1fr; } }
.cluster {
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel);
  padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.node { border: 1px dashed rgba(139,107,255,.35); border-radius: 12px; padding: 10px; min-height: 150px; }
.node .nlabel { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 8px; display: flex; justify-content: space-between; }
.pods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pod {
  aspect-ratio: 1; border-radius: 7px; background: rgba(62,240,161,.18); border: 1px solid rgba(62,240,161,.5);
  animation: podIn .5s var(--ease);
}
.pod.new { background: rgba(56,214,255,.2); border-color: var(--cyan); }
.pod.term { animation: podOut .5s var(--ease) forwards; }
@keyframes podIn { from { transform: scale(0); opacity: 0; } }
@keyframes podOut { to { transform: scale(0); opacity: 0; } }
.cluster-ctl { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cluster-ctl button {
  font-family: var(--mono); font-size: 12.5px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.03); color: var(--text); border: 1px solid var(--border); transition: all .2s;
}
.cluster-ctl button:hover { border-color: var(--cyan); color: var(--cyan); }
.kubectl .term-body { min-height: 260px; font-size: 12.5px; }

/* ---------- timeline (git log) ---------- */
.gitlog { margin-top: 50px; position: relative; padding-left: 40px; }
.gitlog::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--green), var(--violet), var(--dim)); }
.commit { position: relative; padding: 0 0 44px; }
.commit::before {
  content: ""; position: absolute; left: -34px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--violet);
}
.commit.head::before { border-color: var(--green); box-shadow: 0 0 0 6px rgba(62,240,161,.15); }
.commit .meta { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.commit .meta .sha { color: var(--amber); }
.commit .meta .ref { color: var(--green); border: 1px solid rgba(62,240,161,.4); padding: 1px 7px; border-radius: 6px; margin-left: 6px; }
.commit h3 { margin: 6px 0 2px; font-size: 21px; }
.commit .org { color: var(--cyan); font-family: var(--mono); font-size: 14px; }
.commit p { color: var(--muted); margin: 10px 0 0; max-width: 720px; font-size: 15px; }
.commit .chips { margin-top: 12px; }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 50px; }
@media (max-width: 900px) { .proj-grid { grid-template-columns: 1fr; } }
.proj {
  padding: 24px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; transition: transform .35s var(--ease), border-color .35s;
}
.proj:hover { transform: translateY(-6px); border-color: rgba(255,95,162,.45); }
.proj .top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.proj h3 { margin: 0; font-size: 18px; }
.proj p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }

/* ---------- contact terminal ---------- */
.contact .term-body { min-height: 320px; max-height: 420px; overflow-y: auto; cursor: text; }
.contact input {
  background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; width: 70%;
  caret-color: var(--cyan);
}
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

footer { text-align: center; padding: 50px 24px 70px; color: var(--dim); font-family: var(--mono); font-size: 12.5px; }
footer .ok { color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
