/* Ferreira Software: the site's one stylesheet.

   Look A of brand.md (navy and Charter). To change the look, change the tokens in :root:
   for B, --ink #16191F, --accent #0F766E and --serif set to the sans (Inter on the site);
   for C, --ink #1E2420, --accent #1F4D3A and Utopia. `make test` checks that the text
   colours still read (4.5:1 contrast).

   Phone first: the rules up to the first @media are the phone (360-430 px). 30rem (480 px)
   up is a big phone or small tablet, 48rem (768 px) a tablet, 60rem (960 px) a laptop. */

:root {
  --bg: #FFFFFF;
  --ink: #181C24;
  --accent: #183654;
  --on-accent: #FFFFFF;
  --muted: #5C6470;
  --hair: #D5D9DE;
  --panel: #F3F5F7;
  --serif: Charter, "Bitstream Charter", "Charis SIL", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, sans-serif;
  --gutter: 1.25rem;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--serif); overflow-wrap: break-word; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 1.5rem; }
/* Headings break into even lines and paragraphs avoid a lone last word ("Tell me the admin /
   pain." was the first thing on the page); a browser without text-wrap simply wraps as before. */
h1, h2, h3 { font-family: var(--sans); color: var(--accent); line-height: 1.2; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
h1 { margin: 0 0 .8rem; font-size: 1.75rem; letter-spacing: -.01em; }
h2 { margin: 2.6rem 0 .6rem; font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
h3 { margin: 0 0 .15rem; font-size: 1rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 var(--gutter); }

/* What only Ignatius can fill in: [in brackets], grey with a dashed underline.
   `make test` refuses to call the site live while one is left. */
.fill { color: var(--muted); text-decoration-line: underline; text-decoration-style: dashed; text-underline-offset: .2em; }

/* The skip link: out of sight until a keyboard reaches it */
.skip { position: absolute; top: -5rem; left: var(--gutter); z-index: 1; padding: .6rem 1rem; border-radius: 0 0 3px 3px; background: var(--accent); color: var(--on-accent); font: 600 .9rem/1 var(--sans); }
.skip:focus { top: 0; }

/* The header: the mark and the name; the menu on its own line under them on a phone, beside
   them from a tablet up */
.site-header { border-bottom: 1px solid var(--hair); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding-top: 1.1rem; padding-bottom: .6rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.mark { flex: none; width: 2.4rem; height: 2.4rem; }
.brand-name { display: block; color: var(--accent); font: 700 .95rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.brand-tagline { display: block; margin-top: .15rem; color: var(--muted); font: .8rem/1.3 var(--sans); }
.site-nav { flex-basis: 100%; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; margin: 0; padding: 0; list-style: none; }
/* The padding makes each link about 34 px tall to touch (a tablet), at no change to the look */
.site-nav a { display: inline-block; padding: .6rem 0; color: var(--ink); font: 600 .85rem/1 var(--sans); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }

/* The opening: the headline, the offer, two buttons */
.hero { padding-top: 2.6rem; }
.lead { font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0 .5rem; }
.button { display: inline-block; padding: .85rem 1.2rem; border: 2px solid var(--accent); border-radius: 3px; color: var(--accent); font: 600 .95rem/1 var(--sans); text-decoration: none; }
.button:hover { background: var(--panel); }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { border-color: var(--ink); background: var(--ink); }

/* How a job runs: numbered steps between hairlines */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: .8rem 0 .8rem 3rem; border-top: 1px solid var(--hair); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: .8rem; left: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--panel); color: var(--accent); font: 700 .95rem/2rem var(--sans); text-align: center; }
.steps p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Case studies: a card each, side by side from a laptop up */
.cases { display: grid; gap: 1.5rem; }
.case { padding: 1.4rem 1.5rem; border-radius: 6px; background: var(--panel); }
.case p:last-child { margin-bottom: 0; }
.case-meta { margin: 0 0 .7rem; color: var(--muted); font: .85rem/1.5 var(--sans); }

/* Lists and the contact details */
.plain { margin: 0 0 1rem; padding-left: 1.1rem; }
.plain li { margin: .35rem 0; }
.contact { display: grid; gap: .6rem; margin: 0; }
.contact dt { color: var(--muted); font: 600 .8rem/1.9 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.contact dd { margin: 0; }

/* A page of text (privacy.html): the header's left edge, a reading width */
.prose { padding-top: 2.6rem; }
.prose > * { max-width: 40rem; }
.prose h2 { margin-top: 2.2rem; }
.updated { color: var(--muted); font: .85rem/1.5 var(--sans); }

/* The about page (about.html, made by make cv from the CV): a small round photo beside the
   name (his ask: subtle), the summary, then each entry between hairlines; from a
   tablet up the dates take a column of their own, as on the printed CV */
.cv { padding-top: 2.6rem; }
.cv-intro { padding-bottom: 2rem; border-bottom: 1px solid var(--hair); }
.cv-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.headshot { flex: none; width: 4.5rem; height: 4.5rem; border-radius: 50%; }
.cv-head h1 { margin: 0 0 .2rem; }
.cv-label { margin: 0; color: var(--accent); font: 600 1rem/1.4 var(--sans); }
.cv h2 { margin-bottom: .2rem; }
.role { padding: 1.3rem 0; border-bottom: 1px solid var(--hair); }
.role:last-child { border-bottom: 0; }
.role h3 { font-size: 1.05rem; }
.role-meta { margin: 0 0 .5rem; font: 600 .9rem/1.4 var(--sans); }
.when { margin: 0 0 .35rem; color: var(--muted); font: .85rem/1.5 var(--sans); white-space: nowrap; }
.role .plain { margin: 0; }
.role .plain li { margin: .3rem 0; font-size: .97rem; }
.role .plain li::marker { color: var(--muted); }

/* The footer */
.site-footer { margin-top: 3rem; padding: 1.2rem 0 2rem; border-top: 1px solid var(--hair); color: var(--muted); font: .8rem/1.5 var(--sans); }
.site-footer p { margin: 0 0 .3rem; }
.site-footer a { color: inherit; }

/* 30rem (480 px) up: a big phone held sideways, a small tablet */
@media (min-width: 30rem) {
  body { font-size: 18px; }
  h1 { font-size: 2.1rem; }
  .contact div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; }
}

/* 48rem (768 px) up: a tablet; the menu shows */
@media (min-width: 48rem) {
  .site-header .wrap { padding-bottom: 1.1rem; }
  .site-nav { flex-basis: auto; }
  .site-nav ul { justify-content: flex-start; gap: 1.75rem; }
  .site-nav a { font-size: .9rem; }
  .cv-head { gap: 1.4rem; }
  .headshot { width: 5.5rem; height: 5.5rem; }
  .role { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; }
  .role > div { grid-column: 2; }
  .when { margin: .1rem 0 0; }
}

/* 60rem (960 px) up: a laptop; the page opens into columns */
@media (min-width: 60rem) {
  :root { --gutter: 2.5rem; }
  .wrap { max-width: 72rem; }
  .hero { padding: 4.5rem 0 1rem; }
  .prose { padding-top: 4.5rem; }
  .hero .wrap > div { max-width: 46rem; }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { margin-bottom: 1.2rem; font-size: 3rem; }
  h2 { margin: 4rem 0 1.2rem; }
  .lead { font-size: 1.3rem; }
  .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 2.5rem; }
  .steps li { padding: 1.4rem 0 1.6rem; border-bottom: 0; }
  .steps li::before { position: static; display: block; margin-bottom: .9rem; }
  .cv { padding-top: 4.5rem; }
  .cv > * { max-width: 56rem; }
}

@media print {
  .skip, .site-nav, .actions { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; }
}
