/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-void: #06090a;
  --bg-panel: #0c1311;
  --bg-card: #121b18;
  --bg-card-hover: #16221c;
  --accent: #3DDC84;
  --accent-dim: #1d6b4a;
  --accent-deep: #0F9D58;
  --text-primary: #e8f5ec;
  --text-secondary: #7fae8f;
  --text-tertiary: #4a6356;
  --border: #1c2620;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   BOOT SCREEN
   ============================================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 3rem;
  font-family: var(--mono);
  animation: bootFadeOut 0.6s ease forwards;
  animation-delay: 2.4s;
}

@keyframes bootFadeOut {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.boot-line {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 0.6rem;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
}

.boot-line::before {
  content: attr(data-text);
  border-right: 2px solid var(--accent);
  animation: typeLine 0.5s steps(30) forwards, blinkCursor 0.6s step-end infinite;
  display: inline-block;
}

.boot-line:nth-child(1) { animation: revealLine 0.1s forwards; animation-delay: 0s; }
.boot-line:nth-child(2) { animation: revealLine 0.1s forwards; animation-delay: 0.6s; }
.boot-line:nth-child(3) { animation: revealLine 0.1s forwards; animation-delay: 1.2s; }
.boot-line:nth-child(4) { animation: revealLine 0.1s forwards; animation-delay: 1.8s; }

@keyframes revealLine {
  to { opacity: 1; }
}

@keyframes typeLine {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCursor {
  50% { border-color: transparent; }
}

/* ============================================================
   CRT / SCANLINE OVERLAY (subtle ambient texture)
   ============================================================ */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.05) 0px,
    rgba(0,0,0,0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.3;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: 44px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.topbar-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 0.75rem;
}

.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 44px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 44px;
  height: calc(100vh - 44px);
  overflow-y: auto;
}

.profile-block {
  text-align: left;
}

.avatar-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--accent-dim);
  animation: pulseRing 2.4s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.12); opacity: 0; }
}

.avatar-initials {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.profile-name {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.profile-role {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.profile-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: statusPulse 2s ease-out infinite;
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ============================================================
   PROCESS LIST (project nav)
   ============================================================ */
.process-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.process-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  text-align: left;
  width: 100%;
  font-family: var(--sans);
}

.process-item:hover {
  background: var(--bg-card);
  border-color: var(--border);
  transform: translateX(2px);
}

.process-item.active {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
}

.process-item.active .process-name {
  color: var(--accent);
}

.process-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.process-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-tagline {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.process-badge.live {
  background: rgba(61, 220, 132, 0.12);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.process-badge.building {
  background: rgba(127, 174, 143, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.sidebar-footer {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent);
}

/* ============================================================
   DETAIL PANEL
   ============================================================ */
.detail-panel {
  padding: 3rem 3.5rem;
  overflow-y: auto;
}

.detail-content {
  max-width: 760px;
  animation: panelIn 0.4s ease forwards;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.detail-eyebrow .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.detail-title {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.detail-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 1.6rem;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.stack-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 0.35rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--accent);
}

.detail-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 2rem;
  max-width: 620px;
}

.highlights-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 2.4rem;
}

.highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.highlights-list li::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.action-row {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 2.6rem;
}

.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #06140d;
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #4ee893;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-disabled {
  background: transparent;
  border-color: var(--border);
  color: var(--text-tertiary);
  cursor: default;
}

/* ============================================================
   SCREENSHOT GALLERY
   ============================================================ */
.gallery-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.gallery-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.gallery-item.img-missing {
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.img-missing::before {
  content: 'image pending upload';
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.gallery-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0.5rem 0.7rem;
}

.empty-gallery {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-family: var(--mono);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
}

.lightbox-close:hover {
  color: var(--accent);
}

/* ============================================================
   MOBILE NAV TOGGLE
   ============================================================ */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(61, 220, 132, 0.3);
}

.mobile-nav-toggle span {
  width: 20px;
  height: 2px;
  background: #06140d;
  border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 44px;
    width: 86vw;
    max-width: 340px;
    height: calc(100vh - 44px);
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .detail-panel {
    padding: 2rem 1.5rem 5rem;
  }

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

  .mobile-nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .action-row {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

/* scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}
