@scope (.port) {
:scope {
  --ground: #0b1620;
  --panel: #12212d;
  --line: #1f3445;
  --text: #e8eef2;
  --muted: #b7c6d2;
  --air: #f4b740;
  --surface: #3fd0b8;
  --water: #7c9cff;
  --cta: #f4b740;
  --cta-ink: #1a1200;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --header: 56px;
  --radius: 6px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.mono {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

/* ----------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--text);
}

/* ------------------------------------------------------------ stage */

.stage {
  position: relative;
  height: calc(100vh - var(--header));
  min-height: 560px;
  overflow: hidden;
  background: var(--ground);
}

#canvas-host {
  position: absolute;
  inset: 0;
}

#canvas-host canvas {
  display: block;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading[hidden] {
  display: none;
}

/* ------------------------------------------------- breadcrumb, rail */

.crumbs {
  position: absolute;
  top: 18px;
  left: 28px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.crumbs button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.crumbs button:hover {
  color: var(--text);
}

.crumbs span:last-child {
  color: var(--text);
}

.crumbs .sep {
  opacity: 0.5;
}

.stage[data-level='port'] .crumbs button:only-child {
  color: var(--text);
  cursor: default;
}

.crumbs {
  right: 28px;
}

.modes {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.modes button {
  padding: 5px 12px;
  color: var(--muted);
  font: 500 11.5px/1.2 var(--mono);
}

.modes button + button {
  border-left: 1px solid var(--line);
}

.modes button[aria-pressed='true'] {
  background: var(--text);
  color: var(--ground);
}

/* The 2D business view fills the stage under the breadcrumb. */
.biz-host {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  background: var(--ground);
}

.biz-host[hidden] {
  display: none;
}

.stage[data-view='2d'] .credits {
  display: none;
}

.card .pays {
  margin: 0 0 14px;
  font-size: 13px;
}

.rail {
  position: absolute;
  top: 48px;
  left: 28px;
  bottom: 56px;
  z-index: 5;
  width: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-right: 6px;
}

.rail[hidden] {
  display: none;
}

.stage[data-level='terminal'] .rail {
  width: 360px;
  padding: 18px 18px 20px;
  background: rgb(18 33 45 / 94%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rail h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.rail h1.terminal-name {
  font-size: 22px;
}

.rail p {
  margin: 0;
}

.rail .kicker {
  margin: 6px 0 -6px;
}

.rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost {
  padding: 9px 14px;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: rgb(11 22 32 / 80%);
  color: var(--text);
  font: 500 14px/1.2 var(--sans);
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--text);
}

.rows {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(11 22 32 / 70%);
  color: var(--text);
  font: 500 14px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.row:hover {
  border-color: var(--tone);
}

.row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.row-note {
  color: var(--muted);
  font: 400 11px/1.3 var(--mono);
  text-align: right;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

/* ----------------------------------------------------------- badges */

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 9px;
  border: 1px solid #2b4a62;
  border-radius: 3px;
  background: rgb(11 22 32 / 85%);
  color: var(--text);
  font: 500 11.5px/1.25 var(--sans);
  pointer-events: auto;
  cursor: pointer;
}

.badge-count {
  color: var(--muted);
  font-size: 10px;
}

.badge:hover,
.badge.is-hover {
  border-color: var(--text);
}

#canvas-host.is-hovering {
  cursor: pointer;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: 500 12px/1.2 var(--mono);
  cursor: pointer;
}

.filter button[aria-pressed='true'] {
  color: var(--text);
  border-color: var(--tone, var(--muted));
}

.filter i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone, var(--muted));
}

.cta {
  display: inline-block;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--cta);
  color: var(--cta-ink);
  font: 600 14px/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.cta:hover {
  background: #f7c766;
}

.credits {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 12px;
  z-index: 4;
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  opacity: 0.75;
  font-size: 10.5px;
  line-height: 1.5;
}

/* ------------------------------------------------------------- pins */

.pin {
  width: 0;
  height: 0;
  pointer-events: auto;
}

.pin button {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.pin .name {
  padding: 3px 8px;
  border: 1px solid var(--tone);
  border-radius: 3px;
  background: rgb(11 22 32 / 88%);
  font: 500 11px/1.3 var(--mono);
  white-space: nowrap;
}

.pin .stalk {
  width: 1px;
  height: var(--stalk, 48px);
  background: var(--tone);
  opacity: 0.8;
}

.pin .dot {
  width: 10px;
  height: 10px;
  margin-bottom: -5px;
  border: 2px solid var(--ground);
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 1px var(--tone);
}

.pin button:hover .name,
.pin.is-selected .name {
  background: var(--tone);
  color: var(--ground);
}

.pin.is-dim {
  opacity: 0.35;
}

/* ------------------------------------------------------------- card */

.card {
  position: absolute;
  top: 48px;
  right: 24px;
  bottom: 48px;
  z-index: 6;
  width: 440px;
  overflow-y: auto;
  padding: 22px 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card[hidden] {
  display: none;
}

.card .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.layer-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--tone);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layer-tag i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding-right: 34px;
}

.entry-head .logo {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 4px;
  background: #e8eef2;
}

.entry-head .logo img {
  max-width: 100%;
  max-height: 100%;
}

.entry h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.entry h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry .headline {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}

.entry .where {
  margin: 0 0 16px;
  color: var(--tone);
  font-size: 11.5px;
}

.entry .description {
  margin: 14px 0 18px;
  color: var(--muted);
}

.entry p {
  margin: 0 0 10px;
}

.photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0e1b26;
}

.photo img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.photo img[data-fit='contain'] {
  object-fit: contain;
  background: #e8eef2;
}

.photo figcaption {
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.thumbs {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.thumb {
  width: 64px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: none;
  opacity: 0.6;
  cursor: pointer;
}

.thumb.active {
  border-color: var(--tone);
  opacity: 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.entry .steps li {
  position: relative;
  padding-left: 30px;
  counter-increment: step;
}

.entry .steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tone);
  border-radius: 50%;
  color: var(--tone);
  font: 500 11px/1 var(--mono);
}

.entry .steps b {
  display: block;
  font-weight: 600;
}

.entry .steps span {
  color: var(--muted);
  font-size: 14px;
}

.entry > h3 {
  margin-top: 18px;
}

.block {
  margin: 0 0 4px;
  padding: 16px 0 12px;
  border-top: 1px solid var(--line);
}

.ladder {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.ladder span {
  height: 6px;
  border-radius: 1px;
  background: var(--line);
}

.ladder span.on {
  background: var(--tone);
}

.stage-label {
  font-weight: 600;
}

.pairs {
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.pairs dt {
  color: var(--muted);
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pairs dd {
  margin: 0;
}

.label {
  margin: 12px 0 6px !important;
  color: var(--muted);
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 3px 8px;
  border: 1px solid var(--tone);
  border-radius: 999px;
  font: 500 12px/1.3 var(--sans);
}

.chain {
  font: 400 13px/1.5 var(--mono);
}

.verdict {
  font-size: 16px;
  font-weight: 600;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 10px;
}

.metric {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.metric span {
  display: block;
  color: var(--muted);
  font: 500 10px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric b {
  font: 600 17px/1.3 var(--sans);
}

.entry .placeholder-value {
  color: var(--air);
  font-family: var(--mono);
  font-size: 13px;
}

.entry .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.entry .website {
  color: var(--muted);
  font-size: 14px;
}

.entry .website:hover {
  color: var(--text);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stepper button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* -------------------------------------------- list (phones, no WebGL) */

.list {
  display: none;
  padding: 24px 16px 8px;
}

.list .hero-mobile h1 {
  margin: 0 0 18px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 500;
}

.list .hero-mobile .cta {
  margin-bottom: 24px;
}

.list section {
  margin-bottom: 28px;
}

.list section > h2 {
  margin: 0 0 10px;
}

.list details {
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius);
}

.list summary {
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.list summary::-webkit-details-marker {
  display: none;
}

.list summary strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.list summary span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.list .entry {
  padding: 0 16px 16px;
}

/* The summary already shows the layer, name and headline. */
.list .entry-head,
.list .entry .headline {
  display: none;
}

.list .metrics {
  grid-template-columns: 1fr;
}

/* With no 3D, the stage is not shown and the list takes its place. */
body.no-3d .stage {
  display: none;
}

body.no-3d .list {
  display: block;
}

/* ------------------------------------------------------------ bands */

.band {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 24px;
  border-top: 1px solid var(--line);
}

.band:first-of-type {
  border-top: 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.band h2 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 500;
}

.placeholder {
  margin: 0 0 22px;
  color: var(--air);
  font-family: var(--mono);
  font-size: 14px;
}

.site-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* ----------------------------------------------------------- phones */

@media (max-width: 767px) {
  .site-header {
    height: auto;
    min-height: var(--header);
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 10px 16px;
  }

  .site-header nav {
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 13px;
  }

  .band {
    padding: 48px 16px;
  }
}

}
