/* =========================
   Design Tokens
   ========================= */

:root {
  --bg: #0f1220;
  --fg: #e6e6eb;
  --accent: #ffa412;
  --muted: #a0a4c0;
  --border: #2a2d4d;
}

/* =========================
   Global Reset & Base
   ========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 0, 170, 0.08), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(0, 200, 255, 0.06), transparent 60%),
    linear-gradient(180deg, #0b0e1a 0%, #0f1220 40%, #0b0e1a 100%);

  color: var(--fg);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;

  background-image:
    linear-gradient(
      rgba(255, 0, 170, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(0, 200, 255, 0.04) 1px,
      transparent 1px
    );

  background-size: 120px 120px;
  opacity: 0.15;
}

.content,
.site-header,
.site-footer {
  background: linear-gradient(
    180deg,
    rgba(15, 18, 32, 0.85),
    rgba(15, 18, 32, 0.9)
  );
  backdrop-filter: blur(2px);
}

.structural-axiom {
  font-style: italic;
  opacity: 0.9;
}

.nav-btn,
.collapse-btn,
.back-btn {
  box-shadow:
    0 0 0 rgba(255, 164, 18, 0),
    inset 0 0 0 rgba(255, 164, 18, 0);
}

.nav-btn:hover,
.collapse-btn:hover,
.back-btn:hover {
  box-shadow:
    0 0 12px rgba(255, 164, 18, 0.25),
    inset 0 0 8px rgba(255, 164, 18, 0.15);
}

.site-header,
.site-footer,
.accordion {
  position: relative;
  border: none;
}

.site-header::after,
.accordion::after {
  content: "";
  display: block;
  height: 3px; 
  margin-top: 1.5rem;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 0, 170, 0.6),
    rgba(0, 200, 255, 0.6),
    transparent
  );

  box-shadow:
    0 0 12px rgba(255, 0, 170, 0.35),
    0 0 16px rgba(0, 200, 255, 0.25);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  margin-bottom: 1.5rem;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 0, 170, 0.6),
    rgba(0, 200, 255, 0.6),
    transparent
  );

  box-shadow:
    0 0 12px rgba(255, 0, 170, 0.35),
    0 0 16px rgba(0, 200, 255, 0.25);
}

main {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.subtitle {
  margin-top: 0.75rem;
  line-height: 1.5;
}

.subtitle-tagline {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.subtitle-description {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--fg);
}

.subtitle-meta {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.subtitle-tagline {
  text-transform: uppercase;
}

.version-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.version-table th,
.version-table td {
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.75rem;
  vertical-align: top;
}

.version-table th {
  background: rgba(255,255,255,0.05);
  font-weight: 600;
}

/* =========================
   Crew Page 
   ========================= */
.crew-diagram {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  max-height: 70vh;   
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
}

.crew-diagram {
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
}

.crew-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* Sections */
.crew-section {
  margin: 2rem 0;
  text-align: center;
}

.crew-section-title {
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(207, 231, 255, 0.35);
  margin-bottom: 1.5rem;
}

/* Dividers */
.crew-divider {
  width: 100%;
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 0, 170, 0.4),
    rgba(0, 200, 255, 0.4),
    transparent
  );
}

/* =========================
   Before / After diagram panels
   ========================= */

.diagram-pair {
  margin-top: 1.25rem;
}

.diagram-panel .figure {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.crew-diagram {
  max-width: 100%;
  max-height: 100%;           
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* =========================
   Synthwave Horizon Divider
   ========================= */

.horizon-divider {
  width: 100%;
  height: 3px;
  margin: 2rem 0;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 0, 170, 0.6),
    rgba(0, 200, 255, 0.6),
    transparent
  );

  box-shadow:
    0 0 12px rgba(255, 0, 170, 0.35),
    0 0 16px rgba(0, 200, 255, 0.25);

  border-radius: 999px;
}

/* =========================
   Header
   ========================= */

.site-header {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  border-bottom: 1px solid var(--border);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 88px;
  height: 88px;
}

.subtitle {
  color: var(--muted);
}

/* =========================
   Navigation
   ========================= */

.nav {
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 0 1rem;
}

.nav-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 164, 18, 0.15);
}

/* =========================
   Content Container
   ========================= */

.content {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* =========================
   Orientation Blocks
   ========================= */

.orientation-block {
  width: 100%;
  margin: 3rem 0 2rem;
}

.orientation-block h3 {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: #cfe7ff;
}

.orientation-block p,
.orientation-block li {
  color: #c7d4e6;
  line-height: 1.6;
}

.orientation-block ul {
  padding-left: 1.25rem;
}

/* =========================
   Headings
   ========================= */

h1, h2, h3 {
  color: #e6f0ff;
  font-weight: 600;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
}

/* =========================
   Accordion
   ========================= */

.accordion {
  width: 100%;
  max-width: 900px;
  margin: 1rem auto;
  border-top: 1px solid var(--border);
}

.accordion-header {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.3rem;
  padding: 1rem 0;
  cursor: pointer;
}

.accordion-header:hover {
  color: var(--accent);
}

.accordion-content {
  display: none;
  padding-bottom: 1rem;
  color: var(--muted);
}

.accordion.open .accordion-content {
  display: block;
}

/* =========================
   Buttons
   ========================= */

.collapse-btn,
.back-btn {
  margin-top: 1.5rem;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}

.collapse-btn:hover,
.back-btn:hover {
  background: rgba(255, 164, 18, 0.15);
}

/* =========================
   Tables
   ========================= */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  vertical-align: top;
}

th {
  text-align: left;
  color: var(--accent);
  font-weight: 600;
}

td {
  color: var(--fg);
}

/* =========================
   System Diagrams
   ========================= */

.system-diagram {
  margin: 3rem auto;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.system-diagram img {
  width: 65%;
  max-width: 1000px;
  height: auto;
  display: block;
  margin: 3rem auto;
  max-height: 70vh;
  object-fit: contain;
}

.system-diagram figcaption {
  max-width: 900px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.diagram-compare-block {
  margin-top: 3rem;
}

.diagram-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap; 
}

.diagram {
  flex: 1 1 0;
  max-width: 420px; 
}

.diagram img {
  width: 100%;
  height: auto;
  max-height: 520px; 
  object-fit: contain;
  border-radius: 8px;
}

.diagram figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* =========================
   Footer
   ========================= */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* =========================
   Utilities
   ========================= */

.hidden {
  display: none;
}

/* =========================
   Mobile Optimization
   ========================= */

@media (max-width: 768px) {

  body {
    font-size: 0.95rem;
  }

  .site-header {
    padding: 1.5rem 1rem;
  }

  .header-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .logo {
    width: 50px;
    height: 50px;
  }

  .nav {
    padding: 1rem;
    gap: 0.5rem;
  }

  .nav-btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .accordion {
    margin: 1rem 0;
  }

  .accordion-header {
    font-size: 1.15rem;
    padding: 0.8rem 0;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  table::after {
    content: "← swipe →";
    display: block;
    text-align: right;
    font-size: 0.75rem;
    opacity: 0.6;
    padding-top: 0.25rem;
  }

  .system-diagram img {
    width: 100%;
    max-width: 100%;
  }

  .system-diagram figcaption {
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0 0.5rem;
  }

  .site-footer {
    padding: 1.5rem 1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 900px) {
  .diagram-row {
    flex-wrap: wrap;
  }

  .diagram {
    max-width: 100%;
  }
}

/* =========================
   Mobile Optimization — Crew Page
   ========================= */

@media (max-width: 768px) {
  .crew-page {
    padding: 2rem 1rem 3rem;
  }

  .crew-section {
    margin: 1.5rem 0;
  }

  .crew-section-title {
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
  }

  .crew-divider {
    margin: 1.5rem 0;
    opacity: 0.7;
  }

  .diagram-panel .figure {
    padding: 0.75rem;
  }

  .crew-diagram {
    width: 100%;
    max-width: 100%;
    max-height: 55vh;    
    height: auto;
    margin: 0 auto;
  }

  .diagram-pair {
    margin-top: 1rem;
  }
}