/* vanzylv.xyz: the only stylesheet. Values come from "Design direction" in docs/designs/static-cv-page.md. */

@font-face {
  font-family: "Newsreader";
  src: url(/fonts/display.woff2) format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url(/fonts/text.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Fallback metrics, computed with fontTools over the characters in content.json:
   Newsreader vs Georgia: size 101.5%, ascent 72.4%, descent 26.1%.
   Atkinson vs Arial:     size 99.0%,  ascent 99.4%, descent 31.9%. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 101.5%;
  ascent-override: 72.4%;
  descent-override: 26.1%;
}
@font-face {
  font-family: "Atkinson Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 99%;
  ascent-override: 99.4%;
  descent-override: 31.9%;
}

:root {
  color-scheme: light dark;

  --ground: #f2f4f3;
  --ink: #16201c;
  --muted: #4a5550;
  --accent: #0f5c48;

  --display: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --text: "Atkinson Hyperlegible Next", "Atkinson Fallback", Arial, sans-serif;

  --step-display: clamp(2.75rem, 1rem + 6vw, 6rem);
  --step-heading: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
  --step-lead: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);
  --step-body: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-small: 0.9375rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --section-gap: clamp(3rem, 2rem + 3vw, 4.5rem);
  --page-margin: clamp(1.25rem, 4vw, 2.5rem);
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111614;
    --ink: #e6ece9;
    --muted: #a7b2ad;
    --accent: #7fd1b5;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-body);
  line-height: 1.6;
}

h1, h2, h3, h4, p, ul, dl, dd {
  margin: 0;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
}

h1 {
  font-size: var(--step-display);
  line-height: 1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--step-heading);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--step-lead);
}

h4 {
  font-size: var(--step-body);
  font-weight: 700;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

.skip {
  position: absolute;
  top: var(--space-2);
  left: var(--page-margin);
  z-index: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--ink);
  color: var(--ground);
}

/* Hidden until focused. Lint exempts this standard pattern by its class name. */
.visually-hidden:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The frame: a page margin on every block and one centred reading column. */
.masthead,
main,
.colophon {
  padding-inline: var(--page-margin);
}

.masthead {
  max-width: calc(var(--measure) + 2 * var(--page-margin));
  margin-inline: auto;
  padding-block: clamp(3rem, 2rem + 4vw, 5rem) var(--section-gap);
}

main > section,
main > h1,
main > p,
.colophon p {
  max-width: var(--measure);
  margin-inline: auto;
}

main > section {
  padding-block-end: var(--section-gap);
}

main > section > p + p {
  margin-top: var(--space-3);
}

/* Header */
.standfirst {
  margin-top: var(--space-4);
  font-size: var(--step-lead);
}

.summary {
  max-width: var(--measure);
  margin-top: var(--space-3);
  font-size: var(--step-lead);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.contact a {
  display: inline-block;
  padding-block: var(--space-1);
}

.credentials {
  margin-top: var(--space-3);
  font-size: var(--step-small);
  color: var(--muted);
}

/* Experience */
.role {
  margin-top: var(--space-5);
}

.role-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
}

.dates,
.tech {
  font-size: var(--step-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.role-title {
  margin-top: var(--space-1);
}

.tech {
  margin-top: var(--space-1);
}

.projects {
  margin-top: var(--space-3);
  padding: 0;
  list-style: none;
}

.projects li + li {
  margin-top: var(--space-3);
}

details {
  margin-top: var(--space-2);
}

summary {
  padding-block: var(--space-1);
  color: var(--accent);
  cursor: pointer;
}

/* Working with agents */
.practices {
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.practices li + li {
  margin-top: var(--space-4);
}

.proof {
  margin-top: var(--space-5);
  font-family: var(--display);
  font-size: var(--step-lead);
}

/* Stack */
.stack div + div {
  margin-top: var(--space-3);
}

.stack dt {
  font-weight: 700;
}

/* Footer and 404 */
.colophon {
  padding-block-end: var(--space-6);
  font-size: var(--step-small);
  color: var(--muted);
}

.masthead--small {
  padding-block: var(--space-5) var(--space-6);
}

.site-name {
  font-family: var(--display);
  font-size: var(--step-lead);
}

main > h1 {
  font-size: var(--step-heading);
  margin-bottom: var(--space-3);
}

main > h1 + p {
  padding-block-end: var(--section-gap);
}

@media (max-width: 30rem) {
  .role-head {
    grid-template-columns: 1fr;
  }
}

@media print {
  :root {
    --ground: #fff;
    --ink: #000;
    --muted: #333;
    --accent: #000;
  }

  body {
    background: none;
  }

  .skip {
    display: none;
  }

  .masthead {
    padding-block: 0 var(--space-5);
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: var(--step-small);
    color: var(--muted);
  }

  .role {
    break-inside: avoid;
  }

  summary {
    color: var(--ink);
    list-style: none;
  }

  details::details-content {
    content-visibility: visible;
    display: block;
  }
}
