/* =========================================================
   Portfolio — Leandro De Barros Barbosa
   Dark · editorial · refined. Single stylesheet.
   ========================================================= */

:root {
  --bg:          #08080c;
  --bg-elev:     #0e0e15;
  --bg-card:     #101019;
  --bg-card-hi:  #15151f;

  --border:      rgba(255, 255, 255, 0.07);
  --border-mid:  rgba(255, 255, 255, 0.12);
  --border-hi:   rgba(91, 155, 255, 0.4);

  --text:        #edeef2;
  --text-dim:    #a4abb8;
  --text-faint:  #6b7280;

  --accent:      #5b9bff;   /* azure */
  --accent-2:    #9d8cff;   /* violet */
  --accent-3:    #34d9c0;   /* teal */
  --accent-soft: rgba(91, 155, 255, 0.12);

  --maxw: 1120px;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; }
strong { color: var(--text); font-weight: 600; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* =========================================================
   ANIMATED BACKGROUND
   ========================================================= */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
/* Soft aurora via radial gradients only — NO blur filter (cheap to composite).
   The radial gradient fades to transparent well before the circle edge, so the
   blobs already look soft; animating transform alone stays on the GPU. */
.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  will-change: transform;
  transform: translateZ(0);
}
.blob-1 { width: 720px; height: 720px; top: -240px; left: -200px;
  background: radial-gradient(circle, rgba(91,155,255,0.45), transparent 62%);
  animation: drift1 34s ease-in-out infinite alternate; }
.blob-2 { width: 760px; height: 760px; top: 18%; right: -260px;
  background: radial-gradient(circle, rgba(157,140,255,0.38), transparent 62%);
  animation: drift2 40s ease-in-out infinite alternate; }
.blob-3 { width: 680px; height: 680px; bottom: -260px; left: 26%;
  background: radial-gradient(circle, rgba(52,217,192,0.26), transparent 62%);
  animation: drift3 46s ease-in-out infinite alternate; }

@keyframes drift1 { to { transform: translate3d(90px, 70px, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-80px, 90px, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(60px, -70px, 0) scale(1.14); } }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 30%, transparent 80%);
}
.bg-noise {
  position: absolute; inset: 0; opacity: 0.025;
  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='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================
   NAV
   ========================================================= */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent; }
#nav.scrolled { background: rgba(8, 8, 12, 0.7); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand-name { font-size: 0.95rem; letter-spacing: 0.2px; }

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu > a { font-size: 0.9rem; color: var(--text-dim); transition: color 0.2s; }
.nav-menu > a:hover { color: var(--text); }
.nav-num { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); opacity: 0.7; }

.lang-switch { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.lang-switch button { background: none; border: none; cursor: pointer; font-family: var(--font-mono);
  font-size: 0.82rem; font-weight: 500; color: var(--text-faint); padding: 2px; transition: color 0.2s; }
.lang-switch button.active { color: var(--accent); }
.lang-switch button:hover { color: var(--text); }
.lang-sep { color: var(--text-faint); font-size: 0.8rem; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
#hero { position: relative; min-height: 100vh; display: flex; align-items: center; }
.hero-inner { position: relative; z-index: 2; max-width: 820px; }

.status { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--text-dim); border: 1px solid var(--border-mid);
  background: rgba(255,255,255,0.02); padding: 6px 14px; border-radius: 50px; margin-bottom: 26px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 8px rgba(52,217,192,0.7); }

.eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: 0.92rem; letter-spacing: 0.5px; margin-bottom: 20px; }
#hero h1 { font-size: clamp(2.9rem, 7.5vw, 5.4rem); font-weight: 700; letter-spacing: -2px; margin-bottom: 18px; color: #fff; }
.h1-accent { color: var(--text-dim); }
.hero-role { font-size: clamp(1.4rem, 3.6vw, 2.3rem); font-weight: 500; color: var(--text-dim); margin-bottom: 26px; }
.hero-desc { font-size: 1.12rem; color: var(--text-dim); max-width: 640px; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 28px;
  border-radius: 50px; font-size: 0.98rem; font-weight: 500; transition: all 0.25s var(--ease); border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #05101f; font-weight: 600; }
.btn-primary:hover { background: #7eb0ff; transform: translateY(-2px); box-shadow: 0 12px 34px -10px var(--accent); }
.btn-ghost { border-color: var(--border-mid); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.scroll-cue { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--border-mid); border-radius: 14px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 2px; background: var(--accent); animation: scrolldot 1.8s var(--ease) infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translate(-50%, 0);} 40% { opacity: 1;} 80% { opacity: 0; transform: translate(-50%, 14px);} 100% { opacity: 0;} }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 130px 0; scroll-margin-top: 80px; position: relative; }
.section-eyebrow { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.82rem;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.sec-num, .section-eyebrow .sec-num { color: var(--accent); }
.section-title { font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -0.6px; margin-bottom: 52px; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 60px; align-items: start; }
.about-text .section-title { margin-bottom: 26px; }
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.06rem; }
.about-text a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.about-text a:hover { border-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 36px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg-card); transition: border-color 0.3s; }
.stat:hover { border-color: var(--border-hi); }
.stat-n { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.stat-l { font-size: 0.78rem; color: var(--text-faint); line-height: 1.3; }

.about-side { position: sticky; top: 100px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.avatar { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; letter-spacing: 1px;
  color: var(--accent); background: var(--bg-elev); border: 1px solid var(--border-mid); margin-bottom: 26px; }
.facts { list-style: none; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.facts li:first-child { border-top: none; }
.fact-k { color: var(--text-faint); }
.fact-v { color: var(--text); font-weight: 500; text-align: right; }

/* =========================================================
   EXPERIENCE
   ========================================================= */
.timeline { display: flex; flex-direction: column; gap: 28px; }
.exp { display: grid; grid-template-columns: 230px 1fr; gap: 36px; position: relative;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; transition: border-color 0.35s var(--ease), transform 0.35s var(--ease); }
.exp:hover { border-color: var(--border-hi); transform: translateY(-4px); }
.exp-side { display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--accent); padding-left: 18px; }
.exp-date { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); font-weight: 500; }
.exp-loc { font-size: 0.85rem; color: var(--text-dim); }
.exp-type { font-size: 0.82rem; color: var(--text-faint); }
.exp-role { font-size: 1.3rem; margin-bottom: 8px; }
.exp-at { color: var(--accent); margin: 0 2px; }
.exp-sup { color: var(--text-dim); font-size: 0.96rem; margin-bottom: 18px; }
.exp-points { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
.exp-points li { color: var(--text-dim); font-size: 0.96rem; padding-left: 22px; position: relative; }
.exp-points li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

/* =========================================================
   PROJECTS
   ========================================================= */
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 80px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.more-label { margin-bottom: 30px; }

.card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.35s var(--ease), border-color 0.35s, background 0.35s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); border-color: var(--border-hi); background: var(--bg-card-hi); }
.card-strip { height: 4px; width: 100%; }
.strip-ai { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.strip-web { background: linear-gradient(90deg, var(--accent-3), var(--accent)); }

.card-body { padding: 28px; display: flex; flex-direction: column; height: 100%; }
.card-meta { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); letter-spacing: 0.3px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.card-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.card-title { font-size: 1.3rem; margin-bottom: 12px; }
.card-featured .card-title { font-size: 1.5rem; }
.card-desc { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 20px; flex-grow: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent);
  background: var(--accent-soft); padding: 4px 11px; border-radius: 50px; white-space: nowrap; }

.card-links { margin-top: 18px; }
.repo-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 0.8rem; color: var(--text-dim); transition: color 0.2s, gap 0.2s; }
.repo-link::before { content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.51 11.51 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222 0 1.606-.014 2.898-.014 3.293 0 .322.216.694.825.576C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.51 11.51 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222 0 1.606-.014 2.898-.014 3.293 0 .322.216.694.825.576C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") center / contain no-repeat; }
.repo-link:hover { color: var(--accent); gap: 10px; }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-wrap { display: flex; flex-direction: column; gap: 22px; }
.skill-cat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 32px; transition: border-color 0.3s; }
.skill-cat:hover { border-color: var(--border-mid); }
.skill-cat h3 { font-size: 0.95rem; color: var(--text-dim); font-family: var(--font-mono); font-weight: 500;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 24px; }

.logos { display: flex; flex-wrap: wrap; gap: 16px; }
.logo-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 96px; padding: 18px 8px;
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.015);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s; }
.logo-tile:hover { transform: translateY(-6px); border-color: var(--border-hi); background: rgba(91,155,255,0.06); }
.logo-tile img { width: 42px; height: 42px; object-fit: contain; transition: filter 0.3s; }
.logo-tile img.inv { filter: invert(1) brightness(1.4); }
.logo-tile:hover img { filter: drop-shadow(0 4px 14px rgba(91,155,255,0.45)); }
.logo-tile:hover img.inv { filter: invert(1) brightness(1.4) drop-shadow(0 4px 14px rgba(91,155,255,0.45)); }
.logo-tile span { font-size: 0.76rem; color: var(--text-dim); text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.chips span { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-dim);
  border: 1px solid var(--border-mid); padding: 6px 13px; border-radius: 50px; transition: all 0.25s; }
.chips span:hover { color: var(--accent); border-color: var(--border-hi); }

/* =========================================================
   CONTACT / FOOTER
   ========================================================= */
.contact-inner { text-align: center; max-width: 640px; }
.contact-inner .section-eyebrow { justify-content: center; }
.contact-inner .section-title { margin-bottom: 20px; }
.contact-desc { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 44px; }

/* Expandable contact cards — collapsed to an icon, unfold on hover */
.contact-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.ccard { --brand: var(--accent); display: flex; align-items: center; padding: 18px;
  border: 1px solid var(--border-mid); border-radius: 16px; background: var(--bg-card);
  overflow: hidden; transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s, background 0.4s; }
.ccard-ico { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--text); transition: color 0.35s; }
.ccard-ico svg { width: 26px; height: 26px; fill: currentColor; }
.ccard-info { display: flex; flex-direction: column; gap: 2px; max-width: 0; opacity: 0;
  overflow: hidden; white-space: nowrap; transition: max-width 0.45s var(--ease), opacity 0.35s, margin-left 0.45s var(--ease); }
.ccard-name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.ccard-sub { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }
.ccard:hover { transform: translateY(-5px); border-color: var(--brand);
  background: var(--bg-card-hi); box-shadow: 0 16px 44px -16px var(--brand); }
.ccard:hover .ccard-ico { color: var(--brand); }
.ccard:hover .ccard-info { max-width: 340px; opacity: 1; margin-left: 16px; }
.ccard:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ccard:focus-visible .ccard-info { max-width: 340px; opacity: 1; margin-left: 16px; }
.ccard-gh   { --brand: #d8dee6; }
.ccard-li   { --brand: #0a8cff; }
.ccard-mail { --brand: var(--accent-3); }

footer { border-top: 1px solid var(--border); padding: 30px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); }

/* =========================================================
   REVEAL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .blob, .status-dot, .scroll-cue span { animation: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-side { position: static; }
  .featured-grid { grid-template-columns: 1fr; }
  .exp { grid-template-columns: 1fr; gap: 22px; }
  .exp-side { border-left: none; border-top: 2px solid var(--accent); border-left: 0; padding-left: 0; padding-top: 14px; flex-direction: row; flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 4px;
    background: rgba(8,8,12,0.97); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    padding: 18px 28px 24px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: 0.3s var(--ease); }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-menu > a { padding: 10px 0; width: 100%; }
  .lang-switch { margin: 8px 0 0; }
  .brand-name { font-size: 0.82rem; }
  .section { padding: 90px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .logo-tile { width: calc(50% - 8px); }
}
