/* Space Pixl site — the app's style guide, verbatim.
   Dark surface stack, IBM Plex Sans for text, Space Grotesk for display,
   JetBrains Mono for numbers and file facts. */

:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --bar: #0e1015;
  --surface: #12151b;
  --surface-2: #0e1015;
  --raised: #181c24;
  --hover: #161a22;
  --active: #1b2029;
  --active-2: #242a36;
  --track: #1f2430;
  --track-2: #2a3040;
  --keep: #2f3646;
  --text: #e8ebf2;
  --text-2: #d5dae6;
  --text-3: #c9d0de;
  --muted: #9aa3b5;
  --muted-2: #8a93a6;
  --dim: #6f788b;
  --line: rgba(160, 180, 220, 0.12);
  --line-soft: rgba(160, 180, 220, 0.1);
  --line-strong: rgba(160, 180, 220, 0.18);
  --line-hover: rgba(160, 180, 220, 0.26);
  --accent: #93a4ff;
  --accent-soft: rgba(147, 164, 255, 0.1);
  --accent-line: rgba(147, 164, 255, 0.32);
  --ok: #6fd7a3;
  --ok-soft: rgba(111, 215, 163, 0.1);
  --ok-line: rgba(111, 215, 163, 0.3);
  --warn: #f0c26b;
  --warn-soft: rgba(240, 194, 107, 0.1);
  --warn-line: rgba(240, 194, 107, 0.34);
  --err: #f27d85;
  --err-soft: rgba(242, 125, 133, 0.1);
  --err-line: rgba(242, 125, 133, 0.34);
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --disp: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  --r-sm: 6px;
  --r: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --gutter: 16px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #c3ccff;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

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

/* ── Header ─────────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 16, 21, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
}

.brand svg {
  align-self: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--disp);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.brand .version {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.tab {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition:
    color 0.18s,
    background 0.18s;
}

.tab:hover {
  color: var(--text);
  background: var(--hover);
}

.tab.on {
  color: var(--text);
  background: var(--active-2);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 13.5px;
  white-space: nowrap;
}

.status .mono {
  color: var(--ok);
  opacity: 0.9;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

/* ── Sections ───────────────────────────────────────────────────────────── */

section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line-soft);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

.h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.15;
  max-width: 760px;
}

.lead {
  margin-top: 14px;
  font-size: 17px;
  color: var(--muted);
  max-width: 680px;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 84px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 80%;
  background: radial-gradient(60% 50% at 50% 30%, rgba(147, 164, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  max-width: 820px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lead {
  font-size: clamp(17px, 2vw, 20px);
}

.cta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--accent);
  color: #0b0d11;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition:
    transform 0.14s,
    filter 0.14s;
}

.btn:hover {
  filter: brightness(1.08);
  color: #0b0d11;
}

.btn:active {
  transform: translateY(1px);
}

.btn2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  transition:
    background 0.14s,
    border-color 0.14s;
}

.btn2:hover {
  background: var(--hover);
  border-color: var(--line-hover);
  color: var(--text);
}

.btn .sub,
.btn2 .sub {
  font-family: var(--mono);
  font-size: 11.5px;
  opacity: 0.7;
}

.cta-note {
  width: 100%;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--dim);
}

.cta-note a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
}

.frame {
  margin-top: 48px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.frame img {
  width: 100%;
}

/* ── Cards / grids ──────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.grid.c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.c2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.c5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
}

.card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
}

.card .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 10px;
}

.card.step {
  position: relative;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.chip.ok {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.chip.ac {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.chip.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chips .chip {
  height: auto;
  min-height: 24px;
  padding: 3px 9px;
  line-height: 1.35;
  white-space: normal;
}

/* ── Banner ─────────────────────────────────────────────────────────────── */

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

.banner code {
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Savings ────────────────────────────────────────────────────────────── */

.calc {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-top: 36px;
}

.calc .card {
  padding: 26px;
}

.calc label {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

input[type='range'] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) var(--pct, 50%),
    var(--track) var(--pct, 50%)
  );
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  cursor: grab;
}

input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  cursor: grab;
}

.field {
  width: 96px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid var(--line-soft);
  margin-top: 18px;
  flex-wrap: wrap;
}

.seg button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.seg button.on {
  background: var(--active-2);
  color: var(--text);
}

.hero-value {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-value .big {
  font-family: var(--disp);
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-value .unit {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted);
}

.ratio {
  margin-top: 18px;
  height: 10px;
  border-radius: 999px;
  background: var(--ok);
  overflow: hidden;
}

.ratio .keep {
  height: 100%;
  background: var(--keep);
  transition: width 0.35s ease;
}

.calc .foot {
  margin-top: 12px;
  font-size: 13px;
  color: var(--dim);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.bar {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}

.bar .name {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar .track {
  height: 10px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  width: 0;
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bar.ok .fill {
  background: var(--ok);
}

.bar.warn .fill {
  background: var(--warn);
}

.bar .val {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.bar.warn .val {
  color: var(--warn);
}

/* ── Gallery ────────────────────────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.shot {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition:
    border-color 0.18s,
    transform 0.18s;
}

.shot:hover {
  border-color: var(--line-hover);
  transform: translateY(-2px);
}

.shot img {
  aspect-ratio: 1240 / 860;
  object-fit: cover;
  object-position: top;
}

.shot .cap {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

.shot .cap b {
  color: var(--text);
  font-weight: 600;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 9, 0.92);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(1400px, 96vw);
  max-height: 84vh;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
}

.lightbox .cap {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.lightbox .x,
.lightbox .prev,
.lightbox .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
}

.lightbox .x {
  top: 24px;
  right: 24px;
  transform: none;
}

.lightbox .prev {
  left: 24px;
}

.lightbox .next {
  right: 24px;
}

/* ── Engine ─────────────────────────────────────────────────────────────── */

.engine-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 36px;
}

.quote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  font-family: var(--disp);
  font-size: 20px;
  line-height: 1.35;
  color: var(--text-2);
}

.diagram {
  width: 100%;
  height: auto;
  font-family: var(--sans);
}

.diagram .box {
  fill: var(--surface);
  stroke: var(--line-strong);
}

.diagram .box.you {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
}

.diagram .box.out {
  fill: var(--ok-soft);
  stroke: var(--ok-line);
}

.diagram text {
  fill: var(--text);
  font-size: 12.5px;
}

.diagram .m {
  font-family: var(--mono);
  fill: var(--accent);
}

.diagram .s {
  fill: var(--muted);
  font-size: 11px;
}

.diagram .edge {
  stroke: var(--line-hover);
  stroke-width: 1.5;
  fill: none;
}

.diagram .edge.dash {
  stroke-dasharray: 4 4;
}

.etabs {
  margin-top: 40px;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.epanel {
  display: none;
  margin-top: 18px;
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.epanel.on {
  display: block;
}

.epanel h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.epanel p {
  color: var(--muted);
  max-width: 760px;
}

.epanel p + p {
  margin-top: 10px;
}

.epanel table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

.epanel th,
.epanel td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.epanel th {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
}

.epanel td:first-child {
  color: var(--text);
  white-space: nowrap;
}

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

.epanel pre {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
}

.never {
  margin-top: 36px;
}

.never ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}

.never li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 14.5px;
}

.never li::before {
  content: '×';
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--err);
  font-family: var(--mono);
  font-weight: 700;
}

/* ── Playroom ───────────────────────────────────────────────────────────── */

.tease {
  margin-top: 36px;
  border-radius: var(--r-xl);
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(147, 164, 255, 0.16), transparent 60%), var(--surface);
  padding: 34px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
}

.tease h3 {
  font-size: clamp(26px, 3vw, 34px);
  margin: 10px 0 12px;
}

.tease p {
  color: var(--muted);
  font-size: 16px;
}

.knobs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.knob {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: var(--raised);
  font-size: 13.5px;
}

.knob .mono {
  color: var(--dim);
  font-size: 11.5px;
}

/* ── Download ───────────────────────────────────────────────────────────── */

.dl {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dl .card {
  padding: 26px;
}

.dl .card.mine {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dl h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.dl .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}

.dl ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14.5px;
}

.dl li + li {
  margin-top: 6px;
}

.dl code {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

.dl pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-x: auto;
  user-select: all;
}

.dl .meta {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.release-line {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.release-line a {
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  padding: 40px 0 56px;
  color: var(--dim);
  font-size: 13.5px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

footer a {
  color: var(--muted);
}

/* ── Motion ─────────────────────────────────────────────────────────────── */

.js .rise {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.rise.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bar .fill,
  .ratio .keep {
    transition: none;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .grid.c3,
  .grid.c5,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .engine-hero,
  .tease,
  .calc {
    grid-template-columns: 1fr;
  }
  .status .mono {
    display: none;
  }
}

@media (max-width: 640px) {
  section {
    padding: 52px 0;
  }
  .hero {
    padding: 56px 0 40px;
  }
  .grid.c2,
  .grid.c3,
  .grid.c5,
  .gallery,
  .dl,
  .never ul,
  .knobs {
    grid-template-columns: 1fr;
  }
  .tabs {
    display: none;
  }
  .bar {
    grid-template-columns: 1fr auto;
  }
  .bar .name {
    grid-column: 1 / -1;
  }
  .frame {
    margin-top: 32px;
    border-radius: var(--r-md);
  }
  .tease {
    padding: 24px;
  }
  .lightbox .prev,
  .lightbox .next {
    display: none;
  }
}
