/*
 * The documentation site.
 *
 * Same chrome as the console — beveled windows on a neon desktop, paper inside,
 * accent colour on the shadow — built on the console's own tokens.css, which is
 * copied here at build time rather than transcribed. What is new is only what
 * prose needs and an application does not: headings that breathe, lists,
 * blockquotes, and a gallery.
 */

* {
  box-sizing: border-box;
}

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

html,
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  color: var(--win-black);
  font-family: var(--font-ui);
  background:
    linear-gradient(90deg, var(--grid-a) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-b) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, rgba(255, 0, 119, 0.16), transparent 18rem),
    radial-gradient(circle at 84% 8%, rgba(0, 231, 255, 0.14), transparent 20rem),
    linear-gradient(180deg, #202229, #16181d);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
  background-attachment: fixed;
}

/* ---------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 62rem);
  justify-content: center;
  gap: var(--gap);
  padding: clamp(0.75rem, 1.6vw, 1.5rem);
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: clamp(0.75rem, 1.6vw, 1.5rem);
  background: var(--win-face);
  padding: var(--outer-pad);
  box-shadow: var(--shadow) var(--shadow) 0 var(--win-black);
}

.brand {
  display: block;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.55rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(
    90deg,
    var(--title-active) 0 58%,
    var(--pink) 58% 72%,
    var(--cyan) 72% 86%,
    var(--lime) 86% 100%
  );
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  line-height: 1;
}

.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.nav {
  display: grid;
  gap: 0.28rem;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  color: var(--win-black);
  background: var(--win-face-light);
  border-top: 2px solid var(--win-hi);
  border-left: 2px solid var(--win-hi);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav a:hover {
  background: var(--lime);
}

.nav a.active {
  color: #fff;
  background: var(--title-active);
  border-top-color: var(--win-dark);
  border-left-color: var(--win-dark);
  border-right-color: var(--win-hi);
  border-bottom-color: var(--win-hi);
}

.nav a.external {
  margin-top: 0.35rem;
  background: var(--win-face);
}

.nav a .tally {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0 0.25rem;
  background: var(--win-black);
  color: var(--lime);
}

.sidebar-foot {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--win-mid);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  line-height: 1.6;
  color: var(--win-dark);
}

.main {
  display: grid;
  gap: var(--gap);
  align-content: start;
  min-width: 0;
}

/* ---------------------------------------------------------------- window */

.window {
  --accent: var(--pink);
  position: relative;
  background: var(--win-face);
  padding: calc(var(--outer-pad) + var(--title-h) + 0.55rem) var(--outer-pad) var(--outer-pad);
  border-top: 2px solid var(--win-hi);
  border-left: 2px solid var(--win-hi);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  box-shadow:
    var(--shadow) var(--shadow) 0 var(--win-black),
    calc(var(--shadow) + 5px) calc(var(--shadow) + 5px) 0 var(--accent);
  min-width: 0;
}

.titlebar {
  position: absolute;
  top: var(--outer-pad);
  left: var(--outer-pad);
  right: var(--outer-pad);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--title-h);
  padding: 0.2rem 0.45rem;
  color: #fff;
  background: linear-gradient(90deg, var(--title-active) 0 76%, var(--accent) 76% 100%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.titlebar .grow {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sits in the accent stripe on the right, and gives way before it spills out. */
.titlebar-note {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.6rem;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 48rem) {
  .titlebar-note {
    display: none;
  }
}

.window-body {
  background: var(--paper);
  padding: clamp(0.9rem, 2vw, 1.6rem);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-hi);
  border-bottom: 2px solid var(--win-hi);
  min-width: 0;
}

.window-body.flush {
  padding: 0;
}

/* ---------------------------------------------------------------- prose */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 1.6rem 0 0.6rem;
}

.window-body > :first-child,
.window-body > .eyebrow + h1 {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 0.95;
}

h2 {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 900;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--win-mid);
}

h3 {
  font-size: 0.92rem;
  font-weight: 800;
}

h4 {
  font-size: 0.8rem;
  font-weight: 800;
}

p,
li {
  font-size: 0.88rem;
  line-height: 1.65;
}

p {
  margin: 0 0 0.8rem;
}

ul,
ol {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.3rem;
}

li::marker {
  color: var(--pink);
  font-weight: 900;
}

a {
  color: var(--title-active);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

a:hover {
  color: #fff;
  background: var(--title-active);
  text-decoration: none;
}

strong {
  font-weight: 900;
}

hr {
  height: 0;
  margin: 1.4rem 0;
  border: 0;
  border-top: 2px solid var(--win-mid);
}

blockquote {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.9rem;
  background: var(--paper-warn);
  border-left: 4px solid var(--orange);
}

blockquote p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--win-dark);
  margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------- code */

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.05rem 0.25rem;
  background: var(--paper-cool);
  border: 1px solid var(--win-mid);
  white-space: nowrap;
}

pre {
  margin: 0 0 1rem;
  padding: 0.8rem 0.9rem;
  overflow-x: auto;
  color: var(--lime);
  background: var(--win-black);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-hi);
  border-bottom: 2px solid var(--win-hi);
}

pre code {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre;
}

/* ---------------------------------------------------------------- table */

.table-scroll {
  overflow-x: auto;
  margin-bottom: 1rem;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-hi);
  border-bottom: 2px solid var(--win-hi);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

thead th {
  padding: 0.4rem 0.55rem;
  color: #fff;
  background: var(--title-active);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 0.4rem 0.55rem;
  border-top: 1px solid var(--win-mid);
  vertical-align: top;
  line-height: 1.5;
}

tbody tr:nth-child(even) td {
  background: var(--paper);
}

tbody code {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- hero */

.hero .window-body {
  background: var(--paper);
}

.hero h1 {
  margin-bottom: 0.9rem;
}

.hero p {
  max-width: 46rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.button {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  color: var(--win-black);
  background: var(--win-face);
  border-top: 2px solid var(--win-hi);
  border-left: 2px solid var(--win-hi);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.button:hover {
  color: var(--win-black);
  background: var(--lime);
}

.button.primary {
  color: #fff;
  background: var(--title-active);
}

.button.primary:hover {
  color: #fff;
  background: var(--violet);
}

/* ---------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.6rem;
}

.card {
  display: grid;
  gap: 0.25rem;
  padding: 0.6rem 0.7rem;
  color: var(--win-black);
  background: var(--win-face-light);
  border-top: 2px solid var(--win-hi);
  border-left: 2px solid var(--win-hi);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
  text-decoration: none;
}

.card:hover {
  color: var(--win-black);
  background: var(--lime);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.card-blurb {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #3d3d3d;
}

.card:hover .card-blurb {
  color: var(--win-black);
}

/* ---------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
  gap: 0.9rem;
}

.shot a {
  display: block;
  background: none;
}

.shot {
  margin: 0;
  background: var(--win-face);
  padding: 0.35rem;
  border-top: 2px solid var(--win-hi);
  border-left: 2px solid var(--win-hi);
  border-right: 2px solid var(--win-dark);
  border-bottom: 2px solid var(--win-dark);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-hi);
  border-bottom: 2px solid var(--win-hi);
}

.shot figcaption {
  padding: 0.3rem 0.1rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--win-dark);
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 60rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  }
}
