/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bp-bg: #0b1628;
  --bp-grid: rgba(60, 120, 200, 0.07);
  --bp-grid-major: rgba(60, 120, 200, 0.13);
  --bp-line: rgba(100, 180, 255, 0.25);
  --bp-text: rgba(180, 210, 240, 0.85);
  --bp-muted: rgba(120, 160, 200, 0.45);
  --bp-bright: rgba(220, 235, 255, 0.95);
  --bp-accent: rgba(100, 180, 255, 0.7);
  --bp-card: rgba(10, 25, 50, 0.7);
  --bp-border: rgba(60, 120, 200, 0.2);

  --green: #34d399;
  --yellow: #fbbf24;
  --blue: #6366f1;
  --red: #ef4444;

  --hand: 'Architects Daughter', cursive;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bp-bg);
  color: var(--bp-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Graph paper background */
  background-image:
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px),
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px;
  background-attachment: fixed;
}

/* === NAV === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: rgba(11, 22, 40, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bp-border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; }

.brand {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--bp-bright);
  white-space: nowrap;
}

.brand .accent { margin-left: 0; }

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-right a {
  font-family: var(--hand);
  font-size: 0.9rem;
  color: var(--bp-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.topbar-right a:hover { color: var(--bp-bright); }

.nav-cta {
  color: var(--bp-accent) !important;
  border: 1px solid var(--bp-accent);
  padding: 4px 14px;
  border-radius: 2px;
}

.nav-cta:hover {
  background: rgba(100, 180, 255, 0.1);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--bp-text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* === HERO === */
.hero {
  padding: 10rem 2rem 5rem;
  text-align: center;
  position: relative;
}

.blueprint-stamp {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--bp-muted);
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.hero-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 24px rgba(100, 180, 255, 0.25));
}

.hero h1 {
  font-family: var(--hand);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--bp-bright);
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--bp-text);
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.hero-coords {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-coords span {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--bp-muted);
}

/* === SECTIONS === */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.label-line {
  flex: 1;
  height: 1px;
  background: var(--bp-border);
}

.label-text {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--bp-accent);
  white-space: nowrap;
}

/* === SCHEMATIC / NODE MAP === */
.schematic-container {
  position: relative;
  min-height: 620px;
}

.connection-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.node-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 1.5rem;
  min-height: 620px;
  align-content: start;
}

/* Position nodes to roughly align with SVG dots */
.node-pos-1 { grid-column: 1; grid-row: 1; }
.node-pos-2 { grid-column: 2; grid-row: 1; }
.node-pos-3 { grid-column: 1; grid-row: 2; }
.node-pos-4 { grid-column: 1; grid-row: 3; justify-self: center; }
.node-pos-5 { grid-column: 2; grid-row: 2 / 4; align-self: start; }

/* === NODE CARDS === */
.node-card {
  background: var(--bp-card);
  border: 1px solid var(--bp-border);
  border-radius: 2px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  transition: border-color 0.3s;
}

/* Corner tick marks — blueprint feel */
.node-card::before,
.node-card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--bp-line);
  border-style: solid;
}

.node-card::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.node-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

.node-card:hover { border-color: var(--bp-accent); }

.node-classified { border-color: rgba(239, 68, 68, 0.2); }
.node-classified:hover { border-color: rgba(239, 68, 68, 0.4); }
.node-classified::before,
.node-classified::after { border-color: rgba(239, 68, 68, 0.3); }

.node-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot-blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 2s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.node-status {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--bp-muted);
  text-transform: uppercase;
}

.status-red { color: var(--red); }

.node-id {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--bp-muted);
  opacity: 0.5;
}

.node-card h3 {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--bp-bright);
}

.redacted-name {
  font-family: var(--mono) !important;
  letter-spacing: 0.05em;
}

.node-type {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--bp-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.node-desc {
  font-size: 0.82rem;
  color: var(--bp-text);
  line-height: 1.5;
}

.node-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.node-tags span {
  font-family: var(--mono);
  font-size: 0.55rem;
  padding: 2px 8px;
  border: 1px solid var(--bp-border);
  color: var(--bp-muted);
  border-radius: 1px;
}

.tag-red {
  color: var(--red) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.node-bar {
  height: 3px;
  background: rgba(60, 120, 200, 0.1);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.bar-fill { height: 100%; border-radius: 1px; }
.fill-green { background: var(--green); }
.fill-yellow { background: var(--yellow); }
.fill-blue { background: var(--blue); }
.fill-red { background: var(--red); }

.nda-link {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--red);
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color 0.2s;
}

.nda-link:hover { color: var(--bp-bright); }

.redacted {
  background: var(--red);
  color: var(--red);
  padding: 0 3px;
  border-radius: 1px;
  user-select: none;
  font-family: var(--mono);
  font-size: 0.8em;
}

/* Legend */
.schematic-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.schematic-legend span {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--bp-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dash {
  border-top: 1px dashed var(--bp-line);
  padding-top: 0;
}

/* === NOTES CARD (ABOUT) === */
.notes-card {
  display: flex;
  border: 1px solid var(--bp-border);
  border-radius: 2px;
  overflow: hidden;
  background: var(--bp-card);
}

.note-margin {
  width: 60px;
  min-width: 60px;
  background: rgba(60, 120, 200, 0.03);
  border-right: 1px solid rgba(200, 80, 80, 0.2);
  padding: 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.note-margin span {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--bp-muted);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.1em;
}

.note-content {
  padding: 1.5rem;
  flex: 1;
}

.note-content h2 {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--bp-bright);
  margin-bottom: 1rem;
}

.note-content p {
  font-size: 0.9rem;
  color: var(--bp-text);
  margin-bottom: 0.75rem;
  line-height: 1.65;
}

.note-annotation {
  font-family: var(--hand);
  color: var(--bp-accent) !important;
  font-size: 0.95rem !important;
  margin-top: 1rem !important;
}

.note-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bp-border);
}

.note-stat { display: flex; flex-direction: column; }

.ns-num {
  font-family: var(--hand);
  font-size: 2rem;
  color: var(--bp-accent);
}

.ns-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--bp-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === SERVICES === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.service-card {
  border: 1px solid var(--bp-border);
  border-radius: 2px;
  padding: 1.5rem;
  background: var(--bp-card);
  position: relative;
  transition: border-color 0.3s;
}

.service-card:hover { border-color: var(--bp-accent); }

.service-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--bp-line);
  border-left: 1px solid var(--bp-line);
}

.service-num {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--bp-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.service-card h3 {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--bp-bright);
  margin-bottom: 0.4rem;
}

.service-card p {
  font-size: 0.82rem;
  color: var(--bp-muted);
  line-height: 1.5;
}

/* === TEAM === */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.team-card {
  border: 1px solid var(--bp-border);
  border-radius: 2px;
  padding: 1.5rem;
  background: var(--bp-card);
}

.team-badge {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--bp-muted);
}

.badge-priority { color: var(--bp-accent); }

.team-card h3 {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--bp-bright);
  margin: 0.4rem 0;
}

.team-card p {
  font-size: 0.82rem;
  color: var(--bp-muted);
}

/* === CONTACT === */
.contact-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--bp-muted);
  margin-bottom: 2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.contact-card {
  display: block;
  border: 1px solid var(--bp-border);
  border-radius: 2px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  text-align: center;
  background: var(--bp-card);
  transition: all 0.2s;
  position: relative;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--bp-line);
  border-left: 1px solid var(--bp-line);
}

.contact-card:hover {
  border-color: var(--bp-accent);
  transform: translateY(-2px);
}

.contact-type {
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--bp-accent);
  display: block;
  margin-bottom: 0.3rem;
}

.contact-card p {
  font-size: 0.82rem;
  color: var(--bp-muted);
}

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--bp-border);
  padding: 2rem;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

.footer p {
  font-size: 0.7rem;
  color: var(--bp-muted);
  margin-bottom: 0.3rem;
}

.footer-rev {
  font-family: var(--mono);
  font-size: 0.55rem !important;
  letter-spacing: 0.15em;
  opacity: 0.4;
  margin-top: 0.5rem !important;
}

/* === MOBILE === */
@media (max-width: 768px) {
  .topbar-right {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(11, 22, 40, 0.97);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--bp-border);
  }

  .topbar-right.open { display: flex; }
  .mobile-toggle { display: block; }

  .hero { padding: 8rem 1.5rem 3rem; }

  .section { padding: 3rem 1.25rem; }

  /* Flatten the node grid on mobile */
  .schematic-container { min-height: auto; }
  .connection-lines { display: none; }

  .node-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: auto;
  }

  .note-margin { display: none; }

  .services-grid,
  .team-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .note-stats { flex-wrap: wrap; gap: 1.5rem; }
}
