/* ============================================
   PORTFÓLIO — GUSTAVO HELI
   Design: editorial, escuro, tipografia em primeiro lugar.
   Sem cards empilhados, sem glow, sem gradientes decorativos.
   ============================================ */

:root {
  --bg:            #09090f;
  --bg-alt:        #0c0c13;
  --surface:       #101018;
  --border:        rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent:        #6366f1;
  --accent-soft:   rgba(99, 102, 241, 0.1);
  --text:          #e7e9ee;
  --muted:         #979dab;
  --faint:         #565b66;
  --radius:        6px;
  --radius-sm:     4px;
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --mono:          'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --ease:          0.18s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 99px; }

/* ── SKIP LINK (a11y) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ── FOCUS STATES ── */
a:focus-visible, button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease);
}
.navbar.scrolled {
  background: rgba(9, 9, 15, 0.9);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.nav-logo .dot { color: var(--accent); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 500;
  padding: 0.25rem 0;
  transition: color var(--ease);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }
.nav-cta {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem !important;
  font-size: 0.82rem !important;
  transition: border-color var(--ease), color var(--ease) !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover {
  color: var(--text) !important;
  border-color: var(--accent);
}

/* ── LANGUAGE SWITCH ── */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
}
.lang-btn {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--ease), background var(--ease);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.lang-sep {
  color: var(--faint);
  font-size: 0.7rem;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: var(--ease);
}

/* ── HERO ── */
.hero {
  padding: clamp(7rem, 15vw, 9.5rem) 1.5rem clamp(4rem, 8vw, 6rem);
}
.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
}
.hero-name {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 14ch;
}
.hero-role {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 46ch;
}
.hero-tagline {
  margin-top: 1.25rem;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--text);
  font-weight: 400;
  max-width: 34ch;
  line-height: 1.5;
  opacity: 0.92;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}
.hero-stack {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--faint);
  max-width: 620px;
}
.hero-stack strong { color: var(--muted); font-weight: 500; }

/* ── BUTTONS / LINKS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity var(--ease);
}
.btn-primary:hover { opacity: 0.82; }
.btn-text {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color var(--ease), color var(--ease);
}
.btn-text:hover { color: var(--accent); border-color: var(--accent); }

/* ── SECTIONS ── */
.section {
  padding: clamp(4rem, 8vw, 6rem) 1.5rem;
  border-top: 1px solid var(--border);
}
.container {
  max-width: 1080px;
  margin: 0 auto;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.section-index {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}
.section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-width: 20ch;
}
.section-subtitle {
  color: var(--muted);
  font-size: 1rem;
  max-width: 52ch;
  margin-top: 0.85rem;
}
.highlight { color: var(--accent); }

/* ── ABOUT ── */
.about-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3.5rem;
  margin-top: 2.25rem;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.75;
  max-width: 62ch;
}
.about-text strong { color: var(--text); font-weight: 600; }

.about-facts {
  display: flex;
  flex-direction: column;
}
.about-facts > div {
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}
.about-facts > div:first-child { border-top: none; padding-top: 0; }
.about-facts dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-bottom: 0.3rem;
}
.about-facts dd { font-size: 0.9rem; color: var(--text); }

/* ── CODE CARD (perfil.js) ── */
.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.75rem;
}
.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.dot-red, .dot-yellow, .dot-green {
  width: 9px; height: 9px; border-radius: 50%;
}
.dot-red    { background: #6b5a5a; }
.dot-yellow { background: #6b6355; }
.dot-green  { background: #556b5a; }
.code-filename {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}
.code-body {
  padding: 1.1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  overflow-x: auto;
}
.code-body .kw  { color: #a996c9; }
.code-body .var { color: #7a9bc9; }
.code-body .key { color: #c2938f; }
.code-body .str { color: #9dbf8f; }

/* ── PROJECT LIST (case studies) ── */
.project-list { margin-top: 2rem; }
.project {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.project:first-child { border-top: none; padding-top: 0.5rem; }
.project-row {
  display: flex;
  gap: 1.5rem;
}
.project-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
  padding-top: 0.3rem;
  flex-shrink: 0;
  width: 1.6rem;
}
.project-main { flex: 1; min-width: 0; overflow-wrap: break-word; }
.project-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.project-name .plus { color: var(--accent); }
.project-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.project-status::before { content: '· '; color: var(--faint); }
.project-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 62ch;
  margin-bottom: 1.1rem;
}
.project-specs {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  row-gap: 0.55rem;
  column-gap: 1rem;
  max-width: 62ch;
  margin-bottom: 1.25rem;
}
.project-specs dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.project-specs dd { font-size: 0.88rem; color: var(--text); line-height: 1.55; }
.project-specs .tech { color: var(--muted); }

.details-toggle {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  transition: opacity var(--ease);
}
.details-toggle:hover { opacity: 0.75; }

.project-details {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.project-details.open {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 2rem;
  animation: revealDetails 0.22s ease;
}
.project-details.open > div { min-width: 0; }
@keyframes revealDetails {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.project-details h4 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text); }
.project-details p  { color: var(--muted); font-size: 0.85rem; line-height: 1.65; margin-bottom: 0.7rem; }
.project-details ul {
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.project-details ul li { padding-left: 0.9rem; position: relative; }
.project-details ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--faint);
}

/* ── MOCK PREVIEWS (illustrative, not real screenshots) ── */
.preview-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  font-size: 0.78rem;
  overflow-x: auto;
}
.preview-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  margin-top: 0.5rem;
}

.preview-arena .mock-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
}
.mock-logo { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.mock-dots { display: flex; gap: 5px; }
.mock-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.mock-feed { display: flex; flex-direction: column; gap: 0.5rem; }
.mock-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mock-tag { font-size: 0.7rem; color: var(--muted); }
.mock-bar { height: 5px; background: var(--border-strong); border-radius: 2px; }
.w80 { width: 80%; } .w70 { width: 70%; } .w55 { width: 55%; } .w45 { width: 45%; } .w90 { width: 90%; }
.ai-card { border-style: dashed; }
.mock-ai { color: var(--accent); font-size: 0.7rem; }

.preview-ia .chat-window { display: flex; flex-direction: column; gap: 0.5rem; }
.chat-msg {
  max-width: 90%;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid var(--border);
}
.chat-msg.user { align-self: flex-end; color: var(--text); }
.chat-msg.bot {
  align-self: flex-start;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ai-badge { font-size: 0.64rem; color: var(--accent); font-weight: 600; }
.dots { animation: dotblink 1.2s steps(3) infinite; }
@keyframes dotblink {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}

.preview-code .code-lines {
  font-family: var(--mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.line { display: flex; gap: 0.8rem; align-items: baseline; }
.line.empty { height: 12px; }
.ln { color: var(--faint); min-width: 18px; text-align: right; user-select: none; }
.line .kw  { color: #a996c9; }
.line .com { color: var(--faint); font-style: italic; }
.line .num { color: #c2a17a; }
.line .op  { color: #7ea3ac; }

/* ── EXPERIMENTS (working demos) ── */
.experiment-list { margin-top: 2rem; }
.experiment {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.6rem 0;
  border-top: 1px solid var(--border);
}
.experiment:first-child { border-top: none; padding-top: 0.5rem; }
.experiment-main { flex: 1; min-width: 260px; }
.experiment-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.experiment-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.65; max-width: 58ch; margin-bottom: 0.6rem; }
.experiment-tech {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
}
.experiment-demo {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}
.experiment-demo:hover { border-color: var(--accent); color: var(--accent); }

.project-repo-link { display: inline-block; margin: 0.2rem 0 1.2rem; }

/* ── STACK / SKILLS ── */
.stack-list { margin-top: 2rem; }
.stack-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.stack-row:first-child { border-top: none; }
.stack-row dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.stack-row dd { font-size: 0.92rem; color: var(--text); line-height: 1.6; }

/* ── CONTACT ── */
.contact-list {
  margin-top: 2rem;
  max-width: 640px;
  border-bottom: 1px solid var(--border);
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
  transition: color var(--ease);
}
.contact-row:first-child { border-top: none; }
.contact-row:hover { color: var(--accent); }
.contact-glyph {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--faint);
  width: 1.75rem;
  flex-shrink: 0;
}
.contact-row svg { width: 18px; height: 18px; }
.contact-info { flex: 1; }
.contact-info strong { display: block; font-size: 0.95rem; color: var(--text); }
.contact-row:hover .contact-info strong { color: var(--accent); }
.contact-info span { font-size: 0.82rem; color: var(--muted); }
.contact-arrow {
  color: var(--faint);
  font-size: 1rem;
  transition: transform var(--ease), color var(--ease);
}
.contact-row:hover .contact-arrow { transform: translate(3px, -3px); color: var(--accent); }

/* ── FOOTER ── */
.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}
.footer p { color: var(--faint); font-size: 0.8rem; }
.footer strong { color: var(--muted); font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .about-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .project-details.open { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-right { gap: 0.6rem; }
  .lang-switch { gap: 0.2rem; }
  .lang-btn { font-size: 0.72rem; padding: 0.22rem 0.35rem; }
  .lang-sep { font-size: 0.65rem; }
  .nav-cta { padding: 0.35rem 0.65rem !important; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: rgba(9, 9, 15, 0.97);
    backdrop-filter: blur(18px);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 0.85rem 1.5rem; }
  .nav-links a::after { display: none; }
  .menu-toggle { display: flex; }

  .hero-actions { gap: 1.25rem; }
  .project-row { gap: 1rem; }
  .project-num { width: 1.2rem; }
  .project-specs { grid-template-columns: 1fr; row-gap: 0.35rem; }
  .project-specs dd { margin-bottom: 0.4rem; }
  .stack-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .experiment { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .contact-row { gap: 0.85rem; }
}
