/* =========================================================
   Vinicius Pereira — Personal Site
   Minimal black & white. Light / dark themes.
   ========================================================= */

:root,
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-elev-2: #111111;
  --surface: #0d0d0d;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-muted: #b5b5b5;
  --text-dim: #7a7a7a;
  --accent: #ffffff;
  --accent-2: #ffffff;
  --on-accent: #000000;
  --nav-bg: rgba(0, 0, 0, 0.72);
  --grid-line: rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --bg-elev-2: #f3f3f3;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.22);
  --text: #000000;
  --text-muted: #4a4a4a;
  --text-dim: #7a7a7a;
  --accent: #000000;
  --accent-2: #000000;
  --on-accent: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.78);
  --grid-line: rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.18), 0 8px 24px -8px rgba(0, 0, 0, 0.10);
}

:root {
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --container: 1120px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text);
}
.brand-name { font-size: 15px; }
.brand-muted { color: var(--text-muted); }
.nav-links {
  display: flex; gap: 28px;
}
.nav-links a {
  color: var(--text-muted); font-size: 14px;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; }

/* i18n — hide the inactive language */
[data-lang="en"] .lang-pt,
[data-lang="pt"] .lang-en { display: none !important; }

/* Lang toggle button (EN/PT pill) */
.lang-toggle {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-toggle:hover { background: var(--bg-elev-2); border-color: var(--text); }
.lang-toggle .lang-current { font-weight: 700; }
.lang-toggle .lang-sep { opacity: 0.4; margin: 0 4px; }
.lang-toggle .lang-other { opacity: 0.55; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--bg-elev-2); border-color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elev-2);
  font-size: 13px; color: var(--text-muted);
}
.pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text);
  box-shadow: none;
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  margin: 24px 0 12px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--text);
}
.hero-role {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.hero-sub {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.01em;
  max-width: 720px;
  opacity: 0.85;
}
.hero-statement {
  max-width: 720px;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text);
  margin: 0 0 36px;
}
.hero-cta {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 56px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-strong);
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.btn-primary {
  background: var(--text); color: var(--on-accent);
  border-color: var(--text);
}
.btn-primary:hover { opacity: 0.88; }
.btn-ghost {
  background: transparent; color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg-elev-2);
  border-color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stats div { padding: 4px 0; }
.hero-stats dt {
  font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.hero-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------------- Sections ---------------- */
.section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}
.section-alt {
  background: var(--bg-elev);
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 24px;
  max-width: 760px;
}
.section-title em { font-style: normal; color: var(--accent); }
.section-sub {
  color: var(--text-muted);
  max-width: 640px;
  margin: -12px 0 40px;
}

/* ---------------- Prose (About) ---------------- */
.prose {
  max-width: 720px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
}
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--text); font-weight: 600; }

/* ---------------- Cards (Expertise) ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.card-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------------- Timeline ---------------- */
.timeline {
  list-style: none; padding: 0; margin: 0;
  position: relative;
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.timeline-item { position: relative; padding: 0 0 36px; }
.timeline-item::before {
  content: ""; position: absolute;
  left: -34px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: none;
}
.timeline-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.timeline-role {
  font-size: 18px; font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.timeline-company { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.timeline-bullets {
  margin: 0; padding: 0; list-style: none;
}
.timeline-bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 15px;
}
.timeline-bullets li::before {
  content: "→"; position: absolute; left: 0; top: 0;
  color: var(--accent);
}

/* ---------------- Projects ---------------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.project {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 28px;
  display: flex; flex-direction: column;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.project:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.project-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.project-title {
  font-size: 18px; font-weight: 600;
  margin: 0; letter-spacing: -0.01em;
}
.project-org {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.project-block {
  margin: 0 0 14px;
}
.project-block-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.project-block-text {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
.project-stack {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------------- Stack ---------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.stack-cat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
}
.stack-cat h3 {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.stack-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0; padding: 0; list-style: none;
}
.stack-list li {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------------- Stories ---------------- */
.stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.story {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
}
.story h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.story dl { margin: 0; }
.story dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 10px;
}
.story dt:first-child { margin-top: 0; }
.story dd {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------------- Philosophy ---------------- */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.principle {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
}
.principle-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.principle h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.principle p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ---------------- Contact ---------------- */
.contact-inner { max-width: 920px; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact-value {
  font-size: 15px; font-weight: 500;
}

/* ---------------- Footer ---------------- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-muted);
}
.footer-muted { color: var(--text-dim); }

/* ---------------- Reveal ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- Mobile ---------------- */
@media (max-width: 800px) {
  .nav-links { display: none; }
  .lang-toggle, .theme-toggle { margin-left: 4px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 4px;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: transparent;
  }
  .nav-toggle span {
    display: block; width: 16px; height: 1.5px; background: var(--text);
  }
  .mobile-menu {
    display: flex; flex-direction: column;
    padding: 12px 24px 20px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
  }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a {
    padding: 12px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .mobile-menu a:last-child { border-bottom: none; }
  .section { padding: 72px 0; }
  .hero { padding: 64px 0 56px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
