:root {
  --bg-deep: #0a110d;
  --bg-surface: #132219;
  --bg-surface-alt: #172a1f;
  --primary: #3c6e47;
  --primary-glow: rgba(60, 110, 71, 0.4);
  --accent: #d4b886;
  --accent-glow: rgba(212, 184, 134, 0.3);
  --text-main: #e4ebe6;
  --text-muted: #8a9e91;
  --border-color: #2a4232;
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-tech: 'Courier New', Courier, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

h1,
h2,
h3,
h4 {
  color: var(--text-main);
  letter-spacing: 0.5px;
  line-height: 1.25;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--text-main);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

code {
  font-family: var(--font-tech);
  font-size: 0.92em;
  color: var(--accent);
  background: rgba(212, 184, 134, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

pre {
  margin: 12px 0;
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-main);
  font-size: 0.88rem;
  white-space: pre;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--bg-deep);
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top bar */
.topbar {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-color);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-tech);
  font-size: 0.9rem;
}

.brand {
  color: var(--text-main);
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 1px;
}

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

.topbar-sep {
  color: var(--border-color);
  margin: 0 8px;
}

.topbar-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
}

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

/* Section nav */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 17, 13, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.nav-inner a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: color 0.2s, border-color 0.2s;
}

.nav-inner a:hover {
  color: var(--accent);
  border-color: var(--border-color);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 90px 0 80px;
  border-bottom: 1px solid var(--border-color);
  background:
    linear-gradient(90deg, rgba(10, 17, 13, 0.95) 0%, rgba(14, 26, 20, 0.86) 50%, rgba(19, 34, 25, 0.78) 100%),
    url('https://charles-forsyth.github.io/assets/hero-ai-network.jpg') center / cover no-repeat,
    linear-gradient(160deg, var(--bg-deep), var(--bg-surface));
}

.hero::before {
  content: '';
  position: absolute;
  inset: 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.18;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.kicker {
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 12px;
}

.hero h1 {
  font-size: 3.2rem;
  margin: 0 0 12px;
  text-shadow: 0 0 20px var(--primary-glow);
}

.tagline {
  font-family: var(--font-tech);
  color: var(--accent);
  font-size: 1.15rem;
  margin: 0 0 18px;
}

.pitch {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin: 0 0 28px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-family: var(--font-tech);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

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

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

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

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

/* Terminal */
.terminal {
  margin: 0;
  min-width: 0;
  background: rgba(10, 17, 13, 0.92);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 18px var(--primary-glow);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
}

.dot:first-child {
  background: var(--primary);
}

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-body {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 16px;
}

.terminal-body code {
  font-size: 0.76rem;
  color: #c9d6cd;
}

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

.terminal-note {
  margin: 0;
  padding: 0 16px 12px;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Stats */
.stats-strip {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 26px 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-n {
  font-family: var(--font-tech);
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  line-height: 1.1;
}

.stat-l {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 80px 0;
  background: var(--bg-deep);
}

.section-alt {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section h2 {
  font-size: 2.1rem;
  margin: 0 0 14px;
}

.label {
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 8px;
}

.lead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 780px;
  margin: 0 0 32px;
}

.sub {
  font-size: 1.35rem;
  margin: 48px 0 18px;
  color: var(--accent);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.cards-3 {
  margin-top: 36px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.section-alt .card {
  background: var(--bg-deep);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.card-icon {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1.12rem;
  margin: 0 0 10px;
}

.card p {
  color: var(--text-muted);
  margin: 0 0 14px;
  flex-grow: 1;
}

.card-link {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.card-link:hover {
  text-decoration: underline;
}

/* Benefits */
.benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.benefits li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--text-muted);
  padding: 10px 14px;
  border-left: 2px solid var(--primary);
  background: rgba(23, 42, 31, 0.5);
}

.benefits i {
  color: var(--accent);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Architecture */
.arch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.arch-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: 6px;
  padding: 16px;
  min-width: 0;
}

.arch-hpcc,
.arch-aws {
  border-top-color: var(--accent);
}

.arch-box p {
  margin: 0;
}

.arch-tag {
  font-family: var(--font-tech);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.72rem;
  color: var(--accent);
}

.arch-title {
  font-weight: bold;
  margin: 6px 0 8px;
  overflow-wrap: anywhere;
}

.arch-body {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-color);
}

.step {
  position: relative;
  padding: 0 0 26px 56px;
  min-width: 0;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: -56px;
}

.step-n {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-deep);
  color: var(--accent);
  font-family: var(--font-tech);
  font-weight: bold;
}

.step h4 {
  margin: 0;
  font-size: 1.12rem;
  margin-left: 6px;
}

.step p {
  color: var(--text-muted);
  margin: 10px 0;
}

.step .step-src {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  margin: 6px 0 0;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.shot {
  margin: 0;
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.shot:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.shot a {
  display: block;
  background: #ffffff;
}

.shot img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: top left;
}

.shot figcaption {
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.shot-step {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
}

/* Tag cloud */
.tag-cloud {
  list-style: none;
  padding: 24px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.tag {
  display: inline-block;
  font-family: var(--font-tech);
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px 12px;
  background: var(--bg-deep);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.tag.t0 {
  font-size: 0.8rem;
  color: var(--text-muted);
  border-style: dashed;
}

.tag.t1 {
  font-size: 0.9rem;
}

.tag.t2 {
  font-size: 1.1rem;
}

.tag.t3 {
  font-size: 1.3rem;
  font-weight: bold;
}

.tag-feat {
  color: var(--accent);
  border-color: rgba(212, 184, 134, 0.5);
}

/* Workshop */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.split-gap {
  margin-top: 40px;
  align-items: stretch;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--text-main);
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-deep);
}

.file-chip i {
  color: var(--accent);
}

.file-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.code-fig {
  margin: 0;
  min-width: 0;
}

.code-fig figcaption {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.archive {
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 26px;
}

.archive-icon {
  font-size: 1.8rem;
  color: var(--accent);
}

.archive h3 {
  margin: 10px 0 8px;
}

.archive p {
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* Timeline chart */
.chart-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
  padding: 24px 18px 12px;
}

.chart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 620px;
  height: 230px;
}

.bar-col {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 36px;
}

.bar {
  position: relative;
  display: block;
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 3px 3px 0 0;
}

.bar.h0 {
  background: var(--border-color);
}

.bar-n {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--text-main);
}

.bar-lab {
  position: absolute;
  bottom: 16px;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bar-year {
  position: absolute;
  bottom: 0;
  left: 0;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--accent);
}

.bar.h0 { height: 4px; }
.bar.h1 { height: 12px; }
.bar.h2 { height: 20px; }
.bar.h3 { height: 29px; }
.bar.h4 { height: 37px; }
.bar.h5 { height: 45px; }
.bar.h6 { height: 53px; }
.bar.h7 { height: 61px; }
.bar.h8 { height: 70px; }
.bar.h9 { height: 78px; }
.bar.h10 { height: 86px; }
.bar.h11 { height: 94px; }
.bar.h12 { height: 103px; }
.bar.h13 { height: 111px; }
.bar.h14 { height: 119px; }
.bar.h15 { height: 127px; }
.bar.h16 { height: 135px; }
.bar.h17 { height: 144px; }
.bar.h18 { height: 152px; }
.bar.h19 { height: 160px; }

.milestones {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
}

.milestones li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}

.ms-date {
  font-family: var(--font-tech);
  color: var(--accent);
  font-size: 0.9rem;
}

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

/* Links */
.link-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text-main);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.link-card i {
  color: var(--accent);
  font-size: 1.2rem;
  width: 22px;
  text-align: center;
}

.link-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.note {
  margin: 28px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  text-align: center;
  background: var(--bg-deep);
}

.footer p {
  margin: 4px 0;
  color: var(--text-main);
}

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

.footer .footer-note {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

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

  .arch-arrow i {
    transform: rotate(90deg);
  }

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

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

@media (max-width: 640px) {
  .hero {
    padding: 56px 0 50px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .section {
    padding: 56px 0;
  }

  .section h2 {
    font-size: 1.6rem;
  }

  .cards,
  .benefits,
  .gallery,
  .milestones,
  .link-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .stat:last-child {
    grid-column: 1 / -1;
  }

  .shot img {
    height: auto;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .tag-cloud {
    padding: 16px;
  }

  .step {
    padding-left: 48px;
  }

  .step-head {
    margin-left: -48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .card:hover {
    transform: none;
  }
}
