:root {
  --portal-bg: #090d10;
  --portal-surface: #111820;
  --portal-text: #f2f7f4;
  --portal-muted: #aab7b7;
  --portal-border: #2a3942;
  --portal-teal: #43d6c5;
  --portal-gold: #f0c96a;
  --portal-violet: #9b8cff;
  --portal-rose: #ff7d8f;
  --portal-shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
  margin: 0;
}

html {
  background: var(--portal-bg);
  scroll-behavior: smooth;
}

body.portal {
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

.skip-link {
  background: var(--portal-teal);
  color: #061010;
  font-weight: 800;
  left: 12px;
  padding: 9px 12px;
  position: fixed;
  top: -60px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.portal-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(9, 13, 16, 0.9);
  border-bottom: 1px solid rgba(67, 214, 197, 0.18);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.portal-brand {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}

.portal-brand strong,
.portal-brand small {
  display: block;
  line-height: 1.08;
  white-space: nowrap;
}

.portal-brand strong {
  font-size: 17px;
  font-weight: 850;
}

.portal-brand small {
  color: var(--portal-muted);
  font-size: 12px;
  margin-top: 3px;
}

.portal-brand-mark {
  background:
    linear-gradient(var(--portal-bg), var(--portal-bg)) padding-box,
    conic-gradient(from 25deg, var(--portal-teal), var(--portal-violet), var(--portal-gold), var(--portal-teal)) border-box;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(67, 214, 197, 0.22);
  display: block;
  flex: 0 0 38px;
  height: 38px;
  position: relative;
  width: 38px;
}

.portal-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: min(760px, 100%);
  min-width: 0;
}

.portal-nav-toggle {
  display: none;
}

.portal-nav-toggle-icon {
  display: grid;
  gap: 3px;
  width: 15px;
}

.portal-nav-toggle-icon > span {
  background: currentColor;
  border-radius: 999px;
  height: 2px;
  width: 100%;
}

.portal-nav a,
.portal-action {
  border: 1px solid rgba(170, 183, 183, 0.22);
  border-radius: 7px;
  color: var(--portal-text);
  font-size: 13px;
  font-weight: 760;
  min-height: 38px;
  padding: 9px 12px;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.portal-nav a:hover,
.portal-nav a:focus-visible,
.portal-action:hover,
.portal-action:focus-visible {
  background: rgba(67, 214, 197, 0.12);
  border-color: rgba(67, 214, 197, 0.58);
  color: var(--portal-teal);
  outline: none;
  transform: translateY(-1px);
}

.portal-hero {
  align-items: center;
  display: flex;
  min-height: min(680px, calc(76svh - 72px));
  overflow: hidden;
  padding: clamp(40px, 6vw, 88px) clamp(18px, 7vw, 116px);
  position: relative;
}

.portal-hero::after {
  background:
    linear-gradient(90deg, rgba(9, 13, 16, 0.94) 0%, rgba(9, 13, 16, 0.72) 48%, rgba(9, 13, 16, 0.28) 100%),
    linear-gradient(0deg, rgba(9, 13, 16, 0.82) 0%, rgba(9, 13, 16, 0.12) 40%, rgba(9, 13, 16, 0.72) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.portal-hero-canvas {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.portal-hero-content {
  max-width: min(830px, 100%);
  position: relative;
  z-index: 1;
}

.portal-kicker,
.section-label {
  color: var(--portal-gold);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-hero h1 {
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 900;
  line-height: 1;
  margin-top: 12px;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: keep-all;
}

.portal-lede {
  color: #dce8e3;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.38;
  margin-top: 22px;
  max-width: 760px;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.portal-action {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.portal-action.primary {
  background: var(--portal-teal);
  border-color: var(--portal-teal);
  color: #061010;
}

.portal-action.primary:hover,
.portal-action.primary:focus-visible {
  background: #70e5d9;
  color: #061010;
}

.portal-action.compact {
  min-height: 36px;
}

.portal-boundary {
  border-left: 3px solid var(--portal-gold);
  color: #cdd8d6;
  font-size: 14px;
  margin-top: 26px;
  max-width: 700px;
  padding-left: 12px;
}

.citation-strip {
  align-items: center;
  background: rgba(7, 11, 13, 0.58);
  border: 1px solid rgba(67, 214, 197, 0.24);
  border-radius: 8px;
  color: var(--portal-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 7px 10px;
  margin-top: 18px;
  max-width: 760px;
  padding: 10px 12px;
}

.citation-strip a {
  color: var(--portal-teal);
  font-weight: 820;
  overflow-wrap: anywhere;
}

.citation-divider {
  border-left: 1px solid rgba(170, 183, 183, 0.22);
  color: var(--portal-gold);
  font-weight: 800;
  padding-left: 10px;
}

.selective-access-notice {
  background: rgba(21, 32, 42, 0.78);
  border: 1px solid rgba(155, 140, 255, 0.3);
  border-left: 3px solid var(--portal-violet);
  border-radius: 8px;
  color: #dce8e3;
  margin-top: 18px;
  max-width: 760px;
  padding: 14px 16px;
}

.selective-access-notice strong {
  color: var(--portal-text);
}

.selective-access-notice span {
  color: var(--portal-muted);
  display: block;
  font-size: 14px;
  margin-top: 4px;
}

.portal-band {
  border-top: 1px solid rgba(170, 183, 183, 0.14);
  padding: clamp(44px, 6vw, 82px) clamp(18px, 5vw, 76px);
}

.portal-page-main {
  background:
    radial-gradient(circle at 82% 12%, rgba(67, 214, 197, 0.14), transparent 28rem),
    linear-gradient(180deg, #0b1014 0%, var(--portal-bg) 100%);
}

.portal-page-hero {
  border-bottom: 1px solid rgba(170, 183, 183, 0.14);
  padding: clamp(44px, 6vw, 82px) clamp(18px, 7vw, 116px) clamp(38px, 5vw, 68px);
}

.portal-page-hero .portal-kicker {
  margin-bottom: 12px;
}

.portal-page-hero h1 {
  font-size: clamp(38px, 6vw, 74px);
  font-weight: 900;
  line-height: 1;
  max-width: 960px;
}

.portal-page-hero p {
  color: #dce8e3;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.45;
  margin-top: 18px;
  max-width: 860px;
}

.workbook-hero {
  padding-bottom: clamp(28px, 4vw, 48px);
  padding-top: clamp(42px, 6vw, 84px);
}

.workbook-hero h1 {
  font-size: clamp(36px, 5.4vw, 64px);
  max-width: 940px;
}

.workbook-hero p {
  max-width: 800px;
}

.workbook-primary-actions {
  margin-top: 18px;
}

.research-hero {
  padding-bottom: clamp(28px, 4vw, 48px);
  padding-top: clamp(42px, 6vw, 84px);
}

.research-hero h1 {
  font-size: clamp(38px, 6vw, 74px);
  max-width: 980px;
}

.research-hero p {
  max-width: 820px;
}

.partner-readiness-hero {
  padding-bottom: clamp(30px, 4vw, 56px);
  padding-top: clamp(38px, 5vw, 68px);
}

.partner-readiness-hero h1 {
  font-size: clamp(36px, 5.2vw, 64px);
  max-width: 980px;
}

.partner-readiness-hero p {
  max-width: 860px;
}

.portal-page-content {
  padding: clamp(38px, 6vw, 84px) clamp(18px, 5vw, 76px);
}

.portal-page-grid,
.notice-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.portal-page-section {
  margin: 0 auto;
  max-width: 1060px;
}

.portal-page-section + .portal-page-section {
  margin-top: clamp(34px, 5vw, 64px);
}

.portal-page-section h2 {
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.08;
}

.portal-page-section h3 {
  font-size: 18px;
  margin-top: 18px;
}

.portal-page-section p,
.portal-page-section li {
  color: var(--portal-muted);
  font-size: 15px;
}

.portal-page-section p {
  margin-top: 12px;
}

.portal-page-section ul,
.portal-page-section ol {
  margin: 14px 0 0;
  padding-left: 22px;
}

.portal-page-section li + li {
  margin-top: 8px;
}

.portal-page-section a {
  color: var(--portal-teal);
  font-weight: 760;
}

.workbook-steps {
  counter-reset: workbook-step;
  display: grid;
  gap: 10px;
  list-style: none;
  padding-left: 0;
}

.workbook-steps li {
  background: rgba(21, 32, 42, 0.76);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  counter-increment: workbook-step;
  min-height: 78px;
  padding: 14px 16px 14px 54px;
  position: relative;
}

.workbook-steps li::before {
  align-items: center;
  background: rgba(67, 214, 197, 0.12);
  border: 1px solid rgba(67, 214, 197, 0.42);
  border-radius: 7px;
  color: var(--portal-teal);
  content: counter(workbook-step);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 30px;
  justify-content: center;
  left: 14px;
  position: absolute;
  top: 14px;
  width: 30px;
}

.portal-callout {
  background: rgba(21, 32, 42, 0.76);
  border: 1px solid var(--portal-border);
  border-left: 3px solid var(--portal-gold);
  border-radius: 8px;
  margin-top: 18px;
  padding: 18px;
}

.portal-inline-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 18px;
  padding: 0;
}

.portal-inline-list li,
.portal-inline-list li + li {
  margin-top: 0;
}

.portal-inline-list a {
  align-items: center;
  border: 1px solid rgba(170, 183, 183, 0.22);
  border-radius: 7px;
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  text-decoration: none;
}

.citation-list {
  counter-reset: citation;
  list-style: none;
  padding-left: 0;
}

.citation-list li {
  border-top: 1px solid rgba(170, 183, 183, 0.16);
  counter-increment: citation;
  padding: 12px 0 12px 34px;
  position: relative;
}

.citation-list li::before {
  color: var(--portal-gold);
  content: "[" counter(citation) "]";
  font-weight: 820;
  left: 0;
  position: absolute;
  top: 12px;
}

.readiness-table-wrap {
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  box-shadow: 0 18px 34px var(--portal-shadow);
  margin-top: 22px;
  overflow: auto;
}

.readiness-table {
  background: rgba(21, 32, 42, 0.76);
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.readiness-table th,
.readiness-table td {
  border-bottom: 1px solid rgba(170, 183, 183, 0.16);
  padding: 15px 16px;
  text-align: left;
  vertical-align: top;
}

.readiness-table thead th {
  background: rgba(7, 11, 13, 0.72);
  color: var(--portal-text);
  font-size: 13px;
  text-transform: uppercase;
}

.readiness-table tbody th {
  color: var(--portal-gold);
  font-size: 14px;
  width: 18%;
}

.readiness-table td {
  color: var(--portal-muted);
  font-size: 14px;
}

.readiness-table tr:last-child th,
.readiness-table tr:last-child td {
  border-bottom: 0;
}

.contact-card {
  background: rgba(17, 24, 32, 0.82);
  border: 1px solid rgba(67, 214, 197, 0.28);
  border-radius: 8px;
  margin-top: 22px;
  padding: clamp(18px, 4vw, 32px);
}

.contact-email {
  color: var(--portal-teal);
  display: inline-block;
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 850;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.social-preview-page {
  background: var(--portal-bg);
  height: 630px;
  overflow: hidden;
  width: 1200px;
}

.social-preview-card {
  align-items: center;
  display: flex;
  height: 630px;
  overflow: hidden;
  padding: 70px 82px;
  position: relative;
  width: 1200px;
}

.social-preview-card::after {
  background:
    linear-gradient(90deg, rgba(9, 13, 16, 0.95) 0%, rgba(9, 13, 16, 0.66) 48%, rgba(9, 13, 16, 0.16) 100%),
    linear-gradient(0deg, rgba(9, 13, 16, 0.86) 0%, rgba(9, 13, 16, 0.06) 44%, rgba(9, 13, 16, 0.62) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.social-preview-content {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

.social-preview-mark {
  height: 72px;
  margin-bottom: 26px;
  width: 72px;
}

.social-preview-card h1 {
  font-size: 92px;
  font-weight: 900;
  line-height: 0.92;
}

.social-preview-card p {
  color: #dce8e3;
  font-size: 37px;
  font-weight: 680;
  line-height: 1.34;
  margin-top: 26px;
  max-width: 780px;
}

.social-preview-card .social-preview-domain {
  color: var(--portal-gold);
  display: block;
  font-size: 27px;
  font-weight: 820;
  margin-top: 34px;
}

.identity-band {
  background: #0e1419;
}

.quickstart-band {
  background: #10161d;
}

.docs-band {
  background: #0c1115;
}

.stewardship-band {
  background: #111813;
}

.portal-section {
  margin: 0 auto;
  max-width: 1180px;
}

.portal-section h2 {
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 850;
  line-height: 1.05;
  margin-top: 8px;
  max-width: 820px;
}

.portal-section p {
  color: var(--portal-muted);
  margin-top: 14px;
}

.two-column {
  align-items: start;
  display: grid;
  gap: clamp(24px, 5vw, 70px);
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
}

.identity-grid,
.link-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.portal-tile,
.portal-link-card {
  background: rgba(21, 32, 42, 0.76);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  box-shadow: 0 18px 34px var(--portal-shadow);
  min-height: 158px;
  padding: 18px;
}

.portal-tile h3,
.portal-link-card strong {
  color: var(--portal-text);
  display: block;
  font-size: 16px;
  font-weight: 820;
}

.portal-tile p,
.portal-link-card span {
  color: var(--portal-muted);
  display: block;
  font-size: 14px;
  margin-top: 10px;
}

.command-panel {
  background: #070b0d;
  border: 1px solid rgba(67, 214, 197, 0.34);
  border-radius: 8px;
  box-shadow: 0 22px 40px var(--portal-shadow);
  color: #d9fff8;
  font-size: clamp(12px, 1.8vw, 15px);
  line-height: 1.7;
  overflow: auto;
  padding: 18px;
  white-space: pre;
}

.section-header {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.link-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-link-card {
  min-height: 176px;
  text-decoration: none;
}

.portal-link-card:hover,
.portal-link-card:focus-visible {
  border-color: rgba(240, 201, 106, 0.58);
  outline: none;
  transform: translateY(-2px);
}

.stewardship-copy {
  border-left: 1px solid rgba(240, 201, 106, 0.28);
  padding-left: clamp(18px, 3vw, 34px);
}

.portal-footer {
  align-items: center;
  background: #070b0d;
  border-top: 1px solid rgba(170, 183, 183, 0.16);
  color: var(--portal-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px 18px;
  justify-content: space-between;
  padding: 20px clamp(18px, 5vw, 76px);
}

.portal-footer a {
  color: var(--portal-teal);
  font-weight: 760;
}

@media (max-width: 900px) {
  .portal-header {
    align-items: center;
    display: grid;
    gap: 12px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .portal-nav-toggle {
    align-items: center;
    align-self: center;
    background: rgba(170, 183, 183, 0.06);
    border: 1px solid rgba(170, 183, 183, 0.28);
    border-radius: 7px;
    color: var(--portal-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    gap: 8px;
    justify-content: center;
    min-height: 44px;
    padding: 9px 11px;
  }

  .portal-nav {
    border-top: 1px solid rgba(67, 214, 197, 0.18);
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: flex-start;
    max-width: none;
    padding-top: 12px;
    width: 100%;
  }

  [data-navigation-ready="true"] .portal-nav {
    display: none;
  }

  [data-navigation-ready="true"][data-navigation-open="true"] .portal-nav {
    display: grid;
  }

  .portal-nav a {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 44px;
    text-align: center;
  }

  .portal-hero {
    min-height: auto;
  }

  .two-column,
  .identity-grid,
  .link-grid,
  .portal-page-grid,
  .notice-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .portal-brand strong,
  .portal-brand small {
    white-space: normal;
  }

  .portal-header {
    gap: 12px;
    padding: 12px 14px;
  }

  .portal-nav a {
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .portal-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-hero {
    overflow: visible;
    padding: 32px 18px 40px;
  }

  .portal-hero h1 {
    font-size: clamp(40px, 14vw, 54px);
    line-height: 1.02;
  }

  .portal-page-hero h1,
  .workbook-hero h1 {
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.05;
  }

  .portal-lede,
  .portal-page-hero p {
    font-size: 16px;
  }

  .portal-actions {
    flex-direction: column;
  }

  .portal-action {
    width: 100%;
  }

  .citation-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .citation-divider {
    border-left: 0;
    padding-left: 0;
  }

  .portal-tile,
  .portal-link-card {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .portal-nav a,
  .portal-action,
  .portal-link-card {
    transition: none;
  }
}
