/* Quillmere. One stylesheet for every page.
   The site uses six colors, all defined on :root. */

:root {
  --paper: #fbf3fc;
  --ink: #2d1430;
  --muted: #644468;
  --accent: #8d2896;
  --night: #290a2c;
  --glow: #edb5f2;

  --font-round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 16px;
  --wide: 72rem;
  --measure: 40rem;
}

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

html {
  scroll-snap-type: y proximity;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

figure {
  margin: 0;
}

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

/* Type */

h1,
h2,
h3 {
  font-family: var(--font-round);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 1.5rem + 3.9vw, 5.1rem);
  max-width: 17ch;
}

h2 {
  font-size: clamp(1.85rem, 1.3rem + 2.5vw, 3.4rem);
  max-width: 22ch;
}

h3 {
  font-size: clamp(1.2rem, 1.02rem + 0.8vw, 1.55rem);
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
  max-width: var(--measure);
}

li {
  margin: 0 0 0.5em;
}

dl {
  margin: 0;
}

dd {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 600;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.panel--night code {
  color: var(--glow);
}

.lead {
  max-width: 40rem;
  font-size: clamp(1.15rem, 1.03rem + 0.55vw, 1.4rem);
  line-height: 1.5;
}

/* Links, focus and skip link */

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

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

.panel--night a {
  color: var(--glow);
}

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

.panel--night :focus-visible,
.site-footer :focus-visible,
.term :focus-visible {
  outline-color: var(--glow);
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: var(--gutter);
  z-index: 20;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--paper);
  font-family: var(--font-round);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--gutter);
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header and navigation */

.site-header {
  background-color: var(--paper);
  border-bottom: 1px solid var(--muted);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-round);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-round);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid var(--paper);
}

.site-nav a:hover {
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  font-weight: 800;
}

/* Snap panels: each panel is one full-height screen */

.panel {
  scroll-snap-align: start;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(3.5rem, 9vh, 6.5rem) var(--gutter);
  background-color: var(--paper);
  color: var(--ink);
}

.panel--night {
  background-color: var(--night);
  color: var(--paper);
}

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

@media (min-width: 48rem) {
  .panel {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

.eyebrow,
.panel-index {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  max-width: none;
  color: var(--accent);
  font-family: var(--font-round);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.eyebrow::before,
.panel-index::before {
  content: "";
  flex: none;
  width: 2.2rem;
  height: 2px;
  background-color: var(--accent);
}

.panel--night .eyebrow,
.panel--night .panel-index {
  color: var(--glow);
}

.panel--night .eyebrow::before,
.panel--night .panel-index::before {
  background-color: var(--glow);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 4.5rem;
  }
}

.hero-art {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

.hero-art svg {
  width: 100%;
  height: auto;
}

/* Buttons */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--paper);
  font-family: var(--font-round);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.button--quiet {
  background-color: var(--paper);
  color: var(--accent);
}

.button--quiet:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.panel--night .button {
  background-color: var(--glow);
  border-color: var(--glow);
  color: var(--night);
}

.panel--night .button:hover {
  background-color: var(--paper);
  border-color: var(--paper);
  color: var(--night);
}

.panel--night .button--quiet {
  background-color: var(--night);
  border-color: var(--glow);
  color: var(--glow);
}

.panel--night .button--quiet:hover {
  background-color: var(--glow);
  border-color: var(--glow);
  color: var(--night);
}

/* Ledger rules, columns and notes */

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 46rem;
}

.ledger > li {
  margin: 0;
  padding: 1.15rem 0 1.25rem;
  border-top: 1px solid var(--muted);
}

.ledger > li:last-child {
  border-bottom: 1px solid var(--muted);
}

.ledger h3 {
  margin-bottom: 0.35rem;
}

.ledger p {
  margin: 0;
}

.panel--night .ledger > li {
  border-color: var(--glow);
}

.trio {
  display: grid;
  gap: 2.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin: 2.25rem 0 2rem;
}

.trio > div {
  padding-top: 1rem;
  border-top: 2px solid var(--accent);
}

.trio p {
  margin: 0;
}

.check {
  margin-top: 1.6rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
}

.check h3 {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.check p {
  margin: 0;
}

.panel--night .check {
  border-left-color: var(--glow);
}

.panel--night .check h3 {
  color: var(--glow);
}

.note {
  max-width: 44rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--muted);
  font-size: 0.95rem;
  color: var(--muted);
}

.panel--night .note {
  border-top-color: var(--glow);
  color: var(--glow);
}

/* Specimen plates for diagrams that sit inside a panel */

.split-figure {
  margin: 0;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  border: 2px solid var(--ink);
  border-radius: 18px;
  background-color: var(--paper);
  color: var(--ink);
}

.split-figure svg {
  width: 100%;
  height: auto;
}

.split-figure figcaption {
  margin-top: 1rem;
  max-width: none;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Principle index and jump links */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: none;
}

.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border: 2px solid var(--glow);
  border-radius: 999px;
  color: var(--glow);
  font-family: var(--font-round);
  font-weight: 700;
  text-decoration: none;
}

.jump a:hover {
  background-color: var(--glow);
  color: var(--night);
}

/* Offer lines */

.offer-lines {
  counter-reset: offer;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 46rem;
}

.offer-lines > li {
  counter-increment: offer;
  position: relative;
  margin: 0;
  padding: 1.2rem 0 1.4rem 3.4rem;
  border-top: 1px solid var(--muted);
}

.offer-lines > li:last-child {
  border-bottom: 1px solid var(--muted);
}

.offer-lines > li::before {
  content: counter(offer);
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--paper);
  font-family: var(--font-round);
  font-weight: 700;
  line-height: 2.3rem;
  text-align: center;
}

.offer-lines h3 {
  margin-bottom: 0.35rem;
}

.offer-lines p {
  margin: 0;
}

/* Glossary */

.terms {
  max-width: 52rem;
}

.gloss {
  display: grid;
  gap: 0.25rem;
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid var(--muted);
}

.gloss:last-child {
  border-bottom: 1px solid var(--muted);
}

.gloss dt {
  font-family: var(--font-round);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.gloss dd {
  max-width: none;
}

.panel--night .gloss {
  border-color: var(--glow);
}

@media (min-width: 40rem) {
  .gloss {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
  }
}

/* Command reference (static, always visible) */

.command-ref {
  max-width: 52rem;
  margin: 0 0 2.2rem;
}

.command-ref > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--muted);
}

.command-ref > div:last-child {
  border-bottom: 1px solid var(--muted);
}

.command-ref dt {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.command-ref dd {
  max-width: none;
  color: var(--ink);
}

@media (min-width: 40rem) {
  .command-ref > div {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
  }
}

/* Desk Terminal */

.term {
  max-width: 52rem;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background-color: var(--night);
  color: var(--paper);
}

.term-bar {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--glow);
  background-color: var(--night);
}

.term-title {
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--glow);
}

.term-screen {
  padding: 1.1rem clamp(0.85rem, 2.4vw, 1.4rem) 1.2rem;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  line-height: 1.55;
}

.term-log {
  max-height: 25rem;
  margin-bottom: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.term-entry {
  margin-bottom: 1rem;
}

.term-line,
.term-out {
  margin: 0;
  max-width: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-prompt {
  margin-right: 0.6em;
  color: var(--glow);
  font-weight: 700;
}

.term-cmd {
  color: var(--paper);
  font-weight: 700;
}

.term-out {
  color: var(--paper);
}

.term-form {
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--glow);
}

.term-label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-round);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--glow);
}

.term-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.term-row .term-prompt {
  flex: none;
  margin-right: 0;
}

.term-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--glow);
  border-radius: 10px;
  background-color: var(--night);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.term-input:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: 2px;
}

.term-run {
  flex: none;
  min-height: 46px;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--glow);
  border-radius: 10px;
  background-color: var(--glow);
  color: var(--night);
  font-family: var(--font-round);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.term-run:hover {
  background-color: var(--paper);
  border-color: var(--paper);
}

.term-hint {
  margin: 0.6rem 0 0;
  max-width: none;
  font-size: 0.88rem;
  color: var(--glow);
}

.term-note {
  max-width: 46rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Footer */

.site-footer {
  padding: 2.75rem var(--gutter) 3rem;
  background-color: var(--night);
  color: var(--paper);
}

@media (min-width: 48rem) {
  .site-footer {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

.footer-inner {
  display: grid;
  gap: 1.4rem;
  max-width: var(--wide);
  margin: 0 auto;
}

.footer-note,
.footer-mail {
  max-width: 46rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--paper);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.footer-nav a,
.footer-mail a,
.site-footer a {
  color: var(--glow);
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Shapes: diagrams drawn with classes so their colors come from :root */

.line-ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-ink-heavy {
  fill: none;
  stroke: var(--ink);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-muted {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.line-paper {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-glow-thin {
  fill: none;
  stroke: var(--glow);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}

.line-glow-curve {
  fill: none;
  stroke: var(--glow);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-glow-heavy {
  fill: none;
  stroke: var(--glow);
  stroke-width: 7;
  stroke-linecap: round;
}

.fill-ink {
  fill: var(--ink);
}

.fill-accent {
  fill: var(--accent);
}

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

.fill-paper {
  fill: var(--paper);
}

.fill-glow {
  fill: var(--glow);
}

.sheet-body {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5;
}

.mark-text {
  fill: var(--paper);
  font-family: var(--font-round);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Motion: animations and transitions only when motion is allowed */

@keyframes term-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .button,
  .site-nav a,
  .jump a,
  .footer-nav a,
  .term-run {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .term-entry--new {
    animation: term-in 0.32s ease-out both;
  }
}

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

  .button,
  .site-nav a,
  .jump a,
  .footer-nav a,
  .term-run {
    transition: none;
  }

  .term-entry--new {
    animation: none;
  }
}
