/*
  Practical two-column CV. The one photographic element is a card-sized
  plate of bead-blasted aluminium holding the name, role and contact
  (silver in light mode, space grey in dark mode). Everything else is
  plain, readable type on a cool grey surface.
*/

:root {
  color-scheme: light dark;
  --surface: #e7e9ec;
  --ink: #1d2126;
  --muted: #535a64;
  --rule: #c5c9cf;
  --groove-dark: #a9aeb5;
  --groove-light: #fbfcfd;
  --pocket: #e0e3e7;
  --accent: #2b5a87;
  --plate-ink: #1a1d22;
  --plate-muted: #30343b;
  --plate-tone: transparent;
  --plate-fallback: #a9a9ad;
  --engrave-top: rgb(46, 49, 56);
  --engrave-floor: rgb(92, 96, 104);
  --engrave-blend: multiply;
  --engrave-lip: rgba(255, 255, 255, .5);
  --wide: 'wdth' 125;
  --gutter: clamp(16px, 4vw, 48px);
  font-family: 'Archivo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1b1e22;
    --ink: #e6e8eb;
    --muted: #a3a9b2;
    --rule: #353a41;
    --groove-dark: #0f1114;
    --groove-light: #3a3f46;
    --pocket: #16181c;
    --accent: #93b8de;
    --plate-ink: #eef0f3;
    --plate-muted: #cfd3d9;
    --plate-tone: rgba(24, 26, 31, .64);
    --plate-fallback: #3c3e43;
    /* Laser marks on space grey anodising read lighter than the metal. */
    --engrave-top: rgb(150, 154, 162);
    --engrave-floor: rgb(214, 218, 224);
    --engrave-blend: screen;
    --engrave-lip: rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }

.skip-link { position: absolute; left: 16px; top: -100px; background: var(--surface); color: var(--ink); padding: 12px 16px; z-index: 10; }
.skip-link:focus { top: 12px; }

.frame { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Top bar ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; font-size: 14px; }
.wordmark { text-decoration: none; font-weight: 700; font-variation-settings: var(--wide); font-size: 15px; }
.utilities { display: flex; align-items: center; gap: 22px; }
.languages { display: flex; gap: 14px; }
.languages a { text-decoration: none; color: var(--muted); padding-block: 8px; }
.languages a[aria-current] { color: var(--ink); box-shadow: inset 0 -1px currentColor; }
.print-button { border: 0; background: none; padding: 8px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.print-button:hover { color: var(--accent); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(36px, 5vw, 72px);
  padding-block: 8px 24px;
}
.plate { grid-column: 1; grid-row: 1; }
main { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.side { grid-column: 1; grid-row: 2; padding-top: 40px; }

/* ---------- The plate ---------- */

.plate {
  position: relative;
  isolation: isolate;
  align-self: start;
  padding: 30px 28px 28px;
  border-radius: 18px;
  color: var(--plate-ink);
  background-color: var(--plate-fallback);
  background-image: url('img/slab-narrow.jpg');
  background-image: image-set(url('img/slab-narrow.avif') type('image/avif'), url('img/slab-narrow.webp') type('image/webp'), url('img/slab-narrow.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: 20% 30%;
  /* Diamond-cut chamfer: a bright upper rim, a darker lower rim, then the
     shadow the plate casts on the page. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    inset 0 0 0 1px rgba(255, 255, 255, .18),
    inset 0 -2px 0 rgba(0, 0, 0, .22),
    0 1px 2px rgba(0, 0, 0, .25),
    0 18px 36px -18px rgba(0, 0, 0, .45);
}
.plate::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--plate-tone);
  z-index: -1;
}

/* Engraving: the ink layer blends with the photo so the grain shows inside
   the letters; each line is darker at the top (the wall in shadow) and a
   light lip sits just under the cut. */
.engraved {
  --engrave-lh: 1.04;
  position: relative;
  margin: 0;
  font-weight: 760;
  font-variation-settings: var(--wide);
  font-size: 40px;
  line-height: var(--engrave-lh);
  letter-spacing: -.03em;
}
.engraved::before {
  content: attr(data-engrave);
  content: attr(data-engrave) / '';
  position: absolute;
  inset: 0;
  color: var(--engrave-lip);
  transform: translateY(.03em);
}
.engraved-ink {
  position: relative;
  display: block;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, var(--engrave-top) 0 18%, var(--engrave-floor) 50%, var(--engrave-floor) 100%) 0 0 / 100% calc(var(--engrave-lh) * 1em) repeat-y;
  -webkit-background-clip: text;
  background-clip: text;
  mix-blend-mode: var(--engrave-blend);
}

.role { margin: 14px 0 0; font-size: 19px; font-weight: 600; font-variation-settings: 'wdth' 112; letter-spacing: -.01em; }
.fineprint { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--plate-muted); }

.contact { list-style: none; margin: 26px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(0, 0, 0, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); display: grid; gap: 4px; font-size: 14.5px; }
.contact a { display: inline-block; padding-block: 5px; }
.contact a:hover { color: inherit; text-decoration-thickness: 2px; }
.contact-email { font-weight: 600; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) {
  .contact { border-top-color: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .3); }
}

/* ---------- Text blocks ---------- */

.section-title {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 650;
  font-variation-settings: 'wdth' 112;
  color: var(--muted);
}

.side section + section { margin-top: 32px; }
.side h3 { margin: 16px 0 3px; font-size: 15px; font-weight: 650; }
.side .section-title + h3 { margin-top: 0; }
.side p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

.profile { padding: 22px 0 40px; }
.profile p { margin: 0; max-width: 60ch; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; letter-spacing: -.01em; text-wrap: pretty; }

.experience { border-top: 1px solid var(--rule); padding-top: 32px; }

/* Timeline: start years sit beside a machined groove. */
.timeline { list-style: none; margin: 0; padding: 0; }
.job { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px; padding-bottom: 32px; break-inside: avoid; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--groove-dark);
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, .18), 1px 0 0 var(--groove-light);
}
.job:first-child::before { top: 6px; }
.job:last-child::before { bottom: auto; height: 28px; }
.year { margin: 0; padding-left: 18px; font-weight: 700; font-variation-settings: var(--wide); font-size: 24px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.year span { display: block; margin-top: 7px; font-size: 13px; font-weight: 500; font-variation-settings: 'wdth' 100; letter-spacing: 0; color: var(--muted); }
.job h3 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.company { margin: 5px 0 10px; font-size: 15px; color: var(--muted); }
.job p:not(.company):not(.year) { margin: 0; font-size: 16px; line-height: 1.6; max-width: 64ch; }

/* The current assignment sits in a milled pocket. */
.assignment {
  margin: 16px 0;
  padding: 16px 20px 18px;
  border-radius: 10px;
  background: var(--pocket);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .14), inset 0 0 0 1px rgba(0, 0, 0, .05), 0 1px 0 var(--groove-light);
}
.assignment-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.assignment h4 { margin: 0; font-size: 24px; font-weight: 720; font-variation-settings: var(--wide); letter-spacing: -.03em; }
.assignment .period { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.assignment .assignment-role { margin: 4px 0 8px; color: var(--accent); font-size: 15px; font-weight: 600; }

.more { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 32px; }
.more-content { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.more h3 { margin: 0 0 6px; font-size: 17px; font-weight: 650; }
.more p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }

footer { border-top: 1px solid var(--rule); margin-top: 40px; padding: 18px 0 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 13px; color: var(--muted); }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: none; }
  .plate, main, .side { grid-column: 1; grid-row: auto; }
  .plate { padding: 26px 24px 24px; }
  .contact { display: flex; flex-wrap: wrap; gap: 2px 24px; }
  .contact li:first-child { flex-basis: 100%; }
  .profile { padding-top: 40px; }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 32px; }
  .side section + section { margin-top: 0; }
}

@media (max-width: 560px) {
  .topbar { min-height: 56px; gap: 12px; }
  .utilities { gap: 16px; }
  .engraved { font-size: 36px; }
  .profile p { font-size: 18px; }
  .job { grid-template-columns: 1fr; gap: 10px; padding-left: 18px; padding-bottom: 28px; }
  .year { padding-left: 0; display: flex; align-items: baseline; gap: 10px; font-size: 22px; }
  .year span { margin-top: 0; }
  .assignment { padding: 14px 16px 16px; }
  .side, .more-content { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Print: one clean A4 page, no photography ---------- */

@page { size: A4; margin: 12mm 13mm; }
@media print {
  :root { color-scheme: light; --surface: #fff; --ink: #15181c; --muted: #474d55; --rule: #c9ccd1; --accent: #23507a; --groove-dark: #c9ccd1; --groove-light: #fff; --pocket: #fff; --plate-ink: #15181c; --plate-muted: #474d55; }
  body { background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .frame { width: 100%; }
  .skip-link, .topbar { display: none; }
  .layout { grid-template-columns: 52mm minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 9mm; padding: 0; }
  .plate { grid-column: 1; grid-row: 1; }
  main { grid-column: 2; grid-row: 1 / span 2; }
  .side { grid-column: 1; grid-row: 2; display: block; border-top: 0; margin-top: 0; }
  .contact { display: grid; }
  .plate { background: none; box-shadow: none; padding: 0; border-radius: 0; }
  .plate::before, .engraved::before { display: none; }
  .engraved { font-size: 21pt; }
  .engraved-ink { color: var(--ink); -webkit-text-fill-color: var(--ink); background: none; mix-blend-mode: normal; }
  .role { font-size: 11pt; margin-top: 6px; }
  .fineprint { font-size: 8.5pt; }
  .contact { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); box-shadow: none; gap: 1px; font-size: 8.5pt; }
  .contact a { padding: 0; text-decoration: none; }
  .contact a[data-print]::after { content: ' ' attr(data-print); color: var(--muted); }
  .side { padding-top: 16px; }
  .side section + section { margin-top: 14px; }
  .section-title { font-size: 8pt; margin-bottom: 6px; }
  .side h3 { font-size: 8.8pt; margin-top: 7px; }
  .side p { font-size: 8.5pt; line-height: 1.4; }
  .profile { padding: 0 0 12px; }
  .profile p { font-size: 9.8pt; line-height: 1.45; max-width: none; }
  .experience { padding-top: 12px; }
  .job { grid-template-columns: 22mm minmax(0, 1fr); gap: 8px; padding-bottom: 10px; }
  .job::before { width: 2px; box-shadow: none; }
  .year { font-size: 13pt; padding-left: 9px; }
  .year span { font-size: 7.5pt; margin-top: 3px; }
  .job h3 { font-size: 10.5pt; }
  .company { font-size: 8.5pt; margin: 2px 0 4px; }
  .job p:not(.company):not(.year) { font-size: 8.8pt; line-height: 1.42; max-width: none; }
  .assignment { margin: 6px 0; padding: 6px 10px; box-shadow: none; border: 1px solid var(--rule); border-radius: 4px; }
  .assignment h4 { font-size: 12pt; }
  .assignment .period, .assignment .assignment-role { font-size: 8.5pt; }
  .assignment .assignment-role { margin: 1px 0 3px; }
  .more { margin-top: 10px; padding-top: 10px; break-inside: avoid; }
  .more-content { gap: 14px; }
  .more h3 { font-size: 9pt; margin-bottom: 3px; }
  .more p { font-size: 8.5pt; line-height: 1.42; }
  footer { margin-top: 10px; padding: 6px 0 0; font-size: 7.5pt; }
  a { text-decoration: none; }
}
