/* ---------------- documentation page ---------------- */
.docs-page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1.3rem, 3.6vh, 2.4rem) clamp(1rem, 4vw, 2.4rem) clamp(2.4rem, 7vh, 4.5rem);
}

.docs-head {
  margin-bottom: clamp(1.1rem, 2.6vw, 1.8rem);
  animation: fade-up .8s .1s cubic-bezier(.2, .8, .2, 1) both;
}

.docs-head .kicker {
  margin: 0 0 .55rem;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-head h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.2vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.docs-head .lede {
  margin: .6rem 0 0;
  color: var(--muted);
  font-size: clamp(.88rem, 1.4vw, .98rem);
}

.docs-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

/* project picker */
.project-picker {
  position: sticky;
  top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  animation: fade-up .8s .2s cubic-bezier(.2, .8, .2, 1) both;
}

.project-card {
  --accent: var(--gold);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .58rem .62rem;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
  color: #d6d1c6;
  text-decoration: none;
  transition:
    background-color .25s ease,
    border-color .25s ease,
    color .25s ease;
}

.project-card:hover,
.project-card:focus-visible {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .14);
  color: #fff;
  outline: none;
}

.project-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.project-card.is-active {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--accent) 13%, transparent),
      color-mix(in srgb, var(--accent) 3%, transparent) 70%,
      transparent);
}

.pc-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.pc-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pc-icon svg { width: 22px; height: 22px; }

.pc-text {
  display: flex;
  flex-direction: column;
  gap: .14rem;
  min-width: 0;
}

.pc-text strong {
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-text small {
  font-size: .61rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-card.is-active .pc-text small {
  color: color-mix(in srgb, var(--accent) 72%, white);
}

/* project detail */
.project-view {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)),
    rgba(8, 8, 11, .55);
  box-shadow: 0 30px 80px -55px rgba(0, 0, 0, .95);
  animation: fade-up .8s .28s cubic-bezier(.2, .8, .2, 1) both;
}

.project-view.is-switching {
  animation: docs-swap .45s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes docs-swap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.project-banner {
  position: relative;
  height: clamp(180px, 24vw, 268px);
  overflow: hidden;
  background: #0a090d;
  isolation: isolate;
}

.project-banner img { display: block; }

.banner-bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(28px) saturate(135%) brightness(.48);
  transform: scale(1.04);
}

.banner-fg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.banner-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 6, 8, 0) 42%, rgba(8, 8, 11, .78));
}

.project-banner.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  background:
    radial-gradient(55% 95% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent),
    #09090d;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 85%, white);
}

.empty-mark svg { width: 28px; height: 28px; }

.empty-label {
  font-size: .63rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-body {
  padding: 1.1rem clamp(1.1rem, 3vw, 1.9rem) clamp(1.4rem, 3vw, 2rem);
}

.project-head {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.project-head.is-link {
  padding: .38rem .45rem .38rem .38rem;
  margin: -.38rem -.45rem -.38rem -.38rem;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
  color: inherit;
  text-decoration: none;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.project-head.is-link:hover,
.project-head.is-link:focus-visible {
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .045);
  outline: none;
}

.project-head.is-link:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}

.project-head.is-link:hover .project-icon {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.project-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, .9);
  transition: border-color .25s ease;
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-icon svg { width: 26px; height: 26px; }

.icon-ext {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(8, 8, 11, .82);
  color: var(--accent);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .2s ease, transform .2s ease;
}

.icon-ext svg { width: 11px; height: 11px; }

.project-head.is-link:hover .icon-ext,
.project-head.is-link:focus-visible .icon-ext {
  opacity: 1;
  transform: none;
}
.project-kind {
  font-size: .6rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-titles h2 {
  margin: .12rem 0 .22rem;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -.02em;
}

.project-titles p {
  margin: 0;
  color: #c9c4ba;
  font-size: .9rem;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 1.05rem 0 1.4rem;
}

.chip {
  font-size: .6rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .11);
  padding: .3rem .6rem;
  border-radius: 999px;
}

.chip.status {
  color: color-mix(in srgb, var(--accent) 82%, white);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.doc-section h3 {
  margin: 0 0 .45rem;
  font-size: .64rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}

.doc-section p {
  margin: 0;
  max-width: 62ch;
  color: #c6c1b7;
  font-size: .93rem;
  line-height: 1.75;
}

.docs-note {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-top: 1.25rem;
  padding: .8rem .95rem;
  border: 1px dashed rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: rgba(255, 255, 255, .02);
  color: #a7a298;
  font-size: .82rem;
  line-height: 1.55;
}

.docs-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: .12rem;
  color: color-mix(in srgb, var(--accent) 78%, white);
}

.docs-note p { margin: 0; }

/* player / developer documentation buttons */
.docs-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1.2rem;
}

.doc-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  color: #e7e2d6;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color .25s ease,
    background-color .25s ease,
    color .25s ease;
}

.doc-btn:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.doc-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.doc-btn-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
}

.doc-btn-icon svg { width: 18px; height: 18px; }

.doc-btn-text {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}

.doc-btn-text strong {
  font-size: .85rem;
  font-weight: 500;
}

.doc-btn-text small {
  font-size: .72rem;
  color: var(--muted);
}

.doc-btn-arrow {
  margin-left: auto;
  color: var(--accent);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.doc-btn-arrow svg { width: 16px; height: 16px; display: block; }

.doc-btn:hover .doc-btn-arrow { transform: translateX(2px); }

.doc-btn.is-locked {
  opacity: .55;
  cursor: not-allowed;
}

.doc-btn.is-locked:hover {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .025);
  color: #e7e2d6;
}

.doc-btn-lock {
  margin-left: auto;
  padding: .2rem .45rem;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 6px;
  font-size: .57rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.docs-help {
  margin: 1.1rem 0 0;
  font-size: .79rem;
  color: #6f6b62;
}

.docs-help a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 200, 121, .32);
  transition: border-color .2s ease, color .2s ease;
}

.docs-help a:hover {
  color: #ffe7b0;
  border-color: var(--gold);
}

.docs-noscript {
  color: var(--muted);
  font-size: .9rem;
}

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .docs-grid { grid-template-columns: 1fr; }

  .project-picker {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: .5rem;
    padding-bottom: .35rem;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .project-card {
    flex: 0 0 auto;
    min-width: 215px;
    scroll-snap-align: start;
  }
}

@media (max-width: 560px) {
  .docs-page { padding-top: 1rem; }
  .docs-head h1 { font-size: 1.72rem; }
  .project-banner { height: 158px; }
  .project-icon { width: 48px; height: 48px; border-radius: 13px; }
  .project-body { padding: 1rem 1rem 1.35rem; }
  .project-card { min-width: 200px; }
  .pc-icon { width: 42px; height: 42px; }
}
