:root {
  --bg: #0f172a;
  --surface: #17223b;
  --surface-soft: #121b30;
  --text: #e7ecf8;
  --muted: #a6b1c8;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --border: #2a3a5e;
  --hero-grad:
    radial-gradient(circle at 85% 0%, rgba(59, 130, 246, 0.2), transparent 34%),
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.16), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #131f36 55%, #0f172a 100%);
}

body.light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #1e293b;
  --muted: #475569;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #cbd5e1;
  --hero-grad:
    radial-gradient(circle at 92% 8%, rgba(59, 130, 246, 0.16), transparent 38%),
    radial-gradient(circle at 10% 12%, rgba(37, 99, 235, 0.1), transparent 34%),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 62%, #ffffff 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--hero-grad);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

.mesh-bg {
  position: fixed;
  inset: -20% -10% -20% -10%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.14), transparent 33%),
    radial-gradient(circle at 85% 25%, rgba(59, 130, 246, 0.15), transparent 35%),
    radial-gradient(circle at 50% 85%, rgba(15, 23, 42, 0.18), transparent 40%);
  animation: meshMove 22s ease-in-out infinite alternate;
}

@keyframes meshMove {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: translate3d(2%, -2%, 0) scale(1.04);
    filter: hue-rotate(10deg);
  }
  100% {
    transform: translate3d(-2%, 2%, 0) scale(1.02);
    filter: hue-rotate(-8deg);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(45px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}

.orb-1 {
  width: 220px;
  height: 220px;
  background: #3b82f6;
  top: -40px;
  right: -20px;
  animation: floatOrb 10s ease-in-out infinite;
}

.orb-2 {
  width: 190px;
  height: 190px;
  background: #2563eb;
  bottom: 10%;
  left: -50px;
  animation: floatOrb 12s ease-in-out infinite;
}

.orb-3 {
  width: 140px;
  height: 140px;
  background: #1e293b;
  bottom: 25%;
  right: 15%;
  animation: floatOrb 14s ease-in-out infinite;
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
}

.brand img {
  height: 42px;
  width: auto;
  max-width: 205px;
}

body.light .brand {
  background: #0f172a;
}

.nav-links {
  display: flex;
  gap: 1rem;
  margin-left: 0.6rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.theme-btn,
.menu-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.theme-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.theme-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.theme-btn .sun {
  display: none;
}

body.light .theme-btn .sun {
  display: block;
}

body.light .theme-btn .moon {
  display: none;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.menu-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.menu-btn .close-icon {
  display: none;
}

.menu-btn.open .menu-icon {
  display: none;
}

.menu-btn.open .close-icon {
  display: block;
}

.hero {
  padding: 4.5rem 0 2.6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

.pill {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border));
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  margin-bottom: 0.9rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.headline {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--primary);
  margin: 0.65rem 0 1rem;
}

.gradient-text {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--muted);
  max-width: 65ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.4rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 15px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(5, 12, 26, 0.35);
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #eff6ff;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
}

.full {
  width: 100%;
  margin-top: 0.8rem;
}

.stats {
  display: flex;
  gap: 1rem;
}

.stats div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}

.stats h3 {
  font-size: 1.1rem;
}

.stats p {
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-card,
.card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--section-accent, var(--border)) 35%, var(--border));
  border-radius: 16px;
  padding: 1rem;
}

.pulse-card {
  animation: pulseShadow 4s ease-in-out infinite;
}

@keyframes pulseShadow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(125, 58, 237, 0);
  }
  50% {
    box-shadow: 0 0 28px rgba(125, 58, 237, 0.18);
  }
}

.quick-card ul {
  list-style: none;
  margin-top: 0.8rem;
}

.quick-card li {
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.section {
  padding: 3.2rem 0;
  --section-accent: var(--primary);
}

.muted {
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin-bottom: 1.05rem;
  border-left: 4px solid color-mix(in srgb, var(--section-accent) 70%, transparent);
  padding-left: 0.55rem;
}

.section-accent-hero {
  --section-accent: #3b82f6;
}

.section-accent-about {
  --section-accent: #2563eb;
}

.section-accent-skills {
  --section-accent: #3b82f6;
}

.section-accent-projects {
  --section-accent: #2563eb;
}

.section-accent-experience {
  --section-accent: #3b82f6;
}

.section-accent-contact {
  --section-accent: #2563eb;
}

.cards {
  display: grid;
  gap: 1rem;
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack,
.meta,
.impact,
.project-link {
  color: var(--muted);
}

.stack {
  margin: 0.25rem 0 0.5rem;
}

.impact {
  margin-top: 0.55rem;
}

.project-link {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--primary);
}

.project-card {
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chips span {
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--section-accent, var(--border)) 35%, var(--border));
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chips span:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--section-accent, var(--primary)) 50%, var(--border));
  color: var(--text);
}

.list {
  margin-left: 1rem;
  margin-top: 0.5rem;
}

.list li {
  margin-bottom: 0.4rem;
}

.field {
  margin-bottom: 0.7rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.field input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-soft);
  color: var(--text);
}

.field input.input-invalid,
.contact-form textarea.input-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ef4444 20%, transparent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 95px;
}

.field-error {
  display: block;
  min-height: 1.05rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #f87171;
}

.form-note {
  margin-top: 0.6rem;
  color: var(--muted);
}

.form-note.success {
  color: #22c55e;
}

.form-note.error {
  color: #f87171;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.direct-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.direct-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.direct-link:hover {
  transform: translateY(-2px);
}

.direct-link span:last-child {
  display: grid;
  gap: 0.05rem;
}

.direct-link strong {
  font-size: 0.92rem;
}

.direct-link small {
  color: var(--muted);
  font-size: 0.8rem;
}

.link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.link-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.github-link .link-icon svg,
.linkedin-link .link-icon svg {
  fill: currentColor;
  stroke: none;
}

.email-link {
  color: #60a5fa;
}

.github-link {
  color: #94a3b8;
}

.linkedin-link {
  color: #38bdf8;
}

.email-link:hover {
  border-color: #60a5fa;
  background: color-mix(in srgb, #60a5fa 10%, var(--surface-soft));
}

.github-link:hover {
  border-color: #94a3b8;
  background: color-mix(in srgb, #94a3b8 10%, var(--surface-soft));
}

.linkedin-link:hover {
  border-color: #38bdf8;
  background: color-mix(in srgb, #38bdf8 10%, var(--surface-soft));
}

body.light .email-link {
  color: #1d4ed8;
}

body.light .github-link {
  color: #334155;
}

body.light .linkedin-link {
  color: #0369a1;
}

.whatsapp-btn {
  margin-top: 0.9rem;
  background: #25d366;
  color: #032713;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.whatsapp-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.cv-btn {
  margin-left: auto;
}

.site-footer {
  padding: 1rem 0 2rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 930px) {
  .hero-grid,
  .cards.three,
  .cards.two {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3.1rem;
  }
}

@media (max-width: 720px) {
  .cv-btn {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 4%;
    display: none;
    flex-direction: column;
    min-width: 170px;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  .nav-links.show {
    display: flex;
  }

  .stats {
    flex-direction: column;
  }

  .footer-wrap {
    flex-direction: column;
    gap: 0.45rem;
  }
}
