/* =========================================
   Design 2: Blueprint / Technical Schematic
   White-on-blue engineering blueprint paper
========================================= */

@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --blue-deep: #0e2a47;
  --blue-mid: #153d6b;
  --blue-grid: #1b4f8a;
  --blue-light: #2b6fc2;
  --white: #e8f0ff;
  --white-bright: #ffffff;
  --yellow: #ffd666;
  --yellow-dim: #c4a84d;
  --red-mark: #ff6b6b;
  --grid-line: rgba(43, 111, 194, 0.25);
  --grid-line-major: rgba(43, 111, 194, 0.45);

  --font-display: "Courier Prime", monospace;
  --font-body: "IBM Plex Sans", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--blue-deep);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  /* Blueprint grid background */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-major) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px;
  background-position: -1px -1px;
}

::selection {
  background: var(--yellow);
  color: var(--blue-deep);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--blue-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--blue-grid);
  border-radius: 0;
}

/* === FOLD CREASE EFFECT === */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 20%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1000;
}

/* === TOP TITLE BAR === */
.blueprint-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--blue-deep);
  border-bottom: 2px solid var(--blue-light);
  padding: 0.6rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.blueprint-header .title-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.blueprint-header .doc-id {
  color: var(--yellow);
  font-weight: 700;
}

.blueprint-header .doc-title {
  color: var(--white);
}

.blueprint-header .nav-links {
  display: flex;
  gap: 1.5rem;
}

.blueprint-header .nav-links a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.6;
  transition: all 0.3s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.blueprint-header .nav-links a:hover {
  opacity: 1;
  border-bottom-color: var(--yellow);
  color: var(--yellow);
}

/* === MAIN CONTAINER === */
.blueprint-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 3rem 4rem;
}

/* === SECTION BLOCKS === */
.bp-section {
  margin-bottom: 5rem;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.bp-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === DETAIL VIEW LABEL (like a blueprint callout) === */
.detail-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--yellow);
  border: 1px solid var(--yellow-dim);
  display: inline-block;
  padding: 0.3rem 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.detail-label::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 50%;
  width: 15px;
  height: 1px;
  background: var(--yellow-dim);
}

/* === SECTION TITLE === */
.bp-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  color: var(--white-bright);
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 1rem;
}

.bp-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--yellow);
}

/* === TEXT === */
.bp-text {
  color: rgba(232, 240, 255, 0.8);
  max-width: 720px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.bp-text strong {
  color: var(--yellow);
  font-weight: 600;
}

.bp-text code {
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 0.85rem;
  background: rgba(255, 214, 102, 0.1);
  padding: 0.1rem 0.4rem;
}

/* === HERO === */
.hero-section {
  text-align: center;
  padding: 5rem 0 3rem;
}

.hero-section .bp-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 6px;
}

.hero-section .bp-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.hero-section .bp-text {
  margin: 0 auto;
  text-align: center;
}

.hero-stamp {
  display: inline-block;
  margin-top: 2rem;
  border: 3px solid var(--red-mark);
  color: var(--red-mark);
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  transform: rotate(-3deg);
  opacity: 0.8;
}

/* === ARCHITECTURE SVG DIAGRAM === */
.arch-diagram-container {
  border: 1px solid var(--blue-light);
  padding: 2.5rem;
  margin: 2rem 0;
  position: relative;
  background: rgba(14, 42, 71, 0.6);
}

.arch-diagram-container::before {
  content: "SYSTEM ARCHITECTURE — TOP VIEW";
  position: absolute;
  top: -0.6rem;
  left: 1.5rem;
  background: var(--blue-deep);
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--yellow-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.arch-nodes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
  margin-top: 1rem;
}

.arch-node {
  border: 1px solid var(--blue-light);
  padding: 1.2rem;
  text-align: center;
  position: relative;
  transition: all 0.4s ease;
}

.arch-node:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 214, 102, 0.1);
}

.arch-node .node-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 0.3rem;
}

.arch-node .node-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white-bright);
  margin-bottom: 0.5rem;
}

.arch-node .node-desc {
  font-size: 0.75rem;
  color: rgba(232, 240, 255, 0.6);
  line-height: 1.5;
}

/* connector arrows between nodes */
.arch-connector {
  text-align: center;
  color: var(--yellow-dim);
  font-family: var(--font-display);
  font-size: 0.7rem;
  padding: 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  grid-column: 1 / -1;
}

.arch-connector .line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--blue-light) 0px,
    var(--blue-light) 8px,
    transparent 8px,
    transparent 14px
  );
}

/* === SERVICE DETAIL CARDS === */
.service-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.service-detail-card {
  border: 1px solid var(--blue-light);
  padding: 2rem;
  position: relative;
  background: rgba(14, 42, 71, 0.4);
  transition: all 0.4s ease;
}

.service-detail-card:hover {
  border-color: var(--blue-light);
  background: rgba(27, 79, 138, 0.2);
}

.service-detail-card .card-ref {
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background: var(--blue-deep);
  padding: 0 0.4rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--yellow);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.service-detail-card .card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white-bright);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.service-detail-card .card-text {
  font-size: 0.85rem;
  color: rgba(232, 240, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.service-detail-card .card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-spec-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(43, 111, 194, 0.5);
  color: var(--blue-light);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* === CALCULATION SECTION === */
.calc-card {
  border: 1px solid var(--blue-light);
  padding: 2rem;
  margin: 1.5rem 0;
  position: relative;
  background: rgba(14, 42, 71, 0.4);
}

.calc-card::before {
  content: attr(data-ref);
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  background: var(--blue-deep);
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--red-mark);
  letter-spacing: 2px;
}

.calc-card .calc-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
}

.calc-card .formula-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--yellow);
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white-bright);
  letter-spacing: 1px;
}

.calc-card .calc-text {
  font-size: 0.85rem;
  color: rgba(232, 240, 255, 0.7);
  line-height: 1.7;
}

.calc-card .calc-text em {
  color: var(--yellow);
  font-style: normal;
}

/* === DATA FLOW PIPELINE === */
.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2rem 0;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem 0;
  position: relative;
}

.pipeline-step::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 3.5rem;
  bottom: -1rem;
  width: 1px;
  background: repeating-linear-gradient(
    180deg,
    var(--blue-light) 0px,
    var(--blue-light) 6px,
    transparent 6px,
    transparent 12px
  );
}

.pipeline-step:last-child::before {
  display: none;
}

.pipeline-num {
  width: 38px;
  height: 38px;
  border: 2px solid var(--blue-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--yellow);
  flex-shrink: 0;
  background: var(--blue-deep);
  position: relative;
  z-index: 2;
}

.pipeline-content .step-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--white-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.pipeline-content .step-desc {
  font-size: 0.85rem;
  color: rgba(232, 240, 255, 0.65);
  line-height: 1.6;
}

/* === SSE / LIVE SECTION === */
.sse-visualization {
  border: 1px solid var(--blue-light);
  padding: 2rem;
  margin: 1.5rem 0;
  background: rgba(14, 42, 71, 0.4);
  position: relative;
}

.sse-visualization::before {
  content: "LIVE DATA FEED — EVENT STREAM";
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background: var(--blue-deep);
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--red-mark);
  letter-spacing: 2px;
}

.sse-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--red-mark);
}

.sse-live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-mark);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
  }
}

.sse-log {
  background: rgba(0, 0, 0, 0.4);
  padding: 1.2rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  max-height: 260px;
  overflow: hidden;
  position: relative;
}

.sse-log::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, rgba(14, 42, 71, 0.95));
}

.sse-log-line {
  margin-bottom: 0.25rem;
  opacity: 0;
  animation: logFadeIn 0.4s forwards;
}

.sse-log-line .time {
  color: rgba(232, 240, 255, 0.4);
}
.sse-log-line .event {
  color: var(--yellow);
}
.sse-log-line .data {
  color: rgba(232, 240, 255, 0.7);
}
.sse-log-line .coords {
  color: var(--white-bright);
}

@keyframes logFadeIn {
  to {
    opacity: 1;
  }
}

/* === SPECS TABLE === */
.specs-grid {
  border: 1px solid var(--blue-light);
  margin-top: 2rem;
  position: relative;
}

.specs-grid::before {
  content: "SPECIFICATION TABLE — REV. 3.2";
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background: var(--blue-deep);
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--yellow-dim);
  letter-spacing: 2px;
}

.specs-row {
  display: flex;
  border-bottom: 1px solid rgba(43, 111, 194, 0.2);
}

.specs-row:last-child {
  border-bottom: none;
}

.specs-row:hover {
  background: rgba(43, 111, 194, 0.08);
}

.specs-key {
  flex: 0 0 40%;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--yellow-dim);
  letter-spacing: 1px;
  border-right: 1px solid rgba(43, 111, 194, 0.2);
}

.specs-val {
  flex: 1;
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  color: rgba(232, 240, 255, 0.8);
}

/* === FOOTER === */
.blueprint-footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 2px solid var(--blue-light);
  margin-top: 3rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: rgba(232, 240, 255, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .blueprint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
  }

  .blueprint-header .nav-links {
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.7rem;
  }

  .blueprint-main {
    padding: 5.5rem 1.2rem 2rem;
  }

  .hero-section .bp-title {
    font-size: clamp(1.8rem, 8vw, 3rem);
    letter-spacing: 3px;
  }

  .arch-nodes {
    grid-template-columns: 1fr;
  }

  .service-details {
    grid-template-columns: 1fr;
  }

  .pipeline-step {
    gap: 1rem;
  }

  .specs-row {
    flex-direction: column;
  }

  .specs-key {
    border-right: none;
    border-bottom: 1px solid rgba(43, 111, 194, 0.15);
  }
}
