/* ==========================================================================
   moeinalmasi.com
   Hand-written CSS. No build step, no frameworks, no web fonts: the site
   uses the fonts already installed on the visitor's device.

   Contents
     1. Design tokens (light theme, dark theme, motion switches)
     2. Base
     3. Layout helpers
     4. Header and navigation
     5. Small components (buttons, pills, badges, icons)
     6. Hero and animated background
     7. Home page sections
     8. Footer
     9. Long-form pages (privacy notice, 404)
    10. Motion and page transitions
    11. User preferences and print
   ========================================================================== */

/* 1. Design tokens
   ========================================================================== */

:root {
  color-scheme: light;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.85vw, 1.875rem);
  --step-3: clamp(1.875rem, 1.5rem + 1.9vw, 2.75rem);
  --step-hero: clamp(3.25rem, 1.4rem + 9.2vw, 7rem);

  --container: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-h: 4rem;
  --radius-s: 0.75rem;
  --radius-m: 1.25rem;
  --radius-l: 1.75rem;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Brand gradient. Used for the logo, the portrait frame and accents. */
  --brand-a: #ff5c8a;
  --brand-b: #5b5bf7;

  /* Light theme */
  --bg: #fbfaf8;
  --glass: rgba(251, 250, 248, 0.97);
  --panel: rgba(255, 255, 255, 0.82);
  --surface: rgba(255, 255, 255, 0.7);
  --hover: rgba(18, 19, 26, 0.045);
  --border: rgba(18, 19, 26, 0.1);
  --border-strong: rgba(18, 19, 26, 0.2);
  --text: #12131a;
  --text-muted: #51566a;
  --text-subtle: #5f6477;
  --accent: #c81e55;
  --accent-2: #3a3fd4;
  --grad-a: #d6245f;
  --grad-b: #8a3fd8;
  --grad-c: #3a3fd4;
  --glow-1: rgba(255, 92, 138, 0.3);
  --glow-2: rgba(91, 91, 247, 0.22);
  --glow-3: rgba(255, 176, 92, 0.2);
  --fx-a: #e0356d;
  --fx-b: #4a4fe6;
  --fx-alpha: 0.75;
  --grain: 0.05;
  --award-fg: #855600;
  --award-bg: rgba(245, 180, 40, 0.16);
  --award-border: rgba(190, 130, 10, 0.4);
  --shadow: 0 1px 2px rgba(18, 19, 26, 0.04), 0 18px 44px -20px rgba(18, 19, 26, 0.2);
  --shadow-portrait: 0 30px 60px -24px rgba(200, 30, 85, 0.45), 0 12px 28px -14px rgba(18, 19, 26, 0.3);

  /* Motion switches. Every animation reads these, so one place turns
     movement off: the visitor's system setting or the pause button. */
  --motion-on: 1;
  --motion-play: running;
  --scroll: smooth;
  --scroll-fade: fade-away;
}

/* The dark values appear twice on purpose: once for visitors whose system
   prefers dark, once for visitors who picked dark with the theme switch.
   Keep the two blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08090d;
    --glass: rgba(8, 9, 13, 0.97);
    --panel: rgba(14, 15, 21, 0.78);
    --surface: rgba(255, 255, 255, 0.04);
    --hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f3f4f7;
    --text-muted: #adb1bd;
    --text-subtle: #8c91a0;
    --accent: #ff6b93;
    --accent-2: #9aa2ff;
    --grad-a: #ff6b93;
    --grad-b: #c08bff;
    --grad-c: #8b93ff;
    --glow-1: rgba(255, 92, 138, 0.24);
    --glow-2: rgba(91, 91, 247, 0.3);
    --glow-3: rgba(255, 150, 70, 0.1);
    --fx-a: #ff6b93;
    --fx-b: #7d84ff;
    --fx-alpha: 1;
    --grain: 0.07;
    --award-fg: #ffd27a;
    --award-bg: rgba(255, 200, 90, 0.12);
    --award-border: rgba(255, 200, 90, 0.34);
    --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    --shadow-portrait: 0 30px 70px -22px rgba(255, 92, 138, 0.5), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090d;
  --glass: rgba(8, 9, 13, 0.97);
  --panel: rgba(14, 15, 21, 0.78);
  --surface: rgba(255, 255, 255, 0.04);
  --hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f3f4f7;
  --text-muted: #adb1bd;
  --text-subtle: #8c91a0;
  --accent: #ff6b93;
  --accent-2: #9aa2ff;
  --grad-a: #ff6b93;
  --grad-b: #c08bff;
  --grad-c: #8b93ff;
  --glow-1: rgba(255, 92, 138, 0.24);
  --glow-2: rgba(91, 91, 247, 0.3);
  --glow-3: rgba(255, 150, 70, 0.1);
  --fx-a: #ff6b93;
  --fx-b: #7d84ff;
  --fx-alpha: 1;
  --grain: 0.07;
  --award-fg: #ffd27a;
  --award-bg: rgba(255, 200, 90, 0.12);
  --award-border: rgba(255, 200, 90, 0.34);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --shadow-portrait: 0 30px 70px -22px rgba(255, 92, 138, 0.5), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-on: 0;
    --motion-play: paused;
    --scroll: auto;
    --scroll-fade: none;
  }
}

:root[data-motion="on"] {
  --motion-on: 1;
  --motion-play: running;
  --scroll: smooth;
  --scroll-fade: fade-away;
}

:root[data-motion="off"] {
  --motion-on: 0;
  --motion-play: paused;
  --scroll: auto;
  --scroll-fade: none;
}

/* 2. Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: var(--scroll);
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0) / 1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
blockquote,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  text-wrap: balance;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

img,
picture,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

cite {
  font-style: italic;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 3. Layout helpers
   ========================================================================== */

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

/* 4. Header and navigation
   ========================================================================== */

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-250%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  transition: background-color 0.3s, border-color 0.3s;
}

/* With JavaScript the header is see-through until the page scrolls. */
.js .site-header:not(.is-scrolled):not(.is-open) {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 0.75rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

/* On the narrowest phones the logo alone stands in for the name. */
@media (max-width: 22.4375em) {
  .brand__name {
    display: none;
  }
}

.brand__mark {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  transition: transform 0.4s var(--ease-out);
}

.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  background: var(--hover);
  color: var(--text);
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  border-color: var(--border);
  background: var(--hover);
  color: var(--text);
}

/* Each toggle shows the icon for what the button will do next. */
.icon-btn .icon--on,
.icon-btn[aria-pressed="true"] .icon--off {
  display: none;
}

.icon-btn[aria-pressed="true"] .icon--on {
  display: block;
}

.site-header__menu[aria-expanded="true"] .icon--off {
  display: none;
}

.site-header__menu[aria-expanded="true"] .icon--on {
  display: block;
}

@media (min-width: 60em) {
  .site-header__menu {
    display: none;
  }
}

@media (max-width: 59.9375em) {
  .site-header__menu {
    order: 3;
  }

  .site-header__tools {
    order: 2;
  }

  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100svh - var(--header-h));
    padding: 0.5rem var(--gutter) 1.25rem;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 30px 40px -30px rgba(0, 0, 0, 0.35);
  }

  .js .site-nav {
    display: none;
  }

  .js .site-nav[data-open] {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li + li {
    border-top: 1px solid var(--border);
  }

  .site-nav a {
    padding: 0.9375rem 0.25rem;
    border-radius: 0.5rem;
    font-size: 1.0625rem;
  }

  .site-nav a:hover,
  .site-nav a[aria-current] {
    background: transparent;
  }

  /* Without JavaScript there is no menu button: show the links as a strip
     that scrolls sideways inside the header instead. */
  html:not(.js) .site-nav {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    max-height: none;
    padding: 0;
    overflow-x: auto;
    border: 0;
    background: none;
    box-shadow: none;
  }

  html:not(.js) .site-nav__list {
    flex-direction: row;
  }

  html:not(.js) .site-nav li + li {
    border: 0;
  }

  html:not(.js) .site-nav a {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }

  html:not(.js) .brand__name {
    display: none;
  }
}

/* 5. Small components
   ========================================================================== */

.icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background-color 0.2s, border-color 0.2s;
}

.btn .icon {
  transition: transform 0.25s var(--ease-out);
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 12px 30px -14px var(--glow-1);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -14px var(--brand-a);
}

.btn--primary:hover .icon {
  transform: translateX(3px);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn--ghost:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.btn--ghost:hover .icon {
  transform: translateY(3px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.375rem 0.8125rem 0.375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: 500 0.8125rem / 1.3 var(--font-mono);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pill .icon {
  width: 0.9375rem;
  height: 0.9375rem;
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem 0.25rem 0.5rem;
  border: 1px solid var(--award-border);
  border-radius: 999px;
  background: var(--award-bg);
  color: var(--award-fg);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.badge .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding-block: 0.375rem;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.arrow-link .icon {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.25s var(--ease-out);
}

.arrow-link:hover {
  color: var(--text);
}

.arrow-link:hover .icon {
  transform: translate(2px, -2px);
}

/* 6. Hero and animated background
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow: hidden;
  overflow: clip;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: 28s ease-in-out infinite alternate;
  animation-play-state: var(--motion-play);
}

.aurora__blob--1 {
  top: -34vmax;
  right: -20vmax;
  width: 76vmax;
  height: 76vmax;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
  animation-name: drift-a;
}

.aurora__blob--2 {
  bottom: -38vmax;
  left: -26vmax;
  width: 72vmax;
  height: 72vmax;
  background: radial-gradient(closest-side, var(--glow-2), transparent);
  animation-name: drift-b;
  animation-duration: 34s;
}

.aurora__blob--3 {
  top: 34%;
  left: 42%;
  width: 34vmax;
  height: 34vmax;
  background: radial-gradient(closest-side, var(--glow-3), transparent);
  animation-name: drift-c;
  animation-duration: 40s;
}

.hero__canvas {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: min(50%, 30rem);
  opacity: var(--fx-alpha);
  -webkit-mask-image: linear-gradient(to bottom, transparent 2%, #000 42%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 2%, #000 42%, #000 86%, transparent 100%);
}

/* Static stand-in for the animated field when JavaScript is unavailable. */
html:not(.js) .hero__canvas {
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 1.5px);
  background-size: 1.75rem 1.75rem;
}

/* Where the layout is a single column the field sits behind text, so it is
   kept quieter. */
@media (max-width: 59.9375em) {
  .hero__canvas {
    opacity: calc(var(--fx-alpha) * 0.7);
  }
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  z-index: -1;
  height: 7rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.hero__inner {
  flex: 1;
  display: grid;
  align-items: center;
  gap: clamp(1.75rem, 5vw, 4rem);
  padding-block: clamp(2rem, 6vh, 4.5rem) clamp(1.5rem, 4vh, 3rem);
}

.hero__copy > * {
  animation: rise calc(0.9s * var(--motion-on)) var(--ease-out) both;
}

.hero__copy > :nth-child(2) {
  animation-delay: calc(70ms * var(--motion-on));
}

.hero__copy > :nth-child(3) {
  animation-delay: calc(140ms * var(--motion-on));
}

.hero__copy > :nth-child(4) {
  animation-delay: calc(210ms * var(--motion-on));
}

.hero__copy > :nth-child(5) {
  animation-delay: calc(280ms * var(--motion-on));
}

.hero__copy > :nth-child(6) {
  animation-delay: calc(350ms * var(--motion-on));
}

.hero__title {
  margin-top: 1.25rem;
  font-size: var(--step-hero);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 0.96;
}

.hero__title-accent {
  padding-right: 0.06em;
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 55%, var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero__role {
  margin-top: 1.375rem;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.22;
}

.hero__role-org {
  color: var(--text-muted);
  font-weight: 450;
  white-space: nowrap;
}

.hero__lead {
  max-width: 37rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.55;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

/* The portrait. The head rises out of the top of its frame: the photo is
   clipped to the frame, and a second image that holds only the head, cut
   out from the backdrop, sits exactly on top of it and is not clipped.

     --plate  the side of the frame
     --pop    how much wider than the frame the photo is drawn; the extra
              height is what rises above the frame
     --air    the empty strip above the head in the photo, as a share of
              the photo's height (trimmed so that the head starts at the
              top of the box) */
.portrait {
  --plate: clamp(11rem, 50vw, 15rem);
  --pop: 1.4;
  --air: 0.04;
  --photo: calc(var(--plate) * var(--pop));
  --rise: calc(var(--photo) - var(--plate));
  --trim: calc(var(--photo) * var(--air));
  --edge: 3px;
  --round: calc(var(--plate) * 0.27);
  position: relative;
  order: -1;
  width: var(--plate);
  animation: rise calc(1s * var(--motion-on)) var(--ease-out) both;
}

.portrait__stage {
  position: relative;
  isolation: isolate;
  height: calc(var(--photo) - var(--trim));
}

.portrait__stage::before {
  content: "";
  position: absolute;
  inset: calc(var(--rise) - var(--trim) - 24%) -30% -26%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
}

.portrait__plate {
  position: absolute;
  inset: calc(var(--rise) - var(--trim)) 0 0;
  border-radius: var(--round);
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: var(--shadow-portrait);
}

.portrait__photo,
.portrait__head {
  position: absolute;
  top: calc(var(--trim) * -1);
  max-width: none;
}

.portrait__photo {
  left: calc(var(--rise) / -2);
  width: var(--photo);
  background: #b9415f;
  clip-path: inset(calc(var(--rise) + var(--edge)) calc(var(--rise) / 2 + var(--edge)) var(--edge) round calc(var(--round) - var(--edge)));
}

/* The middle half of the photo's width. Keep in step with the crop in
   tools/make-portrait.sh. */
.portrait__head {
  left: calc(var(--rise) / -2 + var(--photo) * 0.25);
  width: calc(var(--photo) * 0.5);
}

/* The portrait fades out as the hero scrolls away. The browser drives this
   from the scroll position, so it costs no script and no layout work. It is
   switched off with the rest of the motion (see the tokens at the top). */
@supports (animation-timeline: view()) {
  .hero {
    view-timeline: --hero block;
  }

  .portrait__stage {
    animation: var(--scroll-fade) linear both;
    animation-timeline: --hero;
    animation-range: exit 0% exit 72%;
    will-change: opacity;
  }
}

@media (min-width: 60em) {
  /* Extra room below the content: the dot field is the floor that the text
     and the portrait stand on. */
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: clamp(3rem, 13vh, 8.5rem);
  }

  .portrait {
    --plate: min(clamp(18rem, 11rem + 13vw, 24rem), (100vh - 11rem) / var(--pop));
    order: 0;
    margin-right: clamp(0rem, 2vw, 2rem);
    animation-delay: calc(200ms * var(--motion-on));
  }
}

/* 7. Home page sections
   ========================================================================== */

.section {
  position: relative;
}

.section__inner {
  display: grid;
  gap: 2rem;
  padding-block: clamp(4rem, 9vw, 7.5rem);
  border-top: 1px solid var(--border);
}

.section__index {
  color: var(--accent);
  font: 500 0.8125rem / 1 var(--font-mono);
  letter-spacing: 0.08em;
}

.section__title {
  margin-top: 0.875rem;
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.08;
}

.section__intro {
  max-width: 40rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.55;
}

@media (min-width: 60em) {
  .section__inner {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 3rem;
  }

  .section__head {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

/* About */

.about__lead {
  max-width: 44rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 550;
  letter-spacing: -0.022em;
  line-height: 1.32;
  text-wrap: pretty;
}

.about__text {
  max-width: 40rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.6;
  text-wrap: pretty;
}

.quote {
  position: relative;
  max-width: 44rem;
  margin-top: 3rem;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.25rem) clamp(3.75rem, 9vw, 5.5rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quote::before {
  content: "\201C";
  position: absolute;
  top: clamp(0.25rem, 1vw, 0.75rem);
  left: clamp(1.125rem, 3vw, 1.75rem);
  background: linear-gradient(135deg, var(--grad-a), var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font: 700 clamp(4rem, 9vw, 5.5rem) / 1 var(--font-serif);
}

.quote p {
  font: italic 400 var(--step-2) / 1.3 var(--font-serif);
  letter-spacing: -0.01em;
}

/* Core philosophies. This section uses the full width: a heading on top,
   a lead card, ten numbered principles and a closing card. */

.section--wide .section__inner {
  display: block;
}

.section--wide .section__head {
  position: static;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section--wide .section__intro {
  margin-top: 1rem;
}

.section__kicker {
  color: var(--text-subtle);
  text-transform: uppercase;
}

.section__kicker::before {
  content: "/";
  margin-inline: 0.75rem;
  color: var(--border-strong);
}

.creed {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 2rem;
  padding: clamp(1.5rem, 4.5vw, 3.25rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.creed::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 130% at 0% 0%, var(--glow-1), transparent 62%),
    radial-gradient(70% 130% at 100% 100%, var(--glow-2), transparent 62%);
}

.creed--base::before {
  background:
    radial-gradient(70% 130% at 100% 0%, var(--glow-2), transparent 62%),
    radial-gradient(60% 130% at 0% 100%, var(--glow-1), transparent 62%);
}

.tag {
  display: inline-block;
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font: 600 0.75rem / 1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.creed__title {
  margin-top: 1rem;
  font-size: clamp(2.125rem, 1.5rem + 2.8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.creed__text {
  max-width: 36rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.6;
  text-wrap: pretty;
}

.creed__label {
  color: var(--text-subtle);
  font: 500 0.8125rem / 1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.tags li {
  padding: 0.4375rem 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.principles {
  display: grid;
  gap: 1rem;
  margin-block: 1rem;
}

/* The number takes its colour from the position in the list, so the ten
   cards run from one end of the brand gradient to the other. */
.principle {
  --tint: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 0.25rem 1rem;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.3s;
}

.principle:hover {
  border-color: var(--border-strong);
}

@supports (color: color-mix(in oklab, red, blue)) {
  .principle {
    --tint: color-mix(in oklab, var(--accent-2) var(--mix, 0%), var(--accent));
  }

  .principle:nth-child(2) { --mix: 11%; }
  .principle:nth-child(3) { --mix: 22%; }
  .principle:nth-child(4) { --mix: 33%; }
  .principle:nth-child(5) { --mix: 44%; }
  .principle:nth-child(6) { --mix: 56%; }
  .principle:nth-child(7) { --mix: 67%; }
  .principle:nth-child(8) { --mix: 78%; }
  .principle:nth-child(9) { --mix: 89%; }
  .principle:nth-child(10) { --mix: 100%; }
}

.principle__num,
.priority__num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--tint, var(--accent));
  font: 600 0.8125rem / 1 var(--font-mono);
  letter-spacing: 0.04em;
}

.principle__num {
  grid-row: span 2;
}

.principle__title {
  align-self: center;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.25;
}

.principle__text {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.priority {
  display: grid;
  gap: 0.625rem;
}

.priority li,
.priority__base {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1.125rem;
  background: var(--bg);
}

.priority__num {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
}

.priority li:nth-child(2) .priority__num {
  --tint: var(--grad-b);
}

.priority li:nth-child(3) .priority__num {
  --tint: var(--accent-2);
}

.priority__title {
  display: block;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.priority__text {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.priority__base {
  display: block;
  margin-top: 0.625rem;
  padding-block: 0.875rem;
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  text-align: center;
}

.priority__base .priority__text {
  color: inherit;
  opacity: 0.78;
}

@media (min-width: 40em) {
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principle {
    display: block;
    padding: 1.5rem;
  }

  .principle__num {
    margin-bottom: 1.125rem;
  }

  .principle__text {
    margin-top: 0.5rem;
  }
}

@media (min-width: 52em) {
  .creed {
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

@media (min-width: 60em) {
  .principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .principle:nth-child(2),
  .principle:nth-child(10) {
    grid-column: span 2;
  }
}

/* Experience */

.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 0.3125rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--border-strong), var(--border) 70%, transparent);
}

.timeline__item {
  position: relative;
  display: grid;
  gap: 0.75rem 2rem;
  padding: 0 0 2.25rem 2.25rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 0;
  width: 0.6875rem;
  height: 0.6875rem;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
}

.timeline__item:first-child::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 0.3125rem var(--glow-1);
}

.timeline__org {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.018em;
  line-height: 1.3;
}

.timeline__org a {
  display: inline-block;
  padding-block: 0.0625rem;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease-out);
}

.timeline__org a:hover {
  background-size: 100% 1px;
}

.timeline__place {
  margin-top: 0.25rem;
  color: var(--text-subtle);
  font: 400 0.8125rem / 1.4 var(--font-mono);
}

.timeline__roles li {
  color: var(--text-muted);
  line-height: 1.5;
}

.timeline__roles li + li {
  margin-top: 0.25rem;
}

.timeline__roles li:first-child {
  color: var(--text);
  font-weight: 550;
}

@media (min-width: 42em) {
  .timeline__item {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .timeline__roles {
    padding-top: 0.1875rem;
  }
}

/* Publications */

.pubs {
  margin: 1.5rem -1.25rem 0;
}

.pub {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.375rem 1.5rem;
  padding: 1.375rem 1.25rem;
  border-radius: var(--radius-m);
  transition: background-color 0.25s;
}

.pub + .pub::before {
  content: "";
  position: absolute;
  top: 0;
  right: 1.25rem;
  left: 1.25rem;
  height: 1px;
  background: var(--border);
}

.pub:hover,
.pub:focus-within {
  background: var(--hover);
}

.pub__year {
  color: var(--text-subtle);
  font: 500 0.875rem / 1.5 var(--font-mono);
}

.pub__title {
  font-size: var(--step-1);
  font-weight: 620;
  letter-spacing: -0.016em;
  line-height: 1.32;
}

.pub__title a {
  text-decoration: none;
}

/* The whole row is one link target. */
.pub__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-m);
}

.pub__title a:focus-visible {
  outline: none;
}

.pub__title a:focus-visible::after {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.pub__authors {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pub__authors b {
  color: var(--text);
  font-weight: 600;
}

.pub__venue {
  margin-top: 0.25rem;
  color: var(--text-subtle);
  font-size: 0.875rem;
  line-height: 1.5;
}

.pub .badge {
  margin-top: 0.75rem;
}

.pub__cta {
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-self: start;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.3125rem 0.625rem 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font: 500 0.75rem / 1.3 var(--font-mono);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.pub__cta .icon {
  width: 0.8125rem;
  height: 0.8125rem;
  transition: transform 0.25s var(--ease-out);
}

.pub:hover .pub__cta,
.pub:focus-within .pub__cta {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.pub:hover .pub__cta .icon,
.pub:focus-within .pub__cta .icon {
  transform: translate(1px, -1px);
}

.pubs__more {
  margin-top: 1.5rem;
}

@media (min-width: 42em) {
  .pub {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
  }

  .pub__year {
    padding-top: 0.1875rem;
  }

  .pub__cta {
    margin-top: 0.125rem;
  }
}

/* Education and certifications */

.duo {
  display: grid;
  gap: 3rem;
}

@media (min-width: 42em) {
  .duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.duo__title {
  color: var(--text-subtle);
  font: 500 0.8125rem / 1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rows {
  margin-top: 1rem;
}

.rows li {
  padding-block: 1.125rem;
  border-top: 1px solid var(--border);
}

.rows li:last-child {
  border-bottom: 1px solid var(--border);
}

.rows__main {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.rows__sub {
  margin-top: 0.125rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.rows__sub .arrow-link {
  padding-block: 0.25rem;
}

/* Skills */

/* Two columns of cards, each card as tall as its content. Cards read down
   the first column and then down the second. */
.skills,
.skills__column {
  display: grid;
  align-content: start;
  gap: 1rem;
}

@media (min-width: 42em) {
  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.skill-card {
  position: relative;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.3s;
}

/* A soft light that follows the pointer (position set from site.js). */
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(22rem circle at var(--spot-x, 50%) var(--spot-y, 0%), var(--glow-1), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.spot:hover::after {
  opacity: 1;
}

.spot > * {
  position: relative;
  z-index: 1;
}

.skill-card:hover {
  border-color: var(--border-strong);
}

.skill-card__title {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chips li {
  padding: 0.3125rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* Contact */

.contact__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.25rem, 5vw, 4.5rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 130% at 100% 0%, var(--glow-1), transparent 62%),
    radial-gradient(70% 130% at 0% 100%, var(--glow-2), transparent 62%);
}

.contact .section__inner {
  display: block;
}

.contact__title {
  margin-top: 0.875rem;
  font-size: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.contact__text {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: var(--step-1);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 1.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 60em) {
  .contact__panel {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }

  .contact__links {
    flex-direction: column;
  }
}

/* The form. Without JavaScript it cannot run its human check, so a short
   note with another way to get in touch is shown in its place. */

.form {
  display: grid;
  gap: 1.125rem;
}

html:not(.js) .form,
.contact__form[data-state] .form {
  display: none;
}

.js .contact__nojs {
  display: none;
}

.contact__form[data-state="unsupported"] .contact__nojs {
  display: block;
}

.form__hint {
  color: var(--text-subtle);
  font-size: 0.875rem;
}

.form__pair {
  display: grid;
  gap: 1.125rem;
}

@media (min-width: 34em) {
  .form__pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  display: grid;
  gap: 0.4375rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.field__input {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.6875rem 0.9375rem;
  border: 1px solid var(--text-subtle);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea.field__input {
  min-height: 9.5rem;
  resize: vertical;
}

.field__input:hover {
  border-color: var(--text);
}

.field__input:focus-visible {
  outline-offset: 1px;
  border-color: var(--accent-2);
}

.field__input:user-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.form__check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg);
}

.form__check > .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.0625rem;
  color: var(--accent);
}

.form__check-title {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.form__check-text {
  margin-top: 0.3125rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.form__captcha {
  min-height: 78px;
  border-radius: 0.25rem;
}

.form__captcha:empty {
  display: none;
}

/* reCAPTCHA keeps its answer in a text box that it hides with an inline
   style. This site's security policy ignores inline styles, so the box is
   hidden here instead. */
.g-recaptcha-response {
  display: none;
}

.form__error,
.form__local {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.form__error {
  border: 1px solid var(--accent);
  background: var(--bg);
  font-weight: 550;
}

.form__error:empty {
  display: none;
}

.form__local {
  border: 1px dashed var(--text-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.form__fallback {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.form .btn {
  justify-self: start;
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

.form__done,
.contact__nojs {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--bg);
}

.form__done {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
}

.form__done .icon {
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

.form__done-title {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.form__done p,
.contact__nojs {
  color: var(--text-muted);
}

/* 8. Footer
   ========================================================================== */

.site-footer {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.25rem;
  border-top: 1px solid var(--border);
}

/* The short claim, and under it the small line that its asterisk points to. */
.site-footer__claim {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.site-footer__claim .icon {
  flex: none;
  align-self: center;
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.site-footer__more {
  margin-top: 0.125rem;
  color: var(--text-subtle);
  font-size: 0.75rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.site-footer__more a {
  transition: color 0.2s;
}

.site-footer__more a:hover {
  color: var(--text);
}

.site-footer__top .arrow-link:hover .icon {
  transform: translateY(-3px);
}

/* 9. Long-form pages
   ========================================================================== */

.page {
  position: relative;
  isolation: isolate;
  padding-block: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem)) clamp(4rem, 9vw, 7rem);
  overflow: hidden;
  overflow: clip;
}

.page__glow {
  position: absolute;
  top: -30vmax;
  right: -24vmax;
  z-index: -1;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
  pointer-events: none;
}

/* The reading column: the heading, the summary and the text share one width
   and sit in the middle of the page, above the footer that spans it. The
   text itself stays left-aligned. */
.page__column {
  max-width: 44rem;
  margin-inline: auto;
}

.page__eyebrow {
  color: var(--accent);
  font: 500 0.8125rem / 1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page__title {
  max-width: 46rem;
  margin-top: 1rem;
  font-size: clamp(2.5rem, 1.5rem + 4.6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.page__meta {
  margin-top: 1.25rem;
  color: var(--text-subtle);
  font: 400 0.8125rem / 1.4 var(--font-mono);
}

.callout {
  max-width: 46rem;
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.callout__title {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.callout ul {
  margin-top: 0.875rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

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

.callout li::marker {
  color: var(--accent);
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-top: 3rem;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.625rem);
  font-weight: 680;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.prose p,
.prose ul {
  margin-top: 1rem;
  color: var(--text-muted);
}

.prose ul {
  padding-left: 1.25rem;
}

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

.prose li::marker {
  color: var(--accent);
}

.prose strong,
.callout strong {
  color: var(--text);
  font-weight: 600;
}

.prose a,
.callout a {
  color: var(--text);
  font-weight: 500;
  text-decoration-color: var(--accent);
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.prose a:hover,
.callout a:hover {
  color: var(--accent);
}

.prose code {
  padding: 0.1em 0.375em;
  border: 1px solid var(--border);
  border-radius: 0.375em;
  background: var(--hover);
  color: var(--text);
  font: 0.875em var(--font-mono);
}

.prose__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.prose__status {
  margin: 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
}

.error {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  overflow: hidden;
  overflow: clip;
  text-align: center;
}

.error__code {
  padding-inline: 0.06em;
  background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 55%, var(--grad-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-display);
  font-size: clamp(6.5rem, 2rem + 26vw, 16rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.error__title {
  margin-top: 1.5rem;
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.error__text {
  max-width: 32rem;
  margin: 1rem auto 0;
  color: var(--text-muted);
  font-size: var(--step-1);
}

.error__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Keep the dot field clear of the centred message. */
.error .hero__canvas {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 2%, #000 42%, #000 86%, transparent 100%),
    radial-gradient(ellipse 38% 48% at 50% 60%, transparent 45%, #000 100%);
  mask-image:
    linear-gradient(to bottom, transparent 2%, #000 42%, #000 86%, transparent 100%),
    radial-gradient(ellipse 38% 48% at 50% 60%, transparent 45%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* 10. Motion and page transitions
   ========================================================================== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 1.25rem, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-away {
  to {
    opacity: 0;
  }
}

@keyframes drift-a {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(-9%, 10%, 0) scale(1.14);
  }
}

@keyframes drift-b {
  from {
    transform: translate3d(0, 0, 0) scale(1.05);
  }

  to {
    transform: translate3d(12%, -8%, 0) scale(0.92);
  }
}

@keyframes drift-c {
  from {
    transform: translate3d(-12%, 6%, 0) scale(0.9);
  }

  to {
    transform: translate3d(14%, -10%, 0) scale(1.2);
  }
}

/* Sections fade up as they scroll into view (class added by site.js). */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.5rem, 0);
  transition:
    opacity calc(0.8s * var(--motion-on)) var(--ease-out),
    transform calc(0.8s * var(--motion-on)) var(--ease-out),
    background-color 0.25s,
    border-color 0.3s;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Smooth cross-fade between the home page and the privacy notice. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: calc(0.28s * var(--motion-on));
}

/* Theme switch: the new theme grows out of the button as a circle. */
.is-theme-switching::view-transition-old(root) {
  animation: none;
}

.is-theme-switching::view-transition-new(root) {
  animation: theme-reveal 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0 at var(--switch-x, 100%) var(--switch-y, 0%));
  }

  to {
    clip-path: circle(var(--switch-r, 150vmax) at var(--switch-x, 100%) var(--switch-y, 0%));
  }
}

/* 11. User preferences and print
   ========================================================================== */

@media (prefers-contrast: more) {
  :root {
    --border: var(--border-strong);
    --text-muted: var(--text);
    --text-subtle: var(--text);
  }

  .hero__canvas,
  .hero__grain {
    display: none;
  }
}

@media (forced-colors: active) {
  .hero__title-accent,
  .error__code,
  .quote::before {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: currentColor;
  }

  .hero__bg,
  .page__glow {
    display: none;
  }

  .btn,
  .icon-btn {
    border: 1px solid ButtonText;
  }

  .timeline__item:first-child::before {
    background: Highlight;
  }
}

@media print {
  /* Dark ink on white paper, whichever theme is on screen. The values are
     marked important so that they also win over the dark theme above. */
  :root {
    color-scheme: light !important;
    --bg: #fff !important;
    --glass: #fff !important;
    --panel: transparent !important;
    --surface: transparent !important;
    --hover: transparent !important;
    --border: #bbb !important;
    --border-strong: #888 !important;
    --text: #000 !important;
    --text-muted: #222 !important;
    --text-subtle: #333 !important;
    --accent: #000 !important;
    --accent-2: #000 !important;
    --award-fg: #000 !important;
    --award-bg: transparent !important;
    --award-border: #888 !important;
    --shadow: none !important;
    --shadow-portrait: none !important;
  }

  .site-header,
  .hero__bg,
  .hero__actions,
  .skip-link,
  .site-footer__top,
  .page__glow,
  .portrait__stage::before,
  .pub__cta,
  .contact__form {
    display: none !important;
  }

  .js [data-reveal],
  .hero__copy > *,
  .portrait,
  .portrait__stage {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .hero {
    min-height: 0;
    padding-top: 0;
  }

  .hero__title-accent {
    color: #000;
    -webkit-text-fill-color: #000;
  }

  .section__inner {
    padding-block: 1.5rem;
  }

  .pub,
  .timeline__item,
  .skill-card,
  .creed,
  .principle {
    break-inside: avoid;
  }

  .pub__title a::after {
    position: static;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: 400;
    overflow-wrap: anywhere;
  }
}
