/* Brad Doleman — braddoleman.com
   Restrained editorial. No external requests, no web fonts, no JavaScript.
   v2 — card grammar retired. Composition carried by type, rules and space.

   Versioning convention: the filename carries the version. Ship a visual
   change as style.v3.css and update the <link> in every page. Cache-Control
   on /*.css is seven days; an unversioned filename serves stale CSS against
   new HTML for up to a week. Do not remove the version from the filename.
*/

/* ---------------------------------------------------------------- tokens */

:root {
  /* palette — carried forward unchanged from v1 */
  --bg:      #faf9f7;
  --ink:     #1c1b19;
  --muted:   #6b6862;
  --rule:    #ddd8ce;
  --accent:  #7a4a1f;

  /* measure and canvas */
  --wrap:    52rem;   /* outer canvas */
  --measure: 40rem;   /* prose column — deliberately narrower than the canvas */
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --offset:  clamp(0rem, 4vw, 4rem);  /* asymmetric indent for display text */

  /* vertical rhythm */
  --band:    clamp(3rem, 1.75rem + 5vw, 6.5rem);

  /* type stacks */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;

  /* type scale — wider than v1 so hierarchy is carried by size, not boxes */
  --f-xs:        0.78rem;
  --f-sm:        0.9rem;
  --f-base:      1.0625rem;
  --f-lede:      clamp(1.2rem,  1.08rem + 0.55vw, 1.5rem);
  --f-h3:        clamp(1.2rem,  1.08rem + 0.5vw,  1.4rem);
  --f-h2:        clamp(1.45rem, 1.22rem + 1vw,    2rem);
  --f-h1:        clamp(1.95rem, 1.35rem + 2.7vw,  3.1rem);
  --f-display:   clamp(2.35rem, 1.3rem + 4.6vw,   4.15rem);
  --f-statement: clamp(1.4rem,  1.1rem + 1.7vw,   2.25rem);
  --f-num:       clamp(1.95rem, 1.45rem + 2.1vw,  2.9rem);
  --f-num-lead:  clamp(2.5rem,  1.7rem + 3.4vw,   4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #161513;
    --ink:    #f0eee9;
    --muted:  #a09a90;
    --rule:   #34322e;
    --accent: #d9a86d;
  }
}

/* ------------------------------------------------------------ foundation */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--f-base);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* A band is a horizontal register of the page. Rules run the full viewport
   width; content inside stays on the measure. No band carries a fill. */
.band { padding-block: var(--band); }
.band--rule { border-top: 1px solid var(--rule); }
.band--tight { padding-block: calc(var(--band) * 0.5); }

main { display: block; }

/* ------------------------------------------------------------- masthead */

.masthead { border-bottom: 1px solid var(--rule); padding: 1.4rem 0; }

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }

.brand-mark { width: 1.45rem; height: 1.45rem; object-fit: contain; flex: none; }

@media (prefers-color-scheme: dark) {
  .brand-mark { filter: invert(1) brightness(1.08); }
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}

nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--f-sm);
  letter-spacing: 0.015em;
}

nav a:hover, nav a[aria-current="page"] { color: var(--ink); }
nav a[aria-current="page"] { border-bottom: 1px solid var(--accent); }

@media (max-width: 32rem) {
  nav { gap: 0.55rem 0.95rem; }
  nav a { font-size: 0.85rem; }
}

/* On narrow phones six nav items wrap 5/1 and strand the last one.
   Constraining the row forces an even 3/3 break instead. */
@media (max-width: 26rem) {
  nav { max-width: 12rem; }
}

/* ------------------------------------------------------------------ type */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.16;
  text-wrap: balance;
}

h1 { font-size: var(--f-h1); margin: 0 0 1.1rem; }
h2 { font-size: var(--f-h2); margin: 0 0 0.9rem; }
h3 { font-size: var(--f-h3); margin: 0 0 0.4rem; line-height: 1.25; }

p  { margin: 0 0 1.15rem; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

ul { padding-left: 1.1rem; max-width: var(--measure); margin: 0 0 1.15rem; }
li { margin-bottom: 0.55rem; }
li:last-child { margin-bottom: 0; }

.lede {
  font-size: var(--f-lede);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.muted { color: var(--muted); }
.small { font-size: var(--f-sm); }

/* Small-caps label. Used for eyebrows and for block headings inside
   case studies, so section labels never compete with the prose. */
.label {
  font-family: var(--sans);
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
  max-width: none;
}

/* ------------------------------------------------- device: display opener */

.display {
  font-size: var(--f-display);
  line-height: 1.04;
  letter-spacing: -0.022em;
  max-width: 30ch;
  margin: 0;
}

.subhead {
  font-family: var(--serif);
  font-size: var(--f-lede);
  color: var(--muted);
  margin: clamp(1.4rem, 3vw, 2.25rem) 0 0;
  max-width: none;
}

/* ------------------------------------------- device: asymmetric opening */

.opening { display: grid; gap: 2rem; }

.opening__text > :last-child { margin-bottom: 0; }

.portrait {
  display: block;
  width: 100%;
  max-width: 11rem;
  border: 1px solid var(--rule);
}

@media (min-width: 52rem) {
  .opening {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: end;
  }
  .opening__portrait { justify-self: end; }
  /* The portrait hangs below the text baseline and crosses the rule of the
     band beneath it. This is the asymmetry — not a boxed image cell. */
  .portrait { max-width: 13rem; margin-bottom: calc(var(--band) * -0.42); }
}

/* -------------------------------------------- device: typographic figures */

/* Numbers are set as type over a hairline, not as tiles. Sizes differ by
   importance, and the grid is two unequal columns rather than four equal. */
.metrics { display: grid; gap: 2.25rem 2.5rem; }

.metric { border-top: 1px solid var(--rule); padding-top: 0.9rem; }

.metric__n {
  display: block;
  font-family: var(--serif);
  font-size: var(--f-num);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.metric__l {
  display: block;
  margin-top: 0.6rem;
  font-size: var(--f-sm);
  line-height: 1.45;
  color: var(--muted);
  max-width: 22rem;
  text-wrap: pretty;
}

@media (min-width: 40rem) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 52rem) {
  .metrics { grid-template-columns: 1.15fr 1fr; column-gap: clamp(2.5rem, 6vw, 5rem); row-gap: 3rem; }
  .metric--lead .metric__n { font-size: var(--f-num-lead); }
}

/* ---------------------------------------------- device: engagement list */

/* Replaces the card grid. Year hangs left, title carries the weight,
   a hairline separates. Only the title is interactive. */
.engagements { list-style: none; margin: 0; padding: 0; max-width: none; }

.engagement {
  display: grid;
  gap: 0.45rem;
  padding: 1.9rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.engagement:last-child { border-bottom: 1px solid var(--rule); }

.engagement__yr {
  font-size: var(--f-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.engagement h3 { margin: 0 0 0.45rem; font-size: var(--f-h2); }

.engagement h3 a { text-decoration: none; }
.engagement h3 a:hover { text-decoration: underline; }

.engagement h3 a::after {
  content: "\00a0\2192";
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7em;
  vertical-align: 0.1em;
}

.engagement p { color: var(--muted); margin: 0; }

@media (min-width: 44rem) {
  .engagement { grid-template-columns: 7rem minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 3rem); }
  .engagement__yr { padding-top: 0.55rem; }
}

/* --------------------------------------------- device: pull statement */

.statement {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 36rem;
  margin-left: var(--offset);
}

.statement p {
  font-family: var(--serif);
  font-size: var(--f-statement);
  line-height: 1.26;
  letter-spacing: -0.015em;
  max-width: none;
  margin: 0;
  text-wrap: pretty;
}

/* ------------------------------------------ device: case-study blocks */

.block + .block { margin-top: clamp(2.25rem, 4vw, 3.25rem); }

.block h2 {
  font-family: var(--sans);
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
  line-height: 1.5;
}

.block p strong, .block p b { font-weight: 600; }

.backlink {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-size: var(--f-sm);
  color: var(--muted);
  text-decoration: none;
}

.backlink:hover { color: var(--ink); }

.note {
  font-size: var(--f-sm);
  color: var(--muted);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}

/* ---------------------------------------------------------- actions */

.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 0.65rem 1.2rem;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--ink); color: var(--bg); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--ink); }

.btn .meta {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-left: 0.4rem;
}

.actions { margin: 1.6rem 0 0; max-width: none; }

/* Secondary routes are text, not buttons. One primary action per page. */
.onward {
  margin: 1.15rem 0 0;
  font-size: var(--f-sm);
  color: var(--muted);
  max-width: none;
}

.note + .onward { margin-top: 2rem; }

.onward a { color: var(--ink); }
.onward a:hover { color: var(--accent); }
.onward .sep { padding: 0 0.55rem; color: var(--rule); }

/* ---------------------------------------------- skip link & sr utility */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus { left: 0; color: var(--bg); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font-size: var(--f-sm);
  color: var(--muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

footer .sep { padding: 0 0.45rem; color: var(--rule); }

/* -------------------------------------------------------- reduced motion */

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

/* ----------------------------------------------------------------- print */

@media print {
  :root {
    --bg: #fff; --ink: #000; --muted: #3a3a3a;
    --rule: #bbb; --accent: #000;
    --band: 1.5rem; --wrap: none; --gutter: 0; --offset: 0rem;
  }
  body { font-size: 11pt; line-height: 1.45; }
  .masthead nav, .skip-link, .backlink, .btn, .onward { display: none; }
  .masthead { padding: 0 0 0.5rem; margin-bottom: 1rem; }
  main { padding-bottom: 0; }
  .band { padding-block: 1.1rem; }
  .display { font-size: 22pt; }
  .opening { grid-template-columns: 1fr; }
  .portrait { max-width: 1.5in; margin-bottom: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 0.9rem 1.5rem; break-inside: avoid; }
  .metric__n { font-size: 16pt; }
  .metric--lead .metric__n { font-size: 16pt; }
  .statement { margin-left: 0; }
  .statement p { font-size: 13pt; }
  .engagement, .block, .metric { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  a { text-decoration: none; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .engagement h3 a::after { content: ""; }
  footer { border-top: 1px solid #bbb; }
}

/* ================================================================
   PHASE 2 — additional composition devices.
   Each one exists because a page needs it. Nothing here is a card:
   every device is built from type, space and hairline rules.
   ================================================================ */

/* ---------------------------------------------- device: timeline */
/* Career history. Years hang left, the role carries the weight,
   a hairline separates. Same grammar as the engagement list, tuned
   for density because there are nine entries rather than two. */

.timeline { list-style: none; margin: 0; padding: 0; max-width: none; }

.timeline li {
  display: grid;
  gap: 0.3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.timeline li:last-child { border-bottom: 1px solid var(--rule); }

.tl-when {
  font-size: var(--f-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tl-role {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.tl-where { display: block; color: var(--muted); font-size: var(--f-sm); margin-top: 0.15rem; }

@media (min-width: 44rem) {
  .timeline li { grid-template-columns: 9rem minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 3rem); }
  .tl-when { padding-top: 0.3rem; }
}

/* ------------------------------------------- device: principle column */
/* Operating principles. A column of statements, not a grid of tiles:
   statement at display scale, explanation beneath, hairline between. */

.principles { margin: 0; padding: 0; list-style: none; max-width: none; }

.principles li {
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  max-width: 46rem;
}

.principles li:last-child { border-bottom: 1px solid var(--rule); }

.pr-head {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.55rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.pr-body { display: block; margin-top: 0.5rem; color: var(--muted); max-width: var(--measure); }

/* --------------------------------------------- device: editorial index */
/* Beyond the résumé, and the book catalogue. Name, one or two lines,
   a right-aligned link. No boxes, no thumbnails, no buttons. */

.index { margin: 0; padding: 0; list-style: none; max-width: none; }

.index li {
  display: grid;
  gap: 0.3rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.index li:last-child { border-bottom: 1px solid var(--rule); }

.ix-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.ix-name a { text-decoration: none; }
.ix-name a:hover { text-decoration: underline; }

.ix-note { color: var(--muted); font-size: var(--f-sm); max-width: var(--measure); }

.ix-tag {
  font-size: var(--f-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.6rem;
  white-space: nowrap;
}

@media (min-width: 46rem) {
  .index li { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 2rem; }
  .ix-note { grid-column: 1 / -1; }
  .ix-go { font-size: var(--f-sm); color: var(--muted); white-space: nowrap; }
}

.ix-go { font-size: var(--f-sm); }

/* --------------------------------------------- device: featured item */
/* One article leads the Writing page at a larger scale. The hierarchy
   is created by size and space, not by a container around it. */

.feature { border-top: 2px solid var(--ink); padding-top: 1.6rem; max-width: 42rem; }

.feature h3 {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.3rem);
  line-height: 1.14;
  margin: 0.4rem 0 0.75rem;
}

.feature h3 a { text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; }

.feature .f-sub { color: var(--muted); margin-bottom: 0.9rem; }

/* An index or a featured item followed by the next group heading was
   colliding: .label carries no top margin by design. */
.index + h3.label, .feature + h3.label, .index + h2.label { margin-top: 2.75rem; }
.feature + .index { margin-top: 2rem; }

/* ------------------------------------------------- device: now block */
/* Present-tense currentness. Three lines and a visible date.
   Updating it is editing three <li> and one date. */

.now { list-style: none; margin: 0 0 1.5rem; padding: 0; max-width: 42rem; }

.now li {
  padding: 1.05rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  display: grid;
  gap: 0.2rem;
}

.now li:last-child { border-bottom: 1px solid var(--rule); }

.now-what {
  font-size: var(--f-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 44rem) {
  .now li { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0 2rem; align-items: baseline; }
}

.stamp {
  font-size: var(--f-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
}

/* ------------------------------------------- device: capability set */
/* Leadership capabilities. Subheading plus a paragraph, separated by
   space rather than boxed into four equal panels. */

.caps > div { max-width: var(--measure); }
.caps > div + div { margin-top: 1.9rem; }

.caps h3 {
  font-family: var(--sans);
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

/* ------------------------------------------- device: scan row */

.scanrow {
  margin: 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: var(--f-sm);
  letter-spacing: 0.02em;
  color: var(--muted);
  max-width: none;
  line-height: 1.9;
}

/* ================================================================
   LONG-FORM ARTICLE
   Optimised for reading 3,500 words, not for scanning.
   ================================================================ */

.article { max-width: var(--measure); }

.article > p { margin-bottom: 1.3rem; }

.article h2 {
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem);
  margin: 2.9rem 0 0.9rem;
  line-height: 1.2;
}

.article > h2:first-of-type { margin-top: 2rem; }

.article ol, .article ul { margin: 0 0 1.3rem; padding-left: 1.3rem; }
.article li { margin-bottom: 0.7rem; }

.article ol { counter-reset: none; }

/* An in-article pull quote. Breaks the measure, carries a hairline
   above and below, and is never boxed or tinted. */
.pull {
  margin: 2.6rem 0;
  padding: 1.3rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: none;
}

.pull p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.012em;
  margin: 0;
  max-width: 34rem;
  text-wrap: pretty;
}

/* The practical-review tables. Genuine tabular data, set as a table:
   hairline rules, no fill, no zebra, no border box. */
.qtable {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0 2rem;
  font-size: var(--f-sm);
  text-align: left;
}

.qtable caption {
  text-align: left;
  font-size: var(--f-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.9rem;
}

.qtable th, .qtable td {
  border-top: 1px solid var(--rule);
  padding: 0.75rem 1.25rem 0.75rem 0;
  vertical-align: top;
  line-height: 1.45;
}

.qtable thead th {
  border-top: 0;
  border-bottom: 1px solid var(--ink);
  font-size: var(--f-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 0.6rem;
}

.qtable tbody tr:last-child th, .qtable tbody tr:last-child td {
  border-bottom: 1px solid var(--rule);
}

.qtable th[scope="row"] { font-weight: 400; padding-right: 2rem; }
.qtable td { color: var(--muted); white-space: normal; }

@media (min-width: 48rem) {
  .qtable { width: calc(100% + clamp(0rem, 8vw, 10rem)); }
  .qtable td { width: 34%; }
}

/* Byline and reading time under an article title. */
.byline {
  font-size: var(--f-sm);
  color: var(--muted);
  max-width: none;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.byline .sep { padding: 0 0.5rem; color: var(--rule); }

/* ---------------------------------------------------- print additions */

@media print {
  .timeline li, .principles li, .index li, .now li, .pull, .qtable tr { break-inside: avoid; }
  .qtable { width: 100%; font-size: 9.5pt; }
  .article { max-width: none; }
  .pull p { font-size: 12pt; }
  .feature { border-top: 1px solid #000; }
}
