/* ===========================================================================
   Download — /journal/ ("the back pages"). An editorial notes section in the
   site's magazine language: paper + grain, ink, hairlines, grotesque + mono,
   index numbering. Deliberately quieter chrome than the main pages (no
   parallax footer, no fold) — it reads like the appendix of the magazine.
   Index page = a contents list; article pages = a single reading column with
   small retro figures (the strategy webp objects) as plates.
   Tokens re-declared (pages.css scopes them to .pages). No auto-hyphenation
   anywhere — the owner's voice rule is no hyphens/dashes in prose.
   =========================================================================== */
:root {
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ink: #38393d;
  --ink-body: #3a3a38;
  --ink-soft: #6b6b69;
  --ink-faint: #b4b4ae;
  --hair: rgba(56, 57, 61, 0.14);
  --rule: rgba(56, 57, 61, 0.85);
  --paper: #f4f3ef;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --fs-label: 0.72rem;
  --fs-body: clamp(1.02rem, 0.98rem + 0.28vw, 1.16rem);
  --fs-lead: clamp(1.18rem, 1.04rem + 0.6vw, 1.5rem);
  --fs-statement: clamp(1.35rem, 1.12rem + 1vw, 1.9rem);
  --fs-head: clamp(1.8rem, 1.3rem + 2.2vw, 2.8rem);
  --fs-display: clamp(2.4rem, 1.4rem + 4.6vw, 5.2rem);

  --sp-1: clamp(0.9rem, 1.6vw, 1.3rem);
  --sp-2: clamp(1.5rem, 2.8vw, 2.2rem);
  --sp-3: clamp(2.2rem, 4.5vh, 3.2rem);
  --sp-4: clamp(3rem, 7vh, 4.6rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.journal-page {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: url(../img/noise.png);
  background-size: 150px;
  background-repeat: repeat;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* article pages sit one level deeper — noise path differs */
body.journal-page--deep {
  background-image: url(../../img/noise.png);
}

.journal-page a:focus-visible,
.journal-page button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* shared top bar stays visible, flag nothing (journal isn't in the nav) */
.journal-page .topbar { opacity: 1; transform: none; pointer-events: auto; }

.jr {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 7.5rem) clamp(1.2rem, 4vw, 2rem) clamp(3rem, 7vh, 4.5rem);
}
.jr--index { max-width: 56rem; }

/* mono voice */
.jr-kicker, .jr-date, .jr-meta, .jr-fig figcaption, .jr-no, .jr-next__label, .jr-colophon, .jr-foot {
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------------
   Masthead (index + articles)
   --------------------------------------------------------------------------- */
.jr-mast { position: relative; }
.jr-mast__rail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--rule);
}
.jr-kicker {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.jr-kicker a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.jr-kicker a:hover { border-bottom-color: var(--ink); }
.jr-date {
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
/* Phones: an article's rail ("dwnld://journal / no. 01" + "Mar 2025 ·
   updated … · 4 min") is too long for one 390px row — the nowrap date ran
   off the screen edge. Stack the two mono lines instead; the index page's
   shorter rail keeps its single row. */
@media (max-width: 40em) {
  .jr-art .jr-mast__rail {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.4rem;
  }
  .jr-art .jr-date { white-space: normal; }
}
.jr-mast h1 {
  margin-top: var(--sp-2);
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.jr-mast__deck {
  margin-top: var(--sp-1);
  font-size: var(--fs-lead);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* the spinning disc — the homepage's CD carried through as marginalia */
.jr-cd {
  position: absolute;
  top: clamp(2.4rem, 6vw, 3.4rem);
  right: 0;
  width: clamp(84px, 12vw, 132px);
  height: auto;
  animation: jr-spin 16s linear infinite;
  pointer-events: none;
  user-select: none;
}
@keyframes jr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .jr-cd { animation: none; } }
@media (max-width: 40em) { .jr-cd { width: 56px; top: 3.4rem; } }

/* ---------------------------------------------------------------------------
   Index — the contents page
   --------------------------------------------------------------------------- */
.jr-index {
  list-style: none;
  margin-top: var(--sp-4);
}
.jr-index li { border-top: 1px solid var(--hair); }
.jr-index li:first-child { border-top: 1px solid var(--rule); }
.jr-index li:last-child { border-bottom: 1px solid var(--hair); }
.jr-index a {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: clamp(1.1rem, 2.4vw, 1.6rem) 0;
  text-decoration: none;
  color: var(--ink);
}
.jr-no {
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  transition: color 0.25s ease;
}
.jr-index h2 {
  font-size: var(--fs-statement);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  transition: opacity 0.25s ease;
}
.jr-index .jr-deck {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
}
.jr-meta {
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  justify-self: end;
}
.jr-index a:hover .jr-no { color: var(--ink); }
.jr-index a:hover h2 { opacity: 0.65; }
@media (max-width: 40em) {
  .jr-index a { grid-template-columns: 2.2rem 1fr; }
  .jr-meta { grid-column: 2; justify-self: start; margin-top: 0.3rem; }
}

/* ---------------------------------------------------------------------------
   Article
   --------------------------------------------------------------------------- */
.jr-art h1 {
  font-size: clamp(2rem, 1.4rem + 2.9vw, 3.6rem);
  margin-top: var(--sp-2);
  max-width: 18ch;
}

/* giant watermark numeral — the About chapters' outline figure, carried
   through. Sits behind the masthead, top right. */
.jr-giant {
  position: absolute;
  z-index: -1;
  top: -1.4rem;
  right: -0.04em;
  font-size: clamp(9rem, 22vw, 15rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.06em;
  user-select: none;
  pointer-events: none;
  color: rgba(56, 57, 61, 0.05);
}
@supports (-webkit-text-stroke: 1px black) {
  .jr-giant {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(56, 57, 61, 0.2);
  }
}
.jr-art .jr-mast__deck { font-size: var(--fs-lead); }

.jr-body { margin-top: var(--sp-3); }
.jr-body h2 {
  font-size: var(--fs-statement);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: var(--sp-3) 0 var(--sp-1);
  text-wrap: balance;
  max-width: 62ch;   /* same measure as body — no mid-phrase wraps */
}
.jr-body h2:first-child { margin-top: 0; }
.jr-body p {
  font-size: var(--fs-body);
  line-height: 1.62;
  color: var(--ink-body);
  margin: 0 0 1.1em;
  max-width: 62ch;
  /* no text-align: justify and no hyphens — clean rag, no broken words */
}
.jr-body strong { font-weight: 600; color: var(--ink); }
.jr-body ul {
  margin: 0 0 1.2em;
  padding: 0;
  list-style: none;
}
.jr-body ul li {
  padding: 0.55rem 0 0.55rem 1.5rem;
  border-top: 1px solid var(--hair);
  position: relative;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-body);
}
.jr-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15em;
  width: 0.75rem;
  height: 1px;
  background: var(--ink);
}
.jr-body ul li:last-child { border-bottom: 1px solid var(--hair); }

/* pull stat (case study numbers) */
.jr-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-1);
  margin: var(--sp-2) 0;
}
.jr-stat { border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.jr-stat b {
  display: block;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.jr-stat span {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.5;
}
@media (max-width: 40em) { .jr-stats { grid-template-columns: 1fr 1fr; } }

/* plates — design elements only, carried from the home page. Two kinds:
   photo plates (the services stills, edge to edge) and object plates (the
   retro tech objects, presented like specimens in a ruled well). */
.jr-plate {
  margin: var(--sp-3) 0 0;
}
.jr-plate--photo img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  background: rgba(56, 57, 61, 0.06);
}
.jr-plate--object .jr-plate__well {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--hair);
  padding: clamp(1.8rem, 4.5vw, 3rem) 0;
  display: grid;
  place-items: center;
}
.jr-plate--object img {
  width: clamp(150px, 23vw, 224px);
  height: auto;
  filter: grayscale(1) contrast(1.05);
}
.jr-plate figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.jr-plate--photo figcaption {
  padding-top: 0.6rem;
  border-top: 1px solid var(--hair);
}
@media (max-width: 40em) {
  .jr-plate--photo img { aspect-ratio: 4 / 3; }
}

/* retro object figures — the strategy webp loops, large enough to matter */
.jr-fig {
  float: right;
  width: clamp(132px, 17vw, 196px);
  margin: 0.3rem 0 1rem 1.6rem;
  text-align: center;
}
.jr-fig img { width: 100%; height: auto; display: block; filter: grayscale(1) contrast(1.05); }
.jr-fig figcaption {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--hair);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
}

/* colophon — the standing agency block (every page; the visible, honest
   version of "text for search engines": who we are, what we do, where) */
.jr-colophon {
  margin-top: var(--sp-4);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-1);
  font-size: 0.8rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  max-width: 58ch;
}
.jr-colophon a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); }
.jr-colophon a:hover { border-bottom-color: var(--ink); }

/* read next */
.jr-next {
  margin-top: var(--sp-3);
  border-top: 1px solid var(--hair);
  padding-top: var(--sp-2);
}
.jr-next__label {
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.8rem;
}
.jr-next a {
  display: block;
  padding: 0.7rem 0;
  border-top: 1px solid var(--hair);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--fs-body);
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: opacity 0.25s ease;
}
.jr-next a:hover { opacity: 0.6; }
.jr-next a span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-faint); margin-right: 0.7em; }

/* CTA pill (same language as the site's Book a call) */
.jr-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-top: var(--sp-2);
  padding: 0.85em 1.4em;
  border: 1px solid var(--ink);
  border-radius: 100px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.jr-cta:hover { background: var(--ink); color: var(--paper); }

/* simple footer */
.jr-foot {
  border-top: 1px solid var(--rule);
  margin-top: var(--sp-4);
  padding: var(--sp-1) clamp(1.2rem, 4vw, 2rem) var(--sp-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  max-width: 50rem;
  margin-inline: auto;
}
.jr-foot a { color: var(--ink-soft); text-decoration: none; }
.jr-foot a:hover { color: var(--ink); }
