/* ============ Design tokens (terminal/dark palette, inspired by alissonlimadev.com) ============ */
:root {
  --bg: #0a0814;
  --bg-alt: #0d0a18;
  --card-bg: #14101f;
  --card-bg-2: #1e1830;
  --border: rgba(168, 85, 247, 0.14);

  --text-100: #ffffff;
  --text-200: #d8d2e5;
  --text-300: #8b859b;

  --red: #a855f7;
  --red-strong: #7c3aed;
  --green: #4ade80;
  --blue: #67e8f9;
  --yellow: #a855f7;

  --font-title: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --font-body: 'Roboto', sans-serif;

  --container: 1120px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-200);
  font-family: var(--font-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.text-muted { color: var(--text-200); }
.text-accent { color: var(--red); }

/* ============ Page-wide ASCII rain background ============ */
/* Fixed behind everything. Foreground content needs `position` set to
   something other than static so normal CSS stacking rules place it above
   this layer — see the `position: relative` added to .section/.footer/.hero. */
.page-rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  background: rgba(10, 8, 20, 0.85);
  backdrop-filter: blur(14px) saturate(1.8);
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .02em;
  color: var(--text-100);
}
.nav__brand-icon { color: var(--red); }
.nav__brand-accent { color: var(--red); }
.nav__links {
  display: flex;
  gap: 32px;
}
.nav__links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-200);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav__links a:hover { color: var(--text-100); }
.nav__links a.is-active { color: var(--text-100); border-bottom-color: var(--red); }
.nav__cta { display: inline-flex; }
.nav__toggle { display: none; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-300);
  margin-left: 8px;
}
.lang-toggle:hover { border-color: var(--red); }
.lang-toggle__sep { color: var(--text-300); opacity: .5; }
.lang-toggle__opt { padding: 2px 4px; border-radius: 4px; }
.lang-toggle[data-active="pt"] .lang-toggle__opt[data-lang-opt="pt"],
.lang-toggle[data-active="en"] .lang-toggle__opt[data-lang-opt="en"] {
  color: var(--red);
  font-weight: 700;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary { background: var(--red); color: #ffffff; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-100);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--ghost:hover { border-color: var(--red); color: var(--red); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 120px;
  overflow: hidden;
  text-align: left;
}
.hero__glow {
  position: absolute;
  top: -120px;
  left: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(168,85,247,0.35), transparent 70%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: center;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
}
.hero__col--text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.hero__col--avatar {
  display: flex;
  justify-content: center;
}

.avatar { position: relative; width: 260px; height: 260px; }
.avatar__ring {
  position: absolute;
  inset: -28px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 999px;
}
.avatar__border {
  position: relative;
  z-index: 1;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.35);
}
.avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  object-position: top center;
}
.hero__online {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 8, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-100);
}

.hero__title {
  font-family: var(--font-title);
  font-weight: 800;
  line-height: 0.95;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.hero__title-line1,
.hero__title-line2 {
  font-size: clamp(40px, 7vw, 80px);
}
.hero__title-line1 { color: var(--text-100); }
.hero__title-line2 { color: var(--red); }

.hero__bio {
  font-size: 15px;
  color: var(--text-300);
  max-width: 520px;
  margin: 0;
}

.terminal-prompt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-200);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 8px;
}
.terminal-prompt .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--red); flex-shrink: 0; }
.terminal-cursor {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__typed {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--red);
  min-height: 34px;
  margin: 0;
}
.typed-cursor {
  display: inline-block;
  width: 10px;
  margin-left: 2px;
  border-right: 2px solid var(--red);
  animation: blink .8s steps(1) infinite;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--green);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
}
.hero__status .dot,
.hero__online .dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.hero__cta .btn span { display: inline-block; transition: transform .2s; }
.hero__cta .btn:hover span { transform: translateX(3px); }

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ============ Sections ============ */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 24px;
  background: rgba(10, 8, 20, 0.82);
}
.section--alt { background: rgba(13, 10, 24, 0.9); }
.section__inner {
  max-width: var(--container);
  margin: 0 auto;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  letter-spacing: 3px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}
.section__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 51px);
  color: var(--text-100);
  margin: 0 0 20px;
}
.section__lead {
  font-size: 16px;
  color: var(--text-300);
  max-width: 620px;
  margin: 0 0 48px;
}

/* About */
.about {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}
.about__photo img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.about__text p {
  font-size: 16px;
  color: var(--text-300);
}
.about__stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__num {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 24px;
  color: var(--green);
}
.stat__label { font-size: 13px; color: var(--text-300); }

/* Skills marquee */
.marquee {
  overflow: hidden;
  padding: 8px 0 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 16px;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.skill-card {
  flex: 0 0 140px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform .2s, border-color .2s;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--red); }
.skill-card i { font-size: 32px; }
.skill-card span { font-size: 14px; color: var(--text-200); }

/* Trajetória (timeline) */
.timeline {
  display: flex;
  flex-direction: column;
  max-width: 720px;
}
.timeline__item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 48px;
  border-left: 2px solid var(--border);
}
.timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--red);
  border: 2px solid var(--bg);
}
.timeline__period {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-300);
}
.timeline__role {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text-100);
  font-size: 18px;
  margin: 6px 0 2px;
}
.timeline__company {
  display: block;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}
.timeline__list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline__list li { font-size: 14px; color: var(--text-300); }

/* Projects — coverflow carousel */
.coverflow {
  position: relative;
  width: 100%;
  outline: none;
}
.coverflow__stage {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.coverflow__card {
  position: absolute;
  left: 50%;
  top: 50%;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform .5s cubic-bezier(.4,0,.2,1),
    width .5s ease,
    height .5s ease,
    opacity .4s ease,
    border-radius .5s ease,
    box-shadow .5s ease;
}
.coverflow__card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.coverflow__card-num {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
}
.coverflow__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 8, 20, 0.75);
  color: var(--text-100);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, color .2s;
}
.coverflow__arrow:hover { border-color: var(--red); color: var(--red); }
.coverflow__arrow--left { left: 0; }
.coverflow__arrow--right { right: 0; }

.coverflow__caption {
  text-align: center;
  max-width: 560px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.coverflow__index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-300);
  letter-spacing: .1em;
}
.coverflow__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  background: rgba(168, 85, 247, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 4px;
}
.coverflow__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 22px;
  color: var(--text-100);
  margin: 4px 0 0;
}
.coverflow__desc {
  font-size: 14px;
  color: var(--text-300);
  margin: 0;
}
.coverflow__links {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  min-height: 20px;
}
.coverflow__links a,
.coverflow__links .link-btn {
  font-size: 14px;
  color: var(--red);
  font-weight: 700;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ============ Lightbox: project screenshot preview ============ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 20, 0.85);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 92vw;
}
.lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-100);
  cursor: pointer;
  font-size: 14px;
  z-index: 1;
}
.lightbox-close:hover { border-color: var(--red); color: var(--red); }
.lightbox-media {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
}
.lightbox-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  pointer-events: none;
}
.lightbox-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-100);
  margin: 0;
}

/* ============ Demo modal: "Shorts Summary" (NLW IA) ============ */
.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 14, 0.75);
  backdrop-filter: blur(4px);
  padding: 24px;
}
.demo-overlay.is-open { display: flex; }

.demo-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  color: #1a1a1f;
  border-radius: 16px;
  padding: 40px;
  font-family: 'Roboto', var(--font-body), sans-serif;
}
.demo-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #f0f0f4;
  color: #1a1a1f;
  cursor: pointer;
  font-size: 14px;
}
.demo-modal__close:hover { background: #e1e1e6; }

.demo-modal__note {
  font-size: 12px;
  color: #7c7c8a;
  background: #f5f3ff;
  border: 1px solid #e4dbff;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

#shorts-app {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#shorts-app h1 {
  color: #996dff;
  margin: 0 0 24px;
  font-size: 28px;
}
#shorts-app h2 {
  align-self: flex-start;
  margin-top: 40px;
  margin-bottom: 8px;
  font-size: 18px;
}
#shorts-app p {
  align-self: flex-start;
  text-align: justify;
  width: 100%;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
#shorts-app .placeholder { color: #7c7c8a; user-select: none; }
#shorts-app .error { color: #e3646e; }

#shorts-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
#shorts-form input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #d4d4dc;
  font-size: 14px;
  font-family: inherit;
}
#shorts-form input:focus { outline: 2px solid #996dff; }
#shorts-form button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #996dff;
  color: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
#shorts-form button:hover { background: #8452ff; }

/* Contact */
.contact { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact__title { line-height: 1.1; }

.btn--glow {
  padding: 16px 32px;
  font-size: 15px;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.45);
  margin-top: 8px;
}

/* Encrypt-on-hover email button: label scrambles then decrypts, a light
   band sweeps through behind it. Ported from a React hover component. */
.btn--encrypt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  isolation: isolate;
}
.btn--encrypt__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.btn--encrypt__icon svg { width: 100%; height: 100%; }
.btn--encrypt__sweep {
  position: absolute;
  inset: -60% -20%;
  z-index: 0;
  background: linear-gradient(to bottom, transparent 42%, #818cf8 50%, transparent 58%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}
.btn--encrypt.is-hovering .btn--encrypt__sweep {
  opacity: 1;
  animation: encryptSweep 1.4s linear infinite;
}
@keyframes encryptSweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.btn--encrypt__label {
  position: relative;
  z-index: 1;
}
/* The email address reads better in mono; the nav CTA keeps the site's
   regular body font, matching every other button/label in the header. */
#emailEncryptBtn .btn--encrypt__label { font-family: var(--font-mono); }

.contact__tiles {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 40px;
}
.contact__tile {
  width: 108px;
  height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-100);
  transition: border-color .2s, transform .2s;
}
.contact__tile:hover { border-color: var(--red); transform: translateY(-4px); }
.contact__tile i { font-size: 26px; color: var(--red); }
.contact__tile-icon { display: inline-flex; width: 26px; height: 26px; color: var(--red); }
.contact__tile-icon svg { width: 100%; height: 100%; }
.contact__tile span:last-child { font-size: 13px; font-weight: 600; }

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-300);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: rgba(10, 8, 20, 0.82);
}

/* ============ Reveal animation ============ */
/* Progressive enhancement: content is fully visible by default (no-JS / JS-broken
   safe). Only once script.js runs and tags <html class="js-ready"> do .reveal
   elements start hidden, to be faded in by the IntersectionObserver below. */
.reveal {
  transition: opacity .6s ease, transform .6s ease;
}
.js-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__col--text { align-items: center; }
  .hero__col--avatar { order: -1; }
  .hero__cta { justify-content: center; }
}

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 220px; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .nav__toggle span {
    width: 22px; height: 2px; background: var(--text-100);
  }
  .hero { padding-top: 120px; }
  .avatar { width: 180px; height: 180px; }
  .avatar__border { width: 180px; height: 180px; }
  .timeline__item { padding-left: 24px; padding-bottom: 36px; }
}
