/* site.css: the registers and the page, built ONLY from token custom
   properties. If a raw value appears here that exists as a token, that is a
   bug against the DLS. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-base);
  color: var(--color-ink);
  font-family: var(--type-body-font-family);
  font-weight: var(--type-body-font-weight);
  font-size: var(--type-body-font-size);
  line-height: var(--type-body-line-height);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* The two registers (IDENTITY P2). Case is NOT part of the register:
   .spec is sentence case; only .label adds caps, for short structural
   labels that are scanned, not read. */

.spec {
  font-family: var(--type-spec-font-family);
  font-weight: var(--type-spec-font-weight);
  font-size: var(--type-spec-font-size);
  line-height: var(--type-spec-line-height);
  letter-spacing: var(--type-spec-letter-spacing);
}
/* Tabular figures ONLY where digits align in columns: Diatype's tnum widens
   the space glyph to figure width, which reads as double spaces in prose. */
.specblock { font-feature-settings: var(--type-spec-font-feature-settings); }

.label { text-transform: uppercase; }

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

.lead {
  font-size: var(--type-lead-font-size);
  line-height: var(--type-lead-line-height);
  max-width: var(--measure-story);
  margin: 0;
}

.display {
  font-size: var(--type-display-xl-font-size);
  font-weight: var(--type-display-xl-font-weight);
  line-height: var(--type-display-xl-line-height);
  letter-spacing: var(--type-display-xl-letter-spacing);
  color: var(--color-signal);
  margin: 0;
}
.display em { font-style: italic; }

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

/* Signal: live and interactive elements only (IDENTITY P3). */
a {
  color: var(--color-signal);
  text-decoration: none;
  transition: text-decoration-color var(--motion-duration-quick) var(--motion-easing-standard);
}
a:hover { text-decoration: underline; }

hr {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 0;
  width: 100%;
}

/* Layout pieces of the confirmed Home v0 */

.topbar { display: flex; justify-content: space-between; gap: var(--space-6); }

.stack-3 { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-6 { display: flex; flex-direction: column; gap: var(--space-6); }
.stack-12 { display: flex; flex-direction: column; gap: var(--space-12); }

.placeholder {
  background: var(--color-line);
  color: var(--color-ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  border-radius: var(--radius-none);
}
.ph-hero { aspect-ratio: 15 / 8; }
.ph-tile { aspect-ratio: 8 / 5; }

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* A real footer: separated by a line, breathing room above, quieter. */

/* Code in prose: the one place a second family is allowed, the visitor's own system
   monospace, per the default-typeface ethos: nothing to download. No box: a single
   left hairline, like the vertical rules elsewhere. */
.prose pre {
  border-left: 1px solid var(--color-line);
  padding: var(--space-2) 0 var(--space-2) var(--space-6);
  overflow-x: auto;
  margin: 0;
}
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
.prose pre code { font-size: 13px; line-height: 1.5; }
.prose ul, .prose ol { margin: 0; padding-left: var(--space-6); max-width: var(--measure-story); }
.prose li + li { margin-top: var(--space-2); }

/* Footer: two rows in the spec register. Row one is the server line, the machine
   talking about itself (static half built in, live half from /api/stats.json, see
   footer.njk). Row two is the colophon. Hairline above each row, equal breathing room. */
footer {
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.server { color: var(--color-ink); }
.colophon {
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

/* The spec block: the machine voice as a key-value table (case pages). */
.specblock {
  margin: 0;
  border-top: 1px solid var(--color-line);
}
.specblock .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-line);
}
.specblock dt, .specblock dd { margin: 0; }

/* Story flow on entry pages: md-compiled content. */
.prose { display: flex; flex-direction: column; gap: var(--space-6); }
.prose h2 {
  font-size: var(--type-heading-font-size);
  font-weight: var(--type-heading-font-weight);
  line-height: var(--type-heading-line-height);
  margin: var(--space-12) 0 0 0;
}
.prose { counter-reset: sec; }
.prose h3 {
  counter-increment: sec;
  font-size: var(--type-heading-font-size);
  font-weight: var(--type-heading-font-weight);
  line-height: var(--type-heading-line-height);
  color: var(--color-signal);
  margin: var(--space-6) 0 0 0;
  position: relative;
  padding-left: 132px;
  min-height: 48px;
}
.prose h3::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-size: var(--type-display-font-size);
  font-weight: var(--type-display-font-weight);
  line-height: var(--type-display-line-height);
  letter-spacing: var(--type-display-letter-spacing);
  color: var(--color-signal);
}
.prose h3::after {
  content: "";
  position: absolute;
  left: 92px;
  top: 6px;
  width: 1px;
  height: 52px;
  background: var(--color-line);
}
.prose h2 { color: var(--color-signal); }
.prose img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.prose hr { margin: var(--space-6) 0; }
.ph-img { aspect-ratio: 16 / 9; }

@media (max-width: 720px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .display { font-size: var(--type-heading-font-size); }
  .specblock .row { grid-template-columns: 1fr; gap: var(--space-1); }
}
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

/* Back to top: instant anchor jump, no JS. Interactive, so signal (P3). */
.totop {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  background: var(--color-base);
  border: 1px solid var(--color-line);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-none);
}

/* Hero slideshow: slow crossfade, pure CSS, static after first cycle setup */
.hero-slides {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-line);
}
.hero-slides { cursor: pointer; }
.hero-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.hero-slides img.on { opacity: 1; }
.dots { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-3); }
.dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-line);
  cursor: pointer;
}
.dots i.on { background: var(--color-ink); }

/* Pull-quote block: hairlines, italic, indented */
.quoteblock {
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-8) 0 var(--space-8) 120px;
}
/* All quotes stack in one grid cell: block sizes to the tallest, no layout jump */
.qstack { display: grid; cursor: pointer; }
.qstack .q {
  grid-area: 1 / 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.qstack .q.on { opacity: 1; pointer-events: auto; }
.qdots { margin-top: var(--space-4); margin-left: -120px; }
.quoteblock blockquote {
  margin: 0;
  font-size: var(--type-quote-font-size);
  line-height: var(--type-quote-line-height);
  font-style: var(--type-quote-font-style);
  max-width: 40em;
}

/* Highlights: numbered entries with a short vertical rule */
.hl {
  display: grid;
  grid-template-columns: 92px 1px 1fr;
  column-gap: var(--space-8);
}
.hl .num {
  font-size: var(--type-display-font-size);
  font-weight: var(--type-display-font-weight);
  line-height: var(--type-display-line-height);
  letter-spacing: var(--type-display-letter-spacing);
  color: var(--color-signal);
}
.hl .vr { background: var(--color-line); width: 1px; min-height: 140px; }
.hl .cell { display: flex; flex-direction: column; gap: var(--space-2); }

/* About: portrait + bio + link grid */
.about { display: grid; grid-template-columns: 1fr 320px; column-gap: var(--space-16); }
.about-text p { max-width: 38em; margin: 0; }
.about-text p + p { margin-top: var(--space-4); }
.about-text .credo { margin-top: var(--space-6); }
.about-side { display: flex; flex-direction: column; gap: var(--space-2); }
.links { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }

/* Background accordion: native details rows */
.prose details { border-top: 1px solid var(--color-line); }
.prose details:last-of-type { border-bottom: 1px solid var(--color-line); }
.prose summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  font-family: var(--type-spec-font-family);
  font-size: var(--type-spec-font-size);
  line-height: var(--type-spec-line-height);
  letter-spacing: var(--type-spec-letter-spacing);
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "+";
  color: var(--color-signal);
  font-size: var(--type-heading-font-size);
  line-height: 1;
}
.prose details[open] summary::after { content: "\2212"; }
.prose details > *:not(summary) { margin-bottom: var(--space-6); }

@media (max-width: 720px) {
  .display { font-size: var(--type-heading-font-size); }
  .prose h3 { padding-left: 0; min-height: 0; }
  .prose h3::before { position: static; display: block; margin-bottom: var(--space-1); }
  .prose h3::after { display: none; }
  .hl { grid-template-columns: 1fr; }
  .hl .vr { display: none; }
  .about { grid-template-columns: 1fr; row-gap: var(--space-6); }
}

.about p.contactlabel { margin-top: var(--space-12); }
.about .lead { display: block; }
.about p { margin-top: var(--space-2); }

/* Image paragraphs escape the text measure: pictures span the column */
.prose p:has(> img) { max-width: none; }

/* Client names: one wrapped spec line, breathing */
.clients { max-width: 66em; line-height: 2; margin: 0; }

/* Legal page: h2 sections speak spec, chapter heading speaks display */
.legal h2 {
  font-family: var(--type-spec-font-family);
  font-size: var(--type-spec-font-size);
  font-weight: var(--type-spec-font-weight);
  line-height: var(--type-spec-line-height);
  letter-spacing: var(--type-spec-letter-spacing);
  text-transform: uppercase;
  color: var(--color-ink-muted);
  margin: var(--space-8) 0 0 0;
}
.legal h2.legal-chapter {
  font-family: inherit;
  font-size: var(--type-display-xl-font-size);
  font-weight: var(--type-display-xl-font-weight);
  line-height: var(--type-display-xl-line-height);
  letter-spacing: var(--type-display-xl-letter-spacing);
  text-transform: none;
  color: var(--color-signal);
  margin-top: var(--space-6);
}
hr.chapter { margin-top: var(--space-16); }
/* DRAFT marker: deliberate non-token, dies at launch */
.draft { color: #C7231A; }
.legal-chapter { scroll-margin-top: var(--space-8); }

/* Services matrix: image + title + two lines, 2-up */
.services { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-12) var(--space-8); }
@media (max-width: 1100px) { .services { grid-template-columns: 1fr 1fr; } }
.svc img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.svc .t {
  font-size: var(--type-heading-font-size);
  font-weight: var(--type-heading-font-weight);
  line-height: var(--type-heading-line-height);
  color: var(--color-signal);
  margin: var(--space-3) 0 0 0;
}
.svc p:not(.t) { margin: var(--space-2) 0 0 0; }
@media (max-width: 720px) { .services { grid-template-columns: 1fr; } }
