/* Fonts are hosted with the site so pages load faster and nothing depends on Google Fonts. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque.a79fdb52d4.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400.7ced534207.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500.6e61834433.woff2") format("woff2");
}

/* Layout idea: one narrow left-aligned column, lots of air, the name is the only loud thing (it glitches). */
:root {
  --bg: #eef0f3;
  --ink: #14171c;
  --muted: #5d6570;
  --line: #cfd4db;
  --split-a: #00b3c7;
  --split-b: #f0325a;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016;
    --ink: #e9ecf1;
    --muted: #8b94a1;
    --line: #262c36;
    --split-a: #2de2f2;
    --split-b: #ff3d6e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1016;
  --ink: #e9ecf1;
  --muted: #8b94a1;
  --line: #262c36;
  --split-a: #2de2f2;
  --split-b: #ff3d6e;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100%;
  overflow-x: hidden;
}
main {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 7rem) 24px 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* load sequence */
.rise { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.rise:nth-child(1) { animation-delay: .05s; }
.rise:nth-child(2) { animation-delay: .15s; }
.rise:nth-child(3) { animation-delay: .25s; }
.rise:nth-child(4) { animation-delay: .35s; }
.rise:nth-child(5) { animation-delay: .45s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* avatar */
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--muted);
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, var(--line) 3px 4px);
}

/* the name, with glitch */
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch::before { color: var(--split-a); }
.glitch::after  { color: var(--split-b); }

/* Key words: only part of the word breaks up, and the area around it tears like a bad TV signal.
   Timing, position and size of every tear are random and set by the script at the bottom. */
.g { position: relative; }
.g::before,
.g::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--on, 0);
}
.g::before { color: var(--split-a); clip-path: var(--c1, none); transform: var(--t1, none); }
.g::after  { color: var(--split-b); clip-path: var(--c2, none); transform: var(--t2, none); }
.g .tv {
  position: absolute;
  inset: -.5em -1em;
  pointer-events: none;
  opacity: var(--on, 0);
  clip-path: var(--c3, none);
  transform: var(--t3, none);
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink) 30%, transparent) 0 1px, transparent 1px 3px),
    linear-gradient(90deg,
      color-mix(in srgb, var(--split-a) 50%, transparent) 0 34%,
      transparent 34% 48%,
      color-mix(in srgb, var(--split-b) 50%, transparent) 48% 86%,
      transparent 86%);
  background-position: 0 0, var(--bx, 0) 0;
}

/* bio */
.bio { display: flex; flex-direction: column; gap: .9rem; max-width: 30rem; }
.bio p { color: var(--muted); }
.bio strong { color: var(--ink); font-weight: 500; }
.hire { color: var(--ink); }
.recent { display: flex; flex-direction: column; gap: .4rem; }
.hire s { color: var(--muted); text-decoration-color: var(--split-b); text-decoration-thickness: 2px; }
.bio p:not(.hire) a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color .2s ease; }
.bio p:not(.hire) a:hover, .bio p:not(.hire) a:focus-visible { text-decoration-color: var(--split-a); }
.hire a { color: inherit; text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* links */
.links ul { list-style: none; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 0;
  color: var(--ink);
  text-decoration: none;
  transition: padding-left .25s ease;
}
.links a .label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.links a .where {
  font-size: .8rem;
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
  transition: color .25s ease;
}
.links a .arrow {
  display: inline-block;
  margin-left: .5rem;
  transition: transform .25s ease;
}
.links a:hover, .links a:focus-visible { padding-left: .6rem; }
.links a:hover .where, .links a:focus-visible .where { color: var(--ink); }
.links a:hover .arrow, .links a:focus-visible .arrow { transform: translate(calc(3px * var(--k, 1)), calc(-3px * var(--k, 1))); }
a:focus-visible { outline: 2px solid var(--split-a); outline-offset: 4px; }


/* photo */
img.avatar {
  display: block;
  object-fit: cover;
  background: var(--line);
  filter: grayscale(1) contrast(1.05);
  transition: filter .4s ease;
}
img.avatar:hover { filter: none; }
.home-life { display: flex; align-items: center; gap: 1rem; }
.home-life .pup { width: 76px; height: 76px; flex: none; }

/* the role line that sits under the name on the home page (outside the h1,
   so pull it back up to sit 1rem under the name despite main's 2.25rem gap) */
.h1-role {
  display: block;
  margin-top: -1.25rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .8rem;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* skip link, only shows when someone tabs to it */
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  padding: .4rem .8rem;
  background: var(--ink);
  color: var(--bg);
  font-size: .8rem;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* author note and further reading at the end of articles */
.byline { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.byline a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.more .row .name { font-size: 1.05rem; }

/* 404 */
.lost { display: flex; flex-direction: column; gap: 1rem; }
.lost a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* top bar on inner pages */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  font-size: .8rem;
}
.top a { color: var(--muted); text-decoration: none; }
.top a:hover, .top a:focus-visible, .top a[aria-current="page"] { color: var(--ink); }
.top a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--split-b); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.top .home { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.top .home img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.top .tabs { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }

.lede { color: var(--muted); max-width: 30rem; }
.lede a, .note a, footer a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }

h2 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.block { display: flex; flex-direction: column; gap: .9rem; }

/* rows shared by work, experience, writing */
.rows { list-style: none; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 0;
  color: var(--ink);
  text-decoration: none;
}
a.row { transition: padding-left .25s ease; }
a.row:hover, a.row:focus-visible { padding-left: .6rem; }
.row .head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .15rem 1rem;
}
.row .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.row .meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.row .meta .arrow { display: inline-block; margin-left: .5rem; transition: transform .25s ease; }
a.row:hover .arrow, a.row:focus-visible .arrow { transform: translate(3px, -3px); }
a.row:hover .meta, a.row:focus-visible .meta { color: var(--ink); }
.row .role { font-size: .85rem; color: var(--ink); }
.row p, .row li { color: var(--muted); }
.row ul { list-style: none; display: flex; flex-direction: column; gap: .3rem; margin-top: .25rem; }
.row ul li { padding-left: 1.1rem; position: relative; }
.row ul li::before { content: "/"; position: absolute; left: 0; color: var(--split-b); }
.row b { color: var(--ink); font-weight: 500; }
/* experience: one line per role, detail on click */
details.row > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: .35rem; }
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary:focus-visible { outline: 2px solid var(--split-a); outline-offset: 4px; }
.row .toggle::before { content: "+"; display: inline-block; margin-left: .5rem; color: var(--split-b); transition: transform .25s ease; }
details.row[open] .toggle::before { transform: rotate(45deg); }
details.row > summary:hover .meta { color: var(--ink); }
.row .first { color: var(--muted); }
.related { color: var(--muted); font-size: .85rem; }
.related a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.note { color: var(--muted); max-width: 30rem; }

/* articles */
h1.title { font-size: clamp(1.8rem, 7.5vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; }
.date { font-size: .8rem; color: var(--muted); }
.prose { display: flex; flex-direction: column; gap: 1rem; max-width: 32rem; }
.prose p, .prose li { color: var(--ink); }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; text-transform: none; color: var(--ink); margin-top: .6rem; }
.prose ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.prose ul li { padding-left: 1.1rem; position: relative; }
.prose ul li::before { content: "/"; position: absolute; left: 0; color: var(--split-b); }
.prose blockquote { border-left: 2px solid var(--split-b); padding-left: 1rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.3; }
.prose strong { font-weight: 500; text-decoration: underline; text-decoration-color: var(--split-a); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.back { font-size: .8rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover, .back a:focus-visible { color: var(--ink); }

footer { font-size: .8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
