/*
  Shared by the overview (index.html) and the five project pages.
  Consultant briefing: white paper, navy ink, one orange accent from the resume.
  One column, written for a phone first. No scripts anywhere.
  Type: Archivo for headings and figures, IBM Plex Sans for reading.
*/

:root {
  --paper: #ffffff;
  --panel: #f3f5f8;
  --ink: #12233f;
  --soft: #55627a;
  --accent: #b24a0c;
  --rule: #d5dae3;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --small: 0.875rem;
  --body: 1.0625rem;
  --h3: 1.3rem;
  --h2: 1.55rem;
  --h1: clamp(1.9rem, 1.3rem + 3vw, 3rem);

  --page: 44rem;
  --gutter: 1.25rem;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.55;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 2;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 0.9rem;
}
.skip:focus { top: 0.75rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

p { margin: 0 0 1rem; }
img { display: block; max-width: 100%; height: auto; }

/* Every region shares one narrow column. */
.masthead-inner,
main,
.colophon {
  width: min(var(--page), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/* masthead: stays at the top so the way back is always one tap away */
.masthead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.masthead .name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.masthead a {
  display: inline-block;
  padding: 0.85rem 0;
  color: var(--ink);
  font-size: var(--small);
  font-weight: 600;
}
.masthead .back { font-size: 1rem; text-decoration: none; }
.masthead .back:hover { text-decoration: underline; }

/* headings */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { margin: 0 0 1rem; font-size: var(--h1); line-height: 1.06; }
h2 { margin: 0 0 0.6rem; font-size: var(--h2); }
h3 { margin: 0 0 0.4rem; font-size: var(--h3); }

.opening { padding-block: 2rem 1.75rem; }
.lede { font-size: 1.15rem; line-height: 1.45; }
.kicker {
  margin: 0 0 0.4rem;
  color: var(--soft);
  font-size: var(--small);
  font-weight: 500;
}
.note { color: var(--soft); }

/* buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.button.quiet { background: transparent; color: var(--ink); }

/* A row of figures: the number first, what it counts underneath. */
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding-block: 1rem;
  border-block: 1px solid var(--rule);
}
.figures div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.figures dt { color: var(--soft); font-size: 0.8125rem; line-height: 1.3; }
.figures dd {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.1rem);
  line-height: 1;
  color: var(--accent);
}

section { padding-block: 2rem; border-top: 2px solid var(--ink); }

/* overview: one short card per project */
.cards { margin: 1rem 0 0; padding: 0; list-style: none; }
.cards > li { padding-block: 1.4rem; border-top: 1px solid var(--rule); }
.cards > li:first-child { border-top: 0; padding-top: 0.5rem; }
.cards > li:last-child { padding-bottom: 0; }
.cards h3 a { color: var(--ink); text-decoration: none; }
.cards h3 a:hover { text-decoration: underline; }
.cards p { margin-bottom: 0.6rem; }

/* label and answer pairs */
.pairs { margin: 0 0 0.75rem; }
.pairs div { margin-bottom: 0.35rem; }
.pairs dt { display: inline; font-weight: 600; }
.pairs dt::after { content: ": "; }
.pairs dd { display: inline; margin: 0; }

.go {
  display: inline-block;
  padding: 0.5rem 0;
  font-weight: 600;
}

/* short rules and plain lists */
.rules, .plain { margin: 0; padding: 0; list-style: none; }
.rules li, .plain li { padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.rules li:first-child, .plain li:first-child { border-top: 0; padding-top: 0.2rem; }
.rules strong { font-weight: 600; }

/* numbered steps */
.steps {
  margin: 0 0 1.25rem;
  padding: 1rem;
  list-style: none;
  counter-reset: step;
  background: var(--panel);
  border-radius: 6px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.15rem 0 0.6rem 2.5rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.75rem;
  text-align: center;
}

/* experience */
.history { margin: 1rem 0 0; padding: 0; list-style: none; }
.history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}
.history strong { font-weight: 600; }
.history .years { color: var(--soft); font-size: var(--small); white-space: nowrap; }
.history .role { grid-column: 1 / -1; color: var(--soft); font-size: var(--small); }

/* Screens: swipe sideways on a phone, scroll on a desktop. */
.screens-label { margin: 0 0 0.5rem; color: var(--soft); font-size: var(--small); }
.screens {
  display: flex;
  gap: 0.75rem;
  margin: 0 calc(-1 * var(--gutter)) 0.75rem;
  padding: 0 var(--gutter) 0.75rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
}
.screens li { flex: 0 0 min(84vw, 34rem); scroll-snap-align: start; }
.screens.phone li { flex-basis: min(64vw, 17rem); }
.screens figure { margin: 0; }
.screens img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
}
.screens figcaption {
  margin-top: 0.4rem;
  color: var(--soft);
  font-size: var(--small);
  line-height: 1.35;
}

/* project page: previous, overview, next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pager a {
  display: block;
  height: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; color: var(--soft); font-weight: 400; }
.pager .all { grid-column: 1 / -1; }
.pager .all a { background: var(--ink); border-color: var(--ink); color: var(--paper); text-align: center; }

/* colophon */
.colophon { padding-block: 2rem 3rem; border-top: 2px solid var(--ink); }
.made { margin-top: 1.75rem; color: var(--soft); font-size: var(--small); }

@media (min-width: 48rem) {
  :root { --body: 1.125rem; --h2: 1.8rem; --h3: 1.4rem; }
  .opening { padding-block: 3.5rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .skip, .masthead a, .actions, .screens-label, .pager { display: none; }
  .masthead { position: static; }
  .screens { flex-wrap: wrap; overflow: visible; }
  .screens li { flex-basis: 45%; }
}
