/* ==================================================
   FINAL — Layout fixes & top horizontal navigation
   Loaded LAST to override all previous layers
   ================================================== */

/* ---------- Hide old side-rail; use top nav instead ---------- */
.side-rail { display: none !important; }
.studio-main { padding-left: 0 !important; padding-top: 76px !important; }

/* ---------- Hide the cyber statusbar (was conflicting) ---------- */
.cyber-statusbar { display: none !important; }

/* ---------- New TOP NAV — clean, modern, cyber-styled ---------- */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 1.5rem;
  height: 64px;
  background: rgba(4, 6, 5, .85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
}
[data-theme="light"] .top-nav { background: rgba(245,247,240,.85); }

.top-nav-brand {
  display: flex; align-items: center; gap: .8rem;
  text-decoration: none; color: var(--ink);
}
.top-nav-brand .brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #0a0d0b;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
  border-radius: 6px;
  position: relative;
}
.top-nav-brand .brand-mark::before {
  content: ''; position: absolute; inset: -2px; border-radius: 8px;
  border: 1px solid var(--accent); opacity: .5;
  animation: brandRing 2.5s infinite;
}
@keyframes brandRing {
  0%,100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.15); opacity: 0; }
}
.top-nav-brand .brand-text {
  display: grid; gap: 2px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}
.top-nav-brand .brand-text strong {
  font-weight: 600;
  font-size: .82rem;
  color: var(--ink);
  letter-spacing: .05em;
}
.top-nav-brand .brand-text small {
  font-size: .58rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Center menu */
.top-nav-menu {
  display: flex; gap: 0;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.top-nav-link {
  position: relative;
  padding: 0 1.2rem;
  height: 100%;
  display: flex; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .25s;
}
.top-nav-link:hover, .top-nav-link.active { color: var(--accent); }
.top-nav-link::before {
  content: ''; position: absolute;
  bottom: 12px; left: 50%; width: 0; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: translateX(-50%);
  transition: width .3s cubic-bezier(.25,1,.5,1);
}
.top-nav-link:hover::before, .top-nav-link.active::before { width: 22px; }

/* Right controls */
.top-nav-actions {
  display: flex; align-items: center; gap: .4rem;
}
.top-nav-actions .nav-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
  transition: all .25s;
  position: relative;
}
.top-nav-actions .nav-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(163,230,53,.05);
}
.top-nav-actions .nav-icon.theme-toggle {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--accent);
}
.top-nav-actions .nav-icon.theme-toggle::after {
  content: ''; position: absolute; inset: -1px;
  border: 1px solid var(--accent); border-radius: 5px;
  opacity: .4;
  animation: brandRing 2s infinite;
  pointer-events: none;
}
.top-nav-actions .nav-cta {
  margin-left: .4rem;
  padding: 0 1rem;
  height: 38px; width: auto;
  background: var(--accent) !important;
  color: #0a0d0b !important;
  border-color: var(--accent) !important;
  display: inline-flex !important;
  align-items: center; gap: .5rem;
}
.top-nav-actions .nav-cta:hover {
  background: var(--accent-2) !important;
  border-color: var(--accent-2) !important;
  color: #0a0d0b !important;
  transform: translateY(-1px);
}

/* Live status pill in top nav */
.top-nav-status {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.top-nav-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink2 1.6s infinite;
}

/* Mobile hamburger */
.top-nav-burger {
  display: none;
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex-direction: column; gap: 4px;
  align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.top-nav-burger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--ink); transition: all .3s;
}

@media (max-width: 1024px) {
  .top-nav-status { display: none; }
}
@media (max-width: 768px) {
  .top-nav { padding: 0 1rem; }
  .top-nav-menu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(4,6,5,.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    height: auto; padding: 1rem 0;
    transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: all .3s;
  }
  [data-theme="light"] .top-nav-menu { background: rgba(245,247,240,.97); }
  .top-nav.open .top-nav-menu {
    transform: translateY(0); opacity: 1; pointer-events: auto;
  }
  .top-nav-link { width: 100%; padding: .9rem 1.5rem; height: auto; }
  .top-nav-link::before { left: 1.5rem; bottom: 50%; transform: translateY(50%); }
  .top-nav-link:hover::before, .top-nav-link.active::before { width: 14px; }
  .top-nav-burger { display: flex; }
  .top-nav-actions .nav-cta span { display: none; }
  .top-nav-actions .nav-cta { width: 38px; padding: 0; }
  .top-nav.open .top-nav-burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .top-nav.open .top-nav-burger span:nth-child(2) { opacity: 0; }
  .top-nav.open .top-nav-burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
}

/* ---------- HERO LAYOUT FIX ---------- */
.hero {
  min-height: calc(100vh - 76px) !important;
  padding: 0 !important;
  display: grid !important;
  align-items: center !important;
}
.hero .container, .hero .hero-grid {
  padding: 4rem 2rem !important;
  align-items: center !important;
}
@media (max-width: 1024px) {
  .hero .container, .hero .hero-grid {
    grid-template-columns: 1fr !important;
    padding: 3rem 1.5rem !important;
    align-items: start !important;
  }
}

/* Profile photo — vertically centered, well-sized */
.hero-visual {
  align-self: center !important;
  align-items: center !important;
}
.profile-card {
  max-width: 420px !important;
  align-self: center;
}

/* Remove the AGENT // 001 corner badge that overlapped */
.hero-grid::before { display: none !important; }

/* Vertical PORTFOLIO label hidden (was overlapping with new top nav) */
.hero::before { display: none !important; }

/* ---------- Section corner-badges repositioned ---------- */
.section::before { top: 4rem !important; right: 2rem !important; }

/* ---------- Footer cleanup ---------- */
.footer { padding: 2.5rem 0 !important; }
.footer .container { padding: 0 2rem !important; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  justify-content: space-between; align-items: center;
}
.footer-legal { gap: 1.5rem; }

/* ---------- Cyber HUD lower-right ---------- */
.cyber-hud { bottom: 1.2rem !important; right: 1.2rem !important; }

/* ---------- Container width tighter ---------- */
.container { max-width: 1320px !important; padding: 0 2rem !important; }
@media (max-width: 768px) { .container { padding: 0 1.5rem !important; } }

/* ---------- Hero title size — slightly smaller for balance ---------- */
.hero-title {
  font-size: clamp(2.5rem, 8vw, 6.5rem) !important;
}

/* ---------- Improve hero CTAs spacing ---------- */
.hero-actions { margin-top: 2rem !important; }
.hero-socials { margin-top: 2.5rem !important; padding-top: 1.5rem !important; }

/* ---------- Photo aspect ratio improved ---------- */
.profile-card { aspect-ratio: 4/5 !important; }
.profile-frame img { object-position: center 25% !important; }

/* ---------- Photo plate refined ---------- */
.profile-card .photo-plate {
  bottom: .8rem !important; left: .8rem !important; right: .8rem !important;
  padding: .8rem 1rem !important;
}

/* ---------- Make sure WebGL grids don't show through old layers ---------- */
#stage, .ultra-loader, .pill-nav, .hud-readout, .hud-status, .scroll-progress,
.ultra-loader, .nav { display: none !important; }
