/* The site is a design file: a dotted canvas with frames on it. Selecting a frame opens it. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #f1f2f4;
  --dot: rgb(20 27 40 / .11);
  --dot-lit: rgb(20 27 40 / .46);
  --frame: #fff;
  --ink: #10131a;
  --ink-2: #5b6472;
  --ink-3: #8d95a3;
  --line: rgb(20 27 40 / .09);
  --line-2: rgb(20 27 40 / .22);
  --fill: rgb(20 27 40 / .05);
  --accent: #0d99ff;
  --accent-text: #0a6fc8;
  --accent-fill: #0a76d4;
  --on-accent: #fff;
  --handle: #fff;
  --live: #14ae5c;
  --shadow: 0 0 0 1px rgb(20 27 40 / .06), 0 1px 2px rgb(20 27 40 / .04), 0 16px 32px -16px rgb(20 27 40 / .12);
  --dock: rgb(255 255 255 / .84);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --gutter: clamp(16px, 2.2vw, 28px);
  --pad: clamp(22px, 4.4vw, 56px);

  --out: cubic-bezier(.16, .84, .24, 1);
  --spring: linear(0, .084, .259, .451, .622, .758, .857, .925, .968, .992, 1.005, 1.01, 1.011, 1.01, 1.008, 1.006, 1.004, 1.002, 1.001, 1.001, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0d0f13;
    --dot: rgb(255 255 255 / .075);
    --dot-lit: rgb(255 255 255 / .36);
    --frame: #16191f;
    --ink: #f1f3f6;
    --ink-2: #9aa3b1;
    --ink-3: #697384;
    --line: rgb(255 255 255 / .09);
    --line-2: rgb(255 255 255 / .24);
    --fill: rgb(255 255 255 / .06);
    --accent-text: #4db5ff;
    --handle: #16191f;
    --shadow: 0 0 0 1px rgb(255 255 255 / .07), 0 16px 32px -16px rgb(0 0 0 / .7);
    --dock: rgb(30 33 40 / .84);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #0d0f13;
  --dot: rgb(255 255 255 / .075);
  --dot-lit: rgb(255 255 255 / .36);
  --frame: #16191f;
  --ink: #f1f3f6;
  --ink-2: #9aa3b1;
  --ink-3: #697384;
  --line: rgb(255 255 255 / .09);
  --line-2: rgb(255 255 255 / .24);
  --fill: rgb(255 255 255 / .06);
  --accent-text: #4db5ff;
  --handle: #16191f;
  --shadow: 0 0 0 1px rgb(255 255 255 / .07), 0 16px 32px -16px rgb(0 0 0 / .7);
  --dock: rgb(30 33 40 / .84);
  color-scheme: dark;
}

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

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* The canvas: faint dots everywhere, and brighter dots gathered around the pointer. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-size: 22px 22px;
  background-position: 50% 0;
}

body::before { background-image: radial-gradient(circle at center, var(--dot) 1px, transparent 1.25px); }

body::after {
  background-image: radial-gradient(circle at center, var(--dot-lit) 1px, transparent 1.25px);
  -webkit-mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
  mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
  opacity: 0;
  transition: opacity .5s ease;
}

.lit body::after { opacity: 1; }

.clock, .status, .foot-links a, .thumb-name, .frame-name, .frame-size, .bar-name, .intro h1, .intro p {
  background: var(--canvas);
  box-shadow: 0 0 0 4px var(--canvas);
  border-radius: 1px;
}

a { color: inherit; }

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

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

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 60;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 13px;
  text-decoration: none;
  transition: top .2s var(--out);
}
.skip:focus { top: 12px; }

/* Interface text at the edges of the canvas. */
.bar,
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  font-size: 13px;
  color: var(--ink-2);
}

.bar { min-height: 60px; }

.bar-name {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: opacity .2s ease;
}
.bar-name:hover { opacity: .6; }

.bar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.clock {
  font: 400 12px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.theme {
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.js .theme { display: grid; }
.theme:hover { background: var(--fill); color: var(--ink); }
.theme svg { display: block; width: 14px; height: 14px; transition: transform .6s var(--spring); }
[data-theme="dark"] .theme svg { transform: rotate(180deg); }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.quiet {
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s ease;
}
.quiet:hover { color: var(--ink); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status i {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.status i::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--live);
  opacity: .25;
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(.7); opacity: .3; }
  50% { transform: scale(1.25); opacity: .1; }
}

/* Landing. */
.home {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 5.6vh, 52px);
  width: min(1048px, 100%);
  margin-inline: auto;
  padding: 8px var(--gutter) 24px;
}

.intro h1 {
  width: fit-content;
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.03em;
}

.intro p {
  width: fit-content;
  margin-top: 1px;
  color: var(--ink-2);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.frames {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.6vw, 32px);
}

.thumb {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity .25s ease;
}

.thumb-name {
  display: block;
  width: fit-content;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: color .15s ease;
}

.thumb-box {
  display: block;
  aspect-ratio: 236 / 300;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--frame);
  box-shadow: var(--shadow);
  transition: transform .5s var(--spring);
}

.thumb-box svg { display: block; width: 100%; height: 100%; }

.thumb:active .thumb-box { transform: scale(.985); }

@media (hover: hover) {
  .thumb:hover .thumb-name { color: var(--accent-text); }
  .frames:has(.thumb:hover) .thumb:not(:hover) { opacity: .6; }
}

/* Frames. */
.stage {
  padding: 4px var(--gutter) 124px;
}

.frame {
  width: min(var(--w, 860px), 100%);
  margin-inline: auto;
}

.frame-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
}

.frame-name { display: block; width: fit-content; color: var(--accent-text); }

.frame-size {
  font: 400 11px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.frame-sheet {
  position: relative;
  isolation: isolate;
}

.frame-box {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius);
  background: var(--frame);
  box-shadow: var(--shadow);
}

.frame-body {
  padding: var(--pad);
  border-radius: var(--radius);
}

.page-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(var(--w, 860px), 100%);
  margin: 16px auto 0;
  font-size: 13px;
}

/* Type inside a frame. */
.title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.038em;
}

.lead {
  max-width: 54ch;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

.section { margin-top: clamp(36px, 5vw, 56px); scroll-margin-top: 24px; }

.eyebrow {
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.headline {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.022em;
  text-wrap: balance;
}

.meta {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.prose {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--ink);
  text-wrap: pretty;
}

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color .2s ease;
}
.text-link:hover { text-decoration-color: currentColor; }

/* A trace that runs edge to edge, broken only by the frame. */
.band {
  margin: clamp(32px, 5vw, 48px) calc(var(--pad) * -1) 0;
  padding: 18px 0;
  border-block: 1px solid var(--line);
  overflow: hidden;
}

/* Figures. */
.stats {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 16px 14px;
  background: var(--frame);
}

.stat-lead .stat-value {
  font-size: clamp(36px, 5.4vw, 54px);
  letter-spacing: -.05em;
}

.stat-value {
  display: block;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.stat-note {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font: 400 11.5px/1.5 var(--mono);
}

/* Rows. */
.rows { display: grid; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 24px;
  margin-inline: -12px;
  padding: 13px 12px;
  color: inherit;
  text-decoration: none;
  transition: opacity .2s ease;
}

.row::before {
  content: "";
  position: absolute;
  inset: 0 12px auto;
  height: 1px;
  background: var(--line);
}

.row-title { font-weight: 450; text-wrap: pretty; }

.row-sub {
  grid-column: 1;
  color: var(--ink-2);
  font-size: 13.5px;
}

.arrow {
  display: block;
  width: 12px;
  height: 12px;
  color: var(--ink-3);
  transition: transform .45s var(--spring), color .2s ease;
}

.row .arrow {
  grid-column: 2;
  grid-row: 1;
  margin-top: 6px;
}

a:hover > .arrow,
a:focus-visible > .arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

@media (hover: hover) {
  .rows:has(a.row:hover) > a.row:not(:hover) { opacity: .45; }
}

/* Projects: one frame cut into cells by hairlines. */
.cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: var(--pad) calc(var(--pad) * -1) calc(var(--pad) * -1);
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--line);
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: var(--pad);
  background: var(--frame);
}

.cell-art {
  aspect-ratio: 460 / 200;
  display: flex;
  align-items: center;
}

.cell-text { display: flex; flex-direction: column; flex: 1; }

.cell-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.015em;
}

.cell-title a {
  color: inherit;
  text-decoration: none;
}

.cell-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.cell-copy {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.cell-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 13px;
}

.cell-meta {
  color: var(--ink-2);
  font: 400 11.5px/1.6 var(--mono);
}

.chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.chip .arrow { width: 10px; height: 10px; }

/* The DrugnomeAI site is the way out of this cell, so it reads as the cell's own action. */
.chip-group {
  display: inline-flex;
  gap: 14px;
  margin-left: auto;
}

/* Empty frame. */
.empty {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  margin-top: 32px;
  padding: clamp(48px, 10vw, 80px) 24px;
  text-align: center;
}

.empty .art {
  position: absolute;
  inset: 0;
  height: 100%;
}

.empty rect { width: calc(100% - 1px); height: calc(100% - 1px); }

.empty-copy { color: var(--ink-2); font-size: 14px; }

/* CV: the same order and wording as the document, with role and dates on one line, employer and place on the next. */
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, box-shadow .2s ease;
}
.button:hover { background: var(--fill); box-shadow: inset 0 0 0 1px var(--ink-3); }
.button .arrow { width: 11px; height: 11px; color: currentColor; }
.button:hover > .arrow { color: currentColor; transform: translateY(1.5px); }

.cv-contact {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 14px;
}
.cv-contact i { margin-inline: 4px; color: var(--ink-3); font-style: normal; }

.cv-section { margin-top: clamp(28px, 4vw, 40px); }

.cv-section > h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.cv-summary {
  max-width: 72ch;
  margin-top: 12px;
  font-size: 14.5px;
  text-wrap: pretty;
}

.skills {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.skills dt { font-weight: 500; }
.skills dd { color: var(--ink-2); }

.job { margin-top: 16px; }

.job-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 20px;
  align-items: baseline;
}

.job-role {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.005em;
}

.job-when {
  color: var(--ink-2);
  font: 400 12px/1.6 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.job-when.side {
  font: 400 13.5px/1.5 var(--sans);
  white-space: normal;
}

.job-org { grid-column: 1; color: var(--ink-2); font-size: 13.5px; font-style: italic; }
.job-where { grid-column: 2; color: var(--ink-2); font-size: 13.5px; text-align: right; }

.points {
  display: grid;
  gap: 4px;
  max-width: 76ch;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.points li {
  position: relative;
  padding-left: 14px;
  text-wrap: pretty;
}

.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .68em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
}

.points strong { color: var(--ink); font-weight: 500; }
.points .points { margin-top: 4px; }
.points sup { font-size: .72em; line-height: 0; }

.refs-head {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.refs {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.refs li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
}

.refs strong { color: var(--ink); font-weight: 500; }

.ref-n {
  font: 400 12px/1.8 var(--mono);
  font-variant-numeric: tabular-nums;
}

/* The dock: Figma's toolbar, where the current page is the active tool. */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--dock);
  box-shadow: var(--shadow), 0 8px 24px -8px rgb(0 0 0 / .18);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  font-size: 13px;
  font-weight: 500;
  transform: translateX(-50%);
}

.dock a {
  position: relative;
  display: grid;
  place-items: center;
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}

.dock a:hover { background: var(--fill); color: var(--ink); }

.dock-home {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: -.02em;
}

.dock-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.dock-items {
  display: flex;
  gap: 2px;
}

.dock a[aria-current="page"],
.dock a[aria-current="page"]:hover {
  background: none;
  color: var(--on-accent);
}

.dock-pill {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: var(--accent-fill);
}

.dock-text { position: relative; }

/* Selection: one box that travels between whatever you point at. */
.sel-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: clip;
  pointer-events: none;
}

.sel {
  position: absolute;
  top: 0;
  left: 0;
  outline: 1px solid var(--accent);
  opacity: 0;
  transition:
    transform .5s var(--spring),
    width .5s var(--spring),
    height .5s var(--spring),
    opacity .14s ease;
}

.sel.on { opacity: 1; }

.sel i {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  background: var(--handle);
}
.sel i:nth-child(1) { left: -4px; top: -4px; }
.sel i:nth-child(2) { right: -4px; top: -4px; }
.sel i:nth-child(3) { left: -4px; bottom: -4px; }
.sel i:nth-child(4) { right: -4px; bottom: -4px; }

.sel b {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font: 500 10.5px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
}

html.js a[data-sel]:focus-visible,
html.js .cell-title a:focus-visible { outline: none; }

/* Line art, drawn only in hairlines and low-opacity ink. Colour arrives on selection. */
.art {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  overflow: visible;
}

.art .h { fill: currentColor; fill-opacity: .86; }
.art .b1 { fill: currentColor; fill-opacity: .1; }
.art .b2 { fill: currentColor; fill-opacity: .24; }
.art .l1 { fill: none; stroke: currentColor; stroke-opacity: .13; stroke-width: 1; vector-effect: non-scaling-stroke; }
.art .l2 { fill: none; stroke: currentColor; stroke-opacity: .36; stroke-width: 1; vector-effect: non-scaling-stroke; }
.art .as { fill: none; stroke: currentColor; stroke-opacity: .46; stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke .25s ease, stroke-opacity .25s ease; }
.art .af { fill: currentColor; fill-opacity: .46; transition: fill .25s ease, fill-opacity .25s ease; }
.art .ants { stroke-dasharray: 3 3; }

:is(.thumb, .cell, .band, .empty):is(:hover, :focus-visible, :focus-within) .art .as { stroke: var(--accent); stroke-opacity: 1; }
:is(.thumb, .cell, .band, .empty):is(:hover, :focus-visible, :focus-within) .art .af { fill: var(--accent); fill-opacity: 1; }

/* What each drawing does when selected. */
@keyframes reveal { from { clip-path: inset(-8% 100% -8% 0); } to { clip-path: inset(-8% -2% -8% 0); } }
@keyframes march { to { stroke-dashoffset: -12; } }
@keyframes settle { from { fill-opacity: .1; } }

:is(.thumb, .cell, .band):hover .reveal { animation: reveal .9s var(--out) both; }
:is(.thumb, .cell, .band, .empty):hover .ants { animation: march .8s linear infinite; }
:is(.thumb, .cell, .band):hover .hit { animation: settle .5s ease both; animation-delay: calc(var(--d, 0) * 70ms); }

/* Things arrive softly on first load. Everything is visible at rest without any script. */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.enter {
  animation: rise .75s var(--out) backwards;
  animation-delay: calc(var(--i, 0) * 60ms + 40ms);
}

/* The footer sits on the bottom edge of the page, so moving it would briefly add a scrollbar. */
.foot.enter { animation-name: appear; }

@keyframes appear { from { opacity: 0; } }

.vt .enter { animation: none; }

/* Moving between pages: the frame is one object that travels and resizes. */
@view-transition { navigation: auto; }

.frame-box { view-transition-name: frame; }
.frame-body { view-transition-name: frame-body; }
.frame-name { view-transition-name: frame-label; }
.intro h1, .bar-name { view-transition-name: name; }
.dock { view-transition-name: dock; }
.dock-items { view-transition-name: dock-items; }
.dock-pill { view-transition-name: dock-pill; }

::view-transition-group(*) {
  animation-duration: .62s;
  animation-timing-function: var(--spring);
}

::view-transition-old(root),
::view-transition-new(root) { animation-duration: .3s; }

::view-transition-group(frame) {
  z-index: 1;
  border-radius: var(--radius);
  background: var(--frame);
  box-shadow: var(--shadow);
}

::view-transition-image-pair(frame) { display: none; }

::view-transition-group(frame-body) {
  z-index: 2;
  overflow: clip;
  border-radius: var(--radius);
}

::view-transition-old(frame-body) { animation: vt-out .16s ease-out both; }
::view-transition-new(frame-body) { animation: vt-in .4s .1s ease-out both; }

::view-transition-group(frame-label),
::view-transition-group(name) { z-index: 3; }

::view-transition-group(dock) { z-index: 10; }
::view-transition-group(dock-pill) { z-index: 11; }
::view-transition-group(dock-items) { z-index: 12; }

::view-transition-new(dock):only-child,
::view-transition-new(dock-pill):only-child,
::view-transition-new(dock-items):only-child { animation: dock-in .55s var(--out) both; }

::view-transition-old(dock):only-child,
::view-transition-old(dock-pill):only-child,
::view-transition-old(dock-items):only-child { animation: dock-out .22s ease-in both; }

@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes dock-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes dock-out { to { opacity: 0; transform: translateY(14px); } }

/* Phones. */
@media (max-width: 760px) {
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-main { justify-content: flex-start; padding-top: 12px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-lead { grid-column: 1 / -1; }
  .stat { justify-content: flex-start; padding: 14px 12px 12px; }
  .job-head { grid-template-columns: minmax(0, 1fr); }
  .job-when, .job-where { grid-column: 1; text-align: left; }
  .skills { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .skills dd { margin-bottom: 8px; }
  .cells { grid-template-columns: minmax(0, 1fr); }
  .chip-group { margin-left: 0; flex-wrap: wrap; }
  .foot { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  .frame-size { display: none; }
}

@media (max-width: 400px) {
  .dock a { padding: 0 9px; }
}

/* Paper, for anyone who prints a page. The downloadable CV is the typeset PDF. */
@media print {
  @page { size: A4; margin: 15mm 16mm; }

  :root {
    --canvas: #fff;
    --frame: #fff;
    --ink: #10131a;
    --ink-2: #4c5563;
    --line: rgb(20 27 40 / .14);
    --accent-text: #10131a;
    color-scheme: light;
  }

  html, body { background: #fff; }
  body { min-height: 0; font-size: 10pt; line-height: 1.42; }
  body::before, body::after, .bar, .dock, .frame-label, .page-foot, .button, .skip, .sel-layer { display: none !important; }
  .stage { padding: 0; }
  .frame { width: 100%; }
  .frame-box { display: none; }
  .frame-body { padding: 0; }
  .enter { animation: none; }
  .job, .refs li { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
}

/* Stillness. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
