:root {
  --bg: #0b0f14;
  --panel: #121822;
  --text: #e6edf7;
  --muted: #a9b4c2;
  --border: #1f2a3a;
  --primary: #8b5cf6;
  --primary-2: #6d28d9;
  --accent: #a78bfa;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  padding: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Sora, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  scroll-behavior: smooth;
}

h1, h2, h3, .brand, .btn {
  font-family: Sora, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.scrolled {
  border-color: var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.nav {
  display: flex;
  gap: 20px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }
.nav a.active { color: var(--text); }
.nav a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}

/* Hero */
.hero {
  padding: 88px 0 48px;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}
.hero-content h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 44px);
}
.hero-content h1.typed-line {
  font-size: clamp(32px, 6vw, 52px);
}
#typed { display: inline-block; }
.typed-line { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.caret { width: 2px; height: 1em; background: var(--text); animation: caret-blink 1s steps(1, end) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.hero-content .subtitle {
  color: var(--muted);
  margin: 0 0 20px;
}
.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradient-pan 10s linear infinite;
}
.hero-actions { display: flex; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box,
              linear-gradient(90deg, var(--primary), var(--primary-2)) border-box;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.btn:hover::before { transform: translateX(100%); }
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #0a0d12;
  border: none;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.22);
  text-decoration: none;
}
.btn-outline {
  background: linear-gradient(var(--panel), var(--panel));
  color: var(--text);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(139, 92, 246, 0.32); }

.hero-aside {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.pill {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.14), rgba(109, 40, 217, 0.14));
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  animation: float-y 6s ease-in-out infinite;
}

/* Sections */
.section { padding: 36px 0; }
.section h2 {
  font-size: 24px;
  margin: 0 0 16px;
  position: relative;
}
.title-icon { margin-right: 8px; filter: saturate(1.2); }
.section-intro { color: var(--muted); margin: -6px 0 16px; }
.section h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -8px;
  width: 64px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 2px;
}
.section p { color: var(--muted); }
.reveal { opacity: 0; transform: translateY(12px); }
.reveal-visible { opacity: 1; transform: translateY(0); transition: transform 600ms var(--ease), opacity 600ms var(--ease); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.skill-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.skill-card h3 { margin: 0 0 10px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  perspective: 800px;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  will-change: transform;
  /* mobile fix: allow proper shrink/wrap inside grid */
  min-width: 0;
}
.project-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  border-color: rgba(155, 92, 255, 0.35);
}
.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  /* mobile fix: wrap long titles with stack label */
  flex-wrap: wrap;
}
.project-header h3 { margin: 0; }
.stack { color: var(--accent); font-weight: 700; }
.chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip {
  background: rgba(44, 243, 148, 0.15);
  color: var(--accent);
  border: 1px solid rgba(44, 243, 148, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

/* Contact */
.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.contact-card::before { content: none; }
.contact-actions { display: flex; gap: 10px; }

/* Contact grid & form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.contact-card.contact-info, .contact-card.contact-form {
  flex-direction: column;
  align-items: stretch;
}
.contact-card .lead { color: var(--text); margin: 0 0 5px; }
.info-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.info-item { display: grid; grid-template-columns: 24px 120px 1fr auto; align-items: center; gap: 10px; }
.info-item .icon {
  width: 24px; height: 24px; display: grid; place-items: center; opacity: 0.8;
}
.info-item .label { color: var(--muted); font-weight: 600; }
.info-item .value { color: var(--text); }

/* Contact social buttons */
.contact-social { display: flex; gap: 10px; }
.icon-btn {
  width: 45px; 
  height: 45px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: 50%;
  background: #ffffffa9;
  background-color: #ffffff7a; 
  border: 2px solid rgb(255, 255, 255);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);

}
/* .icon-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,0.24); } */
.icon-btn.discord span { color: #5865F2; }
.icon-btn.github span { color: #777777; } 

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.icon-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}


/* Quick select chips */
.quick-select { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip-select { cursor: pointer; }
.chip-select.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
  color: var(--text);
}

/* Form meta (hint + counter) */
.form-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.counter { color: var(--muted); }
.counter.warn { color: #ffc56a; }
.counter.max { color: #ff6a6a; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 6px; }
.form-field label { color: var(--muted); font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
  background: #0f141d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.form-field:focus-within { transform: translateY(-1px); }
.small { font-size: 13px; }
.muted { color: var(--muted); }

@media (max-width: 980px) {
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 1200px) {
  .skills-grid, .projects-grid, .services-grid, .highlights-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1.2fr 1fr; }
}

@media (max-width: 980px) {
  .section { padding: 30px 0; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section { padding: 26px 0; }
  .section h2 { font-size: clamp(20px, 5.5vw, 24px); }
  .hero-content .subtitle { font-size: clamp(13px, 3.8vw, 15px); }
  .hero-actions { flex-wrap: wrap; }

  /* Mobile layout */
  .hero-inner { grid-template-columns: 1fr; }
  .hero-aside { justify-content: flex-start; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    right: 4vw;
    top: 66px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    flex-direction: column;
    gap: 10px;
    display: none;
  }
  .nav.open { display: flex; }

  /* Grids em 1 coluna */
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; gap: 12px; }
  .services-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Legibilidade em cards */
  .project-card p, .service-card p { line-height: 1.6; }
}

@media (max-width: 480px) {
  .container { width: 92vw; }
  .btn { min-height: 44px; padding: 12px 16px; }
  .chip, .tag { font-size: 12px; padding: 5px 10px; }
  .info-item { grid-template-columns: 24px 90px 1fr auto; }
}

/* Scroll progress bar */
#particles-js {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 4px;
  z-index: 999;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
}
.scroll-progress__bar {
  width: 100%; height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: transform 0.15s linear;
}

/* Highlights / Why work with me */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.highlight-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.highlight-card .icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(44, 243, 148, 0.25), rgba(106, 226, 255, 0.25));
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.highlight-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  border-color: rgba(44, 243, 148, 0.35);
}
.highlight-card h3 { margin: 0 0 8px; }
.highlight-card p { color: var(--muted); margin: 0; }

/* Stagger animation */
.stagger-item { opacity: 0; transform: translateY(10px); }
.reveal-visible .stagger-item {
  animation: rise-in 500ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 120ms);
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive for highlights */
@media (max-width: 980px) {
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .highlights-grid { grid-template-columns: 1fr; }
}
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.discord-card {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(109, 40, 217, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.discord-header { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.discord-handle-row { display: flex; align-items: center; justify-content: space-between; }
.discord-handle-row .value { font-size: 15px; color: var(--text); }

.contact-form.collapsed { display: none; }

/* Better button interactions */
.btn {
  will-change: transform, box-shadow, filter;
}
.btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 16px 36px rgba(139, 92, 246, 0.28);
}
.btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(1.02);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35), 0 8px 24px rgba(139, 92, 246, 0.25);
}
/* Animated gradient pan on primary */
.btn-primary { background-size: 200% 200%; }
.btn-primary:hover { animation: button-gradient-pan 8s linear infinite; }
@keyframes button-gradient-pan {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
/* Click ripple effect */
.btn { --ripple-color: rgba(255,255,255,0.25); }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), var(--ripple-color), transparent 40%);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.btn.rippling::after { animation: btn-ripple 600ms var(--ease); }
@keyframes btn-ripple {
  0% { transform: scale(0); opacity: 0.35; }
  100% { transform: scale(6); opacity: 0; }
}
.contact-form.collapsed { display: none; }

/* Card hover enhancements */
.project-card, .service-card, .highlight-card, .skill-card {
  position: relative;
  overflow: hidden;
}
.project-card::after, .service-card::after, .highlight-card::after, .skill-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}
.project-card:hover::after, .service-card:hover::after, .highlight-card:hover::after, .skill-card:hover::after {
  transform: translateX(100%);
}
.project-card:hover, .service-card:hover, .highlight-card:hover, .skill-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 14px 34px rgba(139, 92, 246, 0.24);
}
.service-card .icon, .highlight-card .icon {
  transition: filter 0.3s var(--ease), transform 0.3s var(--ease);
}
.service-card:hover .icon, .highlight-card:hover .icon {
  filter: brightness(1.15) saturate(1.2);
  transform: translateY(-2px);
}
/* Tags & chips hover */
.tag, .chip {
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.tag:hover, .chip:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.24);
  background: rgba(139, 92, 246, 0.16);
}
.contact-form.collapsed { display: none; }

/* Services grid (restored) */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.service-card .icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.25), rgba(109, 40, 217, 0.25));
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.service-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  border-color: rgba(139, 92, 246, 0.35);
}

/* Responsive: Services grid */
@media (max-width: 980px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .services-grid { grid-template-columns: 1fr; } }
