:root {
  --bg-deep: #0a0c0b;
  --bg-mid: #121614;
  --bg-raised: #1a1f1c;
  --ink: #e6e8e4;
  --ink-muted: #9aa39a;
  --ink-dim: #6b746c;
  --accent: #c4a35a;
  --accent-soft: rgba(196, 163, 90, 0.18);
  --line: rgba(230, 232, 228, 0.12);
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --header-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-deep);
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

ul {
  list-style: none;
}

/* Atmosphere: gradient + grid + scanline */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(165deg, #0e1210 0%, var(--bg-deep) 42%, #0c100e 100%),
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(196, 163, 90, 0.08), transparent 55%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 70%);
  opacity: 0.55;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.7;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 1.25rem;
  background: rgba(10, 12, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

.brand-mark {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s var(--ease) infinite;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  display: none;
  padding: 2rem 1.25rem;
  background: rgba(10, 12, 11, 0.96);
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

.nav-cta {
  color: var(--accent) !important;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) 1.25rem 4rem;
  max-width: 52rem;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--ink-dim);
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.1s forwards;
}

.status-pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse-ring 2.2s ease-out infinite;
}

.hero-brand {
  font-size: clamp(2.75rem, 10vw, 5.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 0.2s forwards;
}

.hero-lead {
  max-width: 28rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--ink-muted);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 0.35s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 0.5s forwards;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s, transform 0.25s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 500;
}

.btn-primary:hover {
  background: #d4b56a;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: 5rem 1.25rem;
  max-width: 64rem;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 2.5rem;
  max-width: 36rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.65rem;
  letter-spacing: 0.04em;
}

.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Projects */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-item {
  border: 1px solid var(--line);
  background: rgba(26, 31, 28, 0.55);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.project-item:hover {
  border-color: rgba(196, 163, 90, 0.45);
  background: rgba(26, 31, 28, 0.85);
}

.project-item article {
  padding: 1.5rem 1.35rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.project-meta h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(196, 163, 90, 0.4);
  padding: 0.2rem 0.5rem;
  background: var(--accent-soft);
}

.project-item p {
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
  max-width: 40rem;
}

.project-stack {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim) !important;
}

.project-note {
  font-size: 0.9rem;
  color: var(--ink-dim) !important;
  margin-bottom: 0 !important;
}

.project-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.project-link:hover {
  border-bottom-color: var(--accent);
}

/* About */
.about-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.about-photo img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(0.35) contrast(1.05);
  border: 1px solid var(--line);
}

.about-copy p {
  color: var(--ink-muted);
  margin-bottom: 1.1rem;
  max-width: 36rem;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.skill-chips li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
  margin-right: 0.75rem;
}

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.contact-links > a:not(.btn) {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.contact-links > a:not(.btn):hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.contact-links .btn {
  margin-top: 0.75rem;
}

/* Footer */
.site-footer {
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 64rem;
  margin-inline: auto;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
}

/* Currículo page */
.page-curriculo .hero-curriculo {
  padding: calc(var(--header-h) + 3rem) 1.25rem 2.5rem;
  max-width: 48rem;
  margin-inline: auto;
}

.page-curriculo .hero-curriculo h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-curriculo .hero-curriculo .role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.cv-body {
  max-width: 48rem;
  margin-inline: auto;
  padding: 0 1.25rem 4rem;
}

.cv-block {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.cv-block h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.cv-block p,
.cv-block li {
  color: var(--ink-muted);
  margin-bottom: 0.65rem;
}

.cv-block ul {
  padding-left: 0;
}

.cv-block li {
  padding-left: 1rem;
  position: relative;
}

.cv-block li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.2rem;
}

.cv-contact-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.cv-contact-row a {
  color: var(--accent);
  text-decoration: none;
}

.cv-contact-row a:hover {
  text-decoration: underline;
}

.cv-project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink) !important;
  margin-top: 1rem;
  margin-bottom: 0.35rem !important;
}

.cv-download-end {
  margin-top: 1.5rem;
}

/* Animations */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(196, 163, 90, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(196, 163, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(196, 163, 90, 0);
  }
}

@media (min-width: 768px) {
  .site-header {
    padding: 0 2.5rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: block !important;
    padding: 0;
    background: transparent;
  }

  .site-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
  }

  .site-nav a {
    position: relative;
    font-size: 0.85rem;
  }

  .site-nav a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease);
  }

  .site-nav a:not(.nav-cta):hover::after {
    width: 100%;
  }

  .hero,
  .section,
  .site-footer,
  .page-curriculo .hero-curriculo,
  .cv-body {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .about-grid {
    grid-template-columns: 280px 1fr;
    gap: 3rem;
  }

  .contact-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2rem;
  }

  .contact-links .btn {
    margin-top: 0;
  }

  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cv-contact-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-left: 4rem;
    max-width: 58rem;
  }

  .section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-status,
  .hero-brand,
  .hero-lead,
  .hero-actions,
  .brand-dot,
  .status-pulse {
    animation: none;
    opacity: 1;
  }
}
