body.space-site {
  --visual-it: url("./persikai-it-c317d37e2947.webp");
  --visual-infosec: url("./persikai-infosec-c317d37e2947.webp");
  --visual-hero: url("./persikai-hero-c317d37e2947.webp");
  --bg: light-dark(#f6f7f3, #0d1113);
  --surface: light-dark(#fff, #161c20);
  --border: light-dark(#dce2da, #333d42);
  --text: light-dark(#121e1b, #f1f5f2);
  --text-muted: light-dark(#475b54, #b6c4bf);
  --nav-mark: light-dark(#176044, #c2ea91);
  --control-border: light-dark(#74897e, #64746b);
  --topic-it: light-dark(#096575, #91dcec);
  --topic-sec: light-dark(#634792, #d6bcff);
  --radius: 12px;
  --page-gap: clamp(32px, 5vw, 72px);
  --portal-heading-size: clamp(2rem, 3.2vw, 3.25rem);
  --portal-library-width: 76rem;
  --ease-out: cubic-bezier(.2, .75, .25, 1);
  background: var(--bg);
}

body.space-site::before,
body.space-site::after {
  content: none;
}

.space-site .topbar,
.space-site .site-grid > .sidebar {
  border-color: var(--border);
  background: var(--surface);
}

.space-site .topbar-inner {
  max-width: 90rem;
}

.space-site .brand {
  gap: .55rem;
  font-size: clamp(.85rem, 1.7vw, 1.05rem);
  font-weight: 720;
  letter-spacing: -.015em;
  line-height: 1.12;
  white-space: normal;
}

.space-site .brand-name {
  max-width: 24ch;
}

@media (min-width: 900px) {
  .space-site .brand-name {
    max-width: 34ch;
  }
}

.space-site .brand-symbol {
  color: var(--nav-mark);
  flex: none;
}

.space-site :is(.nav-sections, .sidebar) a[aria-current] {
  color: var(--nav-mark);
}

.space-site .nav-sections a {
  font-size: .9375rem;
}

.space-site .sidebar a {
  border-radius: 0 9px 9px 0;
}

.space-site .sidebar a[aria-current],
.space-site .theme-control button[aria-pressed=true]:before {
  background: color-mix(in srgb, var(--nav-mark) 11%, var(--surface));
  border-color: var(--nav-mark);
}

.space-site :is(a, button, input, summary):focus-visible {
  outline: 2px solid var(--nav-mark);
  outline-offset: 3px;
}

.space-site :is(.page-heading, .topic-heading, .editorial-header) {
  border-radius: 16px;
}

.space-site :is(.page-heading, .topic-heading) {
  border: 1px solid var(--border);
  background: var(--surface);
}

.space-site :is(.section-title h2, .materials-heading, .page-heading h1) {
  font-weight: 700;
  letter-spacing: -.045em;
}

.space-site :is(.section-directory a, .database-card, .panel, .document-tree .article-card) {
  border-radius: 12px;
}

.space-site .document-tree .article-card p {
  font-size: .9375rem;
}

.space-site.portal-home .site-grid {
  display: flex;
  flex-direction: column;
}

.space-site.portal-home .site-grid > .sidebar {
  display: none;
}

.portal-home .site-content > main {
  padding-block-start: clamp(16px, 3vw, 42px);
}

.space-site .space-home {
  width: 100%;
  max-width: 81rem;
  margin-inline: auto;
}

.space-site .space-home .hero {
  --nav-mark: #dcfcad;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  isolation: isolate;
  overflow: hidden;
  gap: clamp(18px, 2.5vw, 30px);
  padding: clamp(21px, 5vw, 76px);
  border: 1px solid #394b42;
  border-radius: clamp(17px, 2vw, 28px);
  color: #f7fbf4;
  background: #101716;
  box-shadow: 0 14px 40px #090e101e;
}

.space-site .space-home .hero::before {
  background:
    repeating-linear-gradient(90deg, transparent 0 37px, #b5caba0a 37px 38px),
    radial-gradient(ellipse at 38% 100%, #21352d 0, transparent 68%);
}

.space-site .space-home .hero .hero-copy h1 {
  margin: 0;
  max-width: 21ch;
  font-size: clamp(2rem, 4.65vw, 4.9rem);
  line-height: 1.04;
  letter-spacing: -.05em;
  text-wrap: balance;
  overflow-wrap: normal;
}

.space-site .space-home .hero .hero-topic {
  color: #d7f5a9;
  font-size: .79em;
}

.space-site .space-home .hero .hero-copy .hero-lead {
  max-width: 40ch;
  margin-top: clamp(16px, 2vw, 26px);
  color: #d2e0d9;
  font-size: clamp(1rem, 1.5vw, 1.19rem);
  font-weight: 450;
  line-height: 1.5;
}

.space-site .space-home .hero-controls {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  max-width: 36rem;
  gap: 12px;
}

.space-site .space-home .hero-search {
  flex: 1 1 15rem;
  min-width: 0;
  height: 52px;
  border: 1px solid #82958b;
  border-radius: 10px;
  background: #19241f;
}

.space-site .space-home .hero-search input {
  color: #fff;
  padding-inline: 14px;
  font-size: 1rem;
}

.space-site .space-home .hero-search input::placeholder {
  color: #d0ddd6;
}

.space-site .space-home .hero-search:focus-within {
  outline-color: #dcfcad;
}

.space-site .space-home .hero-search input:focus-visible {
  outline: none;
}

.space-site .space-home .hero-search button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0 9px 9px 0;
  padding-inline: clamp(14px, 2vw, 24px);
  color: #16230d;
  background: #d7f5a9;
  font-weight: 700;
}

.space-site .space-home .hero-search button:hover {
  background: #e8ffd2;
}

.space-site .space-home .hero-controls .secondary-button {
  width: auto;
  min-height: 46px;
  border-color: #799081;
  border-radius: 10px;
  color: #f0f7f1;
  background: #18251f;
}

.space-site .space-home .hero-controls .secondary-button:hover {
  border-color: #d7f5a9;
  background: #263c30;
}

.hero-art {
  grid-row: 3;
  pointer-events: none;
  min-height: clamp(108px, 27vw, 180px);
  margin: 0 calc(-1 * clamp(21px, 5vw, 76px)) calc(-1 * clamp(21px, 5vw, 76px));
  background:
    linear-gradient(180deg, #101716 0%, #1017163b 52%, transparent),
    var(--visual-hero) 55% 52% / cover no-repeat;
}

@media (min-width: 800px) {
  .hero-art {
    position: absolute;
    grid-row: auto;
    inset: 0 0 0 40%;
    z-index: -1;
    margin: 0;
    background:
      linear-gradient(90deg, #101716 0%, #101716c4 24%, #1017161a 72%),
      var(--visual-hero) 68% 50% / cover no-repeat;
  }

  .space-site .space-home .hero {
    min-height: clamp(430px, 43vw, 575px);
  }

  .space-site .space-home .hero :is(.hero-copy, .hero-controls) {
    max-width: 55%;
  }
}

.space-site .space-home .section-title {
  border-top: 1px solid var(--border);
  padding-top: clamp(16px, 2vw, 25px);
  margin-bottom: clamp(14px, 2vw, 24px);
}

.space-site .space-home .section-title h2 {
  font-size: clamp(1.4rem, 3vw, 2.6rem);
}

.space-site .space-home .section-title a {
  color: var(--nav-mark);
  font-size: .9375rem;
  font-weight: 610;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.space-site .space-home .category-list {
  gap: clamp(14px, 2vw, 25px);
}

@media (min-width: 680px) {
  .space-site .space-home .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.space-site .space-home .category-list .category-row {
  --card-padding: clamp(16px, 2.4vw, 28px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  align-items: start;
  gap: 7px 12px;
  margin: 0;
  padding: 0 var(--card-padding) var(--card-padding);
  overflow: hidden;
  border-color: var(--border);
  border-radius: 17px;
  background: var(--surface);
  text-decoration: none;
}

.space-site :is(.category-row, .section-directory a)[data-topic=it],
.space-site .topic-page[data-section=it] {
  --section-visual: var(--visual-it);
  --section-accent: var(--topic-it);
}

.space-site :is(.category-row, .section-directory a)[data-topic=infosec],
.space-site .topic-page[data-section=infosec] {
  --section-visual: var(--visual-infosec);
  --section-accent: var(--topic-sec);
}

.space-site .space-home .category-list .category-row::before,
.space-site .section-directory a::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 2.15;
  border-radius: 9px;
  background: #111822 var(--section-visual) center / cover no-repeat;
}

.space-site .space-home .category-list .category-row::before {
  grid-column: 1 / -1;
  width: calc(100% + 2 * var(--card-padding));
  margin: 0 calc(-1 * var(--card-padding)) calc(var(--card-padding) / 2);
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}

.space-site .space-home .category-row > svg {
  grid-row: span 2;
  box-sizing: content-box;
  padding: 9px;
  margin: 0;
  border-radius: 10px;
  color: var(--section-accent);
  background: color-mix(in srgb, var(--section-accent) 11%, var(--surface));
}

.space-site .space-home .category-list .category-row h3 {
  margin: 0;
  font-size: clamp(1.075rem, 2vw, 1.6rem);
  font-weight: 680;
  letter-spacing: -.035em;
}

.space-site .space-home .category-list .category-row p {
  grid-column: 2;
}

.space-site .space-home .category-list .category-row p,
.space-site .space-home .principles :is(dd, .principles-note) {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.space-site .section-directory a {
  display: grid;
  gap: .8rem;
}

.space-site .space-home .principles dl {
  gap: clamp(12px, 2vw, 26px);
}

.space-site .space-home .principles dl > div {
  padding: 10px 0 0;
  border-top: 2px solid var(--border);
}

.space-home .principles-note {
  margin: 22px 0 0;
  max-width: 67ch;
}

.space-site .footer {
  color: var(--muted);
  border-color: var(--border);
  overflow-wrap: anywhere;
}

.portal-home .footer {
  width: min(100%, 89rem);
  margin-inline: auto;
}

@media (hover: hover) {
  .space-site .space-home .category-list .category-row:hover {
    border-color: var(--section-accent);
    color: var(--section-accent);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .space-site.portal-home .space-home .hero {
    animation: portal-hero-fade .26s var(--ease-out) both;
  }

  .space-site .mobile-drawer[open] {
    animation: persikai-drawer .22s var(--ease-out) both;
  }

  @media (hover: hover) and (pointer: fine) {
    .space-site .space-home .category-list .category-row {
      transition: border-color .2s, box-shadow .22s;
    }

    .space-site .space-home .category-list .category-row::before {
      transition: scale .42s var(--ease-out), filter .3s;
    }

    .space-site .space-home .category-list .category-row:hover {
      transform: none;
      box-shadow: 0 14px 24px #040d2324;
    }

    .space-site .space-home .category-list .category-row:hover::before {
      scale: 1.025;
      filter: brightness(1.1);
    }
  }
}

@keyframes portal-hero-fade {
  from { opacity: .7; }
  to { opacity: 1; }
}

@keyframes persikai-drawer {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@media (max-width: 800px) {
  .space-site .space-home .principles dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .space-site .space-home .hero .hero-copy h1 {
    font-size: clamp(2rem, 9vw, 2.4rem);
    line-height: 1.09;
  }

  .space-site .space-home .hero-search {
    flex-basis: 100%;
  }

  .space-site .space-home .hero-controls {
    gap: 8px;
  }

  .space-site .brand {
    gap: .35rem;
  }

  .space-site .brand-symbol {
    width: 20px;
    height: 20px;
  }
}

.space-site .catalog-page {
  width: 100%;
  max-width: var(--portal-library-width);
  container-type: inline-size;
  margin-inline: auto;
}

.space-site .catalog-heading {
  margin-bottom: clamp(24px, 4vw, 48px);
}

.space-site .catalog-heading h1 {
  margin: 0 0 12px;
  font-size: var(--portal-heading-size);
  line-height: 1.08;
  font-weight: 720;
  letter-spacing: -.055em;
}

.space-site .catalog-heading p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 16px;
}

.space-site .catalog-sections {
  display: grid;
  gap: clamp(16px, 2.5vw, 32px);
}

.space-site .catalog-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
}

.space-site .catalog-card[data-topic=infosec] {
  --section-visual: var(--visual-infosec);
  --section-accent: var(--topic-sec);
}

.space-site .catalog-card[data-topic=it] {
  --section-visual: var(--visual-it);
  --section-accent: var(--topic-it);
}

.space-site .catalog-visual {
  aspect-ratio: 2.25;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #10191d;
}

.space-site .catalog-visual::before {
  content: "";
  display: block;
  height: 100%;
  background: #10191d var(--section-visual) center / cover no-repeat;
}

.space-site .catalog-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(18px, 3.1vw, 36px);
}

.space-site .catalog-copy h2 {
  margin: 0;
  font-size: clamp(1.36rem, 2.7vw, 2.3rem);
  font-weight: 690;
  line-height: 1.06;
  letter-spacing: -.033em;
  overflow-wrap: anywhere;
}

.space-site .catalog-copy p {
  margin: 0;
  max-width: 49ch;
  color: var(--muted);
  line-height: 1.52;
}

.space-site .catalog-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.space-site .catalog-copy li {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .875rem;
  color: var(--section-accent);
  background: color-mix(in srgb, var(--section-accent) 6%, var(--surface));
}

.space-site .catalog-action {
  margin-top: auto;
  padding-top: 9px;
  color: var(--section-accent);
  font-weight: 650;
  text-underline-offset: .22em;
}

.space-site .catalog-card:is(:hover, :focus-visible) {
  border-color: var(--section-accent);
  outline-color: var(--section-accent);
}

.space-site .catalog-card:is(:hover, :focus-visible) .catalog-action {
  text-decoration: underline;
}

@container (min-width: 700px) {
  .space-site .catalog-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.space-site .topic-page {
  max-width: var(--portal-library-width);
  margin-inline: auto;
}

.space-site .topic-page .topic-heading {
  display: grid;
  grid-template-areas: "title" "visual";
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2.8vw, 40px);
  min-height: 0;
  margin-block: clamp(16px, 3vw, 32px) clamp(28px, 4vw, 52px);
  padding: clamp(12px, 1.8vw, 22px);
  border-color: color-mix(in srgb, var(--section-accent) 24%, var(--border));
  border-radius: clamp(14px, 2vw, 24px);
  background:
    radial-gradient(ellipse at 0% 40%, color-mix(in srgb, var(--section-accent) 13%, transparent), transparent 74%),
    var(--surface);
}

.space-site .topic-page .topic-heading::before {
  position: relative;
  inset: auto;
  z-index: auto;
  grid-area: visual;
  min-width: 0;
  aspect-ratio: 3 / 2;
  border-radius: clamp(9px, 1.35vw, 16px);
  background: #10191d var(--section-visual) center / contain no-repeat;
}

.space-site .topic-page .topic-title {
  grid-area: title;
  flex-direction: column;
  gap: clamp(9px, 1.8vw, 20px);
  padding: clamp(5px, 2vw, 28px);
}

.space-site .topic-page .topic-title h1 {
  color: var(--text);
  font: 720 var(--portal-heading-size) / 1.08 var(--font-sans);
  letter-spacing: -.05em;
  text-wrap: balance;
}

.space-site .topic-page .topic-title svg {
  box-sizing: content-box;
  padding: 8px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--section-accent) 28%, var(--border));
  border-radius: 10px;
  color: var(--section-accent);
  background: color-mix(in srgb, var(--section-accent) 9%, var(--surface));
}

@media (min-width: 900px) {
  .space-site .topic-page .topic-heading {
    grid-template-areas: "title visual";
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  }
}

.space-site .topic-page .topic-heading > p {
  display: none;
}

.space-site .topic-materials {
  max-width: none;
}

.space-site .topic-materials .materials-heading {
  padding-bottom: 12px;
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.space-site .topic-materials .material-notice {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
}

.space-site .document-tree {
  --tree-accent: var(--section-accent, var(--topic-accent, var(--nav-mark)));
  --tree-line: color-mix(in srgb, var(--tree-accent) 15%, var(--border));
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.space-site .document-tree .folder-item > details,
.space-site .topic-materials > .document-tree > .document-item {
  min-width: 0;
  border: 1px solid var(--tree-line);
  border-radius: 14px;
  background: var(--surface);
}

.space-site .document-tree .document-tree {
  gap: 0;
  margin: 0;
  padding: 0;
  border-inline-start: 0;
}

.space-site .document-tree .document-tree > .folder-item {
  margin: 8px clamp(8px, 2vw, 20px);
}

.space-site .document-tree .document-tree > .document-item + .document-item {
  border-top: 1px solid var(--border);
}

.space-site .document-tree summary {
  min-height: 60px;
  gap: 12px;
  padding: 10px clamp(12px, 2vw, 24px);
  border: 0;
  border-radius: 13px;
  line-height: 1.35;
  font-size: clamp(1rem, 1.55vw, 1.14rem);
  font-weight: 680;
  background: color-mix(in srgb, var(--tree-accent) 7%, var(--surface));
}

.space-site .document-tree details[open] > summary {
  border-bottom: 1px solid var(--tree-line);
  border-radius: 13px 13px 0 0;
}

.space-site .document-tree summary .file-icon-folder {
  box-sizing: content-box;
  flex: none;
  padding: 7px;
  border-radius: 8px;
  color: var(--tree-accent);
  background: color-mix(in srgb, var(--tree-accent) 12%, var(--surface));
}

.space-site :is(.document-tree, .file-tree) summary .file-icon-chevron {
  order: 1;
  flex: none;
  margin-inline-start: auto;
  color: var(--tree-accent, var(--topic-accent, var(--nav-mark)));
}

.space-site .document-tree .article-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  gap: 3px;
  height: auto;
  min-height: 54px;
  padding: 12px clamp(12px, 2vw, 24px) 12px clamp(43px, 5.2vw, 66px);
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
}

.space-site .document-tree > .document-item:last-child > .article-card {
  border-radius: 0 0 13px 13px;
}

.space-site .topic-materials > .document-tree > .document-item > .article-card {
  border-radius: 13px;
}

.space-site .document-tree .article-card h3 {
  display: block;
  margin: 0;
  min-width: 0;
  font-size: 1.01rem;
  font-weight: 625;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.space-site .document-tree .article-card .file-icon {
  position: absolute;
  inset-block-start: 11px;
  inset-inline-start: clamp(10px, 1.85vw, 23px);
  box-sizing: content-box;
  padding: 4px;
  border-radius: 7px;
  color: var(--tree-accent);
  background: color-mix(in srgb, var(--tree-accent) 8%, var(--surface));
}

.space-site .document-tree .article-card p {
  max-width: 88ch;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.48;
}

.space-site .document-tree .article-card :is(.tag, .article-arrow, .category-arrow, .card-meta),
.space-site .terminal-prompt {
  display: none;
}

.space-site .document-tree :is(summary, .article-card):is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--tree-accent) 10%, var(--surface));
}

.space-site .document-tree :is(summary, .article-card):focus-visible {
  outline-color: var(--tree-accent);
  outline-offset: -2px;
}

.space-site .reading-frame .editorial-header {
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid var(--border);
  border-top: 3px solid var(--topic-accent, var(--nav-mark));
  background: var(--surface);
}

.space-site .reading-frame .editorial-header::before {
  content: none;
}

.space-site .reading-frame .editorial-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.space-site .reading-frame .markdown-content {
  color: var(--text);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.72;
}

.space-site .reading-frame .markdown-content > :is(p, ul, ol, blockquote, .callout) {
  max-width: 70ch;
}

.space-site .reading-frame .markdown-content > :is(p, ul, ol) {
  margin-bottom: 1em;
}

.space-site .reading-frame .markdown-content > h2 {
  margin-block: clamp(1.7rem, 3.8vw, 2.75rem) .65em;
  letter-spacing: -.022em;
}

.space-site .reading-frame .markdown-content > h3 {
  margin-block: 1.5em .55em;
}

.space-site .reading-frame :is(.article-files, .article-toc) {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.space-site .file-tree :is(.folder-item > summary, .document-item > a),
.space-site .reading-frame .toc a {
  padding-inline: 8px;
  border-radius: 6px;
}

.space-site .file-tree .document-item > a {
  border-inline-start: 2px solid transparent;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.space-site .file-tree .document-item > a .file-icon {
  flex: none;
  align-self: flex-start;
  margin-top: 2px;
  color: var(--topic-accent, var(--nav-mark));
}

.space-site .article-files .file-tree .file-tree {
  gap: 1px;
  margin-inline-start: 7px;
  padding-inline-start: 7px;
  border-inline-start: 1px solid var(--border);
}

.space-site .file-tree .folder-item > details > summary {
  margin-bottom: 5px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--topic-accent, var(--nav-mark)) 7%, var(--surface));
  font-weight: 650;
  cursor: pointer;
}

.space-site .file-tree .folder-item > details > summary .file-icon-folder {
  color: var(--topic-accent, var(--nav-mark));
}

.space-site .reading-frame .toc a[data-depth="3"] {
  padding-inline-start: 22px;
}

.space-site .reading-frame .toc a[data-depth="4"] {
  padding-inline-start: 34px;
}

.space-site .file-tree .document-item > a[aria-current=page],
.space-site .reading-frame .toc a[aria-current] {
  border-inline-start-color: var(--topic-accent, var(--nav-mark));
  color: var(--text);
  font-weight: 650;
  background: color-mix(in srgb, var(--topic-accent, var(--nav-mark)) 14%, var(--surface));
}

.space-site .reading-frame .toc a:is(:hover, :focus-visible):not([aria-current]),
.space-site .file-tree .document-item > a:is(:hover, :focus-visible):not([aria-current]) {
  background: color-mix(in srgb, var(--nav-mark) 8%, var(--surface));
}

@media (prefers-reduced-motion: no-preference) {
  .space-site :is(.catalog-card, .document-tree summary, .document-tree .article-card,
    .reading-frame .toc a, .file-tree .document-item > a) {
    transition: border-color .18s, background-color .18s, color .18s;
  }

  .space-site :is(.document-tree, .file-tree) summary .file-icon-chevron {
    transition: transform .18s var(--ease-out);
  }

  .space-site :is(.document-tree, .file-tree) details[open] > :is(.document-tree, .file-tree) {
    animation: portal-folder-reveal .18s var(--ease-out) both;
  }

  .space-site .catalog-visual::before {
    transition: transform .28s var(--ease-out);
  }

  .space-site .catalog-card:focus-visible .catalog-visual::before {
    transform: scale(1.032);
  }

  @media (hover: hover) and (pointer: fine) {
    .space-site .catalog-card:hover .catalog-visual::before {
      transform: scale(1.032);
    }
  }
}

@keyframes portal-folder-reveal {
  from { opacity: .55; }
  to { opacity: 1; }
}

.space-site .portal-trail {
  margin-bottom: clamp(14px, 2vw, 22px);
}

.space-site :is(a, button, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--nav-mark);
  outline-offset: 3px;
}

.space-site .skip:focus {
  z-index: 100;
  inset: 12px auto auto 12px;
  width: auto;
  max-width: calc(100vw - 24px);
  height: auto;
  padding: 10px 14px;
  border: 1px solid var(--nav-mark);
  border-radius: 8px;
  clip: auto;
  clip-path: none;
  color: var(--text);
  background: var(--surface);
}

.space-site .article-image img:not([width][height]) {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

@page {
  margin: 15mm;
}

@media print {
  html:has(.reading-frame),
  body.space-site:has(.reading-frame) {
    color-scheme: light;
    color: #000;
    background: #fff;
  }

  .space-site:has(.reading-frame) :is(.topbar, .sidebar, .footer, .skip, dialog, button),
  .space-site .reading-frame :is(.breadcrumbs, .article-files, .article-toc, .article-tools, .heading-link, .related-materials) {
    display: none !important;
  }

  .space-site:has(.reading-frame) :is(.site-grid, .site-content, #main, .doc-shell),
  .space-site .reading-frame :is(.doc-grid, .markdown-content) {
    display: block;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .space-site .reading-frame :is(.markdown-content, .markdown-content *, .editorial-header, .editorial-header *) {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    content-visibility: visible;
  }

  .space-site .reading-frame .editorial-header {
    margin: 0 0 14pt;
    padding: 0 0 8pt;
    border: 0;
    border-bottom: 1px solid #999;
  }

  .space-site .reading-frame .editorial-header h1 {
    font-size: 20pt;
  }

  .space-site .reading-frame .markdown-content {
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .space-site .reading-frame .markdown-content > :is(p, ol, ul, blockquote, .callout) {
    max-width: none;
  }

  .space-site .reading-frame :is(h1, h2, h3, h4) {
    break-after: avoid;
  }

  .space-site .reading-frame .markdown-content :is(pre, pre code) {
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .space-site .reading-frame .table-scroll {
    overflow: visible;
  }

  .space-site .reading-frame :is(th, td) {
    min-width: 0 !important;
    padding: 4pt;
    overflow-wrap: anywhere !important;
  }
}

/* Shared masthead and footer. */
.space-site .topbar-inner {
  width: 100%;
  max-width: none;
  padding-inline: var(--content-padding);
  gap: clamp(8px, 2vw, 32px);
}

.space-site .topbar .nav-links {
  justify-content: space-between;
  align-items: center;
  column-gap: clamp(14px, 3vw, 52px);
}

.space-site .topbar .brand {
  min-height: 48px;
  min-width: 0;
  color: var(--text);
}

.space-site .topbar .brand-name { max-width: 32ch; }
.space-site .topbar .brand-short { display: none; }

.space-site .topbar .nav-sections { align-items: center; gap: 5px; }
.space-site .topbar .nav-sections a {
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 580;
}

.space-site .topbar .nav-sections a[aria-current] {
  background: color-mix(in srgb, var(--nav-mark) 11%, var(--surface));
}

.space-site .topbar .nav-sections a[aria-current]::after {
  inset: auto 13px 5px;
  height: 1px;
}

.space-site .topbar .theme-control {
  flex: 0 0 auto;
  padding-inline-start: clamp(5px, 1vw, 14px);
  border-inline-start: 1px solid var(--border);
}

.space-site .topbar .theme-control svg { width: 24px; height: 24px; }

/* Sidebar occupies the content row; the footer spans both tracks. */
.space-site .site-grid > .sidebar { grid-row: 1; }

.space-site .site-grid > .portal-footer {
  display: block;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 70px;
  padding: 0;
  white-space: normal;
  background: var(--surface);
  color: var(--muted);
}

.portal-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px clamp(20px, 4vw, 60px);
  min-height: 70px;
  padding: 12px var(--content-padding);
}

.portal-footer .footer-identity {
  min-width: 0;
  display: flex;
  gap: 11px;
  align-items: center;
}

.portal-footer .footer-symbol {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--nav-mark);
}

.portal-footer .footer-name {
  display: inline;
  min-height: 0;
  white-space: normal;
  color: var(--text);
  font-size: 14px;
  font-weight: 610;
}

.portal-footer small { display: block; font-size: 12px; }
.portal-footer .footer-links { display: flex; flex-wrap: wrap; gap: clamp(14px, 2.4vw, 28px); }
.portal-footer .footer-links a { min-height: 44px; color: var(--muted); font-size: 14px; }

@media (hover: hover) {
  .space-site .topbar .nav-sections a:hover:not([aria-current]) {
    background: color-mix(in srgb, var(--text) 6%, var(--surface));
  }
  .portal-footer .footer-links a:hover { color: var(--text); text-decoration: underline; }
}

@media (max-width: 860px) {
  .space-site .topbar .brand-name { display: none; }
  .space-site .topbar .brand-short { display: inline; }
  .space-site .topbar .nav-sections a { padding-inline: 9px; }
}

@media (max-width: 639px) {
  .space-site .topbar-inner { padding-inline: clamp(10px, 3vw, 20px); }
  .space-site .topbar .theme-control { border: 0; padding: 0; }
  .portal-footer-inner { flex-wrap: wrap; padding-block: 14px 6px; }
  .portal-footer .footer-links { width: 100%; padding-inline-start: 49px; }
}

/* Search workspace. */
.portal-search { width: 100%; max-width: var(--portal-library-width); margin-inline: auto; }
.portal-search :is(.portal-search-form, .search-suggestions, .search-results-panel) { max-width: 68rem; }
.portal-search [hidden] { display: none !important; }
.portal-search .portal-trail { margin-block-end: 20px; }

.search-intro { margin-block: 0 24px; }
.search-intro h1 {
  margin: 0;
  color: var(--text);
  font: 720 var(--portal-heading-size)/1.08 var(--font-sans);
  letter-spacing: -.042em;
  text-wrap: balance;
}

.search-intro p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.portal-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.portal-search-field {
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 14px;
  border: 1px solid var(--control-border);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
}
.portal-search-field svg { flex: none; }
.portal-search-field:focus-within { outline: 2px solid var(--nav-mark); outline-offset: 3px; }
.portal-search-field input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.space-site .portal-search-field input:focus-visible { outline: none; }
.portal-search-field input::placeholder { color: var(--muted); opacity: 1; }

.portal-search-submit {
  min-height: 54px;
  padding-inline: clamp(15px, 3vw, 30px);
  border: 1px solid var(--nav-mark);
  border-radius: 11px;
  background: var(--nav-mark);
  color: light-dark(#fff, #17231a);
  font-weight: 680;
}

.search-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}
.search-filters legend { float: inline-start; padding: 12px 10px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.search-filters label { position: relative; cursor: pointer; }
.search-filters input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.search-filters label span,.search-suggestions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.search-filters label :checked + span { border-color: var(--nav-mark); background: color-mix(in srgb, var(--nav-mark) 10%, var(--surface)); }
.search-filters label :focus-visible + span { outline: 2px solid var(--nav-mark); outline-offset: 2px; }

.search-suggestions,.search-results-panel {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding-top: 17px;
}
.search-suggestions h2,.search-results-panel h2 { margin: 0 0 12px; color: var(--text); font-size: 19px; font-weight: 650; }
.search-suggestions ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.search-results-panel:has(h2:empty):has(.search-result-list:empty) { display:none; }
.search-result-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.search-result-link {
  display: block;
  min-width: 0;
  padding: clamp(14px, 2.2vw, 24px);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.search-result-section { color: var(--nav-mark); font-size: 13px; font-weight: 630; }
.search-result-title { margin: 4px 0 0; color: var(--text); font-size: 18px; font-weight: 660; line-height: 1.3; }
.search-result-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 6px 0 0;
  color: var(--muted);
}
.search-result-folder { display: block; margin-top: 9px; color: var(--muted); font-size: 13px; }
.search-recovery { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.search-recovery a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .2em; color: var(--nav-mark); }

@media (hover: hover) {
  .search-result-link:hover,.search-suggestions a:hover { border-color: var(--nav-mark); }
  .search-result-link:hover h3 { text-decoration: underline; text-underline-offset: .14em; }
  .portal-search-submit:hover { filter: brightness(.92); }
}
@media (max-width: 440px) {
  .search-filters legend { float: none; padding: 0 0 6px; }
}
