/* =========================================================
   THIAGO COUTINHO — PORTFÓLIO PREMIUM
   Design tokens, layout e animações
   ========================================================= */

:root {
  /* Cores */
  --bg: #0a0b0d;
  --bg-elevated: #121316;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f2f3f5;
  --text-secondary: #a1a5ac;
  --text-tertiary: #6b6f76;

  --accent: #34e19a;
  --accent-soft: rgba(52, 225, 154, 0.14);
  --accent-glow: rgba(52, 225, 154, 0.35);
  --accent-2: #6e7bff;

  --gradient-text: linear-gradient(120deg, #f2f3f5 0%, #ffffff 40%, #9fe8c9 100%);
  --gradient-border: linear-gradient(135deg, rgba(52,225,154,0.4), rgba(110,123,255,0.15));

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

  /* Layout */
  --max-width: 1120px;
  --section-padding: 160px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Movimento */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.25s;
  --dur-med: 0.6s;
  --dur-slow: 1s;
}

/* ============ RESET ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.mono { font-family: var(--font-mono); }

/* ============ NOISE + CURSOR GLOW ============ */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s var(--ease);
  filter: blur(10px);
}

@media (hover: hover) {
  .cursor-glow.active { opacity: 0.06; }
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), padding var(--dur-fast) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  padding: 14px 0;
  background: rgba(10, 11, 13, 0.7);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-secondary);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--dur-fast) var(--ease);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
}
.lang-toggle span { transition: color var(--dur-fast) var(--ease); }
.lang-toggle .lang-sep { color: var(--text-tertiary); }
.lang-toggle .active { color: var(--accent); }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}
.nav-burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  padding: 0 32px;
  transition: max-height var(--dur-med) var(--ease);
  background: rgba(10, 11, 13, 0.96);
  backdrop-filter: blur(16px);
}
.nav-mobile.open { max-height: 320px; padding: 16px 32px 24px; }
.nav-mobile a {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #06110c;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -4px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }

.btn-sm { padding: 9px 18px; font-size: 0.82rem; }
.btn-lg { padding: 17px 36px; font-size: 1rem; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 32px 100px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float 14s ease-in-out infinite;
}
.orb-a {
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -120px; left: -80px;
}
.orb-b {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  bottom: -140px; right: -100px;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 75%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-eyebrow {
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 26px;
}
.hero-name .line { display: block; }
.hero-name .accent-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-roles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}
.hero-roles .dot-sep { color: var(--accent); }

.hero-desc {
  max-width: 540px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 42px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1;
}
.hero-scroll span {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.scroll-line {
  width: 1px; height: 40px;
  background: var(--border-strong);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  width: 100%; height: 10px;
  background: var(--accent);
  position: absolute;
  top: -10px;
  animation: scrollDown 2.2s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { top: -10px; }
  60% { top: 40px; }
  100% { top: 40px; opacity: 0; }
}

/* ============ SECTIONS (GENERAL) ============ */
.section { padding: var(--section-padding) 32px; position: relative; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-head { margin-bottom: 64px; max-width: 640px; }

.eyebrow {
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  display: inline-block;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-sub {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============ SOBRE ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 20px;
}
.about-text strong { color: var(--text-primary); font-weight: 600; }

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.about-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.about-tags li:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-card {
  padding: 26px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--surface), transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* ============ STACK ============ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stack-card {
  padding: 30px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.stack-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-4px);
}

.stack-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-pills span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

/* ============ TIMELINE ============ */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 90%);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 26px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-card {
  padding: 28px 30px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.timeline-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.timeline-meta { margin-bottom: 10px; }
.timeline-year {
  font-size: 0.78rem;
  color: var(--accent);
}

.timeline-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.timeline-role {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ============ CONTATO ============ */
.contact-card {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  padding: 72px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 100% at 50% 0%, rgba(52,225,154,0.06), transparent 60%), var(--surface);
  position: relative;
}

.contact-card .eyebrow { display: block; }
.contact-card .section-title { margin-bottom: 18px; }

.contact-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 36px;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}

.social-icon {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.social-icon svg { width: 19px; height: 19px; }
.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.footer-copy {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.footer-small {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  opacity: 0.6;
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(18,19,22,0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  z-index: 90;
}
.back-to-top svg { width: 18px; height: 18px; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  :root { --section-padding: 110px; }
  .nav-links, .nav-actions .btn { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .stack-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hero { padding: 120px 22px 90px; }
  .section { padding: var(--section-padding) 22px; }
  .stack-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .contact-card { padding: 48px 24px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .timeline { padding-left: 30px; }
  .timeline-marker { left: -30px; }
}

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