/* ============================================================
   COMPONENTS: Navigation, project cards, hero, visitor counter
   ============================================================ */

/* ---- Navigation (Win95 menu bar) ---- */
.nav-header {
  background-color: var(--win-face);
  border-bottom: 2px solid;
  border-bottom-color: var(--win-dark);
  border-top: 1px solid var(--win-lighter);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: inset 0 1px 0 var(--win-light);
  /* iOS Dynamic Island / notch safe area */
  padding-top: env(safe-area-inset-top);
}

.nav-bar {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Hamburger toggle -- visible on mobile only */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-right: 1rem;
}

.hamburger input {
  display: none;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
}

/* Nav links -- horizontal row on desktop */
.nav-links {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #fff;
  text-decoration: none;
  background: var(--win-titlebar);
  border-color: var(--win-light);
}

/* Active page: sunken button look */
.nav-link.active {
  color: #fff;
  background: var(--win-titlebar);
  border: 1px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}

.nav-link.active::before { content: ''; }
.nav-link.active::after  { content: ''; }

/* Mobile nav -- hamburger visible, links collapse */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  /* Hidden state */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    border-bottom: 2px solid var(--color-primary);
    padding: 1rem 1.5rem;
    gap: 1rem;
    z-index: 99;
  }

  /* Open state -- checkbox drives visibility */
  #menu-toggle:checked ~ .nav-links {
    display: flex;
  }
}

/* ---- Project cards ---- */
.project-card {
  border: 1px solid var(--color-dim);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(255, 155, 26, 0.15);
  cursor: pointer;
}

.project-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-snapshot {
  aspect-ratio: 16 / 10;
  background: #0d0800;
  border-bottom: 1px solid var(--color-dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-snapshot canvas,
.project-snapshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1.25rem;
}

.project-card h3 {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--color-dim);
  line-height: 1.5;
}

/* ---- Hero section ---- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-dim);
  margin-bottom: 3rem;
}

.hero-prompt {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: var(--color-accent-cyan);
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Shell command quick-nav links */
.hero-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.shell-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--color-accent-amber);
  text-decoration: none;
}

.shell-link::before {
  content: './';
  color: var(--color-dim);
}

.shell-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ---- Visitor counter ---- */
.visitor-counter {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--color-dim);
  letter-spacing: 2px;
  margin-top: 1.5rem;
}

.visitor-counter span {
  color: var(--color-accent-amber);
}

/* ---- Buttons (Win95 raised 3D) ---- */
.btn {
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.75rem;
  color: var(--color-primary);
  background: var(--win-face);
  border: 2px solid;
  border-color: var(--win-lighter) var(--win-darker) var(--win-darker) var(--win-lighter);
  box-shadow: inset 1px 1px 0 var(--win-light);
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  letter-spacing: 0;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: var(--win-light);
  color: #fff;
}

.btn:active {
  border-color: var(--win-darker) var(--win-lighter) var(--win-lighter) var(--win-darker);
  box-shadow: inset 1px 1px 0 var(--win-dark);
  padding: 0.45rem 1.15rem 0.35rem 1.25rem;  /* shift content on press */
}

/* ---- Download links ---- */
.download-link {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--color-accent-cyan);
}

.download-link::before {
  content: '[DL] ';
  color: var(--color-dim);
}

/* ============================================================
   HOME PAGE: Hero, mission cards, status bar
   ============================================================ */

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

.home-hero {
  animation: fadeInUp 0.5s ease-out;
}

.home-missions {
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.home-status {
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ---- Hero: Fastfetch-style split layout ---- */
.home-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--color-dim);
  margin-bottom: 3rem;
}

.hero-split {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.hero-art {
  flex: 0 0 auto;
  max-width: 420px;
}

.hero-art canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255, 155, 26, 0.2));
}

.hero-info {
  flex: 1;
  min-width: 0;
}

.hero-hostname {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--color-accent-cyan);
  text-shadow: 0 0 8px rgba(204, 136, 0, 0.4);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.hero-hostname::after {
  content: '_';
  animation: blink 1s step-end infinite;
}

.hero-separator {
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent-amber), transparent);
  margin-bottom: 1.25rem;
  max-width: 320px;
}

.sysinfo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 1rem;
  margin-bottom: 1.5rem;
}

.sysinfo dt,
.sysinfo dd {
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  line-height: 1.4;
  text-shadow: none;
}

.sysinfo dt {
  color: var(--color-accent-cyan);
}

.sysinfo dt::after {
  content: ':';
}

.sysinfo dd {
  color: var(--color-primary);
}

.hero-desc {
  font-family: 'Noto Sans Mono', 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--color-dim);
  line-height: 1.6;
  border-left: 2px solid var(--color-dim);
  padding-left: 1rem;
  text-shadow: none;
}

/* ---- Section headings ---- */
.section-heading {
  font-size: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-dim);
}

.section-heading-deco {
  color: var(--color-accent-amber);
}

/* ---- Mission cards (homepage grid) ---- */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.mission-card {
  display: block;
  color: inherit;
  overflow: hidden;
  position: relative;
  /* Win95 raised panel */
  border: 2px solid;
  border-color: var(--win-lighter) var(--win-darker) var(--win-darker) var(--win-lighter);
  box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark);
  background: var(--win-face);
  transition: box-shadow 0.15s;
}

.mission-card:hover {
  box-shadow:
    inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Odd last card spans full width so it doesn't orphan */
.mission-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Stretched link: title link covers the whole card */
.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* GitHub link sits above the stretched overlay */
.card-repo {
  position: relative;
  z-index: 1;
}

.mission-card-chrome {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  /* Win95 title bar gradient */
  background: linear-gradient(90deg, var(--win-titlebar), #0d1a30);
  border-bottom: 1px solid var(--win-dark);
  flex-direction: row-reverse;  /* buttons go right in Win95 */
}

/* Transform macOS dots into Win95 system buttons */
.chrome-dot {
  width: 16px;
  height: 14px;
  border-radius: 0;
  flex-shrink: 0;
  font-size: 0;
  /* Win95 raised button */
  border: 1px solid;
  border-color: var(--win-lighter) var(--win-darker) var(--win-darker) var(--win-lighter);
  background: var(--win-face);
  position: relative;
}

.chrome-dot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Tahoma, sans-serif;
  font-size: 9px;
  font-weight: bold;
  color: var(--color-primary);
  line-height: 1;
}

.chrome-dot--red::after   { content: '\00D7'; font-size: 11px; }  /* X */
.chrome-dot--amber::after { content: '\25A1'; font-size: 8px; }   /* [] */
.chrome-dot--green::after { content: '\2013'; font-size: 9px; }   /* _ */

.chrome-dot--red   { background: var(--win-face); order: -1; }
.chrome-dot--amber { background: var(--win-face); order: -2; }
.chrome-dot--green { background: var(--win-face); order: -3; }

.chrome-title {
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--win-titlebar-text);
  margin-right: auto;  /* push buttons to right */
  margin-left: 0;
  padding-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-card-preview {
  aspect-ratio: 16 / 10;
  background: #060404;
  overflow: hidden;
  position: relative;
  /* Win95 sunken viewport */
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
  box-shadow: inset 1px 1px 0 var(--win-darker);
  margin: 2px;
}

.mission-card-preview canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mission-card-info {
  padding: 1.25rem;
}

.mission-card-info h3 {
  margin-bottom: 0.75rem;
  font-size: 0.5rem;
}

.mission-card-info p {
  font-size: 0.9rem;
  color: var(--color-dim);
  line-height: 1.5;
  margin-bottom: 1rem;
  text-shadow: none;
}

/* ---- Tags ---- */
.mission-tags,
.meta-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.7rem;
  color: var(--color-primary);
  /* Win95 sunken field */
  border: 1px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
  background: var(--win-darker);
  padding: 0.15rem 0.5rem;
  letter-spacing: 0;
  text-shadow: none;
}

/* ---- Card repo link ---- */
.card-repo {
  margin-top: 0.5rem;
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.75rem;
}

.card-repo a {
  color: var(--color-accent-amber);
}

/* ---- Status bar (Win95 taskbar) ---- */
.home-status {
  margin-top: 3rem;
}

.status-bar {
  display: flex;
  gap: 0;
  padding: 0;
  /* Win95 raised taskbar */
  border: 2px solid;
  border-color: var(--win-lighter) var(--win-darker) var(--win-darker) var(--win-lighter);
  background: var(--win-face);
  flex-wrap: wrap;
}

.status-item {
  font-family: Tahoma, 'Noto Sans Mono', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0;
  padding: 0.4rem 0.75rem;
  /* Win95 sunken status field */
  border-right: 1px solid var(--win-light);
  box-shadow: inset 1px 1px 0 var(--win-dark);
}

.status-item:last-child {
  margin-left: auto;  /* system tray pushes right */
  border-right: none;
}

.status-label {
  color: var(--color-dim);
}

.status-value--green { color: #55cc55; }
.status-value--amber { color: var(--color-accent-amber); }

/* ============================================================
   PROJECTS PAGE: Full-width stacked cards with terminal chrome
   ============================================================ */

.projects-header {
  margin-bottom: 2.5rem;
}

.projects-subtitle {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--color-dim);
  margin-top: 0.5rem;
  text-shadow: none;
}

.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card-full {
  display: block;
  color: inherit;
  overflow: hidden;
  position: relative;
  /* Win95 raised panel */
  border: 2px solid;
  border-color: var(--win-lighter) var(--win-darker) var(--win-darker) var(--win-lighter);
  box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark);
  background: var(--win-face);
  transition: box-shadow 0.15s;
}

.project-card-full:hover {
  box-shadow:
    inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

.card-chrome {
  display: flex;
  align-items: center;
  padding: 2px 3px;
  /* Win95 title bar */
  background: linear-gradient(90deg, var(--win-titlebar), #0d1a30);
  border-bottom: 1px solid var(--win-dark);
  flex-direction: row-reverse;
}

.chrome-dots {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.card-chrome .chrome-title {
  flex: 1;
  margin-right: auto;
  margin-left: 0;
  padding-left: 4px;
}

.chrome-status {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--color-primary);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.card-preview {
  background: #060404;
  overflow: hidden;
  position: relative;
  height: 100%;
  /* Win95 sunken viewport */
  border: 2px solid;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
  box-shadow: inset 1px 1px 0 var(--win-darker);
  margin: 2px;
}

.card-preview canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.card-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-details h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--color-dim);
  line-height: 1.6;
  flex: 1;
  text-shadow: none;
}

.card-meta {
  margin-top: 1.25rem;
}

/* ---- Responsive: tablet ---- */
@media (max-width: 768px) {
  .hero-split {
    flex-direction: column;
    gap: 2rem;
  }

  .hero-art {
    max-width: 100%;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .card-body {
    grid-template-columns: 1fr;
  }

  .card-preview {
    border-right: none;
    border-bottom: 1px solid var(--color-dim);
  }
}

/* ---- Responsive: mobile ---- */
@media (max-width: 480px) {
  .home-hero {
    padding: 2rem 0 1.5rem;
  }

  .hero-hostname {
    font-size: 0.5rem;
  }

  .status-bar {
    flex-direction: column;
  }

  .status-item:last-child {
    margin-left: 0;
  }

  .chrome-title {
    font-size: 0.6rem;
    max-width: 120px;
  }
}
