/* ================================
   Global variables & base styles
   ================================ */

:root{
  --bg: #0b0f19;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --muted2: rgba(255,255,255,0.55);
  --panel: rgba(15,20,35,0.95);
  --border: rgba(255,255,255,0.14);
  --border2: rgba(255,255,255,0.22);
}

*{
  box-sizing: border-box;
}

html, body{
  height: 100%;
  margin: 0;
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ================================
   Background illustration
   ================================ */

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("lab-sketch.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(1) contrast(1.05) brightness(0.35);
  transform: scale(1.02);
}

body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(140,140,255,0.22), transparent 55%),
    radial-gradient(800px 500px at 80% 20%, rgba(80,220,255,0.18), transparent 60%),
    linear-gradient(180deg, rgba(11,15,25,0.75), rgba(11,15,25,0.85));
  pointer-events: none;
}

/* ================================
   Logo
   ================================ */

.logo-wrap{
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 20;
  pointer-events: none;
}

.logo{
  width: 520px;
  max-width: calc(100vw - 44px);
  height: auto;
  display: block;
  background: transparent;
}

/* ================================
   Hamburger navigation
   ================================ */

.nav{
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 30;
}

.nav button{
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 140ms ease, transform 140ms ease;
  color: var(--text);
}

.nav button:hover{
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.nav button:active{
  transform: translateY(0);
}

.nav button:focus{
  outline: 2px solid rgba(255,255,255,0.35);
  outline-offset: 2px;
}

/* Hamburger icon */

.hamburger{
  width: 18px;
  height: 12px;
  position: relative;
}

.hamburger span{
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
}

.hamburger span:nth-child(1){ top: 0; }
.hamburger span:nth-child(2){ top: 5px; }
.hamburger span:nth-child(3){ top: 10px; }

/* Screen-reader only text */

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ================================
   Menu panel
   ================================ */

.menu{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 200px;
  padding: 6px;
  display: grid;
  gap: 2px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 180ms ease;
  transform-origin: top right;
}

.menu.open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.menu a,
.menu .menu-item{
  display: block;
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  white-space: nowrap;
}

.menu a:hover{
  background: rgba(255,255,255,0.06);
}

.menu .menu-item.disabled{
  opacity: 0.55;
  cursor: default;
  user-select: none;
}

.menu a:focus{
  outline: 2px solid rgba(255,255,255,0.30);
  outline-offset: 2px;
}

/* ================================
   Footer (shared style)
   ================================ */

.legal-fixed,
.footer{
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 15;
  font-size: 11px;
  color: var(--muted2);
  line-height: 1.5;
  text-align: right;
  max-width: min(520px, 90vw);
  text-shadow: 0 2px 14px rgba(0,0,0,0.45);
  pointer-events: none;
}

/* ================================
   Motion preferences
   ================================ */

@media (prefers-reduced-motion: reduce){
  .nav button,
  .menu{
    transition: none;
  }
}

/* ================================
   Small screens
   ================================ */

@media (max-width: 600px){
  .logo{
    width: 280px;
  }
  .nav{
    right: 16px;
    top: 16px;
  }
  .legal-fixed,
  .footer{
    right: 12px;
    bottom: 12px;
    text-align: left;
  }
}
