:root {
  --bg: #F3F4F6;
  --ink: #1B1E24;
  --muted: #5D636E;
  --accent: #6A35F2;
  --photo-dot: rgba(243, 244, 246, 0.1);
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --name-h: auto;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161B;
    --ink: #E9EAEE;
    --muted: #9AA0AB;
    --accent: #A98BFF;
    --photo-dot: rgba(20, 22, 27, 0.1);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page {
  position: relative;
  max-width: calc(1120px + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) var(--gutter) 72px;
}

.name {
  margin: 0;
  font-weight: 700;
  font-variant-caps: small-caps;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

/* With JS the name is drawn in dots; the text stays for screen readers. */
.js .name { height: var(--name-h); }
.js .name span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.about {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 2.5rem;
  margin-top: clamp(28px, 4vh, 44px);
}

.text { max-width: 32rem; }

.photo {
  position: relative;
  flex: none;
  width: 128px;
  height: 128px;
  border-radius: 20px;
  overflow: hidden;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Same grid as the canvas; dots.js sets the offsets. */
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--photo-dot) var(--dot-r, 1.2px), transparent calc(var(--dot-r, 1.2px) + 0.6px));
  background-size: var(--cell, 8px) var(--cell, 8px);
  background-position: var(--dot-x, 0) var(--dot-y, 0);
}

/* Set by dots.js when the text fits before the second word of the name. */
.about.aligned {
  display: grid;
  grid-template-columns: var(--col2) auto;
  justify-content: start;
  gap: 0;
}
.about.aligned .text { grid-column: 1; grid-row: 1; }
.about.aligned .photo { grid-column: 2; grid-row: 1; margin-top: 4px; }

.about.split {
  display: grid;
  grid-template-columns: 1fr auto;
  width: var(--name-w);
  gap: 40px;
}
.about.split .text { grid-column: 1; grid-row: 1; }
.about.split .photo { grid-column: 2; grid-row: 1; margin-top: 4px; }

@media (max-width: 640px) {
  .page { padding-top: 32px; }
  .about { flex-direction: column; gap: 1.25rem; margin-top: 28px; }
  .photo { width: 88px; height: 88px; border-radius: 16px; }
}

.lede {
  margin: 0;
  font-size: clamp(1.375rem, 1rem + 1.4vw, 1.875rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 500;
  text-wrap: balance;
}

.facts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.facts li + li { margin-top: 0.5rem; }

.facts li { text-wrap: pretty; }

@media (min-width: 900px) {
  .facts li { white-space: nowrap; }
}

/* Fixed breaks only fit between 375px and 640px. */
@media (max-width: 374px), (min-width: 641px) {
  .narrow { display: none; }
}

.where {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-weight: 500;
}

.old {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color 160ms ease;
}

.links a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
}

a:hover { color: var(--accent); }

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