/* Reset, typography and page furniture. */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

/* Numbers are ledger material: mono, tabular, so columns line up. */
.num {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---- Layout ------------------------------------------------------------- */

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

/* Sections are separated by a hairline rule, not by alternating blocks of
   colour — the page reads like a ruled book. */
.band {
  border-top: var(--hairline) solid var(--rule);
  padding-block: var(--s-16);
}

.band--tight { padding-block: var(--s-12); }
.band:first-of-type { border-top: 0; }

.eyebrow {
  font-family: var(--font-data);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}

.lead {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-top: var(--s-4);
}

.prose {
  max-width: var(--measure);
}
.prose h2 { font-size: var(--step-2); margin-top: var(--s-12); }
.prose h3 { margin-top: var(--s-8); }
.prose p { margin-top: var(--s-4); color: var(--ink-soft); }
.prose ul { margin-top: var(--s-4); padding-left: var(--s-6); color: var(--ink-soft); }
.prose li { margin-top: var(--s-2); }

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px; /* tap target */
  padding: var(--s-3) var(--s-6);
  border: var(--hairline) solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--step-0);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.btn--primary {
  background: var(--violet);
  color: var(--violet-ink);
}
.btn--primary:hover { transform: translateY(-1px); }

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--quiet:hover { background: var(--violet-wash); }

.btn--text {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--violet);
  font-weight: 600;
  text-decoration: underline;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--hairline) solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: 64px;
  padding-block: var(--s-2);
}

/* The till mark is the trademark and leads the wordmark everywhere it
   appears — see brand/README.md. It inherits colour through currentColor, so
   it follows the theme instead of shipping a second, fixed-colour logo. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  width: 1.4em;
  height: 1.4em;
  flex: none;
  color: var(--violet);
}
.brand__word span { color: var(--violet); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  margin-inline-start: auto;
}
.nav__link {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.nav__link:hover,
.nav__link[aria-current='page'] { color: var(--ink); }

.masthead__actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }

@media (max-width: 860px) {
  /* Nav links move to the footer, which carries the same routes. */
  .nav { display: none; }
  .masthead__actions { margin-inline-start: auto; }
}

/* At phone widths two buttons plus the brand cannot fit on one line, and the
   overflow made the whole page scroll sideways. Sign-in is reachable from the
   admin app itself, so the primary action is the one that survives. */
@media (max-width: 560px) {
  .masthead__inner { gap: var(--s-3); }
  .brand { font-size: 1.1rem; }
  .masthead__actions .btn--quiet { display: none; }
  .masthead__actions .btn { padding-inline: var(--s-4); font-size: var(--step--1); }
  .theme-toggle { width: 36px; height: 36px; }
}

/* No overflow-x:hidden here on purpose — it hides sideways-overflow bugs
   instead of fixing them. Measured clean at 500/768/1440. */
.eyebrow { overflow-wrap: anywhere; }

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

.footer {
  border-top: var(--hairline) solid var(--rule);
  padding-block: var(--s-16) var(--s-8);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-8);
}
.footer__title {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}
.footer__list { list-style: none; margin: 0; padding: 0; }
.footer__list li { margin-bottom: var(--s-2); }
.footer__list a { font-size: var(--step--1); color: var(--ink-soft); text-decoration: none; }
.footer__list a:hover { color: var(--ink); text-decoration: underline; }
.footer__base {
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  border-top: var(--hairline) solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

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