.system-page {
  --system-paper: #f5f3ed;
  --system-line: #e5e0d6;
  --system-accent: #e8ddc2;
  margin: 0;
  color: var(--ic-ink);
  font: 400 16px/1.6 var(--ic-sans);
}

.system-page *, .system-page *::before, .system-page *::after { box-sizing: border-box; }
.system-page :where(h1, h2, h3, p, dl, dd, figure, ol, ul) { margin: 0; }
.system-page main :where(ol, ul) { padding: 0; list-style: none; }
.system-page main a { color: inherit; }
.system-page main a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.system-page main :is(section[id], div[id]) { scroll-margin-top: 112px; }
.system-page .system-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.system-page main svg:not(.system-stack-art) {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-width { width: min(var(--ic-max), calc(100% - 2 * var(--ic-gutter))); margin-inline: auto; }

.system-intro {
  padding-block: clamp(132px, 10.8vw, 166px) clamp(32px, 4vw, 52px);
  text-align: center;
}

.system-kicker {
  margin-bottom: 18px;
  font: 500 13px/1.4 Geist, Arial, sans-serif;
  letter-spacing: .045em;
  color: #685c48;
}

.system-intro h1 {
  max-width: 920px;
  margin-inline: auto;
  font: 400 clamp(48px, 5.75vw, 84px)/1.01 var(--ic-serif);
  letter-spacing: -.059em;
  text-wrap: balance;
}

.system-intro > p:last-child {
  max-width: 640px;
  margin: 24px auto 0;
  color: var(--ic-muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  text-wrap: pretty;
}

.system-atlas {
  display: grid;
  grid-template-columns: minmax(264px, .75fr) minmax(0, 1.25fr);
  align-items: center;
  min-height: 450px;
  gap: 12px;
  padding: clamp(28px, 4.2vw, 60px);
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 81% 56%, #4c493d 0%, transparent 56%),
    linear-gradient(147deg, #171716 6%, #1f1f1d 60%, #292824 100%);
  color: #f8f7f3;
}

.system-atlas-copy { z-index: 1; }
.system-atlas h2 {
  max-width: 12ch;
  margin-bottom: clamp(20px, 2.25vw, 34px);
  font: 400 clamp(34px, 3.5vw, 50px)/1.02 var(--ic-serif);
  letter-spacing: -.045em;
  text-wrap: balance;
}

.system-layer-links { display: grid; gap: 6px; max-width: 330px; }
.system-layer-links a {
  display: grid;
  grid-template-columns: 22px 20px 1fr 16px;
  align-items: center;
  gap: 11px;
  min-height: 47px;
  padding: 9px 13px;
  border: 1px solid #f8f5ea26;
  border-radius: 8px;
  background: #ffffff09;
  text-decoration: none;
  transition: background-color .24s, color .24s, border-color .24s;
}
.system-layer-links a > span { font: 400 11px/1 Geist, sans-serif; opacity: .78; }
.system-layer-links a > strong { font-size: 15px; font-weight: 500; line-height: 1.35; }
.system-layer-links a > svg:last-child { width: 16px; height: 16px; opacity: .75; }
.system-layer-links a:hover, .system-layer-links a:focus-visible {
  background-color: #ffffff23;
  border-color: #f8f5ea65;
}
.system-page .system-layer-links a.is-current {
  color: #26231d;
  border-color: var(--system-accent);
  background: var(--system-accent);
}

.system-stack { display: grid; place-items: center; margin: -24px -24px -18px -2px; }
.system-stack-art { display: block; width: 100%; max-width: 650px; height: auto; overflow: visible; }
.system-slab {
  color: #efeee7;
  transition: transform .45s ease, color .3s;
  animation: system-stack-in .78s both cubic-bezier(.22, 1, .36, 1);
  animation-delay: calc(.08s * var(--layer-order));
}
.system-slab > use:last-of-type { stroke: currentColor; stroke-width: 1.35; fill: none; }
.system-slab text { fill: currentColor; font: 500 21px Geist, sans-serif; letter-spacing: -.025em; }
.system-stack-edge {
  fill: var(--slab-depth, #242420);
  stroke: var(--slab-rim, #6f6c60);
  stroke-width: .8px;
}
.system-stack-face {
  fill: var(--slab-face, url(#sys-glass));
  stroke: var(--slab-border, url(#sys-edge));
  stroke-width: 1px;
}
.system-slab.is-current {
  --slab-depth: #716650;
  --slab-rim: #afa187;
  --slab-face: url(#sys-light-glass);
  --slab-border: #fff2d4;
  color: #24221c;
  transform: translate(7px, -5px);
}

@keyframes system-stack-in {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

.system-chapters { margin-top: clamp(88px, 10vw, 152px); }
.system-chapter {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 32px clamp(32px, 5vw, 76px);
  align-items: center;
  margin-bottom: var(--ic-section);
}
.system-chapter-copy { min-width: 0; }
.system-index {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 19px;
  font: 500 13px/1.4 Geist, sans-serif;
  color: #645942;
}
.system-index span {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 29px;
  padding-inline: 4px;
  border: 1px solid var(--system-line);
  border-radius: 7px;
  background: var(--system-paper);
  font-size: 11px;
}
.system-chapter h2, .system-closing h2 {
  font: 400 clamp(36px, 4.2vw, 58px)/1.02 var(--ic-serif);
  letter-spacing: -.052em;
  text-wrap: pretty;
}
.system-chapter-copy > p:not(.system-index), .system-closing > p {
  margin-top: 18px;
  color: var(--ic-muted);
  font-size: 17px;
  line-height: 1.62;
}
.system-points {
  display: grid;
  gap: 12px;
  margin-block: 22px;
  padding-left: 15px;
  border-left: 1px solid #c9beaa;
}
.system-points dt, .system-example-grid dt { font-weight: 650; line-height: 1.35; }
.system-points dd { margin-top: 4px; color: #5c5a55; font-size: 15px; line-height: 1.55; }
.system-link, .system-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 44px;
  width: fit-content;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.35;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.system-page main .system-link svg { width: 16px; height: 16px; }
.system-link:hover { text-decoration-color: #8a795c; }

.system-catalog {
  min-width: 0;
  padding: clamp(16px, 2.7vw, 36px);
  border: 1px solid var(--system-line);
  border-radius: 18px;
  background: linear-gradient(148deg, #faf9f5, #f0ece3);
}
.system-catalog-head, .system-flow-head, .system-format-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}
.system-icon-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ded7c9;
  border-radius: 10px;
  background: #f7f4ec;
  color: #544a39;
}
.system-catalog-head h3, .system-format-meta h3, .system-flow-head h3 {
  font: 500 clamp(19px, 2vw, 25px)/1.15 var(--ic-serif);
  letter-spacing: -.026em;
}
.system-catalog-head p, .system-format-meta p { margin-top: 4px; color: #686259; font-size: 14px; line-height: 1.45; }

.system-source-list { display: grid; gap: 8px; }
.system-source-list a {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #e0dcd2;
  border-radius: 9px;
  background: #fff;
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}
.system-source-list a:hover { background: #fffcf5; border-color: #b5aa95; }
.system-source-list strong, .system-source-list small { display: block; line-height: 1.35; }
.system-source-list strong { margin-top: 2px; font-size: 15px; font-weight: 600; }
.system-source-list small { color: #665e51; font-size: 12px; }
.system-source-list svg { color: #7a6d57; }
.system-catalog-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: #5b5447;
  font-size: 13px;
}
.system-catalog-foot a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; text-underline-offset: 3px; }
.system-page .system-catalog-foot svg { width: 14px; height: 14px; }

.system-media {
  position: relative;
  min-width: 0;
  padding: clamp(14px, 2.4vw, 30px);
  border: 1px solid var(--system-line);
  border-radius: 18px;
  overflow: hidden;
  background: #f4f1e9;
}
.system-media figcaption { margin-top: 12px; color: #625b4e; font-size: 12px; }

.system-project, .system-chat {
  border-color: #55534c;
  background:
    radial-gradient(ellipse at 90% 100%, #5c574a, transparent 68%),
    linear-gradient(135deg, #1d1d1b, #36352f 75%);
}
.system-project figcaption, .system-chat figcaption { color: #e0dbcf; }
.system-app {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  gap: 0;
  padding: 5px 5px 5px 0;
  border-radius: 12px;
  background: #141413;
  box-shadow: 0 14px 32px #0004;
}
.system-app-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 12px;
  color: #e8e3d8;
}
.system-app-rail img { filter: brightness(0) invert(1); }
.system-app-content { min-width: 0; padding: clamp(14px, 2.1vw, 26px); border-radius: 8px; background: #fff; }
.system-app-path { display: flex; align-items: center; gap: 6px; color: #625f56; font-size: 12px; line-height: 1.4; }
.system-page .system-app-path svg { width: 14px; height: 14px; }
.system-app-content h3 {
  margin-top: 7px;
  font: 400 clamp(24px, 2.8vw, 38px)/1.08 var(--ic-serif);
  letter-spacing: -.036em;
}
.system-app-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin-block: 18px 9px;
  color: #67645d;
  border-bottom: 1px solid #eae7df;
  font-size: 12px;
}
.system-app-tabs span { padding-bottom: 7px; }
.system-app-tabs .is-current { border-bottom: 2px solid #1f1e1b; color: #24221f; }
.system-file-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: 6px;
}
.system-file-list li + li { margin-top: 2px; }
.system-file-list li:first-child { background: #f2eee4; }
.system-file-list li svg { color: #70654f; }
.system-file-list :is(strong, small) { display: block; line-height: 1.4; overflow-wrap: anywhere; }
.system-file-list strong { font-size: 14px; font-weight: 600; }
.system-file-list small { color: #655f56; font-size: 12px; }
.system-file-type { color: #5e584d; font-size: 10px; }

.system-chat-question {
  max-width: 91%;
  margin: 16px 0 14px auto;
  padding: 11px 13px;
  border-radius: 11px 11px 3px 11px;
  background: #eeede9;
  font-size: 14px;
  line-height: 1.5;
}
.system-chat-brand { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; }
.system-chat-answer p { margin-top: 7px; font-size: 14px; line-height: 1.55; }
.system-chat-answer sup { font: 500 10px/1 Geist, sans-serif; color: #665a42; vertical-align: super; white-space: nowrap; }
.system-citation {
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid #e2d7bf;
  border-radius: 8px;
  background: #f7f2e6;
}
.system-citation strong { display: block; font-size: 13px; font-weight: 600; }
.system-citation strong span { margin-right: 4px; color: #6b5b40; }
.system-citation q { display: block; margin-top: 4px; font: 400 16px/1.3 var(--ic-serif); }

.system-workflow {
  background:
    radial-gradient(circle at 2px 2px, #b4aa963f 1.2px, transparent 1.7px) 0 0 / 22px 22px,
    linear-gradient(140deg, #f8f6f0, #ede7d9);
}
.system-flow-head small { display: block; margin-bottom: 3px; color: #6c624f; font-size: 12px; }
.system-flow { display: grid; gap: 10px; }
.system-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 9px 11px;
  border: 1px solid #e3ddd0;
  border-radius: 9px;
  background: #fff;
}
.system-flow li + li::before {
  content: "";
  position: absolute;
  left: 25px;
  bottom: 100%;
  width: 1px;
  height: 12px;
  background: #a99c83;
}
.system-flow li:last-child { color: #fffdf7; border-color: #2c2a25; background: #282621; }
.system-flow li > span {
  display: grid;
  place-items: center;
  height: 26px;
  border-radius: 5px;
  background: #f4eee2;
  color: #635740;
  font: 400 11px/1 Geist, sans-serif;
}
.system-flow :is(strong, small) { display: block; line-height: 1.4; }
.system-flow strong { font-size: 14px; font-weight: 600; }
.system-flow small { color: #605b51; font-size: 12px; }
.system-flow li:last-child small { color: #e5dfd4; }

.system-format {
  background:
    radial-gradient(ellipse at 70% 22%, #faf8f2, transparent 72%),
    linear-gradient(145deg, #f4f1ea, #e6dfd0);
}
.system-format-meta { margin-bottom: 16px; }
.system-paper {
  position: relative;
  margin-inline: auto;
  width: min(100%, 490px);
  aspect-ratio: 931 / 720;
  overflow: hidden;
  border: 1px solid #e0d9ca;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 12px 28px #3025181a;
}
.system-paper img { display: block; width: 100%; height: auto; }
.system-paper-blank { position: absolute; inset: 0; opacity: 0; }

.system-example-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--system-line);
  border-radius: 12px;
  background: var(--system-line);
}
.system-example-grid > div { min-width: 0; padding: clamp(16px, 2.3vw, 26px); background: #faf9f6; }
.system-example-grid dd { margin-top: 8px; color: #5f5b52; font-size: 14px; line-height: 1.5; }
.system-example-grid .system-access { color: #6e5e40; font-size: 12px; font-weight: 550; }

.system-closing {
  padding: clamp(36px, 6vw, 80px) clamp(22px, 4vw, 52px);
  border-radius: 18px;
  background: var(--system-paper);
  text-align: center;
}
.system-closing > p { max-width: 52ch; margin-inline: auto; }
.system-closing > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; margin-top: 24px; }
.system-page main .system-button {
  padding: 12px 18px;
  border-radius: 8px;
  background: #24231f;
  color: #fff;
  text-decoration: none;
}
.system-page main .system-button:hover { background: #48443b; }

.system-motion-ready .system-paper-blank { opacity: 1; }
.system-motion-ready .is-playing .system-paper-blank { animation: system-paper-fill .8s .55s ease both; }
.is-playing .system-file-list li { animation: system-appear .42s both; }
.is-playing .system-file-list li:nth-child(2) { animation-delay: .18s; }
.is-playing .system-file-list li:nth-child(3) { animation-delay: .36s; }
.is-playing .system-chat-answer { animation: system-appear .5s .3s both; }
.is-playing .system-citation { animation: system-appear .5s .75s both; }
.is-playing .system-flow li { animation: system-appear .42s both; }
.is-playing .system-flow li:nth-child(2) { animation-delay: .22s; }
.is-playing .system-flow li:nth-child(3) { animation-delay: .44s; }
.is-playing .system-flow li:nth-child(4) { animation-delay: .66s; }
.is-playing .system-flow li:nth-child(5) { animation-delay: .88s; }

@keyframes system-paper-fill { from { opacity: 1; } to { opacity: 0; } }
@keyframes system-appear {
  from { opacity: .15; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .system-chapter { gap: 28px 34px; }
  .system-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .system-intro { padding-top: 126px; }
  .system-intro h1 { font-size: clamp(39px, 8vw, 60px); }
  .system-atlas { grid-template-columns: 1fr; gap: 12px; padding: 26px 18px 23px; border-radius: 17px; }
  .system-atlas h2 { max-width: none; font-size: 34px; }
  .system-layer-links { max-width: none; }
  .system-stack { grid-row: 1; margin: -14px -8px 0; }
  .system-stack-art { max-width: 460px; }
  .system-chapter { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 400px) {
  .system-page { --ic-gutter: 16px; }
  .system-app { grid-template-columns: 33px minmax(0, 1fr); }
  .system-app-rail img { width: 19px; height: 19px; }
  .system-file-type { display: none; }
  .system-file-list li { grid-template-columns: 18px minmax(0, 1fr); }
}
@media (max-width: 340px) {
  .system-example-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .system-page main *, .system-page main *::before, .system-page main *::after {
    animation: none !important;
    transition: none !important;
  }
  .system-motion-ready .system-paper-blank { opacity: 0; }
}
