/* ── Project Card ── */
.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.project-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-dim);
  border-left-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 24px rgba(74, 124, 191, 0.06);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.project-card__number {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--accent-dim);
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0.6;
}

.project-card__title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
}

.project-card__subtitle {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.project-card__divider {
  height: 1px;
  background: linear-gradient(to right, var(--accent-dim), transparent);
  opacity: 0.3;
  margin-bottom: 12px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 2px 8px;
  background: rgba(74, 124, 191, 0.08);
  border: 1px solid rgba(74, 124, 191, 0.15);
  color: var(--accent);
  border-radius: var(--radius);
  letter-spacing: 0.05em;
}

.project-card__tag.featuring {
  background: rgba(74, 124, 191, 0.15);
  border-color: var(--accent);
}

.project-card__preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  line-height: 1.5;
}

/* ── Spec Table ── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin: 16px 0;
}

.spec-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  transition: background 0.2s var(--ease);
}

.spec-table tr:hover td {
  background: rgba(74, 124, 191, 0.02);
}

.spec-table td:first-child {
  color: var(--accent);
  width: 180px;
  letter-spacing: 0.05em;
}

.spec-table td:last-child {
  color: var(--text-dim);
}

/* ── Status Badges ── */
.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 4px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.05em;
  transition: all 0.25s var(--ease);
}

.status-badge.working {
  background: rgba(74, 191, 120, 0.1);
  border: 1px solid rgba(74, 191, 120, 0.25);
  color: #4abf78;
}

.status-badge.working:hover {
  background: rgba(74, 191, 120, 0.18);
  border-color: rgba(74, 191, 120, 0.5);
}

.status-badge.blocked {
  background: rgba(191, 120, 74, 0.1);
  border: 1px solid rgba(191, 120, 74, 0.25);
  color: #bf784a;
}

.status-badge.blocked:hover {
  background: rgba(191, 120, 74, 0.18);
  border-color: rgba(191, 120, 74, 0.5);
}

.status-badge.planned {
  background: rgba(74, 124, 191, 0.1);
  border: 1px solid rgba(74, 124, 191, 0.25);
  color: var(--accent);
}

.status-badge.planned:hover {
  background: rgba(74, 124, 191, 0.18);
  border-color: rgba(74, 124, 191, 0.5);
}

/* ── Kernel Explorer ── */
.kernel-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 32px auto;
  max-width: 500px;
}

.kernel-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  min-width: 200px;
  text-align: center;
}

.kernel-node:hover,
.kernel-node.active {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.kernel-node__title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kernel-node__desc {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.kernel-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  color: var(--accent-dim);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  opacity: 0.5;
  user-select: none;
}

.kernel-arrow.animate {
  animation: pulse-arrow 0.8s var(--ease) infinite alternate;
}

@keyframes pulse-arrow {
  from { opacity: 0.3; transform: translateY(0); }
  to   { opacity: 1; transform: translateY(3px); }
}

.kernel-detail {
  display: none;
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.kernel-detail.visible {
  display: block;
}

.kernel-detail__title {
  color: var(--accent);
  font-size: 0.875rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── CFD Visualizer ── */
/* ── CFD Image Gallery ── */
.cfd-gallery {
  border: 1px solid var(--border);
}

.cfd-gallery__viewport {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.cfd-gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.cfd-gallery__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.cfd-gallery__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.cfd-gallery__btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(74, 124, 191, 0.1);
}

.cfd-gallery__counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 48px;
  text-align: center;
}

/* ── Terminal ── */
.terminal-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.terminal-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-dim);
}

.terminal-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 89;
  width: 380px;
  max-height: 300px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.terminal-panel.open {
  display: flex;
  animation: sectionIn 0.2s ease both;
}

.terminal-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
}

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  color: var(--text-dim);
  line-height: 1.6;
  min-height: 80px;
}

.terminal-body .prompt {
  color: var(--accent);
}

.terminal-body .output {
  color: var(--text);
}

.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 4px 12px 8px;
  border-top: 1px solid var(--border);
}

.terminal-input-line .prompt {
  color: var(--accent);
  margin-right: 8px;
}

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .terminal-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 72px;
    max-height: 50vh;
  }

  .terminal-toggle {
    bottom: 16px;
    right: 16px;
  }

  .cfd-gallery__btn {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .project-card__preview {
    font-size: 0.75rem;
  }

  .kernel-node {
    min-width: 160px;
    padding: 12px 16px;
  }

  .pipeline__box {
    font-size: 0.625rem;
    padding: 8px 12px;
  }

  .pipeline__arrow {
    padding: 0 4px;
    font-size: 0.75rem;
  }

  .status-badge {
    font-size: 0.625rem;
    padding: 3px 8px;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline__node::before {
    left: -20px;
    width: 7px;
    height: 7px;
  }
}

@media (max-width: 480px) {
  .kernel-node {
    min-width: 120px;
    padding: 10px 12px;
  }

  .kernel-node__title {
    font-size: 0.75rem;
  }

  .kernel-node__desc {
    font-size: 0.625rem;
  }
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 32px;
  margin: 24px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline__node {
  position: relative;
  padding-bottom: 24px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.5s var(--ease);
}

.timeline__node.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline__node::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
}

.timeline__node.completed::before {
  background: var(--accent);
}

.timeline__year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.timeline__title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  margin-top: 2px;
}

.timeline__desc {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Orbital schematic (for orbit page) ── */
.orbit-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  position: relative;
}

.orbit-container canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

/* ── Back to top ── */
.section-divider {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--line);
  letter-spacing: 0.2em;
  margin: 24px 0;
  user-select: none;
}

/* ── Project header ── */
.project-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.project-header__title {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.project-header__subtitle {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.project-header__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.project-header__meta span {
  padding: 2px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Pipeline diagram ── */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  margin: 24px 0;
}

.pipeline__step {
  display: flex;
  align-items: center;
  gap: 0;
}

.pipeline__box {
  padding: 12px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.pipeline__box:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.pipeline__arrow {
  padding: 0 8px;
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 1rem;
}
