:root {
  /* Forest Ranger Tech Palette */
  --bg-deep: #0a110d; /* Very dark forest shadow */
  --bg-surface: #132219; /* Dark green-grey surface */
  --bg-surface-alt: #172a1f; /* Slightly lighter surface for contrast */
  --primary: #3c6e47; /* Tech forest green */
  --primary-glow: rgba(60, 110, 71, 0.4);
  --accent: #d4b886; /* Rich tan / khaki */
  --accent-glow: rgba(212, 184, 134, 0.3);
  --text-main: #e4ebe6; /* Off-white with slight green tint */
  --text-muted: #8a9e91; /* Muted sage text */
  --border-color: #2a4232; /* Subtle green border */

  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-tech: 'Courier New', Courier, monospace; /* For tech accents */
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography & General */
h1,
h2,
h3,
h4 {
  color: var(--text-main);
  letter-spacing: 0.5px;
}

/* Hero Section */
.hero {
  background:
    linear-gradient(
      90deg,
      rgba(14, 26, 20, 0.92) 0%,
      rgba(14, 26, 20, 0.78) 45%,
      rgba(14, 26, 20, 0.55) 100%
    ),
    url('assets/hero-ai-network.jpg') center / cover no-repeat,
    var(--bg-deep);
  border-bottom: 1px solid var(--border-color);
  padding: 120px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px) 0 0 / 50px
      50px,
    linear-gradient(var(--border-color) 1px, transparent 1px) 0 0 / 50px 50px;
  opacity: 0.05;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.8rem;
  margin-bottom: 10px;
  color: var(--text-main);
  text-shadow: 0 0 20px var(--primary-glow);
}

.hero h2 {
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 25px;
  font-family: var(--font-tech);
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 30px auto;
}

/* Buttons */
.cta-buttons {
  margin-top: 40px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin: 0 10px;
  transition: all 0.3s ease;
  font-family: var(--font-tech);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-main);
  border: 1px solid var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--primary);
  box-shadow: 0 0 25px var(--primary-glow);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background-color: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

/* Sections */
.section-light {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 80px 20px;
}

.section-dark {
  background-color: var(--bg-deep);
  padding: 80px 20px;
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-text h3 {
  color: var(--accent);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.about-text strong {
  color: var(--text-main);
}

.stat-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  padding: 25px 20px;
  text-align: center;
  border-radius: 6px;
  margin-bottom: 20px;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stat-card i {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.stat-card h4 {
  margin: 0 0 5px 0;
  color: var(--text-main);
}

.stat-card p {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.85rem;
}

/* Vision Section */
.vision-content {
  background: var(--bg-surface-alt);
  border-left: 4px solid var(--accent);
  padding: 30px;
  border-radius: 0 6px 6px 0;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.vision-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

#vision h3 {
  color: var(--primary);
  font-size: 2rem;
}

.lead {
  font-size: 1.4rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 40px;
}

/* Portfolio Grid */
#portfolio h3 {
  text-align: center;
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 40px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.project-card h4 {
  color: var(--text-main);
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 15px;
}

.project-card p {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 25px;
}

.btn-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-family: var(--font-tech);
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--text-main);
}

.btn-link i {
  margin-left: 5px;
  transition: transform 0.2s;
}

.btn-link:hover i {
  transform: translateX(5px);
}

/* GitHub Repos Section */
#github-repos h3 {
  color: var(--accent);
  text-align: center;
  margin-bottom: 30px;
}

.repo-controls {
  margin-bottom: 40px;
  text-align: center;
}

.repo-search {
  padding: 15px 25px;
  width: 100%;
  max-width: 500px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 30px;
  font-size: 1rem;
  font-family: var(--font-tech);
  transition: all 0.3s;
}

.repo-search::placeholder {
  color: var(--text-muted);
}

.repo-search:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 15px var(--primary-glow);
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.repo-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  padding: 25px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.repo-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.repo-card h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.repo-card h4 a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
}

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

.repo-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 20px;
}

.repo-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--primary);
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  font-family: var(--font-tech);
}

.repo-meta i {
  margin-right: 6px;
}

/* Flagship + experiments cards (moved from inline <style> blocks in index.html) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

/* Standardization for Flagship Innovation Cards */
.project-card {
  background: var(--card-bg, #1a1e29);
  border: 1px solid var(--border-color, #2ea043);
  border-radius: 6px;
  padding: 25px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 280px; /* Force minimum height for alignment */
}

/* The Advanced SIGINT card needs special handling because it has an image on top */
.project-card:has(.project-image) {
  padding: 0;
  overflow: hidden;
}

.project-card:has(.project-image) .project-info {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card h4 {
  color: var(--primary-color, #2ea043);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card p {
  color: var(--text-secondary, #8b949e);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1; /* Pushes the button/tags to the bottom uniformly */
}

.project-card .btn-link {
  display: inline-block;
  text-decoration: none;
  color: var(--primary-color, #2ea043);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  margin-top: auto; /* Always aligns at the bottom of the card */
  font-weight: bold;
  transition: color 0.2s;
}

.project-card .btn-link:hover {
  color: #ffffff;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.experiment-card {
  background: var(--card-bg, #1a1e29);
  border: 1px solid var(--border-color, #2ea043);
  border-radius: 6px;
  padding: 20px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.experiment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(46, 160, 67, 0.2);
}
.experiment-card h4 {
  color: var(--primary-color, #2ea043);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.experiment-card p {
  font-size: 0.9rem;
  color: var(--text-secondary, #8b949e);
  flex-grow: 1;
  margin-bottom: 20px;
  line-height: 1.5;
}
.experiment-link {
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  background: var(--primary-color, #2ea043);
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
  transition: background 0.2s;
  font-family: 'Share Tech Mono', monospace;
}
.experiment-link:hover {
  background: #238636;
  color: #ffffff;
}

/* Former inline styles on the OmNet card and experiments intro */
.project-image-img {
  width: 100%;
  border-radius: 4px;
  transition: 0.3s;
}

.plain-link {
  text-decoration: none;
  color: inherit;
}

.pill-row {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-link {
  padding: 5px 15px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.3s;
  display: inline-block;
}

.pill-primary {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.pill-secondary {
  border: 1px solid var(--secondary-color, #00a8ff);
  color: var(--secondary-color, #00a8ff);
}

.muted-lead {
  color: var(--text-secondary);
}

/* HPC Field Manual teaser */
#field-manual h3 {
  text-align: center;
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 15px;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 35px;
}

.manual-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 40px;
}

.manual-strip a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-tech);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.manual-strip a i {
  color: var(--primary);
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
  transition: color 0.3s ease;
}

.manual-strip a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

.manual-strip a:hover i {
  color: var(--accent);
}

/* Footer / Contact */
footer {
  border-top: 1px solid var(--border-color);
}

footer h3 {
  color: var(--accent);
  margin-bottom: 30px;
}

.social-links {
  margin: 30px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.2rem;
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  transition: all 0.3s;
  background: var(--bg-surface-alt);
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-links a:hover {
  color: var(--bg-deep);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 50px;
  font-family: var(--font-tech);
}

.subtle-link {
  color: inherit;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.subtle-link:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .manual-strip {
    grid-template-columns: 1fr 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero h2 {
    font-size: 1.3rem;
  }
  .cta-buttons .btn {
    display: block;
    margin: 10px auto;
    max-width: 250px;
  }
}

.ai-timeline {
  list-style: none;
  margin: 0 auto;
  max-width: 820px;
  padding: 0;
}

.ai-timeline li {
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 6px 0 12px 16px;
}

.ai-timeline strong {
  display: inline-block;
  margin-right: 8px;
  min-width: 3em;
}

.ai-timeline strong {
  color: var(--accent);
}

.ai-timeline a {
  color: var(--accent);
  font-size: 0.9em;
  margin-left: 4px;
  text-decoration: underline;
  white-space: nowrap;
}

.ai-timeline a:hover,
.ai-timeline a:focus {
  color: #fff;
}

/* Project cards with a project page and a repo link */
.project-card .card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: auto;
}

.project-card .card-links .btn-link {
  margin-top: 0;
}

/* Currently promoted project band */
.promoted {
  padding: 56px 20px;
}
.promoted-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.promoted-media {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}
.promoted-media img {
  display: block;
  width: 100%;
  height: auto;
}
.promoted-play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 17, 13, 0.85);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.promoted-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 6px;
}
.promoted-text h3 {
  margin-top: 0;
  text-align: left;
}
@media (max-width: 860px) {
  .promoted-grid {
    grid-template-columns: 1fr;
  }
}
