/* ============================================
   TOKENS
   ============================================ */
:root {
  /* Padrão: DARK */
  --bg: #0d1117;
  --surface: #161b22;
  --header-bg: rgba(13, 17, 23, 0.88);
  --ink: #f0f6fc;
  --ink-soft: #8b949e;
  --line: #30363d;
  --card-shadow-hover: rgba(0, 0, 0, 0.5);

  --accent: #ff4d6d;
  --accent-ink: #ffffff;
  --navy: #171b23;
  --navy-soft: #232936;
  --term-green: #8fe3b0;
  --term-dim: #7c8798;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --max-width: 1120px;
}

body.theme-light {
  --bg: #f8f8f5;
  --surface: #ffffff;
  --header-bg: rgba(248, 248, 245, 0.88);
  --ink: #14171a;
  --ink-soft: #5b6168;
  --line: #e3e4df;
  --card-shadow-hover: rgba(20, 23, 26, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   LANGUAGE TOGGLE LOGIC (pure CSS switch)
   ============================================ */
body.lang-pt [data-lang="en"] {
  display: none;
}
body.lang-en [data-lang="pt"] {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#lang-toggle,
#theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

#theme-toggle {
  padding: 6px 10px;
  line-height: 1;
}

#lang-toggle:hover,
#theme-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.lang-divider {
  color: var(--line);
}

body.lang-pt [data-lang-btn="pt"],
body.lang-en [data-lang-btn="en"] {
  color: var(--ink);
  font-weight: 700;
}

/* Alternância de ícone do tema */
body.theme-dark .icon-sun {
  display: inline-block;
}
body.theme-dark .icon-moon {
  display: none;
}

body.theme-light .icon-sun {
  display: none;
}
body.theme-light .icon-moon {
  display: inline-block;
}

/* ============================================
   LAYOUT SHELL
   ============================================ */
#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

section,
header,
footer {
  width: 100%;
  max-width: var(--max-width);
}

/* ============================================
   HEADER
   ============================================ */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  z-index: 50;
  transition: background-color 0.25s ease;
}

#logo-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

#logo-mark span {
  color: var(--accent);
}

#links {
  display: flex;
  gap: 32px;
}

#links a {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

#links a:hover {
  color: var(--ink);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 56px 0 64px;
}

.hero-text {
  max-width: 480px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 12px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.tagline {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 400px;
}

.buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 8px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 77, 109, 0.35);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* Terminal card — signature element */
.terminal-card {
  background: var(--navy);
  border-radius: 14px;
  width: 420px;
  max-width: 100%;
  flex-shrink: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--navy-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red {
  background: #ff5f56;
}
.dot-yellow {
  background: #ffbd2e;
}
.dot-green {
  background: #27c93f;
}

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--term-dim);
}

.terminal-body {
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.9;
}

.terminal-body p {
  margin: 0;
}

.terminal-body .prompt {
  color: var(--accent);
  margin-right: 4px;
}

.terminal-body .out {
  color: var(--term-green);
  margin-bottom: 8px;
}

.cursor-line {
  margin-top: 4px;
}

.cursor {
  display: inline-block;
  width: 8px;
  background: var(--term-green);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* ============================================
   EXPERIENCE / TIMELINE
   ============================================ */
.experience {
  padding: 36px 0 64px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 4px;
  white-space: nowrap;
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
}

.timeline-content .at {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 16px;
}

.timeline-content > p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
  max-width: 620px;
}

.highlight-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlight-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
}

.highlight-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
  padding: 0 0 64px;
}

#card-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px var(--card-shadow-hover);
  border-color: var(--accent);
}

.card-image {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

body.theme-light .card-image {
  background: var(--bg);
}

.card-content {
  padding: 16px 16px 20px;
  flex: 1;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

.card-content h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}

.card-content p {
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  padding: 0 0 64px;
}

.direct-links {
  display: flex;
  gap: 24px;
}

.direct-links a {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.direct-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
}

#footer p {
  font-size: 14px;
  color: var(--ink-soft);
}

#social-media {
  display: flex;
  gap: 16px;
}

#social-media img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  filter: grayscale(1);
  opacity: 0.75;
  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}

#social-media img:hover {
  filter: grayscale(0);
  opacity: 1;
}

/* ============================================
   SCROLL REVEAL (respects reduced motion)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 0.6s ease,
      transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .cursor {
    animation: blink 1s steps(1) infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1180px) {
  section,
  header,
  footer {
    padding-left: 24px;
    padding-right: 24px;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 36px 24px 48px;
  }
  .hero-text {
    max-width: 100%;
  }
  .terminal-card {
    width: 100%;
  }
  #card-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #header {
    padding: 16px 20px;
  }
  #links {
    display: none;
  }
  .hero-text h1 {
    font-size: 38px;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #card-container {
    grid-template-columns: 1fr;
  }
  .direct-links {
    flex-direction: column;
    gap: 12px;
  }
  #footer {
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px 40px;
  }
}
