/* Fadenza — site styles.
 *
 * Typeset in the same three faces as the app it describes: the system serif (New York) for
 * display, the system sans (SF Pro) for prose, the system mono (SF Mono) for anything that names
 * a state, a key or a format. No webfonts, so the page makes no network requests at all.
 *
 * Palette is a cool graphite ground with a sodium-amber accent — the colour of a VU lamp — and a
 * single muted brick red reserved for failure states, which appear in exactly one place.
 */

:root {
  color-scheme: dark light;

  --ground: #14181d;
  --recess: #10141a;
  --raise: #1a1f27;
  --rule: #272e38;
  --rule-soft: #1f252d;
  --dim: #808b99;
  --body: #b6c0cb;
  --bright: #eef2f7;
  --amber: #e6a44a;
  --amber-soft: rgba(230, 164, 74, 0.28);
  --amber-ghost: rgba(230, 164, 74, 0.09);

  --display: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 40rem;
  --wide: 66rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #f6f7f9;
    --recess: #eaeef2;
    --raise: #ffffff;
    --rule: #d5dbe3;
    --rule-soft: #e3e8ee;
    --dim: #667080;
    --body: #39424e;
    --bright: #101720;
    --amber: #9a6207;
    /* Stronger than the dark-mode value: a low-alpha warm border disappears against paper. */
    --amber-soft: rgba(154, 98, 7, 0.55);
    --amber-ghost: rgba(154, 98, 7, 0.07);
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--bright);
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--raise);
  color: var(--bright);
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ── Masthead ─────────────────────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--rule-soft);
}

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

.wordmark-mark {
  width: 1.15rem;
  height: 1.15rem;
  fill: var(--dim);
}

.wordmark-mark .mark-current {
  fill: var(--amber);
}

.masthead-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.masthead-nav a {
  color: var(--dim);
  text-decoration: none;
}

.masthead-nav a:hover {
  color: var(--bright);
}

/* ── Shared section furniture ─────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.band {
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
  border-top: 1px solid var(--rule-soft);
}

.band-inner {
  max-width: var(--wide);
  margin: 0 auto;
}

.section-head {
  max-width: var(--measure);
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--bright);
  margin: 0;
}

.section-lede {
  margin: 1.1rem 0 0;
  color: var(--dim);
}

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

.hero {
  padding: clamp(4.5rem, 13vw, 9.5rem) var(--gutter) clamp(4rem, 10vw, 7rem);
}

.hero-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  gap: clamp(3rem, 6vw, 4rem);
  align-items: center;
}

/* The art earns a column only when there is room for it beside the type. Below that it would
 * push the status line off the first screen, so it is dropped rather than stacked. */
@media (min-width: 62rem) {
  .hero-inner {
    /* Weighted toward the copy so the five chips sit on one line at common widths. */
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  }
}

.hero-art {
  display: none;
}

@media (min-width: 62rem) {
  .hero-art {
    display: block;
  }
}

.hero-art svg {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  margin-left: auto;
}

.hero-art .art-rows rect {
  fill: var(--body);
}

.hero-art .art-current rect,
.hero-art .art-current path {
  fill: var(--amber);
}

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3rem, 10vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--bright);
  margin: 0;
}

.hero-lede {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--dim);
}

.specs li {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.hero-status {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  max-width: 34rem;
  margin: 2.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--dim);
}

.status-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--amber);
  transform: translateY(-0.1em);
}

/* ── Refusals ledger ──────────────────────────────────────────────────────────────────── */

.band-refusals {
  background: var(--recess);
}

.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.25rem 3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ledger h3 {
  margin: 0 0 0.4rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.01em;
}

/* An em-dash in the accent colour, set in the gutter: the page's structural device is
 * subtraction, so the marker is a minus rather than a bullet or a number. */
.ledger h3::before {
  content: "—";
  color: var(--amber);
  margin-right: 0.55rem;
}

.ledger p {
  margin: 0;
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.band-aside {
  max-width: var(--measure);
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 1.1875rem;
  font-style: italic;
  color: var(--body);
}

/* A quieter variant for a plain "see also" line, which the display italic overstates. */
.band-aside-tight {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--dim);
}

/* ── What it does ─────────────────────────────────────────────────────────────────────── */

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.5rem 3rem;
}

.group-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.9rem;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.group h3 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bright);
}

.group p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--dim);
}

/* ── Behaviour details ────────────────────────────────────────────────────────────────── */

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2.75rem 3rem;
}

.detail h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--bright);
}

.detail p {
  margin: 0;
  color: var(--dim);
  font-size: 0.9375rem;
}

/* ── When to use something else ───────────────────────────────────────────────────────── */

.redirects {
  margin: 0;
  max-width: 46rem;
}

.redirects dt {
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft);
  color: var(--bright);
  font-size: 0.9375rem;
  font-weight: 500;
}

.redirects dd {
  margin: 0.2rem 0 1.1rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* ── Status ───────────────────────────────────────────────────────────────────────────── */

.band-status {
  background: var(--recess);
}

.status-body {
  max-width: var(--measure);
  margin: 0;
  color: var(--dim);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0 0;
}

.cta {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--amber);
  border-radius: 8px;
  background: var(--amber-ghost);
  color: var(--amber);
  font-size: 0.9375rem;
  text-decoration: none;
}

.cta:hover {
  background: var(--amber);
  color: var(--ground);
}

.cta-quiet {
  border-color: var(--rule);
  background: transparent;
  color: var(--body);
}

.cta-quiet:hover {
  background: transparent;
  border-color: var(--body);
  color: var(--bright);
}

/* ── Docs ─────────────────────────────────────────────────────────────────────────────── */

.doc-shell {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 6rem;
}

.doc-nav {
  align-self: start;
  position: sticky;
  top: 2rem;
}

.doc-nav-group {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.doc-nav-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.doc-nav-list a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.9rem;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--dim);
  font-size: 0.9375rem;
  text-decoration: none;
}

.doc-nav-list a:hover {
  color: var(--bright);
}

.doc-nav-list a[aria-current="page"] {
  border-left-color: var(--amber);
  color: var(--bright);
}

.doc {
  min-width: 0;
  max-width: 44rem;
}

.doc h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--bright);
  margin: 0 0 1.75rem;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--bright);
  margin: 3rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
}

.doc h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bright);
  margin: 2rem 0 0.6rem;
}

.doc p,
.doc li {
  font-size: 0.9375rem;
}

.doc ul,
.doc ol {
  padding-left: 1.2rem;
}

.doc li {
  margin: 0.35rem 0;
}

.doc li::marker {
  color: var(--amber);
}

.doc strong {
  color: var(--bright);
  font-weight: 600;
}

.doc code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--recess);
  border: 1px solid var(--rule-soft);
  color: var(--body);
}

/* Key caps. The shortcut table is a list of things you press, so they should look pressable. */
.doc kbd {
  display: inline-block;
  min-width: 1.75em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--raise);
  color: var(--bright);
  /* Sans, not the inherited mono: a monospaced capital O is not distinguishable enough from a
   * zero, and ⌘O vs ⌘0 is exactly the distinction this page exists to make. */
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
}

.doc kbd + kbd {
  margin-left: 0.2em;
}

.doc pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--recess);
  line-height: 1.55;
}

.doc pre code {
  padding: 0;
  border: 0;
  background: none;
}

.doc blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--dim);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.doc th,
.doc td {
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}

.doc th {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom-color: var(--rule);
}

.doc hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--rule-soft);
}

/* Wide tables scroll inside their own box rather than pushing the page sideways. */
.doc .table-scroll {
  overflow-x: auto;
}

/* Competitor favicons. Downloaded and committed rather than hotlinked, so the page still makes
 * no external requests. Several are dark artwork on a transparent background and would vanish
 * against the dark ground, so each sits on a light plate. */
.doc .fav {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  box-sizing: border-box;
  padding: 1px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
  vertical-align: -0.28em;
  margin-right: 0.15rem;
}

/* ── Colophon ─────────────────────────────────────────────────────────────────────────── */

.colophon {
  padding: 3rem var(--gutter) 4rem;
  border-top: 1px solid var(--rule-soft);
}

.colophon-inner {
  max-width: var(--wide);
  margin: 0 auto;
}

.colophon-lede {
  max-width: var(--measure);
  margin: 0;
  font-size: 0.9375rem;
  color: var(--dim);
}

.colophon-note {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  opacity: 0.8;
}

/* ── Narrow ───────────────────────────────────────────────────────────────────────────── */

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

  .doc-nav {
    position: static;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule-soft);
  }

  .doc-nav-list {
    margin-bottom: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --dim: #c2ccd8;
    --rule: #55606d;
    --rule-soft: #3d4652;
  }
}
