/* ============================================================
   GLOBAL BASE — PS2 DEV UI THEME
   ============================================================ */

:root {
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg: #0B0E15;
  --bg-panel: #101720;
  --bg-hover: #1f1f1f;

  --fg: #E3EAF6;
  --fg-muted: #A9C4E8;

  --accent: #8AB7FF;
  --border: #5C6A7A;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

html { scroll-behavior: smooth; }

/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #CBE1FF;
  text-decoration: underline;
}

/* ============================================================
   GRID LAYOUT (Sticky+)
   ============================================================ */

.container {
  display: grid;
  grid-template-columns: 240px 1fr 220px;
  gap: 20px;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ============================================================
   SIDEBARS
   ============================================================ */

.sidebar,
.sidebar-right {
  background: #0F141D;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.sidebar a,
.sidebar-right a {
  display: block;
  color: var(--fg);
  margin: 4px 0;
}

.sidebar a.active {
  color: var(--accent);
  font-weight: 600;
  position: relative;
}

.sidebar a.active::before {
  content: "►";
  position: absolute;
  left: -14px;
  color: var(--accent);
}

.sidebar-right ul {
  margin-left: 0;
  padding-left: 16px;
}
.sidebar-right li {
  margin-bottom: 4px;
}



/* ============================================================
   PANELS
   ============================================================ */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 3px;
}

.panel h1,
.panel h2,
.panel h3,
.panel h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px 0;
}

.panel p,
.panel li,
.panel ul {
  font-size: 14px;
  line-height: 1.45;
}

.panel h1 { font-size: 18px; line-height: 1.3; }
.panel h2 { font-size: 15px; line-height: 1.3; }
.panel h3,
.panel h4 { font-size: 13px; line-height: 1.3; }


.sidebar-right p,
.sidebar-right ul,
.sidebar-right li {
  font-size: 11px;
  font-family: var(--font-mono);
  line-height: 1.45;
}

/* ============================================================
   PROJECT BLOCKS
   ============================================================ */

.project {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 3px;
  opacity: 1;
  transition: opacity 0.18s ease;
  position: relative;   /* <<< ADDED (badge anchor) */
}

.project.fade-out { opacity: 0; }
.project.fade-in  { opacity: 1; }

.project p { margin: 8px 0; }

.project h2 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px 0;
}
.project h3 {
  font-family: var(--font-mono);
  font-size: 16px;
  margin-bottom: 6px;
}

.project-meta {
  display: grid;
  gap: 2px;
}

.project-meta span.tools {
  font-size: 12px;
  opacity: 0.75;
}

.project .tags {
  margin-top: 10px;
  margin-bottom: 14px;
}

.project-lite {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 3px;
}
.project-lite h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 4px 0;
}
.project-lite p {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.9;
}


/* ============================================================
   SELECTED PROJECT BADGE
   ============================================================ */

.project[data-featured="true"]::before {
  content: "★ FEATURED";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  border: 1px solid var(--accent);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--accent);
  background: rgba(255,255,255,0.04);
  letter-spacing: 0.3px;
}

.project.fade-out[data-featured="true"]::before {
  opacity: 0;
}

/* ============================================================
   PROJECT BADGES — PIPELINE TOKENS (T3)
   ============================================================ */

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.04);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge:hover {
  background: rgba(255,255,255,0.07);
  cursor: default;
}

/* ============================================================
   HERO IMAGE — FIRST IMAGE CLAMP
   ============================================================ */

.project > img:first-of-type {
  width: 100%;
  max-width: 640px;
  height: 360px;
  object-fit: cover;
  display: block;
  margin: 0.75rem auto;
  background: #0A0A0A;
  border: 1px solid #444;
  border-radius: 2px;
  cursor: pointer;
}

.hero-image img {
  width: 100%;
  max-width: 640px;
  height: 360px;
  object-fit: cover;
  display: block;
  margin: 0.75rem auto;
  background: #0A0A0A;
  border: 1px solid #444;
  cursor: pointer;
  border-radius: 2px;
}

details[open] .hero-image { margin-top: 8px; }

/* ============================================================
   DETAILS SPACING
   ============================================================ */

.project details + details { margin-top: 14px; }
.project details[open] > summary { margin-bottom: 10px; }
.project details details { margin-left: 8px; }

/* ============================================================
   PROJECT PART TITLE EMPHASIS
   ============================================================ */

.project-part-title {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.2px;
}

.project details > summary {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
}

/* ============================================================
   MINI GALLERY — DOM BASED CYCLING
   ============================================================ */

.gallery-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 6px;
  list-style: none;
}

.gallery-details[open] summary { color: #CBE1FF; }

.gallery-details summary::-webkit-details-marker { display: none; }

.screenshot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.screenshot-row img {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: zoom-out;
}

#lightbox img {
  max-width: 95%;
  max-height: 95%;
  border: 1px solid var(--border);
  background: #000;
}

body.lightbox-open { overflow: hidden; }

/* ============================================================
   FILTER BUTTONS
   ============================================================ */

.filter-buttons button {
  background: none;
  border: 1px solid var(--border);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  margin-right: 8px;
  cursor: pointer;
  border-radius: 2px;
}

.filter-buttons button.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .container { grid-template-columns: 240px 1fr; }
  .sidebar-right { display: none; }
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .screenshot-row img {
    width: 100%;
    height: auto;
  }
}
/* ============================================================
   LAB ENTRIES (BLOG STYLE)
   ============================================================ */

.lab-entry {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.lab-entry:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 6px;
}

.lab-entry h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 4px 0 4px 0;
  color: var(--accent);
}

.lab-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  opacity: 0.9;
}

.lab-date {
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.lab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lab-tags span {
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(138,183,255,0.35);
  background: rgba(138,183,255,0.06);
  color: var(--fg-muted);
}
#lab-lock {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,1);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.lock-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 26px;
  border-radius: 3px;
  width: 360px;
  text-align: center;
}

.lock-panel h2 {
  color: var(--accent);
  margin-bottom: 12px;
}

.lock-panel p {
  margin-bottom: 12px;
  color: var(--fg-muted);
}

.lock-panel input {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border);
  background: #000;
  color: var(--fg);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

#lab-submit, #lab-return {
  margin-top: 8px;
  width: 100%;
  padding: 6px;
  font-family: var(--font-mono);
  background: #0F141D;
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
}
#lab-submit:hover, #lab-return:hover {
  background: var(--bg-hover);
}

#lab-error {
  color: #ff6060;
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
}
.build-footer {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.55;
  text-align: right;
  padding-right: 6px;
}
@media print {

  /* Remove navigation + chrome */
  .sidebar,
  .sidebar-right,
  .build-footer,
  .btn {
    display: none !important;
  }

  /* Expand content to full width */
  .content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0;
  }

  /* Remove panel borders for clean CV print */
  .panel {
    border: none !important;
    padding: 0 0 10px 0 !important;
    margin: 0 0 16px 0 !important;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Force A4 layout */
  @page {
    size: A4;
    margin: 1.4cm;
  }

  body {
    font-size: 12px !important;
    line-height: 1.35;
  }

  /* Remove hyperlinks styling */
  a::after {
    content: "";
  }
}
.btn-download {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download:hover {
  background: var(--accent);
  color: black;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-download:active {
  transform: translateY(0px);
  opacity: 0.85;
}
