/* =========================================================
   PORTFOLIO — DESIGN SYSTEM: SPACEX
   Pure black + spectral white, D-DIN, uppercase + tracking,
   full-viewport photography, ghost buttons. ZERO containers.
   ========================================================= */

/* Fonts loaded from Google Fonts in index.html:
   - Space Grotesk: display + body (geometric, mais caráter que a DIN)
   - JetBrains Mono: textos pequenos/labels/micro (HUD aeroespacial) */

:root {
  --black: #000000;
  --white-100: #ffffff;
  --spectral: #f0f0fa;
  --ghost-bg: rgba(240, 240, 250, 0.10);
  --ghost-bg-hover: rgba(240, 240, 250, 0.20);
  --ghost-border: rgba(240, 240, 250, 0.35);
  --overlay: rgba(0, 0, 0, 0.5);
  --overlay-strong: rgba(0, 0, 0, 0.7);
  --font-display: 'Space Grotesk', 'Arial', 'Verdana', sans-serif;
  --font-body: 'Space Grotesk', 'Arial', 'Verdana', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
}

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

/* ---------- SKIP LINK (visually hidden until focused) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 300;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: var(--spectral);
  color: var(--black);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  outline: 2px solid var(--spectral);
  outline-offset: 2px;
}

html, body {
  background: var(--black);
  color: var(--spectral);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body { overflow-x: hidden; }

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

/* ---------- SCROLL PROGRESS BAR ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: var(--spectral);
  z-index: 200;
  transition: width .15s linear;
  box-shadow: 0 0 10px rgba(240,240,250,0.4);
}

/* ---------- TYPE SYSTEM ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 6.5vw, 5.5rem); /* up from 48px on large screens for hero impact */
  line-height: 1.0;
  letter-spacing: 0.96px;
  text-transform: uppercase;
  color: var(--spectral);
}

.lede {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.85rem, 1.05vw, 0.95rem);
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-top: 18px;
}

.body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  text-transform: none;
  letter-spacing: 0;
  max-width: 60ch;
  margin-top: 24px;
}

.caption-bold {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 0.94;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.micro {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  line-height: 0.94;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  transition: background-color .35s ease, backdrop-filter .35s ease;
}
.nav.is-scrolled {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--spectral);
}
.nav__links {
  display: flex;
  gap: 30px;
}
.nav__links a {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--spectral);
  transition: color .2s ease, opacity .2s ease;
  opacity: .85;
}
.nav__links a:hover { color: var(--white-100); opacity: 1; }

.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 32px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--spectral);
  background: transparent;
  border: 1px solid rgba(240,240,250,0.35);
  border-radius: 32px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
  margin-left: 14px;
}
.lang-toggle:hover {
  background: rgba(240,240,250,0.12);
  border-color: rgba(240,240,250,0.65);
  color: var(--white-100);
}
.nav__toggle span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--spectral);
  transition: transform .3s ease, opacity .3s ease;
}

/* ---------- SCENES (full-viewport sections) ---------- */
.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.scene__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, var(--overlay) 60%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
}
.scene__overlay--strong {
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, var(--overlay-strong) 100%);
}
.scene__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 120px 8vw 80px;
}
.scene__content--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scene__content--center .body { margin-left: auto; margin-right: auto; }
.scene__content--left { text-align: left; max-width: 1200px; }

/* spacing between hero items */
#hero .display { margin-top: 24px; }
#hero .ghost-btn { margin-top: 36px; }
#mission .ghost-btn { margin-top: 36px; }

.scroll-cue {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--spectral);
  opacity: .6;
  animation: drift 2.4s ease-in-out infinite;
  z-index: 2;
}
@keyframes drift {
  0%,100% { transform: translate(-50%, 0); opacity: .6; }
  50%     { transform: translate(-50%, 6px); opacity: 1; }
}

/* ---------- GHOST BUTTON (sole interactive element) ---------- */
.ghost-btn {
  display: inline-block;
  padding: 18px 32px;
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
  border-radius: 32px;
  color: var(--spectral);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ghost-btn:hover {
  background: var(--ghost-bg-hover);
  color: var(--white-100);
  border-color: rgba(255,255,255,0.6);
}
.ghost-btn--sm {
  padding: 12px 22px;
  font-size: 0.7rem;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 36px;
}

/* ---------- CAPABILITIES (text + index, no cards) ---------- */
.capabilities {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-width: 1100px;
}
.capabilities li {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 8px;
  padding: 28px 24px 28px 0;
  border-top: 1px solid rgba(240,240,250,0.18);
}
.cap__index {
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .55;
  color: var(--spectral);
}
.cap__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.cap__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  opacity: .82;
  max-width: 56ch;
}

/* ---------- PROJECTS (text blocks, no cards) ---------- */
.projects {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  grid-auto-rows: 1fr;
  column-gap: 48px;
  row-gap: 56px;
  align-items: stretch;
}
.proj {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .35s cubic-bezier(.25,.46,.45,.94), background-color .35s ease;
}
.proj:hover {
  transform: translateY(-4px);
  background-color: rgba(240,240,250,0.06);
  border-radius: 8px;
}
.proj__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 8px 0 12px;
}
.proj__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.88rem, 0.6vw + 0.5rem, 1rem);
  line-height: 1.65;
  max-width: 60ch;
  margin-bottom: 10px;
  opacity: .82;
  flex: 1 1 auto;
}
.proj__tags {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(240, 240, 250, .65);
}

/* ---------- STACK PILLS (texto com bordas mínimas) ---------- */
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  max-width: 1100px;
}
.stack li {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 10px 14px;
  border: 1px solid rgba(240, 240, 250, 0.35);
  border-radius: 32px;
  color: var(--spectral);
  background: rgba(240, 240, 250, 0.05);
}

/* ---------- DISPLAY (LINE-BY-LINE REVEAL) ---------- */
.display--lines {
  display: block;
  overflow: hidden;
}
.display--lines span {
  display: block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1.0s cubic-bezier(.2,.8,.2,1), opacity 1.0s ease;
  transition-delay: var(--line-delay, 0ms);
  will-change: transform, opacity;
}
.display--lines.is-visible span {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- MANIFESTO (numbered statements) ---------- */
.manifesto {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 64ch;
}
.manifesto li {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: baseline;
  column-gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(240,240,250,0.18);
  position: relative;
}
.manifesto li::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 0;
  height: 1px;
  background: var(--spectral);
  transition: width 1.1s cubic-bezier(.2,.8,.2,1) .15s;
}
.manifesto li.is-visible::before { width: 100%; }
.m__index {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  opacity: .6;
}
.m__text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.55;
  letter-spacing: 0.2px;
  text-transform: none;
}

/* ---------- STATS ---------- */
.stats {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0;
  max-width: 900px;
  border-top: 1px solid rgba(240,240,250,0.18);
}
.stats li {
  padding: 22px 18px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(240,240,250,0.18);
}
.stats li:last-child { border-right: 0; }
.stat__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  line-height: 1.3;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: .7;
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .stats li { border-right: 0; border-bottom: 1px solid rgba(240,240,250,0.18); }
  .stats li:last-child { border-bottom: 0; }
}

/* ---------- PARALLAX (background subtle drift) ---------- */
.scene[data-parallax] {
  background-position: 50% var(--py, 50%);
  transition: background-position .05s linear;
  will-change: background-position;
}

/* ---------- HOVER REFINEMENTS ---------- */
.proj, .capabilities li {
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease, opacity .35s ease;
}
.proj:hover {
  transform: translateY(-4px);
  border-color: rgba(240,240,250,0.55);
}
.capabilities li:hover {
  border-color: rgba(240,240,250,0.55);
}
.capabilities li:hover .cap__title {
  letter-spacing: 1.6px;
  transition: letter-spacing .35s ease;
}
.stack li {
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.stack li:hover {
  background: rgba(240,240,250,0.15);
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-2px);
}

/* ---------- REVEAL ON SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform .9s ease;
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .capabilities { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { padding: 16px 20px; }
  .nav__links {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    transform: translateX(100%);
    transition: transform .35s ease;
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links a { font-size: 1rem; }
  .nav__toggle { display: flex; z-index: 110; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

  .scene__content { padding: 110px 24px 80px; }
  .body { font-size: 0.95rem; }
  .cta-row { flex-direction: column; align-items: center; }
  .cta-row .ghost-btn { width: 100%; max-width: 320px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
