/* ══════════════════════════════════════════════
   PORTFOLIO — Dark Spatial Design System
   Inspired by aura-20 reference cards
   ══════════════════════════════════════════════ */

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: #EAEAEA;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: none;
}

/* ─── CUSTOM CURSOR ─── */
#cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background-color .2s, border-color .2s;
}

#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

body.cursor-hover #cursor-ring {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.6);
}

/* ─── GRID OVERLAY ─── */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.gl-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
}

.crosshair {
  position: absolute;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
}

.crosshair::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
}

.crosshair::after {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
}

/* ─── HUD TYPOGRAPHY ─── */
.meta-text {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.6);
}

.meta-dim {
  color: #555;
}

.side-text {
  writing-mode: vertical-rl;
}

/* ─── LAYOUT FRAME ─── */
.spatial-root {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* desconta a barra do Safari iOS */
  overflow: hidden;
}

.hud-frame {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  grid-template-rows: 60px 1fr 60px;
  pointer-events: none;
}

.hud-frame > * {
  pointer-events: auto;
}

.hud-header {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.hud-left {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hud-right {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  writing-mode: vertical-rl;
}

.hud-footer {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

/* ─── STATUS INDICATORS ─── */
.status-dot {
  width: 6px;
  height: 6px;
  background: #00FF41;
  border-radius: 50%;
  box-shadow: 0 0 12px #00FF41;
  display: inline-block;
  margin-right: 8px;
}

.status-amber {
  background: #F2A23D;
  box-shadow: 0 0 12px #F2A23D;
}

/* ─── PROGRESS BAR ─── */
.progress-track {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.1);
  z-index: 20;
}

.progress-bar {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* ─── LOADER ─── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #EAEAEA;
  transition: opacity 1s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ─── DETAIL PANEL ─── */
.detail-panel {
  position: fixed;
  top: 0;
  right: -50%;
  width: 50%;
  height: 100%;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 50;
  padding: 80px 48px;
  overflow-y: auto;
  transition: right 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.detail-panel.open {
  right: 0;
}

.detail-panel .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: none;
  color: #EAEAEA;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.detail-panel .close-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

.detail-panel .project-eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 12px;
}

.detail-panel .project-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #EAEAEA;
  margin-bottom: 8px;
}

.detail-panel .project-subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.detail-panel .project-desc {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  margin-bottom: 28px;
  max-width: 520px;
}

.detail-panel .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.detail-panel .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.detail-panel .screenshot-grid {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.detail-panel .screenshot-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.3s ease;
}

.detail-panel .screenshot-grid img:hover {
  transform: scale(1.02);
}

.detail-panel .section-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  margin-top: 24px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-panel .section-label::before {
  content: '';
  width: 12px;
  height: 1px;
  background: #555;
}

/* ─── NAV ARROWS (laterais, discretas) ─── */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.22);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-arrow:hover { color: rgba(255, 255, 255, 0.85); }
.nav-arrow:active { color: #fff; }
.nav-prev { left: 6px; }
.nav-next { right: 6px; }

/* ─── ABOUT CTA (WhatsApp) ─── */
.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 32px;
  padding: 13px 22px;
  background: #EAEAEA;
  color: #0a0a0a;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.about-cta:hover {
  background: #fff;
  transform: translateX(4px);
}

/* ─── THREE.JS CANVAS ─── */
#gl-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ─── RESPONSIVE ─── */
/* CNPJ do rodapé: só aparece no mobile */
.footer-cnpj { display: none; }

/* Logo é clicável (abre a aba Sobre) em desktop e mobile */
#brand-logo { cursor: pointer; }

/* Qualquer aparelho de toque (inclui celular deitado >768px): navegação mobile enxuta */
@media (pointer: coarse) {
  html, body { cursor: auto; }
  #cursor-ring, #cursor-dot { display: none; }

  /* Rodapé: somente o CNPJ (!important vence o display:flex inline do SYSTEM ACTIVE) */
  .hud-footer > div:not(.footer-cnpj),
  .hud-footer .scroll-hint { display: none !important; }
  .footer-cnpj {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.45);
  }

  /* Assinatura completa sai do canvas (passa a abrir no painel do logo) */
  .signature-hud { display: none !important; }
}

@media (max-width: 768px) {
  html, body {
    cursor: auto;
  }

  #cursor-ring, #cursor-dot {
    display: none;
  }

  .hud-frame {
    grid-template-columns: 20px 1fr 20px;
    grid-template-rows: 44px 1fr 44px;
  }

  .hud-left, .hud-right {
    display: none;
  }

  .detail-panel {
    width: 100%;
    right: -100%;
    padding: 60px 24px;
  }

  .detail-panel .project-title {
    font-size: 24px;
  }
}

/* ─── SCROLL HINT ─── */
@keyframes scroll-hint {
  0%, 100% { opacity: 0.4; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(8px); }
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: scroll-hint 2s ease-in-out infinite;
}

.scroll-hint .arrow {
  width: 16px;
  height: 1px;
  background: #EAEAEA;
  position: relative;
}

.scroll-hint .arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-right: 1px solid #EAEAEA;
  border-bottom: 1px solid #EAEAEA;
  transform: rotate(-45deg);
}
