[hidden] { display: none !important; }

/* ---- Page-level ------------------------------------------- */
.projects-page,
.resources-page {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Mobile sidebar toggle -------------------------------- */
.sidebar-toggle {
  display: none;
  background: var(--cta);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  margin: 1rem 1.5rem;
}

/* ---- Sticky nav ------------------------------------------- */
.sticky-nav {
  position: fixed;
  top: -6px;
  left: 0;
  width: 100%;
  background: rgba(18, 19, 24, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  padding: 0.75rem 2rem;
  box-sizing: border-box;
  display: flex;
  gap: 2rem;
  align-items: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.sticky-nav.visible {
  transform: translateY(0);
}

.sticky-nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.sticky-nav a:hover {
  color: #fff;
}

/* ---- Two-panel layout ------------------------------------- */
.projects-layout,
.resources-layout {
  display: flex;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 1.5rem 1.5rem;
  gap: 3rem;
  box-sizing: border-box;
}

/* ---- Sidebar ---------------------------------------------- */
.projects-sidebar,
.resources-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 4.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.sidebar-title {
  color: var(--accent);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-left: 0.6rem;
}

/* ---- Projects flat list ----------------------------------- */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-list li {
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}

.project-list li:hover {
  color: var(--text);
  background: rgba(136, 150, 168, 0.08);
}

.project-list li.active {
  color: var(--accent);
  background: rgba(136, 150, 168, 0.12);
  font-weight: bold;
}

/* ---- Resource Hub brand list (flat, same style as project list) -- */
.brand-list, #tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.brand-list li, #tool-list li {
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}

.brand-list li:hover, #tool-list li:hover {
  color: var(--text);
  background: rgba(136, 150, 168, 0.08);
}

.brand-list li.active, #tool-list li.active {
  color: var(--accent);
  background: rgba(136, 150, 168, 0.12);
  font-weight: bold;
}

/* ---- Content area ----------------------------------------- */
.projects-content,
.resources-content {
  flex: 1;
  min-width: 0;
  position: relative;
}

.projects-placeholder,
.resources-placeholder {
  color: var(--text-muted);
  margin-top: 2rem;
  text-align: left;
  font-size: 1.1rem;
}

/* ---- Loading indicator ------------------------------------ */
.projects-loader,
.resources-loader {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 4rem;
}

.loader-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: loader-bounce 1s infinite ease-in-out;
}

.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes loader-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-8px); opacity: 1;   }
}

/* ---- Content body (injected HTML) ------------------------- */
.project-body h1,
.resource-body h1 {
  color: var(--accent);
  margin-top: 0;
}

.project-body h2,
.resource-body h2 {
  color: var(--accent);
  margin-top: 0rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.project-body p,
.resource-body p {
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 95ch;
}

.project-body img,
.resource-body img {
  max-width: 90%;
  border-radius: 8px;
  cursor: zoom-in;
  transition: opacity 0.3s;
}

.project-body a,
.resource-body a {
  color: var(--accent);
}

.project-body .project-gallery,
.resource-body .resource-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ---- Info tables ------------------------------------------ */
.info-table {
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.info-table th,
.info-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 1.2rem;
  text-align: left;
}

.info-table th {
  color: var(--accent);
  background: rgba(136, 150, 168, 0.06);
}

.info-table tr:hover {
  background: rgba(136, 150, 168, 0.04);
}

/* ---- Toggle button ---------------------------------------- */
.toggle-btn {
  margin-left: 0.75rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: rgba(136, 150, 168, 0.1);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.2s;
}

.toggle-btn:hover {
  background: rgba(136, 150, 168, 0.2);
}

/* ---- Lightbox --------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
}

.lightbox-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.lightbox-viewport.grabbing {
  cursor: grabbing;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  user-select: none;
  pointer-events: none;
}

/* ---- Tool List ---- */
.tracer-frame {
  width: 100%;
  height: 80vh;
  border: none;
  border-radius: 8px;
  margin-top: 1rem;
  background: #0d0f14;
}

.cart-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.cart-list li a {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.cart-list li a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Bits & Bobs ------------------------------------------ */
.small-text { font-size: 0.7rem; max-width: 90ch; }
.text-cent {text-align: center;}
#center-the-thing {max-width: inherit;}

/* ---- Mobile layout ---------------------------------------- */
@media (max-width: 700px) {

  /* Hide sidebar toggle and sidebar entirely */
  .sidebar-toggle        { display: none; }
  .projects-sidebar,
  .resources-sidebar     { display: none; }

  /* Layout becomes single column */
  .projects-layout,
  .resources-layout {
    flex-direction: column;
    padding: 0 0 1rem 0;
    gap: 0;
  }

  .project-body img, .resource-body img { max-width: 100%; }
  .projects-content, .resources-content { padding: 0 1rem; }
  .projects-placeholder, .resources-placeholder {text-align: center;}

  /* ---- Info table → mobile cards ---------------------------- */
  .info-table {
    display: block;
    width: 100%;
    border: none;
  }

  .info-table thead {
    display: none;
  }

  .info-table tbody {
    display: block;
  }

  .info-table tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
  }

  .info-table tr:hover {
    background: var(--surface);
  }

  .info-table td {
    display: block;
    border: none;
    padding: 0.4rem 0;
    text-align: left;
  }

  .info-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.15rem;
  }

  .info-table td:last-child {
    padding-bottom: 0;
  }

  .info-table a {justify-content: flex-start;}

  /* ---- Mobile tab strip ----------------------------------- */
  .mobile-tab-strip {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .mobile-tab-strip::-webkit-scrollbar { display: none; }

  .mobile-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
  }

  .mobile-tab:hover {
    color: var(--text);
    border-color: var(--accent);
  }

  .mobile-tab.active {
    color: var(--text);
    border-color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--accent);
  }

  /* View More button — below the strip */
  .mobile-view-more {
    display: block;
    margin: 0 1rem 0.75rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: color 0.2s, border-color 0.2s;
  }

  .mobile-view-more:hover {
    color: var(--text);
    border-color: var(--accent);
  }

  /* ---- Resources 2x3 grid --------------------------------- */
  .mobile-brand-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  /* ---- Full panel overlay (projects) ---------------------- */
  .mobile-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1rem 2rem;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  .mobile-panel-overlay.open .mobile-panel {
    transform: translateY(0);
  }

  .mobile-panel-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
  }

  /* Filter pills inside panel */
  .mobile-filter-strip {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  .mobile-filter-pill {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
  }

  .mobile-filter-pill.active {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(136, 150, 168, 0.12);
  }

  /* Project list inside panel */
  .mobile-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-panel-list li {
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s;
  }

  .mobile-panel-list li:last-child { border-bottom: none; }

  .mobile-panel-list li:hover { color: var(--text); }

  .mobile-panel-list li.active {
    color: var(--accent);
    font-weight: bold;
  }
}
