/* =========================================
   01. PROJECTS & LABS
========================================= */

.projects-section {
  padding-top: 100px;
  padding-bottom: 100px;
}

.project-featured {
  padding: 32px;

  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  background: var(--surface);

  transition: border-color var(--transition);
}

.project-featured:hover {
  border-color: var(--border-hover);
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.project-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.project-index {
  color: var(--text-muted);

  font-family: var(--font-mono);
  font-size: 11px;
}

.project-category {
  color: var(--accent);

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.project-status {
  padding: 5px 9px;

  border: 1px solid var(--border);
  border-radius: 4px;

  color: var(--text-muted);

  font-family: var(--font-mono);
  font-size: 10px;
}

.status-active {
  color: var(--green);
  border-color: rgba(101, 214, 138, 0.2);
  background: rgba(101, 214, 138, 0.04);
}

.project-featured h3 {
  margin-top: 28px;

  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.project-subtitle {
  margin-top: 6px;

  color: var(--text-secondary);
  font-size: 14px;
}

.project-description {
  max-width: 750px;

  margin-top: 20px;

  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.9;
}

/* Architecture pipeline */

.architecture {
  margin-top: 32px;
  padding: 22px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: var(--bg);
}

.architecture-label {
  color: var(--text-muted);

  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  margin-top: 18px;
}

.pipeline-node {
  flex: 1;
  min-width: 0;

  padding: 14px 10px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  background: var(--surface);

  text-align: center;
}

.pipeline-node small {
  display: block;

  color: var(--text-muted);

  font-family: var(--font-mono);
  font-size: 9px;
}

.pipeline-node strong {
  display: block;
  margin-top: 5px;

  font-size: 11px;
  font-weight: 500;
}

.pipeline-highlight {
  border-color: rgba(41, 151, 255, 0.35);
  background: var(--accent-soft);
}

.pipeline-highlight strong {
  color: var(--accent);
}

.pipeline-arrow {
  color: var(--text-muted);
  font-size: 12px;
}

/* Project footer */

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;

  margin-top: 26px;
  padding-top: 22px;

  border-top: 1px solid var(--border);
}

/* Project tags */

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-stack span {
  padding: 5px 9px;

  border: 1px solid var(--border);
  border-radius: 4px;

  color: var(--text-secondary);

  font-family: var(--font-mono);
  font-size: 10px;
}

/* Project link */

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 500;

  transition: color var(--transition);
}

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

/* Project grid */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;

  margin-top: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;

  min-height: 310px;
  padding: 26px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  background: var(--surface);

  transition:
    border-color var(--transition),
    transform var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.project-card h3 {
  margin-top: 24px;

  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.project-card p {
  margin-top: 12px;

  color: var(--text-secondary);

  font-size: 13px;
  line-height: 1.8;
}

.project-card .tech-stack {
  margin-top: auto;
  padding-top: 24px;
}

.project-card .project-link {
  margin-top: 22px;
}

.project-card-more {
  justify-content: space-between;

  background:
    radial-gradient(
      circle at top right,
      rgba(41, 151, 255, 0.07),
      transparent 50%
    ),
    var(--surface);
}

.project-card-more h3 {
  margin-top: 16px;
}

.project-card-more p {
  max-width: 350px;
}

/* =========================================
   02. CASE STUDY IMAGES & EVIDENCE GRID
========================================= */

.case-study-figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-study-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #181818;
  border: 1px solid #1f1f1f;
  border-radius: 4px;
  display: block;
}

.case-study-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.evidence-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topology-figure {
  margin: 2rem 0;
}

.topology-figure img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #ffffff;
}

/* =========================================
   03. VALIDATION TABLE
========================================= */

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.validation-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.validation-table th,
.validation-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.validation-table th {
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.validation-table tbody tr:last-child td {
  border-bottom: none;
}

.badge-pass {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 4px;
}

/* =========================================
   04. RESPONSIVE (PROJECTS)
========================================= */

@media (max-width: 800px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .evidence-grid,
  .evidence-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pipeline {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .pipeline-node {
    flex: 0 0 110px;
  }

  .pipeline-arrow {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) {
  .project-featured {
    padding: 20px;
  }

  .project-featured h3 {
    font-size: 25px;
  }

  .architecture {
    padding: 14px;
  }

  .project-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-card {
    min-height: 280px;
    padding: 22px;
  }
}

/* =========================================
   05. CASE STUDY & LAB DETAIL PAGES
========================================= */

.project-page {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
  padding: 80px 0 100px;
}

.project-page .eyebrow,
.project-page .section-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-page h1 {
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.06em;
  max-width: 820px;
  margin: 18px 0 22px;
}

.project-page .lede {
  color: var(--text-secondary);
  max-width: 680px;
  font-size: 16px;
  line-height: 1.85;
}

.project-page .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.project-page .meta span {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 9px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.project-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 65px;
}

.project-page .actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.project-page .actions a:hover {
  border-color: var(--border-hover);
  background: var(--surface-raised);
}

.project-page .actions a.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.project-page .actions a.primary:hover {
  background: white;
  transform: translateY(-1px);
}

.project-page section {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.project-page h2 {
  font-size: clamp(24px, 3.5vw, 30px);
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 12px 0 18px;
}

.project-page h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.project-page p,
.project-page li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
}

.project-page ul {
  padding-left: 20px;
}

.project-page .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 26px;
}

.project-page .tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.project-page .tile .num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  display: block;
  margin-bottom: 14px;
}

.project-page .tile p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 0;
}

.project-page .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.project-page .status {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.project-page .footer {
  border-top: 1px solid var(--border);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.project-page .footer a {
  color: var(--text-secondary);
  font-size: 13px;
  transition: color var(--transition);
}

.project-page .footer a:hover {
  color: var(--text);
}

@media (max-width: 800px) {
  .project-page .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .project-page {
    width: calc(100% - 32px);
    padding: 60px 0 75px;
  }
}

/* =========================================
   06. PROJECTS DIRECTORY PAGE
========================================= */

.page-hero {
  padding: 90px 0 65px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin-top: 15px;
  font-size: clamp(38px, 6vw, 60px);
  letter-spacing: -0.06em;
}

.page-hero p {
  max-width: 620px;
  margin-top: 20px;
  color: var(--text-secondary);
}

.directory {
  padding: 65px 0 100px;
}

.directory-group {
  margin-bottom: 55px;
}

.directory-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.directory-heading h2 {
  font-size: 18px;
  font-weight: 500;
}

.directory-heading span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.directory-card {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 25px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--border);
}

.directory-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.directory-content h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.directory-content p {
  max-width: 650px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.directory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.directory-tags span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.9;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.brand-logo:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.brand-logo img {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

@media (max-width: 650px) {
  .directory-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
