/* ============================================================
   ROOT & RESET
   ============================================================ */
:root {
  --green:       #04AA6D;
  --green-light: #06d489;
  --navy:        #0a192f;
  --lead:        #2d2d2d;
  --grey:        #8892b0;
  --black:       #0a0a0a;
  --white:       #e6f1ff;
  --card-bg:     #112240;
  --border:      rgba(4, 170, 109, 0.18);

  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --nav-h:    64px;
  --max-w:    1100px;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.section-title {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}
.section-title::before {
  content: '// ';
  color: var(--green);
}

.section-subtitle {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--grey);
  margin-bottom: 52px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease);
}

.btn--primary {
  background: var(--green);
  color: var(--black);
}
.btn--primary:hover {
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(4, 170, 109, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn--outline:hover {
  background: rgba(4, 170, 109, 0.1);
  transform: translateY(-2px);
}

.btn--sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(4, 170, 109, 0.6);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 99;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lead);
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.2s, border-color 0.2s;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: rgba(4, 170, 109, 0.12);
  border-color: var(--green);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  user-select: none;
}
.nav__bracket { color: var(--green); }

.nav__links {
  display: flex;
  gap: 36px;
}
.nav__links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey);
  position: relative;
  transition: color 0.2s;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width 0.25s var(--ease);
}
.nav__links a:hover,
.nav__links a.active { color: var(--white); }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--green); }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--grey);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.5px;
}
.lang-toggle:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 28px;
}

.hero__greeting {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--green);
  font-style: italic;
  margin-bottom: 12px;
  animation: fadeUp 0.7s var(--ease) both;
}

.hero__name {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 10px;
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}

.hero__title {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  color: var(--grey);
  margin-bottom: 22px;
  animation: fadeUp 0.7s var(--ease) 0.2s both;
}
.hero__title-primary { color: var(--green); }
.hero__sep { opacity: 0.3; }

.hero__tagline {
  font-size: 0.95rem;
  color: var(--grey);
  max-width: 430px;
  line-height: 1.75;
  margin-bottom: 36px;
  animation: fadeUp 0.7s var(--ease) 0.3s both;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeUp 0.7s var(--ease) 0.4s both;
}

/* ============================================================
   TERMINAL
   ============================================================ */
.hero__terminal {
  animation: fadeUp 0.7s var(--ease) 0.25s both;
}

.terminal {
  background: #13131f;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(4, 170, 109, 0.08);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1e1e2e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal__dot--red    { background: #ff5f57; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green  { background: #28c840; }

.terminal__filename {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--grey);
  margin-left: 8px;
}

.terminal__body {
  padding: 20px 22px;
  overflow-x: auto;
}
.terminal__body code {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.85;
  white-space: pre;
  color: #abb2bf;
}

/* Syntax tokens */
.tk-kw  { color: #c678dd; }
.tk-mod { color: #e5c07b; }
.tk-str { color: #98c379; }
.tk-cmt { color: #5c6370; font-style: italic; }
.tk-op  { color: #56b6c2; }
.tk-dec { color: #61afef; }
.tk-fn  { color: #61afef; }

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: 80px 0;
  background: var(--black);
  border-top: 1px solid var(--border);
}

.about__inner {
  max-width: 720px;
}

.about__text {
  font-size: 1.05rem;
  color: var(--grey);
  line-height: 1.85;
  margin-top: 4px;
}

.about__text em {
  color: var(--white);
  font-style: normal;
}

/* ============================================================
   STACK
   ============================================================ */
.stack {
  padding: 100px 0;
  background: linear-gradient(180deg, var(--black) 0%, var(--navy) 100%);
}

.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 18px;
}

.tech-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: default;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.tech-card:hover {
  background: rgba(4, 170, 109, 0.08);
  border-color: rgba(4, 170, 109, 0.3);
  transform: translateY(-5px);
}

.tech-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tech-card__icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.tech-card__icon--svg { }
.tech-card__icon--text {
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.tech-card__name {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--grey);
  text-align: center;
  line-height: 1.3;
}

/* ============================================================
   DATABRICKS ECOSYSTEM
   ============================================================ */
.eco {
  margin-top: 64px;
}

.eco__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.eco__label {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}
.eco__label::before {
  content: '// ';
  color: #FF3621;
}

.eco__subtitle {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--grey);
  margin-bottom: 28px;
}

.eco__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.eco-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid rgba(255, 54, 33, 0.5);
  border-radius: 6px;
  transition: background 0.25s var(--ease), border-left-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.eco-card:hover {
  background: rgba(255, 54, 33, 0.05);
  border-left-color: #FF3621;
  transform: translateX(3px);
}

.eco-card__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.eco-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.eco-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eco-card__name {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
}

.eco-card__tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: #FF3621;
  background: rgba(255, 54, 33, 0.1);
  border: 1px solid rgba(255, 54, 33, 0.25);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.eco-card__desc {
  font-size: 0.82rem;
  color: var(--grey);
  line-height: 1.6;
}

@media (max-width: 700px) {
  .eco__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects {
  padding: 100px 0;
  background: var(--navy);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}

.project-card {
  background: #0d1b2e;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project-card:hover {
  transform: translateY(-7px);
  border-color: rgba(4, 170, 109, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(4, 170, 109, 0.1);
}

/* Project placeholder images */
.project-card__image {
  aspect-ratio: 8 / 3;
  position: relative;
  overflow: hidden;
  background: #0d1b2e;
}
.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s var(--ease);
}
.project-card:hover .project-card__image img {
  transform: scale(1.04);
}
/* Bottom fade so o badge fica legível */
.project-card__image::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(13,27,46,0.7), transparent);
  pointer-events: none;
  z-index: 1;
}

.project-card__badge {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--green);
  background: rgba(4, 170, 109, 0.06);
  border: 1px solid rgba(4, 170, 109, 0.3);
  padding: 7px 14px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.project-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.project-card__title {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white);
}

.project-card__desc {
  font-size: 0.855rem;
  color: var(--grey);
  line-height: 1.65;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--green);
  background: rgba(4, 170, 109, 0.08);
  border: 1px solid rgba(4, 170, 109, 0.2);
  padding: 3px 8px;
  border-radius: 3px;
}

/* ============================================================
   COMING SOON CARD
   ============================================================ */
.project-card--soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  border: 1px dashed rgba(4, 170, 109, 0.3);
  background: rgba(4, 170, 109, 0.03);
}
.project-card--soon:hover {
  border-color: rgba(4, 170, 109, 0.6);
  background: rgba(4, 170, 109, 0.06);
  box-shadow: 0 0 32px rgba(4, 170, 109, 0.08);
}

.soon__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px;
  text-align: center;
}

.soon__icon {
  display: flex;
  gap: 8px;
  align-items: center;
}
.soon__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.4;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.soon__dot:nth-child(2) { animation-delay: 0.2s; }
.soon__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%       { opacity: 1;    transform: scale(1.15); }
}

.soon__title {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.soon__desc {
  font-size: 0.85rem;
  color: var(--grey);
  max-width: 220px;
  line-height: 1.6;
}

.soon__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--green);
  opacity: 0.8;
  transition: opacity 0.2s;
  margin-top: 4px;
}
.soon__link:hover { opacity: 1; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: 100px 0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--black) 100%);
  text-align: center;
}

.contact__text {
  font-size: 1rem;
  color: var(--grey);
  margin: 0 auto 44px;
  max-width: 480px;
  line-height: 1.7;
}

.contact__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.contact__link:hover { transform: translateY(-3px); }

.contact__link--linkedin {
  background: #0a66c2;
  color: #fff;
}
.contact__link--linkedin:hover {
  background: #0f74d4;
  box-shadow: 0 8px 28px rgba(10, 102, 194, 0.4);
}

.contact__link--github {
  background: var(--lead);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.1);
}
.contact__link--github:hover {
  background: #3a3a3a;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.contact__link--portfolio {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.contact__link--portfolio:hover {
  background: rgba(4, 170, 109, 0.1);
  box-shadow: 0 8px 28px rgba(4, 170, 109, 0.2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 24px;
  text-align: center;
  background: var(--black);
  border-top: 1px solid var(--border);
}
.footer p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--grey);
}
.footer a {
  color: var(--green);
  transition: color 0.2s;
}
.footer a:hover { color: var(--green-light); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger via CSS custom property set by JS */
.reveal { transition-delay: var(--delay, 0s); }

/* ============================================================
   TYPEWRITER CURSOR
   ============================================================ */
.tw-cursor {
  display: inline-block;
  color: var(--green);
  font-weight: 300;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--lead); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 56px 24px;
    min-height: auto;
  }
  .hero__terminal { display: none; }
}

/* Hamburger button */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: 8px;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--grey);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 600px) {
  .nav__hamburger { display: flex; }

  .nav__links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 25, 47, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 16px 0 24px;
    border-bottom: 1px solid rgba(4, 170, 109, 0.2);
    z-index: 999;
  }
  .nav__links.open { display: flex; }
  .nav__links li { width: 100%; text-align: center; }
  .nav__links a { display: block; padding: 14px 0; font-size: 1rem; }

  .projects__grid { grid-template-columns: 1fr; }

  .contact__links { flex-direction: column; align-items: center; }

  .stack__grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  .hero__name { letter-spacing: -0.5px; }
}
