/* CV page styles (/cv/ and /lt/cv/): page frame, plain CV and print layout.
   Dashboard charts are styled in cv-dashboard.css.
   Moved here from the inline <style> in scripts/build-cv.py so browsers can cache it. */

/* Colours and fonts come from /assets/css/tokens.css (Vaitkus EdTech design system).
   brand-red is for rules, markers and numbers 24px+; smaller text stays ink. */
/* Layout: red masthead with an organisations rail and four stats, then a tinted side column (details, contact, skills) beside the main column (profile, expertise, experience). */
:root {
  --bg: var(--canvas);
  --side: var(--surface-sunk);
  --muted: var(--ink-muted);
  --accent: var(--brand-red);
  --display: var(--font-display);
  --body: var(--font-body);
}
/* base: box sizing, page, links and headings */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--body);
}
a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.15;
  text-wrap: balance;
}
/* top bar and buttons (print, download, back) */
.topbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.topbar a.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.btn {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: var(--radius-sm);
  min-height: var(--tap-min);
  padding: 10px 16px;
  font: 600 14px var(--body);
  cursor: pointer;
}
/* the CV sheet and its red masthead: name, organisations rail, four stats */
.page {
  max-width: 1080px;
  margin: 0 auto 48px;
  background: var(--paper);
  border: 1px solid var(--line);
}

/* masthead */
.mast {
  padding: 36px 44px 0;
  text-align: center;
}
.eyebrow {
  margin: 0;
  font: 500 15px/1.2 var(--display);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
}
.mast h1 {
  margin: 8px 0 6px;
  font: var(--text-hero);
  letter-spacing: 0.5px;
}
.mast .sub {
  margin: 0 auto;
  max-width: 52ch;
  font-size: 17px;
  color: var(--muted);
  font-style: italic;
}
.mast .tagline {
  margin: 14px auto 0;
  max-width: 64ch;
  font-size: 15px;
}
.orgs {
  list-style: none;
  margin: 24px -44px 0;
  padding: 12px 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}
.orgs li {
  font: 500 14px/1.6 var(--display);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.orgs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.orgs li::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0 -44px;
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}
.stat dd {
  order: -1;
}
.stat + .stat {
  border-left: 1px solid var(--line);
}
.stat dd {
  margin: 0;
  font: 600 34px/1 var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat dt {
  margin-top: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* body grid */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
}
aside {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 8px 26px 32px;
}
.main {
  padding: 8px 40px 36px;
  min-width: 0;
}
.cv-section h2 {
  font: var(--text-section-title);
  text-transform: uppercase;
  color: var(--ink);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
aside .cv-section h2 {
  font-size: 17px;
}
.details div {
  margin-bottom: 10px;
}
.details dt,
.skills dt {
  font-weight: 700;
  font-size: 13px;
}
.details dd,
.skills dd {
  margin: 1px 0 0;
  font-size: 14px;
}
.skills dt {
  margin-top: 10px;
}
.plain {
  padding-left: 18px;
  margin: 0;
  font-size: 14px;
}
.plain li {
  margin-bottom: 4px;
}
.plain.contact {
  list-style: none;
  padding: 0;
  overflow-wrap: anywhere;
}
.side-quote {
  margin: 0;
}
.side-quote blockquote {
  margin: 0;
  font-style: italic;
  font-size: 14px;
}
.side-quote blockquote p {
  margin: 0 0 8px;
}
.side-quote figcaption {
  font-size: 13px;
  font-weight: 600;
}
.side-quote figcaption span {
  font-weight: 400;
  color: var(--muted);
}
.main p {
  margin: 0 0 10px;
}
/* main column: expertise, experience entries, earlier work */
.expertise div {
  margin-bottom: 12px;
}
.expertise dt {
  font-weight: 700;
}
.expertise dd {
  margin: 2px 0 0;
}
.job {
  margin-bottom: 22px;
  break-inside: avoid;
}
.job h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}
.job .role {
  margin: 2px 0 0;
  font-weight: 600;
}
.job .meta {
  margin: 0 0 6px;
}
.ach-label {
  margin: 6px 0 4px !important;
  font: italic 600 13px var(--body);
  color: var(--muted);
}
.job ul {
  margin: 0;
  padding-left: 18px;
}
.job li {
  margin-bottom: 3px;
}
.job-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  font-size: 14px;
}
.job-links a {
  font-weight: 600;
}
.job {
  scroll-margin-top: 20px;
}
.meta {
  color: var(--muted);
  font-size: 13px;
}
.earlier {
  font-size: 14px;
  color: var(--muted);
}
/* products, recommendations, writing and 'why work with me' */
.intro {
  color: var(--muted);
}
.products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
.product h3 {
  font-size: 17px;
  margin: 0 0 2px;
}
.product p {
  margin: 0;
}
.recs {
  display: grid;
  gap: 14px;
}
.rec {
  margin: 0;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
.rec blockquote {
  margin: 0;
  font-style: italic;
}
.rec blockquote p {
  margin: 0 0 4px;
}
.rec figcaption {
  font-size: 13px;
  color: var(--muted);
}
.writing {
  list-style: none;
  padding: 0;
  margin: 0;
}
.writing li {
  margin-bottom: 10px;
}
.why {
  font-size: 14px;
  color: var(--muted);
}

/* small screens: one column */

@media screen and (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    order: 2;
  }
  .main {
    order: 1;
    padding: 8px 20px 28px;
  }
  aside {
    padding: 8px 20px 28px;
  }
  .mast {
    padding: 26px 20px 0;
  }
  .orgs,
  .stats {
    margin-left: -20px;
    margin-right: -20px;
  }
  .orgs {
    padding: 10px 20px;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .mast h1 {
    font-size: 34px;
  }
  .products {
    grid-template-columns: 1fr;
  }
  .page {
    border-left: 0;
    border-right: 0;
  }
}
/* print: white paper, no window, no controls */
@media print {
  :root {
    --bg: #fff;
    --paper: #fff;
    --side: #f4f5f7;
    --ink: #000;
    --muted: #444;
    --line: #d6d9dd;
    --accent: #b00000;
    --accent-soft: #fbeaea;
  }
  @page {
    size: A4;
    margin: 12mm;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body {
    font-size: 9pt;
    line-height: 1.4;
  }
  .topbar,
  .print-hide {
    display: none;
  }
  .page {
    border: 0;
    margin: 0;
    max-width: none;
  }
  .mast {
    padding: 0 0 0;
  }
  .mast h1 {
    font-size: 26pt;
  }
  .orgs,
  .stats {
    margin-left: 0;
    margin-right: 0;
  }
  .stat dd {
    font-size: 20pt;
  }
  .stat {
    padding: 8px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  }
  aside {
    padding: 0 14px 0 12px;
  }
  .main {
    padding: 0 0 0 18px;
  }
  .cv-section h2 {
    margin-top: 14px;
    font-size: 13pt;
  }
  aside .cv-section h2 {
    font-size: 11pt;
  }
  .job {
    margin-bottom: 10px;
  }
  .job h3 {
    font-size: 12pt;
  }
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
  }
  .product .meta,
  .intro {
    display: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}
/* glass design (shared with the homepage and case studies): window behind, the CV sheet is a frosted panel */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  padding: 10px max(16px, calc((100% - 1080px) / 2));
}
.topbar a.back {
  color: var(--ink-2);
}
.page {
  position: relative;
}
aside {
  background: color-mix(in srgb, var(--sunk) 55%, transparent);
}
.stat dd {
  color: var(--red-large);
}
.btn {
  background: var(--ink);
  color: var(--paper);
}
.mast .sub,
.meta,
.earlier,
.intro,
.why,
.rec figcaption,
.side-quote figcaption span {
  color: var(--muted);
}
@media screen and (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
  }
}
