/* Applied Dog — applieddog.com
   One stylesheet, no framework, no reset library, no external request.

   The hard constraint on this site is zero third-party requests: no CDN, no
   Google Fonts, no analytics, no embeds. Everything below resolves to a file
   under /assets/. That constraint is what keeps the Datenschutzerklärung to a
   few paragraphs and removes any need for a cookie banner. Don't add a font
   URL, an icon set or a script tag here without re-reading site/README.md. */

/* ---------------------------------------------------------------- 1. fonts */
/* GUST Latin Modern, subsetted to Latin-1 plus the punctuation the three
   pages actually use — 12.2 KB and 9.4 KB. Generated by site/src/make-assets.py.
   The -v1 in the filenames is what lets nginx serve /assets/fonts/ immutable
   for a year; bump it there and here together. Licence sits beside them. */
@font-face {
  font-family: "LM Roman";
  src: url("fonts/lmroman-regular-v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LM Mono";
  src: url("fonts/lmmono-regular-v1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- 2. tokens */
:root {
  --ink: #15171A;      /* not pure black: pure black on paper reads as a screenshot */
  --paper: #E9E4D9;
  --red: #B03A26;      /* annotation only — see §5 below */

  --serif: "LM Roman", Iowan Old Style, Palatino, Georgia, serif;
  --mono: "LM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --track-mono: 0.055em;   /* brand spec: mono tracked +55/1000 */
  --measure: 34rem;
  --column: 46rem;

  /* Only one font weight is subsetted, so nothing here is ever bold. Latin
     Modern has no screen-legible synthetic bold and the brand type spec
     doesn't use one; hierarchy comes from size, case and tracking instead. */
}

/* The paper ground is the identity, not a theme. There is deliberately no
   prefers-color-scheme: dark branch — the brand's dark pair exists for placing
   the mark on someone else's dark surface, not for inverting our own page.
   color-scheme keeps the UA from darkening scrollbars and form controls. */
:root { color-scheme: light; }

/* ---------------------------------------------------------------- 3. reset */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------------- 4. layout */
.stack {
  width: 100%;
  max-width: var(--column);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2rem);
}

/* Landing page: lockup and the rest sit either side of a full-bleed rule,
   the same arrangement as the YouTube banner. */
.home main {
  display: grid;
  align-content: center;
  gap: clamp(1.75rem, 5vw, 2.75rem);
  padding-block: clamp(2.5rem, 8vh, 5rem);
}

/* ---------------------------------------------------------------- 5. plate rule */
/* "The plate rule with tick marks is the system's connective tissue" —
   brand/README.md §5. Built from three background layers rather than an image
   so it goes full-bleed at any viewport width: tall ticks every 5th, short
   ticks every 16px, then the rule itself. Every fifth short tick is covered
   by a tall one, which is why both layers start at x=0.
   Red is absent by design: on this site it appears on the 404 page only,
   where it means what it's supposed to mean — the researcher is pointing at
   something. Spend it anywhere else and it stops meaning anything. */
.rule {
  border: 0;
  margin: 0;
  width: 100%;
  height: 12px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 80px) 0 0 / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px) 0 5px / 100% 5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 10px / 100% 2px no-repeat;
}

/* ---------------------------------------------------------------- 6. lockup */
/* Type in the lockup is outlined in the SVG, so it needs no webfont and can't
   reflow. aspect-ratio is set from the asset's natural 1378x222, which reserves
   the box before the image arrives — no layout shift. */
.lockup {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}
.lockup picture { display: block; }
.lockup img {
  width: min(42rem, 100%);
  aspect-ratio: 1378 / 222;   /* natural size of lockup.svg */
  margin-inline: auto;
}

/* Legal-page header: the compact lockup always, since at 20rem the full one's
   subtitle would be ~7px. It's only a link home. */
.lockup--small img {
  width: min(20rem, 72%);
  aspect-ratio: 1378 / 176;   /* natural size of lockup-compact.svg */
  margin-inline: 0;
}

/* Announced by screen readers at every width; visible only below 34rem, where
   the SVG no longer carries it. */
.lockup__sub {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 34rem) {
  .lockup img { aspect-ratio: 1378 / 176; }
  .lockup__sub {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    display: block;
    margin-top: 0.85rem;
    text-align: center;
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1.4;
    letter-spacing: var(--track-mono);
    text-transform: uppercase;
  }
}

/* ---------------------------------------------------------------- 7. type */
.lede {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: clamp(1.125rem, 1rem + 0.9vw, 1.5rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.label,
h2 {
  margin: 2.5rem 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.35em;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  line-height: 1.2;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- 8. links */
/* Hover inverts rather than recolouring. "Ink on paper, or paper on ink.
   Nothing else." — brand/README.md §5. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration-color: transparent;
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  text-decoration-color: transparent;
}

/* ---------------------------------------------------------------- 9. channels */
.channels ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.85em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}
/* Separator lives on the li, never inside the a, so the inverting hover
   doesn't swallow it. */
.channels li:not(:last-child)::after {
  content: "·";
  margin-left: 0.85em;
  text-decoration: none;
}
.channels a { padding: 0.15em 0.2em; }

.contact {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: var(--track-mono);
}

/* ---------------------------------------------------------------- 10. legal pages */
.doc main { padding-block: clamp(2rem, 6vh, 3.5rem) clamp(3rem, 8vh, 4.5rem); }
.doc header { padding-block: clamp(1.5rem, 5vh, 2.5rem) 0; }
.doc .rule { margin-top: clamp(1.5rem, 4vh, 2rem); }
.doc main .stack { max-width: calc(var(--measure) + 8rem); }

.doc dl { margin: 0 0 1.25rem; }
.doc dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  margin-top: 0.9rem;
}
.doc dd { margin: 0.1rem 0 0; }

address { font-style: normal; }

.doc h2:first-of-type { margin-top: 1.75rem; }

/* ---------------------------------------------------------------- 11. footer */
footer {
  padding: 1.5rem clamp(1.25rem, 5vw, 2rem) 1.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  text-align: center;
}
footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.8em;
  margin: 0;
  padding: 0;
  list-style: none;
}
footer li:not(:last-child)::after { content: "·"; margin-left: 0.8em; }

/* ---------------------------------------------------------------- 12. registration marks */
/* Corner crosses, as on the banner. Decorative; hidden on small screens where
   they'd crowd the content, and on print. */
.registration span {
  position: fixed;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.registration span::before,
.registration span::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.registration span::before { inset: calc(50% - 1px) 0 auto; height: 2px; }
.registration span::after { inset: 0 auto 0 calc(50% - 1px); width: 2px; }
.registration span:nth-child(1) { top: 24px; left: 24px; }
.registration span:nth-child(2) { top: 24px; right: 24px; }
.registration span:nth-child(3) { bottom: 24px; left: 24px; }
.registration span:nth-child(4) { bottom: 24px; right: 24px; }

@media (max-width: 46rem) {
  .registration { display: none; }
}

/* ---------------------------------------------------------------- 13. 404 */
/* The one place red is spent. A callout ring with nothing inside it. */
.notfound {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  text-align: center;
}
.notfound .ring {
  width: clamp(8rem, 30vw, 11rem);
  aspect-ratio: 1;
  border: 6px solid var(--red);
  border-radius: 50%;
}
.notfound .fig {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--red);
}

/* ---------------------------------------------------------------- 14. a11y */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---------------------------------------------------------------- 15. print */
@media print {
  :root { --paper: #fff; }
  body { font-size: 10.5pt; }
  .registration, .rule { display: none; }
  a { text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
