/* ============================================================
   SHOAL — Shared Design System · shoal.bot · Confidential
   ============================================================ */

:root {
  --sb-w:       220px;
  --ocean:      #040e17;
  --deep:       #061522;
  --surface:    #0a2035;
  --teal:       #00c9d4;
  --teal-dim:   #00adb8;
  --teal-glow:  rgba(0, 201, 212, 0.12);
  --fog:        rgba(255,255,255,0.05);
  --text:       #e8f4f6;
  --text-dim:   #9dc4d2;
  --text-faint: #5e8a9c;
  --border:     rgba(0, 201, 212, 0.15);
  --border-dim: rgba(255,255,255,0.09);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--ocean);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--ocean); }
::-webkit-scrollbar-thumb { background: var(--teal-dim); border-radius: 2px; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 48px;
  background: rgba(4, 14, 23, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-dim);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  justify-self: start;
}
.nav-logo span { color: var(--teal); }
.nav-links { display: flex; gap: 28px; align-items: center; justify-content: center; }
.nav-link {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text-dim); }
.nav-link.active { color: var(--teal-dim); }
.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.nav-cta {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  padding: 9px 20px;
  border: 1px solid var(--teal-dim);
  border-radius: 2px;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--teal-glow); border-color: var(--teal); }

/* Reset: breadcrumb nav must not inherit the fixed-position nav rule */
nav.breadcrumb {
  position: static;
  background: transparent;
  backdrop-filter: none;
  border: none;
  padding: 0;
  display: flex;
  grid-template-columns: unset;
  z-index: auto;
}

/* ── NAV MAP BUTTON ── */
.nav-map-btn {
  background: none;
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.nav-map-btn:hover { border-color: var(--teal-dim); color: var(--teal-dim); }

/* ── SITE MAP OVERLAY ── */
.site-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 14, 23, 0.97);
  backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 48px 60px;
}
.site-overlay.open { opacity: 1; pointer-events: all; }
.overlay-inner { max-width: 1000px; width: 100%; }
.overlay-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 56px; }
.overlay-title { font-family: 'Cormorant Garamond', serif; font-size: 13px; font-weight: 400; letter-spacing: 6px; text-transform: uppercase; color: var(--text-faint); }
.overlay-close { background: none; border: 1px solid var(--border-dim); border-radius: 2px; color: var(--text-faint); cursor: pointer; font-size: 16px; padding: 8px 12px; transition: all 0.2s ease; font-family: 'DM Mono', monospace; }
.overlay-close:hover { border-color: var(--teal-dim); color: var(--text); }
.overlay-section-label { font-size: 8px; letter-spacing: 4px; text-transform: uppercase; color: var(--teal-dim); margin-bottom: 10px; display: block; }
.overlay-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; margin-bottom: 2px; }
.overlay-card { display: block; text-decoration: none; padding: 24px 24px; background: var(--deep); border: 1px solid var(--border-dim); border-radius: 2px; transition: border-color 0.25s ease; position: relative; }
.overlay-card:hover { border-color: var(--border); }
.overlay-card:hover .overlay-card-arrow { opacity: 1; }
.overlay-card.featured { background: rgba(0,201,212,0.04); border-color: var(--border); }
.overlay-card-tag { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--teal-dim); display: block; margin-bottom: 8px; }
.overlay-card.featured .overlay-card-tag { color: var(--teal); }
.overlay-card-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.15; margin-bottom: 7px; }
.overlay-card-desc { font-size: 10px; color: var(--text-faint); line-height: 1.7; }
.overlay-card-arrow { position: absolute; top: 20px; right: 16px; font-size: 11px; color: var(--teal-dim); opacity: 0; transition: opacity 0.2s ease; }
.overlay-divider { height: 36px; }
.overlay-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }

/* ── LAYOUT ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 48px; }
section { position: relative; }

/* ── TYPOGRAPHY ── */
.section-label {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
  display: block;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -1px;
}
.section-title em { font-style: italic; font-weight: 300; color: var(--text-dim); }
.body-text {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.9;
}
.body-text + .body-text { margin-top: 14px; }

/* ── BUTTONS ── */
.btn-primary {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ocean);
  background: var(--teal);
  padding: 13px 32px;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.25s ease;
  display: inline-block;
}
.btn-primary:hover { background: #00e5f0; box-shadow: 0 0 36px rgba(0,201,212,0.4); transform: translateY(-1px); }
.btn-ghost {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  padding: 13px 32px;
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.25s ease;
  display: inline-block;
}
.btn-ghost:hover { color: var(--text); border-color: var(--teal-dim); background: var(--fog); }

/* ── PAGE HERO ── */
.page-hero {
  padding: 148px 0 88px;
  border-bottom: 1px solid var(--border-dim);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 60% 80% at 65% 50%, rgba(0,201,212,0.05) 0%, transparent 65%);
  pointer-events: none;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.breadcrumb a, .breadcrumb span {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover { color: var(--text-dim); }
.breadcrumb-sep { opacity: 0.4; }
.sprint-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--teal-glow);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 28px;
}
.page-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.95;
  letter-spacing: -3px;
  color: var(--text);
  margin-bottom: 24px;
}
.page-hero-title em { font-style: italic; font-weight: 300; color: var(--teal); }
.page-hero-sub {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-dim);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 44px;
}
.hero-stats {
  display: flex;
  gap: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border-dim);
  flex-wrap: wrap;
}
.hero-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -1px;
  display: block;
  line-height: 1;
}
.hero-stat-label {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-top: 8px;
}

/* ── CONTENT SECTIONS ── */
.content-section { padding: 96px 0; }
.content-section + .content-section { border-top: 1px solid var(--border-dim); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.two-col.align-center { align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; }

/* ── DETAIL CARDS ── */
.detail-card {
  background: var(--deep);
  border: 1px solid var(--border-dim);
  padding: 32px 28px;
  border-radius: 2px;
  transition: border-color 0.3s ease;
}
.detail-card:hover { border-color: var(--border); }
.detail-card-icon { font-size: 22px; margin-bottom: 18px; display: block; }
.detail-card-label {
  font-size: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal-dim);
  display: block;
  margin-bottom: 8px;
}
.detail-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}
.detail-card-body {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ── REVEAL ── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── PAGE NAV ── */
.page-nav-section {
  background: var(--deep);
  border-top: 1px solid var(--border-dim);
  padding: 48px 0;
}
.page-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.page-nav-link {
  text-decoration: none;
  padding: 20px 24px;
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  transition: border-color 0.3s ease, background 0.3s ease;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.page-nav-link:hover { border-color: var(--border); background: var(--fog); }
.page-nav-link.right { text-align: right; align-items: flex-end; }
.page-nav-dir { font-size: 8px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-faint); }
.page-nav-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
}
.page-nav-link:hover .page-nav-name { color: var(--teal); }
.page-nav-home {
  text-align: center;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}
.page-nav-home:hover { color: var(--teal-dim); }

/* ── FOOTER ── */
footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
}
.footer-links { display: flex; gap: 24px; }
.footer-link {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover { color: var(--text-dim); }
.footer-note { font-size: 9px; color: var(--text-faint); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 14px 24px; }
  .container { padding: 0 24px; }
  .two-col, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 2px; }
  .page-hero { padding: 110px 0 64px; }
  footer { flex-direction: column; gap: 16px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .page-nav-inner { flex-direction: column; }
  .page-nav-link { min-width: 100%; }
  .page-nav-link.right { text-align: left; align-items: flex-start; }
  .overlay-grid { grid-template-columns: 1fr 1fr; }
  .overlay-bottom { grid-template-columns: 1fr; }
  .site-overlay { padding: 70px 24px 48px; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero-stats { gap: 28px; }
  .page-hero-title { letter-spacing: -2px; }
  .overlay-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — Wiki-style left navigation vein
   Injected by sidebar.js. CSS lives here to stay with the
   design system. All rules scoped to .sb-* or .site-sidebar.
   ══════════════════════════════════════════════════════════════ */

/* Layout shift: push page content right of the sidebar */
body.sb-layout {
  padding-left: var(--sb-w);
}

/* ── Sidebar shell ─────────────────────────────────────────── */
.site-sidebar {
  position: fixed;
  top: 64px;                          /* flush below fixed nav */
  left: 0;
  width: var(--sb-w);
  height: calc(100vh - 64px);
  background: #01080f;                /* slightly darker than ocean */
  border-right: 1px solid rgba(255,255,255,0.045);
  z-index: 89;                        /* below nav (z:100), above content */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 16px rgba(0,0,0,0.35);
}

/* ── Scrollable nav body ───────────────────────────────────── */
.sb-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 48px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.05) transparent;
}
.sb-body::-webkit-scrollbar        { width: 2px; }
.sb-body::-webkit-scrollbar-track  { background: transparent; }
.sb-body::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.06); border-radius: 1px; }

/* ── Section group ─────────────────────────────────────────── */
.sb-group {
  margin-bottom: 2px;
}

.sb-group-label {
  display: block;
  font-size: 7px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.45;
  padding: 12px 0 3px 22px;
  user-select: none;
}

/* ── List + the vein ───────────────────────────────────────── */
.sb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

/* The vein — vertical thread connecting all items */
.sb-list::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 201, 212, 0.1) 20%,
    rgba(0, 201, 212, 0.1) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.sb-item { position: relative; }

/* ── Individual link ───────────────────────────────────────── */
.sb-link {
  display: grid;
  grid-template-columns: 18px 1fr;    /* tag column | label column */
  align-items: center;
  gap: 0;
  font-size: 11px;
  font-weight: 300;
  color: rgba(127, 168, 184, 0.55);
  text-decoration: none;
  padding: 5px 12px 5px 28px;
  line-height: 1.3;
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
  border-left: 2px solid transparent;
}

/* Node: circle on the vein */
.sb-link::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  transition: background 0.18s ease, box-shadow 0.18s ease;
  z-index: 1;
}

/* Hover state */
.sb-link:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.025);
}
.sb-link:hover::before {
  background: rgba(127,168,184,0.4);
}

/* Active state — the teal vein pulse */
.sb-link--active {
  color: var(--teal);
  background: rgba(0,201,212,0.07);
  border-left-color: var(--teal);
}
.sb-link--active::before {
  background: var(--teal);
  width: 5px;
  height: 5px;
  left: 9.5px;
  box-shadow: 0 0 6px rgba(0,201,212,0.7), 0 0 12px rgba(0,201,212,0.25);
}
.sb-link--active:hover {
  background: rgba(0,201,212,0.09);
}

/* Sprint/product number tag */
.sb-tag {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  color: var(--text-faint);
  opacity: 0.4;
  letter-spacing: 0;
  line-height: 1;
}
.sb-link--active .sb-tag {
  color: var(--teal-dim);
  opacity: 0.6;
}

.sb-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Sidebar footer ────────────────────────────────────────── */
.sb-foot {
  flex-shrink: 0;
  padding: 10px 16px 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.sb-foot span {
  font-size: 7px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.3;
}

/* ── Mobile hamburger toggle ───────────────────────────────── */
.sb-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  background: var(--deep);
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  cursor: pointer;
  z-index: 150;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  transition: border-color 0.2s ease;
}
.sb-toggle:hover { border-color: var(--teal-dim); }
.sb-toggle span {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
  transform-origin: center;
}
.sb-toggle--x span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.sb-toggle--x span:nth-child(2) { opacity: 0; width: 0; }
.sb-toggle--x span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ── Mobile backdrop veil ──────────────────────────────────── */
.sb-veil {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 15, 0.72);
  z-index: 88;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sb-veil--on {
  opacity: 1;
  pointer-events: all;
}

/* ── Responsive: collapse sidebar on narrow screens ─────────── */
@media (max-width: 960px) {
  body.sb-layout {
    padding-left: 0;                  /* no push on mobile */
  }
  /* Shift nav content right so toggle button doesn't overlap logo */
  body.sb-layout nav {
    padding-left: 58px;
  }
  .site-sidebar {
    transform: translateX(calc(-1 * var(--sb-w)));
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 149;                     /* slides above content when open */
    top: 0;                           /* full height on mobile */
    height: 100vh;
    padding-top: 64px;                /* clear behind nav */
  }
  .site-sidebar.sb--open {
    transform: translateX(0);
  }
  .sb-toggle { display: flex; }
  .sb-veil   { display: block; }
}
