html { overflow-x: hidden; }

:root {
  --bg: #080a0f;
  --surface: #0d1117;
  --panel: #111620;
  --border: #1e2a3a;
  --border2: #253040;
  --amber: #f0a830;
  --amber2: #e8850a;
  --amber-dim: #f0a83022;
  --cyan: #30c8e0;
  --red: #e05040;
  --green: #40c878;
  --blue: #4090e8;
  --purple: #9060e0;
  --text: #d8dde8;
  --muted: #5a6880;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Orbitron', monospace;
  --body: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  overflow-x: hidden;
  padding: 8px clamp(8px, 2.5vw, 24px) 60px;
  width: 100%;
  max-width: 100vw;
}

body::before {
  content:'';
  position:fixed;
  inset:0;
  background-image:
    linear-gradient(rgba(30,42,58,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,42,58,0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events:none;
  z-index:0;
}

.wrapper { position:relative; z-index:1; max-width:900px; margin:0 auto; padding:0 0 60px; }

/* ═══════════════════════════════════════
   HAMBURGER NAV
═══════════════════════════════════════ */

.hamburger {
  position: fixed;
  top: 16px;
  right: 16px; left: auto;
  z-index: 1000;
  width: 36px;
  height: 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--amber);
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,10,15,0.85);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.nav-overlay.open { opacity: 1; pointer-events: all; }

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 60px 0 40px;
}
.nav-drawer.open { transform: translateX(0); }

.nav-section {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.nav-section:last-child { border-bottom: none; }

.nav-section-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding: 12px 20px 6px;
}
.nav-subsection { padding-left: 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--amber-dim); }
.nav-link.active { color: var(--amber); background: var(--amber-dim); }
.nav-link .nav-num { color: var(--muted); font-size: 9px; }
.nav-link.active .nav-num { color: var(--amber); }
.nav-link.sub { padding-left: 40px; font-size: 10px; }

/* NAV LOGO */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 998;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.nav-logo {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.1em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.nav-logo em {
  color: var(--amber);
  font-style: normal;
}

.nav-logo-sub {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.15em;
  font-weight: 400;
}

/* NAV BACK LINK */
.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-back:hover { color: var(--amber); }

.nav-back-arrow { font-size: 14px; }

/* NAV ITEM */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-item:hover { color: var(--text); background: var(--amber-dim); }

.nav-item-num {
  color: var(--amber);
  font-size: 9px;
  min-width: 18px;
}

.nav-item-sub {
  font-size: 9px;
  color: var(--muted);
  margin-left: auto;
}

/* PAGE HEADER */
.page-header {
  padding: 32px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-breadcrumb {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.page-title em { color: var(--amber); font-style: normal; }

.page-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  line-height: 2;
}

.status-bar {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* SECTIONS */
.section { margin-bottom: 28px; }

.section-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border2), transparent);
}

h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

h3 {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  margin-top: 20px;
}

p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 12px;
}

strong { color: var(--text); font-weight: 500; }

/* CARDS */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-accent { border-left: 3px solid var(--amber); }
.card-cyan { border-left: 3px solid var(--cyan); }
.card-green { border-left: 3px solid var(--green); }
.card-red { border-left: 3px solid var(--red); }
.card-blue { border-left: 3px solid var(--blue); }

/* STEPS */
.steps { display: flex; flex-direction: column; gap: 12px; }

.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
}

.step-n {
  width: 36px; height: 36px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 14px;
  color: var(--amber);
  background: var(--amber-dim);
  flex-shrink: 0;
}

.step-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.step-desc { font-size: 12px; color: var(--muted); line-height: 1.6; font-weight: 300; }

/* TABLE */
table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }

th {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--amber);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border2);
}

td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--muted); line-height: 1.5; word-break: break-word; white-space: normal; }
td:first-child { color: var(--text); font-weight: 500; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--amber-dim); }
/* TABLE WRAPPER — scroll on mobile, wrap on desktop */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}
.table-scroll table {
  margin-bottom: 0;
  min-width: 500px;
}



/* SVG DIAGRAMS */
.diagram {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.diagram-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  align-self: flex-start;
}

/* GRID 2COL */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .grid2 { grid-template-columns: 1fr; }
  table { font-size: 11px; }
  th, td { padding: 7px 8px; }
  .hier-row { flex-wrap: wrap; gap: 6px; }
  .hier-level, .hier-name { width: auto; }
  .hier-desc { width: 100%; }
  .diagram { padding: 12px; overflow-x: auto; }
  .diagram svg { max-width: 100%; height: auto; }
}

/* SPECS */
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.spec-val { color: var(--amber); font-family: var(--mono); font-size: 11px; }

/* HIERARCHY */
.hierarchy { display: flex; flex-direction: column; gap: 4px; }

.hier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  position: relative;
}

.hier-level { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: 0.1em; width: 70px; flex-shrink: 0; }
.hier-name { font-weight: 500; font-size: 13px; color: var(--text); width: 100px; flex-shrink: 0; }
.hier-desc { font-size: 11px; color: var(--muted); flex: 1; }
.hier-connector { width: 1px; height: 8px; background: var(--border2); margin-left: 20px; }

/* TAGS */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.tag-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid #f0a83044; }
.tag-cyan { background: #30c8e022; color: var(--cyan); border: 1px solid #30c8e044; }
.tag-green { background: #40c87822; color: var(--green); border: 1px solid #40c87844; }
.tag-red { background: #e0504022; color: var(--red); border: 1px solid #e0504044; }

/* NOTION LINKS */
.notion-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.notion-link:hover { border-color: var(--amber); background: var(--amber-dim); }
.notion-icon { font-size: 18px; flex-shrink: 0; }
.notion-title { font-size: 13px; font-weight: 500; }
.notion-desc { font-size: 11px; color: var(--muted); }
.notion-arrow { margin-left: auto; color: var(--muted); font-size: 16px; }

/* PHASE TIMELINE */
.timeline { display: flex; flex-direction: column; gap: 0; }
.phase {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  position: relative;
}
.phase:not(:last-child) .phase-line {
  position: absolute;
  left: 13px; top: 28px; bottom: -4px;
  width: 1px;
  background: var(--border2);
}
.phase-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 10px;
  flex-shrink: 0;
  background: var(--panel);
  margin-top: 2px;
}
.phase-dot.done { border-color: var(--green); color: var(--green); background: #40c87811; }
.phase-dot.active { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
.phase-dot.future { color: var(--muted); }
.phase-content { padding-bottom: 20px; }
.phase-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.phase-desc { font-size: 11px; color: var(--muted); line-height: 1.6; }

/* NOTE BOX */
.note { padding: 12px 16px; border-radius: 4px; font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.note-amber { background: #f0a83011; border: 1px solid #f0a83033; color: #c8882a; }
.note-cyan { background: #30c8e011; border: 1px solid #30c8e033; color: #28a8c0; }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border2), transparent); margin: 24px 0; }

/* FIBER LEGEND */
.fiber-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.fl-item { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.fl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* PAGE FOOTER */
.page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
