:root {
  --color-space-canvas: #0f0d1b;
  --color-inventory-panel: #1f1b2c;
  --color-steel-silver: #c3c7db;
  --color-muted-silver: #969ab0;
  --color-alien-violet: #a855f7;
  --color-violet-deep: #38204f;
  --color-frame-line: #55506d;
  --color-warning-amber: #d5a84b;
  --color-black: #080710;

  --font-body: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Space Grotesk", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --text-meta: 0.6875rem;
  --text-caption: 0.8125rem;
  --text-small: 0.875rem;
  --text-body: 1.0625rem;
  --text-lead: 1.25rem;
  --text-h3: clamp(1.3125rem, 2vw, 1.5rem);
  --text-h2: clamp(1.8125rem, 4vw, 2.25rem);
  --text-h1: clamp(2.125rem, 6vw, 4rem);
  --text-display: clamp(2.5rem, 7vw, 4.5rem);

  --leading-tight: 1.02;
  --leading-heading: 1.1;
  --leading-body: 1.65;
  --leading-meta: 1.3;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  --container-max: 75rem;
  --container-padding: 2rem;
  --container-padding-mobile: 1.25rem;

  --surface-panel: var(--color-inventory-panel);
  --surface-active: var(--color-violet-deep);
  --border-color: var(--color-frame-line);
  --border-strong: var(--color-steel-silver);
  --border-accent: var(--color-alien-violet);

  --radius-none: 0;
  --radius-small: 2px;

  --shadow-offset: 2px 2px 0 rgba(0, 0, 0, 0.42);
  --shadow-inset: inset 0 0 0 1px rgba(195, 199, 219, 0.05);

  --transition-fast: 140ms ease;
  --transition-base: 200ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--color-space-canvas);
  color-scheme: dark;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--color-space-canvas);
  color: var(--color-steel-silver);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font-synthesis: none;
}

main,
header,
footer,
section,
article,
aside,
nav,
figure,
form,
fieldset,
details {
  min-width: 0;
}

img,
picture,
svg,
canvas,
video,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

svg {
  fill: currentColor;
}

iframe {
  border: 0;
}

a {
  color: var(--color-steel-silver);
  text-decoration-color: rgba(195, 199, 219, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-alien-violet);
  text-decoration-color: currentColor;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
  cursor: pointer;
}

button:disabled,
[type="button"]:disabled,
[type="submit"]:disabled,
[type="reset"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-none);
  background: var(--surface-panel);
  color: var(--color-steel-silver);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-inset);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted-silver);
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  min-height: 1rem;
  padding: 0;
  accent-color: var(--color-alien-violet);
}

fieldset {
  margin: 0 0 var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border-color);
}

legend {
  padding: 0 var(--space-2);
  color: var(--color-steel-silver);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: inline-block;
  margin-bottom: var(--space-2);
  color: var(--color-steel-silver);
  font-size: var(--text-small);
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--color-alien-violet);
  outline-offset: 3px;
}

::selection {
  background: var(--color-violet-deep);
  color: var(--color-steel-silver);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--color-steel-silver);
  font-family: var(--font-heading);
  font-weight: 650;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  margin-bottom: var(--space-5);
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
}

h2 {
  margin-bottom: var(--space-4);
  font-size: var(--text-h2);
  line-height: var(--leading-heading);
}

h3 {
  margin-bottom: var(--space-3);
  font-size: var(--text-h3);
  line-height: 1.15;
}

h4 {
  margin-bottom: var(--space-3);
  font-size: 1.125rem;
  line-height: 1.25;
}

h5,
h6 {
  margin-bottom: var(--space-2);
  font-size: 1rem;
  line-height: 1.3;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

small {
  font-size: var(--text-small);
}

strong,
b {
  color: var(--color-steel-silver);
  font-weight: 700;
}

em,
i {
  font-style: italic;
}

hr {
  height: 1px;
  margin: var(--space-6) 0;
  border: 0;
  background: var(--border-color);
}

ul {
  list-style: none !important;
}

ol {
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding-left: 1.4em;
}

ul:not([class]) {
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding-left: 1.25em;
  list-style: square !important;
}

ul:not([class]) > li::marker,
ol > li::marker {
  color: var(--color-alien-violet);
}

.content-list > li + li,
.rich-text > ul > li + li,
.rich-text > ol > blockquote {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 2px solid var(--color-alien-violet);
  background: rgba(31, 27, 44, 0.62);
  color: var(--color-steel-silver);
}

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

figure {
  margin: 0 0 var(--space-5);
}

figcaption {
  margin-top: var(--space-2);
  color: var(--color-muted-silver);
  font-size: var(--text-caption);
  line-height: 1.45;
}

table {
  width: 100%;
  margin-bottom: var(--space-5);
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  background: var(--surface-panel);
  font-size: var(--text-small);
}

caption {
  margin-bottom: var(--space-2);
  color: var(--color-muted-silver);
  font-size: var(--text-caption);
  text-align: left;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--color-steel-silver);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

code,
kbd {
  border: 1px solid var(--border-color);
  background: var(--color-inventory-panel);
  color: var(--color-steel-silver);
  padding: 0.08em 0.32em;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  margin: 0 0 var(--space-5);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  background: var(--color-inventory-panel);
  padding: var(--space-4);
  color: var(--color-steel-silver);
  font-size: var(--text-small);
  line-height: 1.55;
  box-shadow: var(--shadow-inset);
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

details {
  margin-bottom: var(--space-3);
  border: 1px solid var(--border-color);
  background: var(--surface-panel);
  box-shadow: var(--shadow-inset);
}

summary {
  cursor: pointer;
  padding: var(--space-4);
  color: var(--color-steel-silver);
  font-family: var(--font-heading);
  font-weight: 600;
}

details > :not(summary) {
  margin-left: var(--space-4);
  margin-right: var(--space-4);
}

details > :last-child {
  margin-bottom: var(--space-4);
}

.container {
  width: min(100% - (var(--container-padding) * 2), var(--container-max));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-8);
}

.section--large {
  padding-block: var(--space-9);
}

.stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stack > * {
  min-width: 0;
}

.stack--2 {
  gap: var(--space-2);
}

.stack--3 {
  gap: var(--space-3);
}

.stack--4 {
  gap: var(--space-4);
}

.stack--5 {
  gap: var(--space-5);
}

.stack--6 {
  gap: var(--space-6);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: var(--space-3);
}

.cluster > * {
  min-width: 0;
}

.cluster--tight {
  gap: var(--space-2);
}

.cluster--spaced {
  gap: var(--space-4);
}

.panel {
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-none);
  background: var(--surface-panel);
  padding: var(--space-6);
  box-shadow: var(--shadow-offset), var(--shadow-inset);
}

.panel--compact {
  padding: var(--space-4);
}

.panel--active {
  border-color: var(--border-accent);
  background: var(--surface-active);
}

.panel > :last-child,
.compact-group > :last-child,
.card-content > :last-child {
  margin-bottom: 0;
}

.frame {
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-none);
  box-shadow: var(--shadow-inset);
}

.frame--accent {
  border-color: var(--border-accent);
}

.meta,
.eyebrow {
  color: var(--color-muted-silver);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: var(--leading-meta);
  text-transform: uppercase;
}

.meta--accent,
.eyebrow--accent {
  color: var(--color-alien-violet);
}

.lead {
  color: var(--color-steel-silver);
  font-size: var(--text-lead);
  line-height: 1.5;
}

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

.button,
.button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 2.875rem;
  border: 1px solid var(--color-alien-violet);
  border-radius: var(--radius-none);
  background: var(--color-alien-violet);
  color: var(--color-space-canvas);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.button:hover,
.button:focus-visible {
  border-color: #bb78fb;
  background: #bb78fb;
  color: var(--color-space-canvas);
  text-decoration: none;
  transform: translateY(2px);
  box-shadow: inset 0 0 0 1px rgba(15, 13, 27, 0.5);
}

.button--secondary,
.button--secondary:visited {
  border-color: var(--border-color);
  background: transparent;
  color: var(--color-steel-silver);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  border-color: var(--color-alien-violet);
  background: var(--color-violet-deep);
  color: var(--color-steel-silver);
}

.inventory-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 3.25rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-none);
  background: var(--surface-panel);
  box-shadow: var(--shadow-inset);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.inventory-slot > * {
  min-width: 0;
  max-width: 100%;
}

.inventory-slot:hover,
.inventory-slot:focus-within {
  border-color: var(--color-alien-violet);
}

.inventory-slot:hover > *,
.inventory-slot:focus-within > * {
  transform: translate(1px, 1px);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-3);
  left: var(--space-3);
  transform: translateY(-150%);
  border: 1px solid var(--color-alien-violet);
  background: var(--color-space-canvas);
  color: var(--color-steel-silver);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  gap: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-none);
  background: var(--surface-panel);
  color: var(--color-steel-silver);
  padding: var(--space-2);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--color-alien-violet);
  color: var(--color-alien-violet);
}

.nav-toggle > * {
  flex: 0 0 auto;
  min-width: 0;
}

@media (max-width: 56.25rem) {
  :root {
    --text-body: 1rem;
    --text-lead: 1.125rem;
  }

  .section {
    padding-block: var(--space-7);
  }

  .section--large {
    padding-block: var(--space-8);
  }

  .panel {
    padding: var(--space-5);
  }
}

@media (max-width: 40rem) {
  .container,
  .section {
    padding-block: var(--space-6);
  }

  .section--large {
    padding-block: var(--space-7);
  }

  .panel {
    padding: var(--space-4);
  }

  .button {
    width: 100%;
  }

  table {
    font-size: var(--text-caption);
  }

  th,
  td {
    padding: var(--space-2) var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}