@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   BASE
   ============================================================ */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #0f0f0f;
  color: #c8f7da;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* CSS-only scanline overlay for CRT/matrix aesthetic */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.025) 3px,
    rgba(0, 0, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

/* ============================================================
   HEADINGS
   ============================================================ */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  margin-top: 2rem;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

h1 {
  color: #39d96c;
  font-size: 2.3rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
}

h2 {
  color: #66ffcc;
  font-size: 1.45rem;
  font-weight: 500;
  border-bottom: 1px solid #2da67b;
  padding-bottom: 0.5rem;
  margin-top: 3.5rem;
}

h3 {
  color: #4ecba3;
  font-size: 1.15rem;
  font-weight: 500;
}

h4 {
  color: #3aab89;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

/* ============================================================
   BODY TEXT
   ============================================================ */
p {
  margin: 0.85rem 0;
  max-width: 70ch;
  color: #c8f7da;
}

p.tagline {
  color: #a0e8c8;
  font-size: 1rem;
  max-width: 68ch;
  line-height: 1.8;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

p.updated {
  text-align: center;
  font-size: 0.85rem;
  color: #4ecba3;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}

/* ============================================================
   LINKS
   ============================================================ */
a {
  color: #66ffcc;
  text-decoration: none;
  border-bottom: 1px dotted rgba(102, 255, 204, 0.4);
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:visited {
  color: #66ffcc;
}

a:hover {
  color: #0f0f0f;
  background-color: #66ffcc;
  border-bottom-color: transparent;
  border-radius: 2px;
}

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.toc {
  margin: 2rem auto;
  background-color: #111111;
  border: 1px solid #2da67b;
  border-radius: 6px;
  padding: 1.5rem 2rem;
}

.toc h3 {
  text-align: center;
  color: #39d96c;
  margin-top: 0;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc li {
  margin: 0.3rem 0;
}

.toc a {
  color: #a0e8c8;
  text-decoration: none;
  display: inline-block;
  border-bottom: none;
  transition: all 0.15s ease;
}

.toc a:hover {
  color: #0f0f0f;
  background: #66ffcc;
  padding-left: 6px;
  border-radius: 3px;
}

/* ============================================================
   INLINE CODE
   ============================================================ */
code {
  background: #111;
  border: 1px solid #1a3d2e;
  border-radius: 3px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  color: #7dffc4;
  text-shadow: none;
}

/* ============================================================
   LISTS
   ============================================================ */
ul, ol {
  margin: 1rem 0 1.5rem 1rem;
  padding-left: 1.2rem;
  color: #c8f7da;
}

li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

/* ============================================================
   TOPOLOGY DIAGRAM (Part 1 - interfaces)
   ============================================================ */
.topology {
  margin: 2.5rem 0 3rem;
}

.topo-root {
  display: flex;
  justify-content: center;
}

.topo-firewall {
  border: 1px solid #39d96c;
  border-radius: 8px;
  background: #111111;
  padding: 0.9rem 1.9rem;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  color: #39d96c;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.topo-firewall small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  color: #4ecba3;
  font-size: 0.72rem;
  margin-top: 0.3rem;
  letter-spacing: 0.03em;
}

.topo-trunk {
  width: 1px;
  height: 1.75rem;
  background: #2da67b;
  margin: 0 auto;
}

.topo-zones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid #2da67b;
  margin: 0 auto;
}

.topo-zone {
  flex: 1 1 165px;
  max-width: 200px;
  padding: 1.5rem 0.5rem 0;
  position: relative;
  display: flex;
}

.topo-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 1.5rem;
  background: #2da67b;
}

.zone-box {
  border: 1px solid #2da67b;
  border-radius: 6px;
  background: #111111;
  padding: 0.85rem 0.9rem;
  text-align: center;
  width: 100%;
}

.zone-box h4 {
  margin: 0 0 0.35rem;
  color: #3aab89;
  font-size: 0.92rem;
}

.zone-box .cidr {
  display: block;
  font-size: 0.76rem;
  color: #7dffc4;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.zone-box p {
  margin: 0;
  font-size: 0.78rem;
  color: #a0e8c8;
  line-height: 1.55;
  max-width: none;
}

.zone-box.restricted {
  border-color: #ffd666;
}

.zone-box.restricted h4 {
  color: #ffd666;
}

.zone-box.wan {
  border-style: dashed;
}

.zone-box.meta {
  border-style: dotted;
}

/* Mobile fallback: drop the bus/tree lines, use a simple left-border list */
@media (max-width: 700px) {
  .topo-zones {
    display: block;
    border-top: none;
    border-left: 1px solid #2da67b;
    padding-left: 1rem;
    max-width: 320px;
  }
  .topo-zone {
    max-width: 100%;
    padding: 0 0 1.2rem 0.75rem;
  }
  .topo-zone::before {
    top: 0.9rem;
    left: -1rem;
    transform: none;
    width: 1rem;
    height: 1px;
  }
}

/* ============================================================
   SERVICE GRID (Part 2 - services)
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}

.service-card {
  border: 1px solid #2da67b;
  border-radius: 6px;
  background: #111111;
  padding: 1.1rem 1.2rem;
}

.service-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.service-head h4 {
  margin: 0;
}

.service-meta {
  font-size: 0.78rem;
  color: #4ecba3;
  margin: 0.2rem 0 0.6rem;
  letter-spacing: 0.02em;
}

.service-card p {
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0.4rem 0 0;
  max-width: none;
}

.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.status-active {
  color: #39d96c;
  border: 1px solid #1e6b54;
}

.status-disabled {
  color: #ffd666;
  border: 1px solid #6b5a1e;
}

.status-fixed {
  color: #66ffcc;
  border: 1px solid #1b664d;
}

/* ============================================================
   ENTRY-STYLE CARDS (Part 3 - audit narrative)
   ============================================================ */
.entry {
  background-color: #111111;
  border-left: 3px solid #2da67b;
  border-radius: 6px;
  padding: 1.75rem 2rem;
  margin: 2rem auto;
}

.entry.backlog {
  border-left-color: #ffd666;
}

/* ============================================================
   NAVIGATION BUTTONS
   ============================================================ */
.nav-buttons {
  text-align: center;
  margin: 2rem 0;
}

.nav-buttons a {
  display: inline-block;
  margin: 0.25rem 0.4rem;
  padding: 0.4rem 1rem;
  border: 1px solid #2da67b;
  color: #a0e8c8;
  background-color: transparent;
  text-decoration: none;
  border-bottom: 1px solid #2da67b;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.nav-buttons a:hover {
  background-color: #2da67b;
  color: #0f0f0f;
  border-color: #2da67b;
  opacity: 1;
}

/* ============================================================
   BACK ARROW (sticky)
   ============================================================ */
.back-arrow {
  position: sticky;
  top: 1rem;
  left: 0.5rem;
  display: inline-block;
  font-size: 0.9rem;
  color: #a0e8c8;
  text-decoration: none;
  border: 1px solid #2da67b;
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  background-color: transparent;
  font-family: 'JetBrains Mono', monospace;
  z-index: 1000;
  transition: all 0.2s ease;
}

.back-arrow:hover {
  background-color: #2da67b;
  color: #0f0f0f;
  border-color: #2da67b;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  font-size: 0.82rem;
  color: #2da67b;
  padding: 2rem 0;
  border-top: 1px solid #1a3d2e;
  letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  body {
    font-size: 0.97rem;
  }
  .back-arrow {
    left: 0.4rem;
  }
  .entry {
    padding: 1.2rem 1.1rem;
  }
  h1 {
    font-size: 1.7rem;
  }
}
