/*
  Rafael Souza Portfolio
  Design: "Arquitetura como linguagem" — grafo de nós, navy profundo, Syne display
  Paleta: storm-950 / electric-500 / sky-400 / violet-400
  Tipografia: Syne (display) + Inter (body) + JetBrains Mono (code)
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --c-bg:        #050D1A;
  --c-surface:   #0D1B2E;
  --c-surface-2: #162236;
  --c-border:    #1E3049;
  --c-blue:      #2563EB;
  --c-blue-l:    #3B82F6;
  --c-sky:       #38BDF8;
  --c-violet:    #A78BFA;
  --c-text:      #E2E8F0;
  --c-text-2:    #94A3B8;
  --c-text-3:    #64748B;

  --f-display: 'Syne', sans-serif;
  --f-body:    'Inter', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  --nav-h: 64px;
  --max-w: 1280px;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.mono { font-family: var(--f-mono); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 768px)  { .container { padding: 0 2rem; } }
@media (min-width: 1280px) { .container { padding: 0 3rem; } }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: background 0.3s var(--ease), border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(5, 13, 26, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--c-border);
}

.nav__logo {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-blue-l);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav__links { display: none; gap: 2.5rem; }
.nav__links a { font-size: 0.875rem; color: var(--c-text-2); transition: color 0.2s; }
.nav__links a:hover { color: var(--c-text); }

.nav__cta {
  display: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-blue-l);
  border: 1px solid rgba(37, 99, 235, 0.5);
  padding: 0.375rem 1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav__cta:hover { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }

.nav__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 768px) {
  .nav { padding: 0 2rem; }
  .nav__links { display: flex; }
  .nav__cta { display: block; }
  .nav__hamburger { display: none; }
}

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 1.5rem;
  z-index: 99;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.25s;
  pointer-events: none;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: all; }
.mobile-menu ul { display: flex; flex-direction: column; gap: 1rem; }
.mobile-menu a { font-size: 1.125rem; color: var(--c-text-2); transition: color 0.2s; }
.mobile-menu a:hover { color: var(--c-text); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
.btn--primary:hover { background: var(--c-blue-l); border-color: var(--c-blue-l); }

.btn--ghost { background: transparent; color: var(--c-text-2); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-text-3); color: var(--c-text); }

.btn--lg { padding: 0.875rem 1.75rem; font-size: 0.9375rem; }

/* ============================================================
   SECTIONS — COMUM
   ============================================================ */
.section {
  padding: 6rem 0;
  border-top: 1px solid var(--c-border);
}

.section__header { margin-bottom: 3rem; }

.section__eyebrow {
  display: block;
  font-size: 0.6875rem;
  color: var(--c-blue-l);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--f-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.js-loaded .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.js-loaded .reveal.delay-1 { transition-delay: 0.1s; }
.js-loaded .reveal.delay-2 { transition-delay: 0.2s; }
.js-loaded .reveal.delay-3 { transition-delay: 0.3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--c-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, black 0%, transparent 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__left { display: flex; flex-direction: column; gap: 1.5rem; }

.hero__eyebrow {
  font-size: 0.6875rem;
  color: var(--c-blue-l);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__name {
  font-family: var(--f-display);
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  font-weight: 800;
  line-height: 0.93;
  color: var(--c-text);
  letter-spacing: -0.03em;
}

.hero__desc {
  font-size: 1.125rem;
  color: var(--c-text-2);
  max-width: 42ch;
  line-height: 1.75;
}

.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero__stats {
  display: flex;
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-border);
}

.hero__stat { display: flex; flex-direction: column; gap: 2px; }

.hero__stat-value { font-size: 1.5rem; font-weight: 500; color: var(--c-text); line-height: 1; }

.hero__stat-label {
  font-size: 0.6875rem;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero__right { display: flex; align-items: center; justify-content: center; }

.hero__graph { width: 100%; max-width: 420px; height: 340px; display: block; }

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-text-3);
}
.hero__scroll-hint span { font-size: 0.625rem; letter-spacing: 0.25em; text-transform: uppercase; }
.hero__scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--c-text-3), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

.anim-1 { opacity: 0; animation: fadeUp 0.6s var(--ease) 0.10s forwards; }
.anim-2 { opacity: 0; animation: fadeUp 0.7s var(--ease) 0.22s forwards; }
.anim-3 { opacity: 0; animation: fadeUp 0.6s var(--ease) 0.38s forwards; }
.anim-4 { opacity: 0; animation: fadeUp 0.6s var(--ease) 0.50s forwards; }
.anim-5 { opacity: 0; animation: fadeUp 0.6s var(--ease) 0.62s forwards; }
.anim-6 { opacity: 0; animation: fadeIn 0.8s ease  0.40s forwards; }

@media (min-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr 1fr;
    padding: 5rem 3rem 6rem;
    gap: 4rem;
  }
  .hero__graph { max-width: 540px; height: 480px; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about__content { display: grid; grid-template-columns: 1fr; gap: 3rem; }

/* Photo */
.about__photo-col { display: flex; justify-content: center; }

.about__photo-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.about__photo-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-blue), var(--c-sky), var(--c-violet));
  z-index: 0;
}

.about__photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--c-bg);
  display: block;
}

/* Text */
.about__text { display: flex; flex-direction: column; gap: 1.25rem; }

.about__text p {
  font-size: 1.0625rem;
  color: var(--c-text-2);
  line-height: 1.8;
  max-width: 62ch;
}

/* Meta card */
.about__meta {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  align-self: start;
}

.about__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-border);
}
.about__meta-item:first-child { padding-top: 0; }
.about__meta-item:last-child  { border-bottom: none; padding-bottom: 0; }

.about__meta-key {
  font-size: 0.625rem;
  color: var(--c-text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.about__meta-val { font-size: 0.9375rem; color: var(--c-text); }

@media (min-width: 768px) {
  .about__content { grid-template-columns: auto 1fr; gap: 3rem; }
  .about__photo-col { justify-content: flex-start; align-items: flex-start; }
}

@media (min-width: 1024px) {
  .about__content { grid-template-columns: auto 1fr 300px; gap: 3.5rem; }
}

/* ============================================================
   STACK
   ============================================================ */
.stack__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 640px)  { .stack__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .stack__grid { grid-template-columns: repeat(3, 1fr); } }

.stack__category { display: flex; flex-direction: column; gap: 0.75rem; }

.stack__cat-label {
  font-size: 0.625rem;
  color: var(--c-text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stack__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tag {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  line-height: 1.4;
}
.tag--primary { background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.3); color: var(--c-sky); }
.tag--accent  { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.3); color: var(--c-violet); }
.tag--muted   { color: var(--c-text-3); }
.tag--sm      { font-size: 0.6875rem; padding: 0.1875rem 0.5rem; }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects__note { font-size: 0.8125rem; color: var(--c-text-3); margin-bottom: 2rem; }

.projects__grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px)  { .projects__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .projects__grid { grid-template-columns: 1fr 1fr 1fr; } }

.project-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.project-card:hover {
  border-color: rgba(37,99,235,.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(37,99,235,.08);
}

.project-card--featured {
  border-color: rgba(37,99,235,.35);
  background: linear-gradient(140deg, var(--c-surface) 0%, rgba(37,99,235,.06) 100%);
}

.project-card--ghost { opacity: 0.55; }
.project-card--ghost:hover { opacity: 0.75; }

.project-card__header { display: flex; align-items: center; justify-content: space-between; }

.project-card__type {
  font-size: 0.625rem;
  color: var(--c-text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card__links a { font-size: 1.125rem; color: var(--c-text-3); transition: color 0.2s; line-height: 1; }
.project-card__links a:hover { color: var(--c-blue-l); }

.project-card__title {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}

.project-card__desc { font-size: 0.875rem; color: var(--c-text-2); line-height: 1.75; flex: 1; }

.project-card__tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: auto; }

.projects__footer { margin-top: 2.5rem; display: flex; justify-content: center; }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp__list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.exp-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-blue);
  border-radius: 0 6px 6px 0;
  transition: border-left-color 0.25s, box-shadow 0.25s;
}
.exp-card:hover {
  border-left-color: var(--c-sky);
  box-shadow: 0 4px 24px rgba(37,99,235,.08);
}

.exp-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exp-card__period {
  font-size: 0.75rem;
  color: var(--c-blue-l);
  letter-spacing: 0.06em;
}

.exp-card__location {
  font-size: 0.6875rem;
  color: var(--c-text-3);
  letter-spacing: 0.06em;
}

.exp-card__body { display: flex; flex-direction: column; gap: 1rem; }

.exp-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exp-card__role {
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-text);
}

.exp-card__company {
  font-size: 0.875rem;
  color: var(--c-text-2);
}

.exp-card__bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.exp-card__bullets li {
  font-size: 0.875rem;
  color: var(--c-text-2);
  line-height: 1.65;
  padding-left: 1.25rem;
  position: relative;
}
.exp-card__bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--c-blue-l);
  font-size: 0.75rem;
  top: 0.2em;
}
.exp-card__bullets strong { color: var(--c-text); font-weight: 600; }

.exp-card__tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }

@media (min-width: 768px) {
  .exp-card { grid-template-columns: 140px 1fr; gap: 2rem; }
}

/* Education */
.edu__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .edu__grid { grid-template-columns: 1fr 1fr; }
}

.edu-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
}

.edu-card__year {
  font-size: 0.75rem;
  color: var(--c-violet);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.edu-card__degree {
  font-family: var(--f-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.4;
  margin-bottom: 0.375rem;
}

.edu-card__badge {
  display: inline-block;
  font-size: 0.625rem;
  color: var(--c-violet);
  background: rgba(167,139,250,.12);
  border: 1px solid rgba(167,139,250,.3);
  border-radius: 3px;
  padding: 0.125rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.06em;
}

.edu-card__school {
  display: block;
  font-size: 0.8125rem;
  color: var(--c-text-3);
  margin-bottom: 0.5rem;
}

.edu-card__detail {
  font-size: 0.8125rem;
  color: var(--c-text-3);
  line-height: 1.6;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact { background: var(--c-surface); }

.contact__inner { max-width: 680px; }

.contact__desc {
  font-size: 1.0625rem;
  color: var(--c-text-2);
  margin-top: 1rem;
  margin-bottom: 2rem;
  line-height: 1.75;
}

.contact__actions { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
@media (min-width: 640px) { .contact__actions { flex-direction: row; flex-wrap: wrap; } }

.contact__socials { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.contact__socials a {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.contact__socials a:hover { color: var(--c-blue-l); border-color: var(--c-blue-l); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--c-border); padding: 1.5rem 0; }

.footer .container { display: flex; align-items: center; justify-content: space-between; }

.footer__copy { font-size: 0.6875rem; color: var(--c-text-3); letter-spacing: 0.1em; }

.footer__top { font-size: 0.6875rem; color: var(--c-text-3); letter-spacing: 0.08em; transition: color 0.2s; }
.footer__top:hover { color: var(--c-blue-l); }

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.8; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .anim-1, .anim-2, .anim-3, .anim-4, .anim-5, .anim-6 { opacity: 1 !important; }
}
