/* cv.mattcree.fyi */

:root {
  --desk: #d6d0c4;
  --paper: #fbf8f1;
  --grain: 0.07;
  --ink: #1f1d1a;
  --muted: #6f6a60;
  --rule: #cfc8ba;
  --link: #2b4a73;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.12), 0 14px 44px rgba(40, 30, 10, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #121110;
    --paper: #23211d;
    --grain: 0.05;
    --ink: #e8e3d8;
    --muted: #9c968a;
    --rule: #403c35;
    --link: #a9bfdc;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 44px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { background: var(--desk); }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
}

/* The sheet. Paper colour, a faint fibre grain, a soft shadow on the desk. */
main {
  position: relative;
  max-width: 46rem;
  margin: 2rem auto 4rem;
  padding: 3rem 1.5rem 4rem;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 30%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.15  0 0 0 0 0.05  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
  background-blend-mode: normal, multiply;
  box-shadow: var(--shadow);
  border-radius: 2px;
}
main::after {
  /* grain strength, without touching the text */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: var(--paper);
  opacity: calc(1 - var(--grain) * 6);
  mix-blend-mode: normal;
  border-radius: inherit;
  z-index: 0;
}
main > * { position: relative; z-index: 1; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.14em; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

p { margin: 0 0 0.75em; max-width: 60ch; }
b { font-weight: 600; }

header {
  padding-bottom: 1.25rem;
  border-bottom: 3px double var(--rule);
  margin-bottom: 1.75rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 500;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 0.35rem;
}

.sub { font-size: 1.125rem; margin-bottom: 0.6rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.95rem; margin: 0; }

.summary { font-size: 1.125rem; margin-bottom: 2.5rem; }

h2 {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 2.75rem 0 1rem;
}

.entry { margin: 0 0 1.6rem; }

.when {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.15rem;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}
h3 .at { font-weight: 400; font-style: italic; color: var(--muted); }
h3 .at::before { content: ", "; }

ul { margin: 0 0 0.75em; padding-left: 1.1em; }
li { margin-bottom: 0.3em; max-width: 58ch; }

.project { margin-top: 0.75em; }

dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 1.5rem; row-gap: 0.4rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; max-width: 56ch; }

@media (min-width: 44rem) {
  main { margin: 3.5rem auto 5rem; padding: 5rem 5rem 6rem; }
  .entry { display: grid; grid-template-columns: 8.5rem 1fr; column-gap: 1.5rem; }
  .when { margin: 0.15rem 0 0; }
  h3 .at { display: block; }
  h3 .at::before { content: none; }
}

@media (max-width: 30rem) {
  main { margin: 0.75rem 0.5rem 2rem; padding: 2.25rem 1.25rem 3rem; }
  dl { grid-template-columns: 1fr; row-gap: 0.1rem; }
  dd { margin-bottom: 0.6rem; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --rule: #999; --link: #000; }
  @page { margin: 18mm 16mm; }
  body { font-size: 10.5pt; line-height: 1.4; }
  html, body { background: #fff; }
  main { max-width: none; margin: 0; padding: 0; background: #fff; box-shadow: none; border-radius: 0; }
  main::after { display: none; }
  a { text-decoration: none; }
  h1 { font-size: 22pt; }
  h2 { break-after: avoid; margin-top: 1.5rem; }
  h3 { break-after: avoid; }
  .entry { break-inside: auto; margin-bottom: 1rem; }
  .project { break-inside: avoid; }
  .summary { margin-bottom: 1.25rem; }
}
