@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --muted: #9a9a9a;
  --line: #e6e6e6;
  --accent-bg: #fafafa;
  --danger: #b3261e;
  --font: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- the breathing dot ----------
   Carried from the boot/tab reference files — the one recurring
   signature mark. Used in eyebrows, status, and the boot screen. */

.dot {
  display: inline-block;
  vertical-align: middle;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0.5em rgba(10, 10, 10, 0.3);
  flex: none;
}

.dot.breathe {
  animation: dot-breathe 1.6s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { transform: scale(0.75); opacity: 0.6; }
  50%      { transform: scale(1.05); opacity: 1; }
}

.dot.hide {
  opacity: 0;
  width: 0;
  margin-left: 0;
  transition: opacity 0.3s ease, width 0.3s ease, margin 0.3s ease;
}

/* ---------- boot overlay ----------
   Plays once per session on entry to the research subdomain, then
   fades to reveal the page already rendered underneath. */

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.boot-overlay.done {
  opacity: 0;
  pointer-events: none;
}

.boot-word {
  font-family: var(--font);
  font-weight: 500;
  font-size: clamp(20px, 4vw, 40px);
  white-space: nowrap;
  color: var(--text);
  line-height: 1;
}

.boot-letter {
  display: inline-block;
  vertical-align: middle;
  width: 1ch;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.4);
  filter: blur(4px);
  transition:
    opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.3s ease;
}

.boot-letter.revealed {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.boot-word .dot {
  margin-left: 0.14em;
}

/* STATUS STRIP — legal-status marker, sits above the nav on every page */

.status-strip {
  background: #000;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 0;
}

.status-strip .container {
  display: flex;
  justify-content: center;
}

/* NAVIGATION */

nav {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.nav-inner {
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
}

.brand-mark {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-crumb {
  color: var(--muted);
  font-weight: 400;
}

.nav-right {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
}

.nav-right a:hover {
  color: var(--text);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
}

.nav-dropdown-trigger::after {
  content: ' \25BE';
  font-size: 10px;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  min-width: 160px;
  grid-template-columns: repeat(var(--panel-columns, 1), minmax(140px, 1fr));
  grid-auto-flow: row;
  padding: 6px 0;
  display: none;
  z-index: 60;
  text-transform: none;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: grid;
}

.nav-dropdown-menu a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--muted);
}

.nav-dropdown-menu a:hover {
  color: var(--text);
  background: var(--accent-bg);
}

.nav-dropdown-empty {
  display: block;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--muted);
}

/* HERO */

.hero {
  padding: 90px 0 0;
  border-bottom: 1px solid var(--line);
}

.hero.hero-compact {
  padding: 60px 0 56px;
}

.hero-top {
  padding-bottom: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-compact h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.hero-description {
  max-width: 600px;
  margin-top: 26px;
  color: #4a4a4a;
  font-size: 16px;
  line-height: 1.6;
}

.tab-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.tab-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tab-pill:hover {
  border-color: var(--text);
  background: var(--accent-bg);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  font-size: 12px;
  color: var(--muted);
}

.more-link:hover {
  color: var(--text);
}

.more-link .arrow {
  display: inline-block;
  animation: more-bob 1.6s ease-in-out infinite;
}

@keyframes more-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 30px;
}

.back-link:hover {
  color: var(--text);
}

/* CONTEXT STRIP — hero signature element */

.context-strip {
  border-top: 1px solid var(--line);
  padding: 26px 0 30px;
}

.context-track {
  position: relative;
  height: 30px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    var(--text) 0,
    var(--text) 2px,
    transparent 2px,
    transparent 15px
  );
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.context-track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0.85;
}

.context-window {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  background: var(--text);
  opacity: 0.1;
  border-left: 1.5px solid var(--text);
  border-right: 1.5px solid var(--text);
  animation: slide-window 9s ease-in-out infinite;
}

@keyframes slide-window {
  0%, 100% { left: 0%; }
  50% { left: 82%; }
}

.context-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

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

/* SECTIONS */

section {
  padding: 85px 0;
  border-bottom: 1px solid var(--line);
}

section.section-tight {
  padding: 56px 0;
}

.section-header {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 70px;
  margin-bottom: 42px;
}

.section-header.with-action {
  align-items: end;
}

.section-number {
  font-size: 12px;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.section-intro {
  margin-top: 12px;
  max-width: 650px;
  color: var(--muted);
}

/* REGISTRY */

.registry {
  border-top: 1px solid var(--text);
}

.registry-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 0.8fr 1fr;
  gap: 25px;
  padding: 21px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: background 0.15s ease;
}

.registry-row.is-link {
  cursor: pointer;
}

.registry-row.is-link:hover {
  background: var(--accent-bg);
}

.registry-head {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.research-title {
  font-weight: 500;
  font-size: 14px;
}

.research-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status .dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.status .dot.is-paused {
  background: var(--muted);
}

.muted {
  color: var(--muted);
}

/* DIRECTION & PERSPECTIVE */

.direction-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
}

.direction-copy {
  max-width: 560px;
}

.direction-copy p {
  margin: 0 0 24px;
  color: #444;
  font-size: 16px;
  line-height: 1.7;
}

.direction-copy p:last-child {
  margin-bottom: 0;
}

.focus-list {
  border-top: 1px solid var(--line);
}

.focus-item {
  padding: 24px 0 24px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: border-color 0.15s ease;
}

.focus-item:hover {
  border-left-color: var(--text);
}

.focus-item h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.focus-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* PLANS */

.plans {
  border-top: 1px solid var(--text);
}

.plan {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 60px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.plan-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.plan h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

.plan p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
}

/* PARTNERS */

.partners-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  align-items: start;
}

.partners-intro p {
  margin: 0 0 26px;
  color: #444;
  font-size: 16px;
  line-height: 1.7;
  max-width: 520px;
}

.partner-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.partner-cta .muted {
  font-size: 13px;
}

.partner-categories {
  border-top: 1px solid var(--line);
}

.partner-category {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.partner-category h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.partner-category p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* DETAIL PAGE */

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin-bottom: 56px;
}

.detail-meta-item .focus-label {
  margin-bottom: 9px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-meta-item div:last-child {
  font-size: 14px;
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 90px;
}

.detail-copy p {
  margin: 0 0 22px;
  color: #444;
  font-size: 15px;
  line-height: 1.7;
  max-width: 640px;
}

.detail-copy h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 40px 0 14px;
}

.detail-copy h3:first-child {
  margin-top: 0;
}

.log-list {
  border-top: 1px solid var(--line);
}

.log-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.log-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.detail-side {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}

.side-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.side-block {
  margin-bottom: 34px;
}

.side-block:last-child {
  margin-bottom: 0;
}

.asset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.asset-item:last-child {
  border-bottom: none;
}

.asset-item a {
  color: var(--muted);
}

.asset-item a:hover {
  color: var(--text);
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
}

.btn:hover {
  opacity: 0.8;
}

.btn-outline {
  background: transparent;
  color: var(--text);
}

.btn-outline:hover {
  background: var(--accent-bg);
  opacity: 1;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn-danger:hover {
  background: #fbeceb;
  opacity: 1;
}

/* ADMIN TABLE */

.admin-table {
  border-top: 1px solid var(--text);
  width: 100%;
}

.admin-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.8fr 0.8fr auto;
  gap: 20px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.admin-row.admin-head {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

/* FORM / MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  overflow-y: auto;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #fff;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.data-note {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 30px;
}

/* ADMIN TABS */

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.tab-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.admin-panel[hidden] {
  display: none;
}

.admin-subsection {
  margin-bottom: 48px;
}

.admin-subsection:last-child {
  margin-bottom: 0;
}

.admin-subsection-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-subsection-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}

.field-list {
  border-top: 1px solid var(--line);
  margin-bottom: 16px;
}

.field-list-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.field-list-item .form-field:last-child {
  margin-bottom: 0;
}

/* FOOTER */

footer {
  background: #000;
  color: #fff;
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-col-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-col a,
.footer-col span {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  padding: 5px 0;
}

.footer-col a:hover {
  color: #fff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  padding: 20px 0 30px;
}

/* BOTTOM BAR — same nav config as the header, rendered a second time via
   the shared .js-nav-links hook, dark-themed. Since nav.js just does
   querySelectorAll('.js-nav-links'), this needs no JS of its own. */

.bottom-bar {
  background: #000;
  padding: 26px 0;
}

.bottom-bar .container {
  display: flex;
  justify-content: center;
}

.bottom-bar .js-nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.bottom-bar .js-nav-links > a,
.bottom-bar .nav-dropdown-trigger {
  color: #999;
  font-size: 13px;
}

.bottom-bar .js-nav-links > a:hover,
.bottom-bar .nav-dropdown-trigger:hover {
  color: #fff;
}

.bottom-bar .nav-dropdown-menu {
  background: #141414;
  border-color: #2a2a2a;
}

.bottom-bar .nav-dropdown-menu a {
  color: #999;
}

.bottom-bar .nav-dropdown-menu a:hover {
  color: #fff;
  background: #1c1c1c;
}

.bottom-bar .nav-dropdown-empty {
  color: #666;
}

/* MOBILE */

@media (max-width: 750px) {

  .container,
  .nav-inner {
    width: min(100% - 32px, 1180px);
  }

  .hero {
    padding: 70px 0 0;
  }

  .section-header {
    display: block;
  }

  .section-number {
    margin-bottom: 18px;
  }

  .registry-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .registry-head {
    display: none;
  }

  .direction-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .plan {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nav-right {
    display: none;
  }

  .context-caption {
    flex-direction: column;
    gap: 4px;
  }

  .detail-meta {
    grid-template-columns: 1fr 1fr;
    row-gap: 20px;
  }

  .detail-body {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .detail-side {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 30px;
  }

  .admin-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-row.admin-head {
    display: none;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .partners-layout {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .admin-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
}