/* ============================================================
   LAYOUT — page chrome, nav, grid
   ------------------------------------------------------------
   NORA-derived structure. sidebar nav on desktop, top bar on
   mobile. main content sits over the ambient effects layers.
   ============================================================ */


/* ---- APP SHELL ------------------------------------------ */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: var(--z-content);
}


/* ============================================================
   SIDEBAR — desktop only
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width-desktop);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: var(--z-nav);
  overflow: hidden;
}


/* ---- BRAND BLOCK — NORA pattern, logo-only ------------- */
/* logo + tiny status line. gradient underline at bottom-left.
   no wordmark text, no marketing slogan in this block. */
.brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
  position: relative;
}

/* gradient accent under the brand block — the NORA tell */
.brand::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-5);
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 8px rgba(var(--brand-glow-rgb), .5);
}

/* logo — 140px wide. theme swaps the image via --logo-mark.
   subtle theme-tinted drop-shadow glow, intensifies on hover. */
.brand-logo {
  display: block;
  width: 140px;
  height: 60px;
  background-image: var(--logo-mark);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  user-select: none;
  filter: drop-shadow(0 0 6px rgba(var(--brand-glow-rgb), .25));
  transition: filter var(--dur-base) var(--easing), transform var(--dur-base) var(--easing);
}
.brand-logo:hover {
  filter: drop-shadow(0 0 10px rgba(var(--brand-glow-rgb), .4));
  transform: scale(1.02);
}

/* tiny status line — operational state, NOT marketing copy */
.brand-status {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .3em;
  color: var(--muted);
  text-transform: uppercase;
  padding-left: 3px;
  margin-top: 2px;
}


/* ---- NAV LIST + ITEMS ----------------------------------- */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-fast) var(--easing);
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--surface-2);
  color: var(--text);
}

/* active rail — 3x16 cyan stub sticking out the left edge,
   glowing. positioned at -10px so it bleeds past the nav padding. */
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 6px var(--accent);
}

.nav-item .nav__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .85;
}


/* ---- SIDEBAR FOOTER ------------------------------------- */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-footer__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar-footer__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-footer__status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-soft, var(--border));
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 6px var(--live);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .55; transform: scale(.85); }
}

.sidebar-footer__text {
  flex: 1;
  line-height: 1.3;
}

.sidebar-footer__top {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--text);
  text-transform: uppercase;
}

.sidebar-footer__bot {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--muted);
  margin-top: 2px;
}


/* ============================================================
   MOBILE NAV — top bar + collapsible sheet, <= 768px only
   ============================================================ */
.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height-mobile);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-nav);
  padding: 0 var(--space-4);
  align-items: center;
  justify-content: space-between;
}

.nav-mobile__brand {
  display: block;
  width: 100px;
  height: 36px;
  background-image: var(--logo-mark);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  filter: drop-shadow(0 0 6px rgba(var(--brand-glow-rgb), .25));
}

.nav-mobile__toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--easing);
}

.nav-mobile__toggle:hover {
  border-color: var(--accent);
}

/* mobile sheet — slides down when [data-nav-open] on .app */
.nav-sheet {
  display: none;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  flex: 1;
  margin-left: var(--nav-width-desktop);
  min-height: 100vh;
  padding: var(--space-6);
  position: relative;
  z-index: var(--z-content);
}


/* ---- STATUS STRIP — instrument readout ----------------- */
.status-strip {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}

.status-strip__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-strip__divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.status-strip__value {
  color: var(--text);
}


/* ---- SECTION DIVIDER — instrument-panel banner ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-7) 0 var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-divider__bracket {
  color: var(--accent);
  opacity: 0.7;
}

.section-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--border) 0%,
    transparent 100%
  );
}


/* ---- GRID UTILITIES ------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--projects { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--videos   { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid--partners { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }


/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */
@media (max-width: 768px) {

  .nav { display: none; }

  .nav-mobile { display: flex; }

  .main {
    margin-left: 0;
    padding: calc(var(--nav-height-mobile) + var(--space-5)) var(--space-4) var(--space-6);
  }

  .status-strip {
    font-size: 9px;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-3);
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  /* mobile sheet — appears when nav opens */
  .nav-sheet {
    display: block;
    position: fixed;
    top: var(--nav-height-mobile);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-3);
    z-index: calc(var(--z-nav) - 1);
    transform: translateY(-110%);
    transition: transform var(--dur-base) var(--easing);
  }

  .app[data-nav-open="true"] .nav-sheet {
    transform: translateY(0);
  }
}


/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-9);
  padding: var(--space-6) 0 var(--space-5);
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (max-width: 600px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.footer__heading {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__links a {
  color: var(--text);
  font-size: var(--text-sm);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
  gap: var(--space-2);
}
