/* ==========================================================================
   Cris Ravazzano — curriculum vitae
   "Statement of Record": the CV set like the opening pages of an annual
   report. Built on Bootstrap 5.3 (reboot + grid only); everything with
   character lives here.

   Contents
   1. Fallback face          7. At a glance
   2. Tokens (dark / light)  8. Timeline
   3. Base                   9. Entries (experience, education)
   4. Ledger grid           10. Recognition (plate + register)
   5. Running head          11. Writing, areas, closing, colophon
   6. Masthead + sections   12. Print
   ========================================================================== */

/* 1. Fallback face — keeps the headline from reflowing when Newsreader loads */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 93%;
}

/* 2. Tokens ================================================================
   Dark is the default. The Light / Dark switch in the running head is a pair
   of radio inputs; :has() swaps the palette with no JavaScript.            */
:root {
  color-scheme: dark;

  --paper: #111315;
  --paper-2: #181b1f;
  --ink: #eceae4;
  --ink-2: #b4b2ab;
  --ink-3: #8e8c86;
  --rule: #2c3035;
  --rule-strong: #cfccc4;
  --accent: #5cc2a8;
  --accent-line: #357a6a;
  --selection: #1f4a40;
  --bar: #8e8c86;
  --portrait-filter: grayscale(1) contrast(1.04) brightness(.92);

  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page-pad: clamp(16px, 4vw, 48px);
  --section-space: clamp(3.5rem, 1.5rem + 5vw, 6rem);
  --rail: 200px;
  --notes: 240px;
  --gap: 48px;

  /* Bootstrap reboot hooks */
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
  --bs-secondary-color: var(--ink-3);
  --bs-body-font-family: var(--serif);
  --bs-font-monospace: var(--mono);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.55;
  --bs-link-color-rgb: 92, 194, 168;
  --bs-link-hover-color-rgb: 92, 194, 168;
  --bs-border-color: var(--rule);
  --bs-border-radius: 0;
  --bs-border-radius-sm: 0;
  --bs-border-radius-lg: 0;
  --bs-border-radius-xl: 0;
  --bs-border-radius-pill: 0;
}

:root:has(#theme-light:checked) {
  color-scheme: light;

  --paper: #fbfaf7;
  --paper-2: #f3f1eb;
  --ink: #16181d;
  --ink-2: #4a4f59;
  --ink-3: #676b73;
  --rule: #d9d5cc;
  --rule-strong: #16181d;
  --accent: #0e5e52;
  --accent-line: #5e9a8b;
  --selection: #cfe3dc;
  --bar: #676b73;
  --portrait-filter: grayscale(1) contrast(1.06) brightness(1.03);
  --bs-link-color-rgb: 14, 94, 82;
  --bs-link-hover-color-rgb: 14, 94, 82;
}

@media (min-width: 992px) {
  :root { --bs-body-font-size: 1.125rem; }
}

/* 3. Base ================================================================== */
*,
::before,
::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--bs-body-font-size);
  line-height: 1.55;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
dt { font-weight: inherit; }
p, li { text-wrap: pretty; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }

h1 {
  font-size: min(clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem), 12.5vw);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.022em;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + .9vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--accent-line);
}

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

::selection {
  background: var(--selection);
  color: var(--ink);
}

time { font-variant-numeric: tabular-nums; }

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--page-pad);
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
  color: var(--paper);
}

.nobr { white-space: nowrap; }

.ext {
  margin-left: .25em;
  color: var(--ink-3);
  text-decoration: none;
  display: inline-block;
}

/* Shared small type ------------------------------------------------------- */
.kicker,
.runin__label,
.notes__label {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-3);
}

.notes {
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.notes p + p { margin-top: 10px; }
.notes__label { margin-right: .6em; }

.quiet { color: var(--ink-2); }

/* 4. Ledger grid ===========================================================
   One grid for everything: rail | main | notes.
   Mobile: one column. 768–1199: rail | main (notes drop under main).
   1200+ and print: the full three-column ledger.                            */
.container-xl {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: baseline;
}

.ledger > * { min-width: 0; }

.c-rail,
.c-main,
.c-notes,
.c-wide { grid-column: 1 / -1; }

@media screen and (max-width: 767.98px) {
  .ledger > .c-notes { margin-top: 14px; }
  .ledger > :where(.c-rail + .c-main, .c-rail + .c-wide) { margin-top: 6px; }
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .ledger {
    grid-template-columns: 160px minmax(0, 1fr);
    column-gap: 40px;
  }
  .c-rail { grid-column: 1; }
  .c-main,
  .c-notes,
  .c-wide { grid-column: 2; }
  .ledger > .c-notes { margin-top: 14px; }
}

@media (min-width: 1200px), print {
  .ledger {
    grid-template-columns: var(--rail) minmax(0, 1fr) var(--notes);
    column-gap: var(--gap);
  }
  .c-rail { grid-column: 1; }
  .c-main { grid-column: 2; }
  .c-notes { grid-column: 3; }
  .c-wide { grid-column: 2 / 4; }
  .notes__label { display: block; margin: 0 0 1px; }
}

/* 5. Running head ========================================================== */
.runhead {
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.runhead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
}

.runhead__id {
  display: flex;
  gap: 12px;
  margin: 0;
}

.runhead__rev::before {
  content: "·";
  margin-right: 12px;
}

.runhead__end {
  display: flex;
  align-items: center;
  gap: 32px;
}

.runhead__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}

.runhead__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.runhead__nav a:hover,
.runhead__nav a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
}

/* Light / Dark switch: two radios styled as a segmented control */
.theme {
  display: inline-flex;
  flex: none;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--rule);
}

.theme input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.theme label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}

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

.theme input:checked + label {
  background: var(--ink);
  color: var(--paper);
  cursor: default;
}

.theme input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .theme input:checked + label {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

@media (max-width: 1199.98px) {
  .runhead__nav { display: none; }
}

@media (max-width: 399.98px) {
  .runhead__rev { display: none; }
}

/* 6. Masthead + sections =================================================== */
.masthead {
  align-items: start;
  padding-top: clamp(2.25rem, 1rem + 4vw, 4.5rem);
  padding-bottom: 8px;
}

.masthead__portrait { line-height: 0; }

.portrait {
  display: inline-block;
  padding: 3px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  line-height: 0;
}

/* Source is 180px square: never display larger than 120px. */
.portrait img {
  display: block;
  width: 112px;
  height: 112px;
  max-width: 120px;
  object-fit: cover;
  filter: var(--portrait-filter);
}

.masthead__id { padding-top: 2px; }

.masthead__role {
  margin-top: 16px;
  font-size: clamp(1.1875rem, 1.05rem + .45vw, 1.375rem);
  line-height: 1.3;
  color: var(--ink-2);
}

.masthead__loc {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-3);
}

.contact { font-size: .8125rem; }

.contact > div {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  align-items: baseline;
  min-height: 44px;
  padding-block: 11px;
  border-top: 1px solid var(--rule);
}

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

.contact dt {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact dd {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.contact a { text-decoration: none; }
.contact a:hover,
.contact a:focus-visible { text-decoration: underline; }

/* Written out, not linked, so the address is not harvested */
.contact__plain { color: var(--ink); }

@media screen and (max-width: 767.98px) {
  .masthead {
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 16px;
  }
  .masthead > .c-rail { grid-column: 1; }
  .masthead > .c-main { grid-column: 2; margin-top: 0; }
  .masthead > .c-notes { grid-column: 1 / -1; margin-top: 28px; }
  .portrait img { width: 80px; height: 80px; }
  .contact > div { padding-block: 13px; }
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .masthead > .c-notes { margin-top: 32px; }
}

@media (min-width: 1200px), print {
  .contact { font-size: .75rem; }
  .contact > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    padding-block: 9px;
    min-height: 0;
  }
}

/* Section frame: the thick-thin rule that opens every section */
.sec {
  padding-top: var(--section-space);
  scroll-margin-top: 24px;
}

.sec-head {
  position: relative;
  margin-bottom: 32px;
  padding-top: 20px;
  border-top: 2px solid var(--rule-strong);
}

.sec-head::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--rule-strong);
}

.sec-num {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--accent);
}

main { counter-reset: sec; }
.sec { counter-increment: sec; }
.sec-num::before { content: counter(sec, decimal-leading-zero); }

@media screen and (max-width: 767.98px) {
  .sec-head {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    margin-bottom: 24px;
  }
  .sec-head > .c-rail { grid-column: 1; }
  .sec-head > .c-main { grid-column: 2; margin-top: 0; }
}

/* Summary */
.summary > * + * { margin-top: 14px; }

.lede {
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.625rem);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.summary p { max-width: 64ch; }
.summary .lede { max-width: 34ch; }

/* 7. At a glance ========================================================== */
.figs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-block: 1px solid var(--rule);
  background: var(--paper-2);
}

.fig {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  container-type: inline-size;
}

@media screen and (max-width: 1199.98px) {
  .figs .fig:nth-child(odd) { border-right: 1px solid var(--rule); }
  .figs .fig:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
}

.fig__num {
  order: -1;
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  /* Sized to the cell so the longest figure ($10–25M) stays on one line */
  font-size: clamp(20px, 23.5cqi, 3.25rem);
  white-space: nowrap;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}

.fig__num .u {
  margin-left: .04em;
  font-size: .6em;
  letter-spacing: 0;
  color: var(--ink-2);
}

.fig__num .u--pre {
  margin-left: 0;
  margin-right: .06em;
}

.fig__cap {
  max-width: 24ch;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
}

.fnref {
  margin-left: .2em;
  font-family: var(--mono);
  font-weight: 500;
  text-decoration: none;
}

.fnotes {
  display: grid;
  gap: 4px;
  max-width: 76ch;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink-3);
  counter-reset: fn;
}

.fnotes li {
  position: relative;
  padding-left: 1.6em;
  counter-increment: fn;
}

.fnotes li::before {
  content: counter(fn);
  position: absolute;
  left: 0;
  color: var(--accent);
}

.fnotes li:target {
  background: var(--selection);
  color: var(--ink-2);
}

@media (min-width: 1200px), print {
  .figs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .figs .fig { padding: 24px; }
  .figs .fig + .fig { border-left: 1px solid var(--rule); }
}

/* 8. Timeline ==============================================================
   Scale: Jan 2009 (month 1) to Dec 2026 (month 216). Bars take --s / --e as
   inclusive month numbers. Bars are borders so they print without
   "background graphics".                                                    */
.tl { margin: 0 0 40px; }

.tl__row { align-items: center; }

.tl__label {
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 24px;
  color: var(--ink-2);
  text-wrap: balance;
}

.tl__track {
  position: relative;
  height: 24px;
  background: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px calc(100% / 18));
}

.tl__bar {
  position: absolute;
  top: 9px;
  left: calc((var(--s) - 1) / 216 * 100%);
  width: calc((var(--e) - var(--s) + 1) / 216 * 100%);
  height: 0;
  border-top: 6px solid var(--bar);
}

.tl__bar--lc { border-top-color: var(--accent); }

.tl__bar--lc::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 0;
  height: 14px;
  border-right: 1px solid var(--accent);
}

.tl__bar--study {
  height: 6px;
  border: 1px solid var(--bar);
}

.tl__scale {
  position: relative;
  height: 22px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.tl__scale span {
  position: absolute;
  top: 0;
  left: calc((var(--m) - 1) / 216 * 100%);
  padding-left: 4px;
  border-left: 1px solid var(--rule);
  line-height: 1;
  padding-top: 4px;
}

@media screen and (max-width: 767.98px) {
  .tl__label { line-height: 1.4; padding-top: 10px; }
  .tl__row > .c-wide { margin-top: 2px; }
  .tl__track { height: 16px; }
  .tl__bar { top: 5px; }
  .tl__bar--lc::after { top: -8px; height: 12px; }
  .tl__axis > .c-rail { display: none; }
}

/* 9. Entries (experience, education) ======================================= */
.entries { border-top: 1px solid var(--rule); }

.entries > li {
  padding-block: 32px;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
}

.entries > li:last-child { border-bottom: 0; }

/* A list that starts right under a section head needs no second rule */
.sec-head + .entries { border-top: 0; }
.sec-head + .entries > li:first-child { padding-top: 4px; }

.entry__period {
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.entry__period .dur {
  display: block;
  margin-top: 2px;
  font-size: .75rem;
  color: var(--ink-3);
}

.present { color: var(--accent); }

.entry h3 a {
  color: inherit;
  text-decoration-color: var(--rule);
}

.entry h3 a:hover,
.entry h3 a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.entry__role {
  margin-top: 2px;
  font-style: italic;
  color: var(--ink-2);
}

.roles { margin-top: 4px; }

.roles li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
}

.roles .role {
  font-style: italic;
  color: var(--ink-2);
}

.roles .when {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.entry__desc,
.runin,
.dash { margin-top: 14px; max-width: 64ch; }

.runin + .runin { margin-top: 10px; }
.runin__label { margin-right: .5em; }

.dash li {
  padding-left: 1em;
  text-indent: -1em;
}

.dash li + li { margin-top: 4px; }

.dash li::before {
  content: "–";
  display: inline-block;
  width: 1em;
  text-indent: 0;
  color: var(--ink-3);
}

.subhead { padding-top: 40px; padding-bottom: 12px; }

.entries--compact > li { padding-block: 18px; }
.entries--compact h3 { font-size: 1.125rem; }

.entries--compact .entry__desc {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--ink-2);
}

@media screen and (max-width: 767.98px) {
  .entries > li { padding-block: 24px; }
  .entries--compact > li { padding-block: 16px; }
  .entry__period { font-size: .75rem; }
  .entry__period .dur { display: inline; margin-left: .15em; }
}

/* 10. Recognition =========================================================== */
.rec-intro {
  max-width: 60ch;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-2);
}

.plate { margin: 24px 0 48px; }

.plate img {
  display: block;
  width: 100%;
  max-width: 760px; /* 1520px source: stays sharp on 2x screens */
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}

.plate figcaption {
  display: grid;
  gap: 4px;
  max-width: 62ch;
  margin-top: 12px;
}

.plate__label {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

.plate__meta {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.plate__text {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.plate:target figcaption .plate__label { background: var(--selection); }

@media (min-width: 1200px), print {
  .plate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--notes);
    column-gap: var(--gap);
    align-items: end;
  }
  .plate figcaption { margin-top: 0; }
}

@media screen and (max-width: 767.98px) {
  .plate img {
    width: calc(100% + 2 * var(--page-pad));
    max-width: none;
    margin-inline: calc(var(--page-pad) * -1);
    border-inline: 0;
  }
}

/* Register — the award table, closed with an accounting total */

.register {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.register .col-date { width: 104px; }
.register .col-result { width: 190px; }

.register thead th {
  padding: 10px 12px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-3);
}

.register thead th.num { text-align: right; }

.register tbody th,
.register td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: baseline;
}

.register thead th:first-child,
.register tbody td:first-child,
.register tfoot td:first-child { padding-left: 0; }

.register thead th:last-child,
.register td:last-child { padding-right: 0; }


.reg__date {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.reg__name {
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.35;
  color: var(--ink);
}

.reg__name .sub,
.reg__result .sub {
  display: block;
  margin-top: 3px;
  font-size: .75rem;
  color: var(--ink-3);
}

.reg__name .sub { font-family: var(--sans); font-weight: 500; }

.register .reg__result {
  font-family: var(--mono);
  font-size: .875rem;
  text-align: right;
  white-space: nowrap;
}

.register tbody tr:target { background: var(--selection); }

.register tbody tr:target .reg__date,
.register tbody tr:target .sub { color: var(--ink-2); }

.register tfoot td {
  padding-block: 10px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 3px double var(--rule-strong);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.register tfoot .reg__name {
  font-family: var(--mono);
  font-size: .75rem;
}

.register tfoot .reg__result { font-size: .75rem; }

/* Stacked register on phones and portrait tablets */
@media screen and (max-width: 991.98px) {
  .register-kicker { display: none; }
  .register thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .register,
  .register tbody,
  .register tfoot { display: block; }
  .register tbody { border-top: 1px solid var(--rule-strong); }
  .register tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "date result"
      "name name";
    column-gap: 12px;
    padding-block: 14px;
    border-bottom: 1px solid var(--rule);
  }
  .register tbody th,
  .register td {
    padding: 0 !important;
    border: 0;
  }
  .register .reg__date { grid-area: date; }
  .register .reg__result { grid-area: result; white-space: normal; }
  .register .reg__name { grid-area: name; margin-top: 6px; }
  .reg__result .sub { display: inline-block; max-width: 100%; margin-left: 0; }
  .register tfoot tr {
    border-top: 1px solid var(--rule-strong);
    border-bottom: 3px double var(--rule-strong);
  }
  .register tfoot td { border: 0; }
}

/* 11. Writing, areas, closing, colophon ===================================== */
.writing { margin-top: 28px; border-top: 1px solid var(--rule); }

.wrow {
  padding-block: 22px;
  border-bottom: 1px solid var(--rule);
}

.wrow__title {
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}

.wrow__title a { text-decoration-color: var(--accent-line); }

.wrow__desc {
  max-width: 62ch;
  margin-top: 6px;
  font-size: 1rem;
  color: var(--ink-2);
}

.wrow__points {
  margin-top: 10px;
  font-size: 1rem;
  color: var(--ink-2);
}

.wrow__src {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.wrow__all {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: .8125rem;
}

.area {
  padding-top: 12px;
  border-top: 2px solid var(--rule-strong);
}

.area__head {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink);
}

.area__list { margin-top: 8px; }

.area__list li {
  padding-block: 9px;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.4;
}

.closing .kicker { margin-bottom: 10px; }

.closing__item { font-size: 1.125rem; }

.closing__text {
  max-width: 52ch;
  margin-top: 6px;
  font-size: 1rem;
  color: var(--ink-2);
}

.closing__meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-3);
}

.colophon {
  margin-top: var(--section-space);
  padding-bottom: 48px;
}

.colophon__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 20px;
  border-top: 2px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.6;
  color: var(--ink-3);
}

.colophon__inner::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--rule-strong);
}

.colophon a { text-decoration-color: var(--accent-line); }
.colophon__inner p { text-wrap: wrap; }

/* Fixed gutters, so larger default text sizes cannot push rows past the page edge */
.row.g-4 { --bs-gutter-x: 24px; }

/* 12. Print (US Letter, three pages) ======================================== */
@page {
  size: letter;
  margin: 14mm 14mm 16mm;

  @top-right { content: ""; }

  @bottom-right {
    content: "Cris Ravazzano — CV · " counter(page) " / " counter(pages);
    font: 7pt "IBM Plex Mono", ui-monospace, monospace;
    color: #555;
  }
}

@media print {
  :root,
  :root:has(#theme-light:checked) {
    color-scheme: light;
    --paper: #fff;
    --paper-2: #fff;
    --ink: #000;
    --ink-2: #333;
    --ink-3: #555;
    --rule: #bbb;
    --rule-strong: #000;
    --accent: #0e5e52;
    --accent-line: #0e5e52;
    --selection: transparent;
    --bar: #555;
    --portrait-filter: grayscale(1) contrast(1.06);
    --rail: 28mm;
    --notes: 38mm;
    --gap: 5mm;
    --section-space: 6mm;
    --page-pad: 0;
  }

  html { font-size: 9pt; }
  body { font-size: 9pt; line-height: 1.38; }
  h1 { font-size: 22pt; }
  h2 { font-size: 11.5pt; }
  h3 { font-size: 10pt; }
  .lede { font-size: 10.5pt; line-height: 1.35; }

  .runhead,
  .skip-link,
  .ext,
  .colophon__links,
  .wrow__desc,
  .wrow__points,
  .wrow__src,
  .wrow__all,
  .wrow__pub,
  #areas { display: none !important; }

  a { color: inherit; text-decoration: none; }
  .fnref { color: var(--accent); }

  .container-xl { max-width: none; padding: 0; }

  .masthead { padding-top: 0; padding-bottom: 0; }
  .portrait img { width: 19mm; height: 19mm; }
  .masthead__role { margin-top: 5pt; font-size: 10.5pt; }
  .masthead__loc { margin-top: 3pt; }
  .contact > div { padding-block: 2.5pt; }

  .sec-head { margin-bottom: 6pt; padding-top: 6pt; break-inside: avoid; break-after: avoid; }
  .summary > * + * { margin-top: 4pt; }

  .figs .fig { padding: 6pt 9pt; gap: 3pt; }
  .fig__num { font-size: 16pt; }
  .fnotes { margin-top: 5pt; gap: 1pt; }

  .tl { margin-bottom: 6pt; }
  .tl__label { line-height: 10pt; font-size: 6.5pt; }
  .tl__track { height: 10pt; background: none; }
  .tl__bar { top: 3pt; border-top-width: 4pt; }
  .tl__bar--study { height: 4pt; border-top-width: 1px; }
  .tl__bar--lc::after { top: -5pt; height: 7pt; }
  .tl__scale { height: 10pt; margin-top: 1pt; }

  .entries > li { padding-block: 6pt; }
  .entries--compact > li { padding-block: 4pt; }
  .subhead { padding-top: 6pt; padding-bottom: 0; }
  .entry__desc,
  .runin { margin-top: 3pt; }
  .runin + .runin { margin-top: 1.5pt; }
  .entries--compact .entry__desc { font-size: 8.75pt; margin-top: 2pt; }

  .plate { margin: 6pt 0 8pt; }
  .plate img { width: 62mm; }
  .register tbody th,
  .register td { padding-block: 3.5pt; }
  .register thead th { padding-block: 3pt; }
  .register tfoot td { padding-block: 3.5pt; }
  .reg__name { font-size: 9pt; }
  .reg__name .sub,
  .reg__result .sub { margin-top: 0; }

  .writing { margin-top: 4pt; }
  .wrow { padding-block: 3.5pt; }
  .wrow__title { font-size: 9.5pt; }

  .row.g-4 { --bs-gutter-y: 6pt; --bs-gutter-x: 5mm; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .closing .kicker { margin-bottom: 3pt; }
  .closing__item { font-size: 9.5pt; }
  .closing__text { font-size: 8.75pt; margin-top: 2pt; }

  .colophon { margin-top: 8pt; padding-bottom: 0; }
  .colophon__inner { padding-top: 6pt; }

  /* Long entries may split across pages; short ones stay whole */
  .entries > li { break-inside: auto; }
  .entries--compact > li,
  .wrow,
  figure,
  tr,
  .figs,
  .tl { break-inside: avoid; }
  h2,
  h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
}
