/* =========================================================
   Gabriel Alves — Portfolio
   Dark: Preto + Laranja | Light: Branco + Laranja
========================================================= */

:root {
  --orange: #ff6b1a;
  --orange-dark: #c2410c;
  --orange-soft: #ff6b1a1a;

  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --container: 1140px;
}

/* ---------- Dark theme (default) ---------- */
[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-alt: #131315;
  --bg-card: #17171a;
  --border: #2a2a2e;
  --text: #f4f4f3;
  --text-muted: #a3a3a8;
  --text-faint: #6b6b70;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f5f3;
  --bg-card: #ffffff;
  --border: #e7e5e1;
  --text: #16161a;
  --text-muted: #55555c;
  --text-faint: #8a8a90;
  --shadow: 0 20px 60px -25px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

::selection { background: var(--orange); color: #0a0a0b; }

/* ---------- Background orbs ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
}
[data-theme="light"] .orb { opacity: .18; }
.orb-1 {
  width: 480px; height: 480px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, var(--orange), transparent 70%);
}
.orb-2 {
  width: 420px; height: 420px;
  top: 40%; right: -160px;
  background: radial-gradient(circle, var(--orange-dark), transparent 70%);
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  font-family: var(--font-mono);
  letter-spacing: -.02em;
  white-space: nowrap;
}
.logo .dot { color: var(--orange); }
.logo-slash { color: var(--text-faint); font-weight: 500; margin-left: 2px; }

.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  font-size: .92rem;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--orange);
  transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

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

/* Language switch */
.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .03em;
}
.lang-btn:hover { border-color: var(--orange); color: var(--orange); }
.lang-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 150px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s ease;
  overflow: hidden;
}
.lang-switch.open .lang-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.lang-menu li {
  padding: 10px 14px;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text-muted);
}
.lang-menu li:hover { background: var(--orange-soft); color: var(--orange); }
.lang-menu li.active { color: var(--orange); font-weight: 600; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--orange); color: var(--orange); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ============ HERO ============ */
.hero {
  padding: 96px 24px 80px;
  text-align: center;
  max-width: 860px;
}
.hero-eyebrow {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0 0 12px;
}
.hero-name {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.hero-role {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.hero-role .accent { color: var(--orange); }
.hero-tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto 28px;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.stack-tags span {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #0a0a0b;
}
.btn-primary:hover { box-shadow: 0 14px 30px -12px var(--orange-dark); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

/* Terminal card */
.terminal-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-alt) 80%, transparent);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-red { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green { background: #28c840; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-faint);
}
.terminal-body {
  margin: 0;
  padding: 20px 22px 24px;
  font-family: var(--font-mono);
  font-size: .86rem;
  line-height: 1.9;
  overflow-x: auto;
}
.tk-key { color: var(--orange); }
.tk-key::before { content: "$ "; color: var(--text-faint); }
.tk-out { display: block; color: var(--text-muted); }
.tk-ok { display: inline-block; color: #4ade80; }
.cursor { color: var(--orange); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ SECTIONS ============ */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-kicker {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .05em;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  max-width: 720px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 0 48px;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p { color: var(--text-muted); margin: 0 0 16px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.badge {
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.about-card h3 { margin: 0 0 18px; font-size: 1.05rem; color: var(--orange); }
.fact-list { display: flex; flex-direction: column; gap: 14px; }
.fact-list li {
  display: flex;
  gap: 10px;
  font-size: .92rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}
.fact-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.skill-cat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.skill-cat h3 {
  margin: 0 0 16px;
  font-size: .95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-alt);
}
.chip-orange { border-color: color-mix(in srgb, var(--orange) 45%, transparent); color: var(--orange); }
.chip-row.small .chip { font-size: .74rem; padding: 5px 10px; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover { border-color: color-mix(in srgb, var(--orange) 45%, transparent); transform: translateY(-4px); }
.project-media { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-alt); }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.project-card:hover .project-media img { transform: scale(1.04); }
.project-media-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: .85rem;
  background:
    repeating-linear-gradient(135deg, var(--bg-alt), var(--bg-alt) 10px, var(--bg) 10px, var(--bg) 20px);
}
.project-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.project-head h3 { margin: 0; font-size: 1.2rem; }
.project-link {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.project-link:hover { color: var(--orange); border-color: var(--orange); }
.project-body p { color: var(--text-muted); font-size: .92rem; margin: 0 0 16px; flex: 1; }
.tag-pill {
  font-size: .72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  white-space: nowrap;
}
.tag-pill-muted { background: var(--bg-alt); color: var(--text-faint); }
.project-card-soon { opacity: .8; }

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}
.timeline-item .t-period {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.timeline-item h3 { margin: 0 0 2px; font-size: 1.1rem; }
.timeline-item .t-meta { color: var(--text-faint); font-size: .84rem; margin-bottom: 10px; display: block; }
.timeline-item ul { display: flex; flex-direction: column; gap: 8px; }
.timeline-item li {
  color: var(--text-muted);
  font-size: .92rem;
  padding-left: 16px;
  position: relative;
}
.timeline-item li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange);
}
.edu-note {
  margin: 32px 0 0 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
  max-width: 780px;
}

/* ---------- Blog ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
}
.blog-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--orange);
  background: var(--orange-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.blog-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.blog-card p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.blog-cta {
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
}
.blog-cta p { color: var(--text-muted); margin: 0 0 18px; font-size: 1rem; }

/* ---------- Languages ---------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.lang-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
}
.lang-item .lang-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--orange);
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.lang-item .lang-name { font-weight: 600; margin-bottom: 4px; }
.lang-item .lang-level { color: var(--text-faint); font-size: .82rem; }
.lang-bar { height: 4px; border-radius: 4px; background: var(--border); margin-top: 14px; overflow: hidden; }
.lang-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-dark)); }

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-section .section-title,
.contact-section .section-subtitle { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .84rem;
  color: var(--text-faint);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    transform: translateY(-130%);
    transition: transform .25s ease;
    z-index: 90;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .lang-switch .lang-btn span:not(#langCurrent) { display: none; }
}

@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: 1fr; }
  .hero { padding: 76px 20px 60px; }
  .section { padding: 72px 0; }
}
