/* pepp.co — Andrew Peppard
   An editorial print layout: a magazine feature, not a web page.

   Two serifs do all the work. Bodoni Moda carries display and sets the
   tone — a high-contrast didone whose OPTICAL SIZE axis (6-96) is the
   signature here: hairlines thin as the type grows and thicken as it
   shrinks, which no system stack can fake. Newsreader carries reading
   text at a single pinned optical size.

   Structure comes from rules, numerals and indentation — the vocabulary
   of a printed page — over the colour fields of the previous version. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-var.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-italic-var.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2-variations");
  font-weight: 350 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Warm press stock, warm black, one print red. */
  --stock:     #F4F1EA;
  --tint:      #E9E4D8;
  --ink:       #1A1714;
  --deep:      #120F0D;
  --soft:      #6A6155;
  --rule:      #CFC7B6;
  --accent:    #9A2E1E;

  --on-deep:   #F2EDE2;
  --soft-deep: #A79C88;
  --rule-deep: #3A342B;
  --accent-deep: #D9694F;

  --display: "Bodoni Moda", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  --text:    "Newsreader", Georgia, "Times New Roman", Times, serif;

  --pad: 1.5rem;
  --maxw: 72rem;
  /* No percentage here: a percentage inside a custom property re-resolves
     against whichever element consumes it, which breaks the full-bleed
     spread at mobile widths. */
  --gutter: max(var(--pad), calc((100vw - var(--maxw)) / 2));
  --measure: 33rem;

  --track: 0.16em;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--text);
  /* 17px on a phone, 19px from tablet up. A fixed 19px leaves only ~40
     characters to the line at 375px, which is too short to read well. */
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

p { margin: 0 0 1.05em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--rule);
  transition: color 140ms var(--ease), text-decoration-color 140ms var(--ease);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.spread :focus-visible, .testimonial :focus-visible {
  outline-color: var(--accent-deep);
}

/* Tracked capitals stand in for the small caps neither face carries.
   This is the page's only label voice: no monospace, no second sans. */
.ann, .kicker, .label {
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  line-height: 1.4;
}
.ann { color: var(--soft); font-weight: 500; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--ink); color: var(--stock);
  padding: 0.7rem 1.1rem;
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: var(--track); text-transform: uppercase;
  text-decoration: none;
  transition: top 140ms var(--ease);
}
.skip:focus { top: 1rem; }

/* ---------- Running head ---------- */

.masthead {
  width: min(100% - 2 * var(--pad), var(--maxw));
  margin: 0 auto;
  padding: 0.9rem 0 0.85rem;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft);
}
.masthead span:nth-child(2) { display: none; }

/* ---------- The cover ---------- */

.hero {
  width: min(100% - 2 * var(--pad), var(--maxw));
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
}

.titleblock {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--accent);
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  margin-bottom: clamp(1.75rem, 5vw, 3rem);
}


.hero__name {
  font-size: clamp(3.25rem, 12vw, 9.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.025em;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

/* Thick-thin: the oldest trick in the case, and still the right one. */
.hero__rule {
  box-sizing: content-box;
  border: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 3px;
  margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
}

.hero__summary {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.375rem, 3.2vw, 2.125rem);
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: 24ch;
  margin: 0;
  text-wrap: balance;
}

/* ---------- Page grid ---------- */

.page { width: min(100% - 2 * var(--pad), var(--maxw)); margin-inline: auto; }

.rail { display: none; }

.flow { counter-reset: sec; }
.flow > section { counter-increment: sec; }

.flow > .section {
  border-top: 2px solid var(--ink);
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 7vw, 5.5rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 15ch;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
}
h2::before {
  content: counter(sec, upper-roman);
  display: block;
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.05em; }

/* Drop cap, four lines deep in the print red. Marked up with a span
   rather than ::first-letter, which drags any adjoining punctuation up
   with it — "I've" came out with a four-line apostrophe. */
.dropcap {
  float: left;
  font-family: var(--display);
  font-weight: 500;
  font-size: 4.05em;
  line-height: 0.76;
  margin: 0.05em 0.08em 0 0;
  color: var(--accent);
}
.spread__body .dropcap { color: var(--accent-deep); }

.lede {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  line-height: 1.35;
  max-width: 34ch;
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}

/* ---------- Chronology ---------- */

.arc {
  list-style: none;
  margin: clamp(2.25rem, 5vw, 3.25rem) 0 0;
  padding: 0;
  max-width: 32rem;
  border-top: 1px solid var(--ink);
}
.arc li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
}
.arc__yr {
  flex: none;
  width: 4ch;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.arc__ph {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
}

/* ---------- The spread: What I'd argue about ---------- */

.spread {
  background: var(--deep);
  color: var(--on-deep);
  margin-inline: calc(-1 * var(--gutter));
  /* Air below, so the next section's rule reads as that section's opening
     and not as a border on the bottom of this panel. */
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
}
.spread h2 { max-width: 13ch; }
.spread h2::before { color: var(--accent-deep); }
.spread__title {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.25rem, 6.5vw, 5rem);
  letter-spacing: -0.02em;
}
.spread__body {
  max-width: 62rem;
  font-size: 1.125rem;
  line-height: 1.62;
}
.spread__body p { margin-bottom: 1.05em; }

/* ---------- Selected work ---------- */

.work { max-width: 42rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.work h3 { font-size: clamp(1.875rem, 4vw, 2.75rem); margin-bottom: 0.65rem; }
.work h3 a { text-decoration-color: var(--accent); }
.work__meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 1.1rem;
}
.work p:last-of-type { max-width: var(--measure); }

/* ---------- Press kit ---------- */

.kit { display: grid; gap: 2.5rem; align-items: start; margin-bottom: clamp(3rem, 6vw, 4.5rem); }

/* The headshot as a plate: ruled frame, ruled caption beneath. */
.shot { margin: 0; max-width: 18rem; }
.shot img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--tint);
  border: 1px solid var(--ink);
}
.shot figcaption {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
}
.dl {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration-color: var(--accent);
}

.attr { margin: 0; border-top: 1px solid var(--ink); }
.attr dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--soft);
  padding-top: 0.85rem;
}
.attr dd {
  margin: 0 0 0.85rem;
  padding-top: 0.1rem;
  font-size: 1.0625rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.85rem;
}

/* ---------- Bios ---------- */

.bio { margin-bottom: 2.25rem; max-width: 42rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.bio__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem;
}
.bio__head h3 {
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.bio__head .ann { margin-left: 0.75rem; font-weight: 500; text-transform: none; letter-spacing: 0.04em; }

.bio blockquote {
  margin: 0;
  padding-left: clamp(1rem, 3vw, 2.25rem);
  font-size: 1.0625rem;
  color: var(--ink);
}
.bio blockquote p + p { margin-top: 0.85em; }

/* A text button, not a pill. */
.copy {
  flex: none;
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0 0 0.15rem;
  cursor: pointer;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy[data-state="done"] { color: var(--accent); border-color: var(--accent); }

/* ---------- Topics ---------- */

.topics__h {
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--soft);
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 1rem;
}
.topics {
  list-style: none; margin: 0; padding: 0; max-width: 42rem;
  counter-reset: topic;
  border-top: 1px solid var(--ink);
}
.topics li {
  counter-increment: topic;
  position: relative;
  padding: 0.9rem 0 0.9rem 3rem;
  font-size: 1.0625rem;
  border-bottom: 1px solid var(--rule);
}
.topics li::before {
  content: counter(topic, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1.05rem;
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ---------- Pull quote (styled and ready; markup commented out) ---------- */

.testimonial {
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  max-width: 40rem;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
}
.testimonial blockquote { margin: 0; }
.testimonial blockquote p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.375rem, 3vw, 2rem);
  line-height: 1.3;
  text-wrap: balance;
}
.testimonial blockquote p::before { content: "\201C"; color: var(--accent); }
.testimonial blockquote p::after  { content: "\201D"; color: var(--accent); }
.testimonial figcaption {
  display: flex; flex-direction: column; gap: 0.2rem;
  margin-top: 1.5rem;
}
.testimonial__name {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: var(--track); text-transform: uppercase;
}
.testimonial__title { font-size: 0.8125rem; font-style: italic; color: var(--soft); }

/* ---------- Contact ---------- */

.paths { display: grid; gap: clamp(2.5rem, 5vw, 3.5rem); }
.path { border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.path h3 {
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 1rem;
}
.path__addr {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 0.7rem;
}
.path__addr a { text-decoration-color: var(--accent); }
.path__note { color: var(--soft); max-width: 32ch; font-size: 1.0625rem; }

/* Ruled form fields, the way a printed form is ruled. */
.form { margin-top: 1.75rem; max-width: 32rem; }
.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 0.35rem;
}
.field input, .field textarea {
  width: 100%;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.4rem 0;
  -webkit-appearance: none;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.field textarea { resize: vertical; min-height: 6.5rem; }
.field input:hover, .field textarea:hover { border-color: var(--accent); }
.field input:focus-visible, .field textarea:focus-visible {
  background: var(--tint);
  border-color: var(--accent);
  outline-offset: 2px;
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--accent);
  border-bottom-width: 2px;
}

/* Honeypot — off-canvas rather than display:none, which some bots skip. */
.hp {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.turnstile:not(:empty) { margin-bottom: 1.35rem; }

.submit {
  font-family: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--stock);
  background: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 0.9rem 2.25rem;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}
.submit:hover { background: var(--accent); }
.submit[disabled] { opacity: 0.45; cursor: default; }

.status:empty { display: none; }
.status {
  margin: 1.35rem 0 0;
  font-size: 1rem;
  border-left: 2px solid var(--soft);
  padding: 0.2rem 0 0.2rem 1rem;
  max-width: 34rem;
}
.status--ok   { border-left-color: var(--ink); }
.status--err  { border-left-color: var(--accent); }
.status--note { border-left-color: var(--accent); }

/* ---------- Colophon ---------- */

.foot {
  padding-block: 2rem 4rem;
  border-top: 3px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.foot p { margin-bottom: 0.5rem; }
.foot .ann { font-weight: 500; }

/* ---------- Wider viewports ---------- */

@media (min-width: 40rem) {
  .masthead span:nth-child(2) { display: block; }
}

@media (min-width: 56rem) {
  .titleblock { flex-direction: row; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
  .titleblock span + span::before {
    content: "\2022";
    margin-right: 0.9rem;
    color: var(--rule);
  }
}

@media (min-width: 48rem) {
  .kit { grid-template-columns: 18rem minmax(0, 1fr); gap: 3rem; }
  .attr {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: baseline;
  }
  .attr dt { border-bottom: 1px solid var(--rule); padding-bottom: 0.85rem; }
  .attr dd { margin-bottom: 0; padding-top: 0.85rem; }
  .paths { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 4rem; }
}

@media (min-width: 64rem) {
  .page {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    column-gap: 4rem;
    align-items: start;
  }

  /* Table of contents. */
  .rail {
    display: block;
    position: sticky;
    top: 3rem;
    padding-top: clamp(2rem, 4vw, 3rem);
  }
  .rail ol { list-style: none; margin: 0; padding: 0; counter-reset: nav; border-top: 1px solid var(--rule); }
  .rail li { counter-increment: nav; border-bottom: 1px solid var(--rule); }
  .rail a {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.35;
    color: var(--soft);
    text-decoration: none;
    padding: 0.65rem 0;
  }
  .rail a::before {
    content: counter(nav, upper-roman);
    /* --rule would be prettier and sits at 1.5:1 on stock, which is not a
       colour to set a numeral in. Hierarchy comes from the weight instead. */
    color: var(--soft);
    font-weight: 400;
    letter-spacing: 0.08em;
    transition: color 140ms var(--ease);
  }
  .rail a:hover { color: var(--ink); }
  .rail a:hover::before { color: var(--accent); }
  .rail a[aria-current] { color: var(--ink); }
  .rail a[aria-current]::before { color: var(--accent); }

  /* The spread runs off the right edge of the page. */
  .spread {
    margin-left: -3rem;
    margin-right: calc(-1 * var(--gutter));
    padding-left: 3rem;
    padding-right: var(--gutter);
  }

  /* Two columns, as a feature well would be set. */
  .spread__body {
    column-count: 2;
    column-gap: 3.5rem;
    column-rule: 1px solid var(--rule-deep);
  }
  .spread__body p:last-child { margin-bottom: 0; }
}

/* ---------- Motion ---------- */

/* Gated on .js so nothing is hidden when JavaScript is unavailable. */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

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