/* marvora.io. Tokens follow DESIGN-DNA.md exactly; change that file first. */

:root {
  --ground: #f5f5f2;
  --surface: #ebebe6;
  --ink: #16171a;
  --ink-muted: #55575c;
  --line: #d3d3cc;
  --accent: #b0381a;
  --on-accent: #fbfbf8;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --t-1: 0.85rem;
  --t0: 1.0625rem;
  --t1: 1.33rem;
  --t2: 1.66rem;
  --t3: 2.07rem;
  --t4: 2.6rem;
  --t5: clamp(2.4rem, 5vw + 1rem, 3.6rem);

  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 5rem;
  --s7: 8rem;

  --r: 2px;
  --hair: 1px solid var(--line);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --measure: 62ch;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121315;
    --surface: #1b1c1f;
    --ink: #ebeae5;
    --ink-muted: #a4a49e;
    --line: #303136;
    --accent: #f2774f;
    --on-accent: #121315;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t0);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

h1 { font-size: var(--t5); letter-spacing: -0.025em; }
h2 { font-size: var(--t3); letter-spacing: -0.02em; }
h3 { font-size: var(--t2); letter-spacing: -0.01em; }
h4 { font-size: var(--t1); }

p, ul, ol, dl, figure, blockquote, pre { margin: 0; }

p { max-width: var(--measure); text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

strong { font-weight: 600; }

hr { border: 0; border-top: var(--hair); margin: var(--s4) 0; }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.skip {
  position: absolute;
  left: var(--s2);
  top: var(--s2);
  padding: var(--s1) var(--s2);
  background: var(--ink);
  color: var(--ground);
  border-radius: var(--r);
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

/* ---------- Header ---------- */

.site-head { border-bottom: var(--hair); }

.site-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--t1);
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The signature gate diamond, small. */
.wordmark__mark {
  width: 0.6rem;
  height: 0.6rem;
  background: var(--accent);
  transform: rotate(45deg);
}

.nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 2rem);
  list-style: none;
  padding: 0;
  font-size: var(--t-1);
}

.nav a {
  color: var(--ink);
  text-decoration-color: transparent;
  padding-block: var(--s1);
}

.nav a:hover,
.nav a[aria-current="page"] { text-decoration-color: currentColor; }

/* ---------- Sections ---------- */

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

.section + .section { border-top: var(--hair); }

.section h2 + * { margin-top: var(--s3); }

/* Hero: split, copy left, install right (from 75rem). */
.hero { padding-block: var(--s5); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
}

.hero + .section { border-top: var(--hair); }

.hero__copy h1 { max-width: 16ch; }

.lede {
  margin-top: var(--s3);
  font-size: var(--t1);
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 36ch;
}

.label {
  font-size: var(--t-1);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-muted);
}

/* A command never breaks: the block scrolls sideways inside itself, never the page. */
.commands {
  margin-top: var(--s1);
  max-width: 100%;
  padding: var(--s2) var(--s3) var(--s2) var(--s2);
  background: var(--surface);
  border-radius: var(--r);
  border-left: 3px solid var(--accent);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.commands code { font-size: inherit; }

.run-as {
  margin-top: var(--s2);
  color: var(--ink-muted);
}

.provenance {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: var(--hair);
  font-size: var(--t-1);
  color: var(--ink-muted);
}

.commit {
  margin-top: var(--s1);
  font-size: var(--t-1);
  color: var(--ink-muted);
}

/* Before you install: two-column checklist with a diamond lead. */
.checks {
  display: grid;
  gap: var(--s3) var(--s5);
  list-style: none;
  padding: 0;
}

.checks li {
  position: relative;
  padding-left: var(--s3);
  max-width: 44ch;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border: 1.5px solid var(--ink);
  transform: rotate(45deg);
}

.checks strong { display: block; }

/* Method: heading and copy, then the diagram as the section's centrepiece.
   Tall diagram on small screens, the wide one from 1024 px. */
.method__head {
  display: grid;
  gap: var(--s3);
}

.method__copy p + p { margin-top: var(--s2); }

.method__figure { margin-top: var(--s5); }

.method__figure img {
  width: 100%;
  max-width: 22.5rem;
  margin-inline: auto;
}

/* The diagram is drawn in the light tokens with attributes only (the CSP blocks
   style inside it); in dark mode the page turns it to the dark tokens. */
@media (prefers-color-scheme: dark) {
  .method__figure img { filter: invert(1) hue-rotate(180deg); }
}

/* Sample run: the showpiece band on the tinted surface. */
.showpiece {
  background: var(--surface);
}

.section.showpiece,
.showpiece + .section { border-top: 0; }

.showpiece__head p {
  margin-top: var(--s3);
  font-size: var(--t1);
  line-height: 1.45;
  color: var(--ink-muted);
}

/* The two runs shown on the sample page, each with its status shape
   (shape, never colour alone). */
.endings {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
  padding: 0;
  list-style: none;
}

.ending {
  padding-top: var(--s3);
  border-top: 1px solid var(--ink);
}

.ending h3 { font-size: var(--t1); }

.ending p {
  margin-top: var(--s1);
  color: var(--ink-muted);
}

.track {
  display: flex;
  gap: 0.9rem;
  margin-bottom: var(--s2);
  padding-left: 0.15rem;
}

.track .mark {
  width: 0.7rem;
  height: 0.7rem;
}

.showpiece__link {
  display: inline-block;
  margin-top: var(--s5);
  padding: var(--s2) var(--s3);
  background: var(--ink);
  color: var(--ground);
  border-radius: var(--r);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.showpiece__link:hover { text-decoration: underline; }

/* What has run: rows with a status shape, colour never alone. */
.status { display: grid; }

.status__row {
  display: grid;
  gap: var(--s1);
  padding-block: var(--s2);
}

.status__row + .status__row { border-top: var(--hair); }

.status dt { font-weight: 600; }

.status dd {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.mark {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border: 1.5px solid var(--ink);
  transform: rotate(45deg) translateY(-0.1em);
}

.mark--done { background: var(--ink); }

.mark--part { background: linear-gradient(135deg, var(--ink) 50%, transparent 50%); }

.mark--none { background: transparent; }

/* Key to the status marks. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  margin-top: var(--s2);
  padding: 0;
  list-style: none;
  font-size: var(--t-1);
  color: var(--ink-muted);
}

.legend li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

/* On your machine: heading beside a short list, one plain fact per line. */
.prose-cols {
  display: grid;
  gap: var(--s3);
}

.machine-list {
  display: grid;
  gap: var(--s2);
  max-width: var(--measure);
  padding: 0;
  list-style: none;
}

.machine-list li {
  padding-top: var(--s2);
  border-top: var(--hair);
}

.machine-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose > * + * { margin-top: var(--s2); }

.prose h2,
.prose h3 { margin-top: var(--s5); }

.prose h2 + *,
.prose h3 + * { margin-top: var(--s2); }

.prose ul,
.prose ol { padding-left: 1.2em; max-width: var(--measure); }

.prose li + li { margin-top: var(--s1); }

.prose blockquote {
  padding-left: var(--s2);
  border-left: 3px solid var(--line);
  color: var(--ink-muted);
}

.block {
  padding: var(--s2);
  background: var(--surface);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: var(--t-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Proof: the rendered table scrolls inside its own region, never the page. */
.proof > * + * { margin-top: var(--s3); }

.proof h3,
.proof h4 { margin-top: var(--s5); }

.proof > h3:first-child { margin-top: 0; }

.proof > .legend { margin-top: var(--s2); }

.proof blockquote {
  margin-top: var(--s5);
  padding-left: var(--s2);
  border-left: 3px solid var(--line);
  color: var(--ink-muted);
  max-width: var(--measure);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: var(--hair);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-1);
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.7rem 1rem 0.7rem 0;
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

tbody tr:nth-child(odd) td { background: color-mix(in srgb, var(--surface) 55%, transparent); }

td:first-child { font-weight: 600; padding-left: 0.5rem; }

th:first-child { padding-left: 0.5rem; }

/* What is coming. */
.next__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s2);
}

.next > p + .next__list { margin-top: var(--s3); }

.next__list li { max-width: var(--measure); }

.next__watch {
  margin-top: var(--s4);
  font-weight: 600;
}

/* ---------- Sample page ---------- */

.banner {
  background: var(--ink);
  color: var(--ground);
  padding-block: var(--s2);
  font-size: var(--t-1);
}

.banner p { max-width: none; }

.sample-head { padding-bottom: var(--s4); }

.section.sample-body { border-top: 0; padding-top: var(--s2); }

/* ---------- Footer ---------- */

.site-foot {
  border-top: var(--hair);
  padding-block: var(--s5);
  font-size: var(--t-1);
  color: var(--ink-muted);
}

/* ---------- Wider screens ---------- */

@media (min-width: 768px) {
  .section { padding-block: var(--s7); }
  .hero { padding-block: var(--s6) var(--s5); }
  .hero + .section { padding-top: var(--s6); }

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

  .method__head {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: var(--s6);
  }

  .method__head > h2 + * { margin-top: 0; }

  .method__figure { margin-top: var(--s6); }

  .showpiece h2 { font-size: var(--t4); }

  .section.sample-head { padding-top: var(--s6); }

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

  .status__row {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: var(--s4);
  }

  .prose-cols {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: var(--s6);
  }

  .prose-cols > h2 + * { margin-top: 0; }
}

@media (min-width: 1024px) {
  .method__figure img { max-width: none; }
}

/* The split hero only where the longest command fits on one line beside a
   two-line headline; below this the two stack. */
@media (min-width: 75rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 31rem);
    align-items: center;
    gap: var(--s5);
  }
}

/* ---------- Motion: calm, and only when the reader allows it ---------- */

@media (prefers-reduced-motion: no-preference) {
  a { transition: text-decoration-thickness 160ms var(--ease), text-underline-offset 160ms var(--ease); }

  .showpiece__link { transition: transform 120ms var(--ease); }
  .showpiece__link:active { transform: translateY(1px); }

  .hero__copy,
  .hero__install {
    animation: rise 480ms var(--ease) both;
  }

  .hero__install { animation-delay: 80ms; }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
