/* cv.saphid.app — no build step, self-hosted fonts, no third-party requests. */

@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/mona-sans-latin-wdth-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monaspace Neon";
  src: url("/fonts/monaspace-neon-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #eeeeea;
  --ink: #0d0e0f;
  --ink-2: #2f3133;
  --muted: #5b5d5f;
  --line: #d3d3ce;
  --line-strong: #0d0e0f;
  --seg: #0d0e0f;
  --accent: #ee3c00;        /* graphics only: 3:1 on --bg */
  --accent-text: #b33000;   /* small text: 4.5:1 on --bg */
  --button-ink: #eeeeea;

  --sans: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Monaspace Neon", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 74rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --rail: 9rem;
  --head: 17rem;
  --gap: 2.5rem;
  --career-h: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d0e;
    --ink: #eeeeea;
    --ink-2: #cdcdc8;
    --muted: #93959a;
    --line: #26282a;
    --line-strong: #eeeeea;
    --seg: #dcdcd7;
    --accent: #ff5a1f;
    --accent-text: #ff7a4a;
    --button-ink: #0c0d0e;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

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

::selection { background: var(--accent); color: #fff; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

/* ---------- Shared small type ---------- */

.topbar__kind,
.section__label,
.entry__dates,
.career__label,
.footer__meta,
.link,
.button {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  transition: text-decoration-color 0.15s ease;
}
.link:hover { text-decoration-color: var(--accent); }
.arrow { white-space: pre; color: var(--muted); }
.link:hover .arrow { color: var(--accent-text); }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 1.1rem;
  background: var(--ink);
  color: var(--button-ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background-color 0.15s ease;
}
.button .arrow { color: inherit; }
.button:hover { background: var(--accent-text); color: var(--button-ink); }

/* ---------- Hero ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.topbar__kind {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.topbar__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.name {
  margin-top: clamp(2rem, 7vw, 5.5rem);
  margin-left: -0.045em;
  font-size: clamp(3.25rem, 11.6vw, 9.25rem);
  font-weight: 640;
  font-stretch: 108%;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.role {
  margin-top: clamp(1.25rem, 2.6vw, 2rem);
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
  font-weight: 520;
  line-height: 1.25;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.role i {
  font-style: normal;
  font-weight: 300;
  color: var(--accent-text);
  padding-inline: 0.12em;
}

.now {
  max-width: 37rem;
  margin-top: 0.9rem;
  padding-bottom: clamp(2.25rem, 5vw, 3.75rem);
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Career bar ---------- */

.career {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-block: 1px solid var(--line);
}

.career__bar {
  position: relative;
  display: flex;
  gap: 2px;
}

/* --m is months from each role's start to the next role's start, so the bar is a
   true time axis: April 2014 through November 2026 inclusive is 152 months. ServiceNow stops at
   Canva's start (their September 2019 overlaps) and Displayr carries July 2026. */
.seg { flex: var(--m) 1 0; min-width: 0.5rem; }
.seg--google     { --m: 15; }
.seg--servicenow { --m: 50; }
.seg--canva      { --m: 15; }
.seg--aws        { --m: 43; }
.seg--displayr   { --m: 25; }
.seg--algolia    { --m: 3; }

.career__bar a {
  position: relative;
  display: block;
  padding-block: 1.05rem 0.85rem;
  text-decoration: none;
  color: var(--muted);
  outline-offset: -2px;
}
.career__bar a::before {
  content: "";
  display: block;
  height: 0.75rem;
  background: var(--seg);
  transition: background-color 0.2s ease;
}

.career__label {
  display: block;
  margin-top: 0.6rem;
  white-space: nowrap;
}
.career__label b {
  display: block;
  font-weight: 400;
  color: var(--ink);
  transition: color 0.2s ease;
}
.seg--algolia .career__label {
  position: absolute;
  right: 0;
  top: 1.8rem;
  text-align: right;
}
.seg--algolia a { height: 100%; }

/* The lit segment: the role in view, else the current role. */
.career__bar a.is-active::before,
.career__bar a:hover::before,
.career__bar:not(:has(.is-active)) a.is-current::before {
  background: var(--accent);
}
.career__bar:has(.is-active) a:not(.is-active) b { color: var(--muted); }

/* ---------- Sections ---------- */

main { padding-bottom: clamp(4rem, 9vw, 7rem); }

.section {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 var(--gap);
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-strong);
}

.section__label {
  position: sticky;
  top: calc(var(--career-h) + 1.1rem);
  align-self: start;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.entry,
.row {
  display: grid;
  grid-template-columns: var(--head) minmax(0, 1fr);
  gap: 0 var(--gap);
}

.entry {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--career-h) - 2px);
}
.entry:first-child { padding-top: 0; border-top: 0; scroll-margin-top: calc(var(--career-h) + 1.1rem); }
.entry:last-child { padding-bottom: 0; }

.entry__org {
  font-size: 1.5rem;
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.entry__role {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-2);
  text-wrap: balance;
}
.entry__dates {
  margin-top: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.entry__link { margin-top: 0.15rem; }

.points {
  max-width: 38rem;
  color: var(--ink-2);
}
.points li {
  position: relative;
  padding-left: 1.25rem;
  text-wrap: pretty;
}
.points li + li { margin-top: 0.55rem; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.3125rem;
  height: 0.3125rem;
  background: var(--muted);
}
.points strong {
  font-weight: 640;
  color: var(--ink);
}

.entry__note {
  max-width: 38rem;
  margin-top: 1.1rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.entry__note a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}
.entry__note a:hover { text-decoration-color: var(--accent); }

/* ---------- Skills & qualifications ---------- */

.row {
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}
.row:first-child { padding-top: 0; border-top: 0; }
.row:last-child { padding-bottom: 0; }

.row dt {
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.row dd {
  max-width: 38rem;
  color: var(--ink-2);
  text-wrap: pretty;
}
.rows--quals dd {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 2rem;
  padding-block: 1.25rem 2rem;
}
.footer__name {
  font-weight: 620;
  letter-spacing: -0.01em;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
}
.footer__meta {
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 68rem) {
  :root { --rail: 7.5rem; --head: 14.5rem; --gap: 2rem; }
}

@media screen and (max-width: 56rem) {
  /* Section label moves above its content. */
  .section { grid-template-columns: minmax(0, 1fr); }
  .section__label { position: static; margin-bottom: 1.75rem; }
  :root { --head: 15rem; }
}

@media screen and (max-width: 48rem) {
  /* Career bar: one readout line above the bar instead of a label per segment. */
  :root { --career-h: 4.5rem; }
  .career__bar { margin-top: 1.6rem; }
  .career__bar::after {
    content: "2014 — now";
    position: absolute;
    right: 0;
    bottom: calc(100% - 0.55rem);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
  }
  .career__bar a { position: static; padding-block: 1rem; }
  .seg--algolia { min-width: 1.5rem; }
  .career__label,
  .seg--algolia .career__label {
    display: none;
    position: absolute;
    left: 0;
    right: auto;
    top: auto;
    bottom: calc(100% - 0.55rem);
    margin: 0;
    text-align: left;
  }
  .career__label b { display: inline; color: var(--ink); }
  .career__bar a.is-active .career__label,
  .career__bar:not(:has(.is-active)) a.is-current .career__label { display: block; }
}

@media screen and (max-width: 42rem) {
  body { font-size: 1rem; }

  .entry, .row { grid-template-columns: minmax(0, 1fr); }
  .entry { padding-block: 1.75rem; }
  .entry__head { margin-bottom: 1rem; }
  .entry__org { font-size: 1.375rem; }
  .row dt { margin-bottom: 0.2rem; }

  .name span { display: block; }
  .name { font-size: clamp(3rem, 17.5vw, 6rem); line-height: 0.86; }

  .footer__meta { margin-left: 0; flex-basis: 100%; }
}

@media screen and (max-width: 26rem) {
  .topbar__kind { display: none; }
  .topbar__links { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- Print: one A4 page, also the source of the PDF ---------- */

.topbar__site { display: none; }

@page { size: A4; margin: 11mm 13mm 10mm; }

@media print {
  :root {
    --bg: #fff; --ink: #000; --ink-2: #1c1c1c; --muted: #555;
    --line: #cfcfcf; --line-strong: #000; --seg: #000;
    --accent: #e03800; --accent-text: #b33000;
    --head: 41mm; --gap: 4mm;
  }
  html { font-size: 8.1pt; }
  body { font-size: 1rem; line-height: 1.33; }
  a { text-decoration: none !important; }
  .wrap { max-width: none; padding-inline: 0; }

  .skip, .button, .arrow, .footer, .entry__link, .now { display: none !important; }
  .topbar__site { display: block; }

  .topbar { padding: 0; }
  .topbar__links { gap: 5mm; }
  .topbar__kind, .topbar .link, .section__label, .entry__dates, .career__label { font-size: 0.76rem; }
  .topbar .link { min-height: 0; }

  .name { margin-top: 3.5mm; font-size: 3.7rem; line-height: 0.9; letter-spacing: -0.035em; word-spacing: 0.1em; }
  .role { margin-top: 2.4mm; padding-bottom: 4mm; font-size: 1.32rem; }

  .career { position: static; border-block: 0.6pt solid var(--line); }
  .career__bar a { padding-block: 2.2mm 1.8mm; }
  .career__bar a::before { height: 1.7mm; }
  .career__label { margin-top: 1.3mm; }
  .seg--algolia .career__label { top: 3.9mm; }
  .career__bar a.is-active::before { background: var(--seg); }
  .career__bar a.is-current::before { background: var(--accent) !important; }
  .career__label b { color: var(--ink) !important; }

  main { padding-bottom: 0; }
  .section {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 3mm;
    padding-top: 1.5mm;
    border-top-width: 0.8pt;
  }
  .section__label { position: static; margin-bottom: 1.8mm; }

  .entry { padding-block: 1.75mm; border-top-width: 0.5pt; break-inside: avoid; }
  .entry__org { font-size: 1.24rem; }
  .entry__role { margin-top: 0.5mm; font-size: 0.92rem; line-height: 1.3; text-wrap: wrap; }
  .entry__dates { margin-top: 0.9mm; }
  .points, .row dd, .entry__note { max-width: none; }
  .points li { padding-left: 3mm; text-wrap: wrap; }
  .points li + li { margin-top: 0.35mm; }
  .points li::before { top: 0.58em; width: 1mm; height: 1mm; }
  .entry__note { margin-top: 0.9mm; padding-left: 3mm; font-size: 1rem; }
  .entry__note a { color: inherit; }

  /* Skills run in as labelled paragraphs; qualifications sit on one line. */
  .row { display: block; padding-block: 0.55mm; border-top: 0; break-inside: avoid; }
  .row:first-child { padding-top: 0; }
  .row dt, .row dd { display: inline; }
  .row dt { margin-right: 1.6mm; }
  .row dd { text-wrap: wrap; }
  .rows--quals { display: flex; flex-wrap: wrap; gap: 0 9mm; }
  .rows--quals .row { padding-block: 0; }
  .rows--quals dd { font-size: 0.84rem; line-height: 1.33; }
  #qualifications { break-inside: avoid; }
}

/* Live GitHub badge for T3 Code, served first-party by src/worker.js. Hidden in print with .entry__link. */
.entry__badge { margin-top: 0.4rem; line-height: 0; }
.entry__badge a { display: inline-block; border-radius: 3px; }
.entry__badge img { display: block; height: 20px; width: auto; }
