/* ==================================================================
   Design tokens. Change colors or type here and the whole site follows.

   The look follows Apple's interface guidelines, translated for the web:
   the system font (San Francisco on Apple devices), quiet neutral
   surfaces, one accent blue for anything you can press, translucent
   "glass" for the floating header, and size-specific letter spacing.

   The admin dashboard (admin.css) reads the same variable names, so keep
   them when you change values.
   ================================================================== */
:root {
  /* Surfaces */
  --paper: #f5f5f7;          /* page background */
  --paper-raised: #ffffff;   /* cards and inputs */
  --panel: #ebebf0;          /* fills: chips, segmented track, code */
  --grid: #e3e3e8;
  --glass: rgba(245, 245, 247, 0.72);
  --glass-heavy: rgba(250, 250, 252, 0.94);
  --scrim: rgba(0, 0, 0, 0.18);

  /* Text */
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;

  /* Lines */
  --rule: #d2d2d7;
  --hairline: rgba(60, 60, 67, 0.16);

  /* Accent: one color for everything you can press */
  --pen: #0071e3;
  --pen-hover: #0077ed;
  --pen-ink: #ffffff;
  --pen-tint: rgba(0, 113, 227, 0.1);

  --hl: #0071e3;             /* admin tab underline, quote bars */
  --star: #ff9f0a;           /* featured achievements */
  --danger: #d70015;
  --ok: #248a3d;

  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-float: 0 8px 40px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Type: the platform's own fonts first. ui-serif is New York on Apple
     devices and is used only for long reading (blog posts). */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: ui-serif, "New York", "Iowan Old Style", "Charter", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --wrap: 1080px;
  --gutter: clamp(20px, 5vw, 44px);
  --header-h: 52px;
  --radius: 12px;            /* inputs, small surfaces */
  --radius-card: 20px;       /* cards */
  --radius-pill: 980px;

  color-scheme: light;
}

/* Light is the default. Dark applies only when the visitor picks it with
   the switch in the header (saved in their browser as "theme"). */
:root[data-theme="dark"] {
  --paper: #000000;
  --paper-raised: #1c1c1e;
  --panel: #2c2c2e;
  --grid: #232325;
  --glass: rgba(22, 22, 23, 0.72);
  --glass-heavy: rgba(30, 30, 32, 0.94);
  --scrim: rgba(0, 0, 0, 0.5);
  --ink: #f5f5f7;
  --ink-soft: #a1a1a6;
  --ink-faint: #86868b;
  --rule: #424245;
  --hairline: rgba(84, 84, 88, 0.6);
  --pen: #2997ff;
  --pen-hover: #47a6ff;
  --pen-ink: #ffffff;
  --pen-tint: rgba(41, 151, 255, 0.16);
  --hl: #2997ff;
  --star: #ffb340;
  --danger: #ff453a;
  --ok: #30d158;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 48px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* =============================================================== base */
[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;      /* 17px, the iOS body size */
  line-height: 1.47;
  letter-spacing: -0.012em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--pen);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pen) 60%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: color-mix(in srgb, var(--pen) 24%, transparent);
}

/* Headings: tracking tightens and leading closes as size grows. */
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
}
h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.028em;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: -0.014em;
}
p {
  margin: 0 0 1em;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.reading {
  font-size: 1.1875rem;
  line-height: 1.5;
}
.muted {
  color: var(--ink-soft);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Featured titles keep the .hl span from the scripts; the card around
   them carries the emphasis now (see .achievement.featured). */
.hl {
  background: none;
}

/* Anything that responds to touch shrinks a touch on press, instantly,
   and settles back on release. */
.btn,
.chip,
.pressable,
.seg-btn,
.cal-day,
.menu-btn,
.row-link {
  transition: transform 160ms cubic-bezier(0.25, 1, 0.5, 1), background-color 160ms ease,
    color 160ms ease, box-shadow 200ms ease, opacity 160ms ease;
}
.btn:active,
.chip:active,
.pressable:active,
.menu-btn:active {
  transform: scale(0.96);
  transition-duration: 60ms;
}

/* ============================================================ header */
/* A translucent bar that floats over the page. The hairline under it
   appears only once content scrolls underneath. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hairline);
  opacity: 0;
  transition: opacity 240ms ease;
}
.is-scrolled .site-header::after {
  opacity: 1;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}
.brand {
  margin-right: auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand:hover {
  text-decoration: none;
}
.site-nav ul {
  position: relative;
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* The soft pill that glides between links as the pointer moves. */
.nav-glide {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  will-change: transform, width;
}
.nav-glide.is-on {
  opacity: 1;
}
.site-nav li {
  position: relative;
}
.site-nav a {
  display: inline-block;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  text-decoration: none;
  transition: color 160ms ease;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--pen);
}

/* The Admin link, shown only when you're signed in. A hairline sets it
   apart from the public pages. */
.site-nav .nav-admin {
  margin-left: 9px;
  padding-left: 9px;
}
.site-nav .nav-admin::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--hairline);
}
.menu-sheet .nav-admin {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}
.nav-admin.is-new {
  animation: admin-in 360ms ease both;
}
@keyframes admin-in {
  from {
    opacity: 0;
  }
}

/* Light / dark switch. The sun and moon trade places with a turn. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.theme-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.25, 1, 0.5, 1), background-color 160ms ease,
    color 160ms ease;
}
@media (hover: hover) {
  .theme-btn:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 7%, transparent);
  }
}
.theme-btn:active {
  transform: scale(0.9);
  transition-duration: 60ms;
}
.theme-btn svg {
  position: absolute;
  transition: transform 420ms cubic-bezier(0.34, 1.3, 0.5, 1), opacity 220ms ease;
}
.theme-btn .moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
:root[data-theme="dark"] .theme-btn .sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
:root[data-theme="dark"] .theme-btn .moon {
  opacity: 1;
  transform: none;
}
/* Switching themes eases the colors across instead of flashing. */
.theme-changing,
.theme-changing *,
.theme-changing *::before,
.theme-changing *::after {
  transition: background-color 360ms ease, color 360ms ease, border-color 360ms ease,
    box-shadow 360ms ease, fill 360ms ease !important;
}

.theme-changing .theme-btn svg {
  transition: transform 420ms cubic-bezier(0.34, 1.3, 0.5, 1), opacity 220ms ease !important;
}

/* Compact header: a Menu button opens a glass sheet anchored to it. */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.menu-btn svg {
  display: block;
}
.menu-btn .bar {
  transform-origin: 50% 50%;
  transition: transform 320ms cubic-bezier(0.25, 1, 0.5, 1);
}
.menu-btn[aria-expanded="true"] .bar-top {
  transform: translateY(3px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] .bar-bottom {
  transform: translateY(-3px) rotate(-45deg);
}
.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: var(--scrim);
  opacity: 0;
}
.menu-sheet {
  position: fixed;
  z-index: 49;
  top: calc(var(--header-h) + 8px);
  left: 12px;
  right: 12px;
  padding: 10px;
  border-radius: 24px;
  background: var(--glass-heavy);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-float);
  transform-origin: calc(100% - 20px) -8px;
  touch-action: none;
}
.menu-sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu-sheet a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.menu-sheet a:active {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.menu-sheet a[aria-current="page"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pen);
}
.menu-grabber {
  width: 36px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}

@media (max-width: 720px) {
  .site-nav {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
}
@media (min-width: 721px) {
  .menu-sheet,
  .menu-scrim {
    display: none !important;
  }
}

/* ============================================================ footer */
.site-footer {
  margin-top: clamp(80px, 12vw, 128px);
  padding: 22px 0 36px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0;
  border-top: 1px solid var(--hairline);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  flex-wrap: wrap;
}
.site-footer ul {
  display: flex;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.site-footer a:hover {
  color: var(--ink);
}

/* =========================================================== buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--pen);
  color: var(--pen-ink);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.btn:hover {
  background: var(--pen-hover);
  text-decoration: none;
}
.btn-quiet {
  background: var(--pen-tint);
  color: var(--pen);
}
.btn-quiet:hover {
  background: color-mix(in srgb, var(--pen) 16%, transparent);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: progress;
  transform: none;
}
.btn-small {
  min-height: 32px;
  padding: 0 14px;
  font-size: 0.875rem;
  letter-spacing: -0.006em;
}
.btn-icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
}
.btn-icon svg {
  display: block;
}

/* A text link with a chevron, Apple's "Learn more ›" */
.more-link,
.chev-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 400;
  color: var(--pen);
}
.more-link::after,
.chev-link::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  transition: transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
}
.more-link:hover::after,
.chev-link:hover::after {
  transform: translateX(2px) rotate(45deg);
}

/* ======================================================= page header */
.page-head {
  padding: clamp(48px, 9vw, 96px) 0 clamp(28px, 4vw, 44px);
}
.page-head p {
  max-width: 42ch;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.1875rem, 2.2vw, 1.375rem);
  line-height: 1.38;
  letter-spacing: -0.016em;
}
.page-head .btn {
  margin-top: 8px;
}

/* ============================================================== cards */
.card {
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* ================================================================ home */
.hero {
  position: relative;
  padding: clamp(64px, 13vw, 148px) 0 clamp(40px, 7vw, 80px);
  text-align: center;
  isolation: isolate;
}
/* A faint wash of the accent behind the name, nothing more. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: calc(-1 * var(--header-h) - 120px);
  width: min(1100px, 100%);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--pen) 12%, transparent),
    transparent
  );
  pointer-events: none;
}
.hero-name {
  margin: 0 auto;
  max-width: 14ch;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero-headline {
  margin: 18px auto 0;
  max-width: 30ch;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(1.3125rem, 2.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero-bio {
  margin: 22px auto 0;
  max-width: 54ch;
  color: var(--ink);
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.52;
  letter-spacing: -0.014em;
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.section {
  margin-top: clamp(56px, 8vw, 96px);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.section-head p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  letter-spacing: -0.008em;
}

/* Segmented control for the achievement filters. The white thumb glides
   to the chosen segment on a spring and can be redirected mid-flight. */
.filters {
  max-width: 100%;
}
.filters:empty {
  display: none;
}
.seg {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  border-radius: 10px;
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 0;
  border-radius: 8px;
  background: var(--paper-raised);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  will-change: transform, width;
}
:root[data-theme="dark"] .seg-thumb {
  background: #636366;
}
.chip {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.004em;
  white-space: nowrap;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  font-weight: 600;
}
.chip:active {
  transform: scale(0.95);
}

/* Achievement timeline: a sticky year beside a stack of cards. */
.year-group {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0 28px;
  padding: 0 0 36px;
}
.year-label {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.year-label > span {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: block;
  padding-top: 22px;
}
.year-items {
  display: grid;
  gap: 14px;
}
.achievement {
  position: relative;
  padding: clamp(20px, 3vw, 28px);
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 300ms ease, transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
}
@media (hover: hover) {
  .achievement:hover {
    box-shadow: var(--shadow-lift);
  }
}
.achievement h3 {
  max-width: 40ch;
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.achievement .meta {
  display: flex;
  gap: 8px 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  letter-spacing: -0.006em;
}
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
}
.achievement p {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.achievement .link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  font-size: 0.9375rem;
}
.achievement .link::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* Featured: a warm star and a soft ring, so the proudest work stands out
   without shouting. */
.achievement.featured {
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--star) 55%, transparent), var(--shadow-card);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--star) 9%, transparent),
      transparent 55%
    ),
    var(--paper-raised);
}
@media (hover: hover) {
  .achievement.featured:hover {
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--star) 70%, transparent), var(--shadow-lift);
  }
}
.achievement.featured h3::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.35em;
  vertical-align: -0.04em;
  background: var(--star);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#ach-note::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.35em;
  vertical-align: -0.08em;
  background: var(--star);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 720px) {
  .year-group {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 28px;
  }
  .year-label {
    font-size: 1.75rem;
  }
  .year-label > span {
    padding-top: 0;
    position: static;
  }
}

/* Two grouped lists side by side: Recent posts and Coming up. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}
.split .section-head {
  margin-bottom: 14px;
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.plain-list li {
  position: relative;
  padding: 14px 44px 14px 20px;
}
/* Inset hairline separators, like an iOS grouped list. */
.plain-list li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 0;
  height: 1px;
  background: var(--hairline);
}
.plain-list li:has(a.title)::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-top: 2px solid var(--ink-faint);
  border-right: 2px solid var(--ink-faint);
  transform: rotate(45deg);
  opacity: 0.7;
  pointer-events: none;
}
.plain-list li:has(a.title):active {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.plain-list .title {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.014em;
  text-decoration: none;
}
/* The whole row is the link target. */
.plain-list a.title::before {
  content: "";
  position: absolute;
  inset: 0;
}
.plain-list a.title:hover {
  text-decoration: none;
}
@media (hover: hover) {
  .plain-list li:has(a.title):hover {
    background: color-mix(in srgb, var(--ink) 3%, transparent);
  }
}
.plain-list .sub {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  letter-spacing: -0.006em;
}
.plain-list .empty,
.plain-list .notice {
  padding: 18px 20px;
}
.more-link {
  margin: 14px 0 0 4px;
  font-size: 1rem;
}

.empty,
.notice {
  padding: 24px 0;
  color: var(--ink-soft);
}
.notice.error {
  color: var(--danger);
}

/* ============================================================ calendar */
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .cal-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.cal-card {
  padding: clamp(14px, 2.4vw, 24px);
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 14px;
}
.cal-toolbar h2 {
  min-width: 0;
  font-size: clamp(1.25rem, 4.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-toolbar .controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-hint {
  margin: 12px 4px 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-align: center;
}
@media (hover: hover) and (pointer: fine) {
  .cal-hint {
    display: none;
  }
}

/* The month strip: previous, current and next month sit side by side
   and the whole strip follows your finger. */
.cal-viewport {
  overflow: hidden;
  touch-action: pan-y;
  transition: height 320ms cubic-bezier(0.25, 1, 0.5, 1);
}
.cal-strip {
  display: flex;
  align-items: flex-start;
  width: 300%;
  will-change: transform;
}
.cal-strip.is-dragging {
  cursor: grabbing;
}
.cal-strip.is-dragging .cal-day {
  pointer-events: none;
}
.cal-grid {
  flex: 0 0 33.3333%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px 2px;
  min-width: 0;
}
.cal-dow {
  padding: 4px 0 8px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
}
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 96px;
  padding: 6px 3px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
@media (hover: hover) {
  .cal-day:hover {
    background: color-mix(in srgb, var(--ink) 4%, transparent);
  }
}
.cal-day:active {
  transform: scale(0.94);
  transition-duration: 60ms;
}
.cal-day.outside {
  color: var(--ink-faint);
  opacity: 0.5;
}
.cal-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: background-color 200ms ease, color 200ms ease, transform 300ms cubic-bezier(0.34, 1.4, 0.5, 1);
}
.cal-day.today .cal-num {
  color: var(--pen);
  font-weight: 700;
}
.cal-day[aria-pressed="true"] .cal-num {
  background: var(--ink);
  color: var(--paper-raised);
  font-weight: 600;
}
.cal-day.today[aria-pressed="true"] .cal-num {
  background: var(--pen);
  color: var(--pen-ink);
}
.cal-chip {
  display: block;
  width: 100%;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--pen-tint);
  color: var(--pen);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-dot {
  display: none;
}
@media (max-width: 640px) {
  .cal-day {
    min-height: 52px;
    padding: 4px 0 6px;
    gap: 3px;
  }
  .cal-num {
    width: 34px;
    height: 34px;
    font-size: 1.0625rem;
  }
  .cal-chip {
    display: none;
  }
  .cal-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink-faint);
  }
}

.cal-side {
  padding: 20px 20px 8px;
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.cal-side h3 {
  padding-bottom: 6px;
  font-size: 1.0625rem;
  letter-spacing: -0.014em;
}
.cal-side + .cal-side {
  margin-top: 16px;
}
.cal-side .empty {
  padding: 8px 0 14px;
  font-size: 0.9375rem;
}
.event-item {
  position: relative;
  padding: 12px 0 12px 14px;
  border-top: 1px solid var(--hairline);
}
.event-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 2px;
  background: var(--pen);
}
.event-item .when {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  letter-spacing: -0.004em;
}
.event-item .what {
  margin-top: 1px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.event-item p {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  letter-spacing: -0.008em;
}
.event-item a {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.9375rem;
}

/* ================================================================ blog */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.post-list > li:not(.notice):not(.empty) {
  position: relative;
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 32px);
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 300ms ease, transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
}
@media (hover: hover) {
  .post-list > li:not(.notice):not(.empty):hover {
    box-shadow: var(--shadow-lift);
  }
}
.post-list > li:not(.notice):not(.empty):active {
  transform: scale(0.985);
  transition-duration: 60ms;
}
.post-list time {
  display: block;
  color: var(--ink-soft);
  font-size: 0.875rem;
  letter-spacing: -0.006em;
}
.post-list a {
  display: inline-block;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.022em;
  text-decoration: none;
  text-wrap: balance;
}
.post-list a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.post-list a:hover {
  text-decoration: none;
}
.post-list p {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.47;
}

.article {
  max-width: 680px;
  margin: 0 auto;
  padding-top: clamp(36px, 7vw, 72px);
}
.article .back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  font-size: 1rem;
}
.article .back::before {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 6px 0 2px;
  border-bottom: 1.6px solid currentColor;
  border-left: 1.6px solid currentColor;
  transform: rotate(45deg);
}
.article h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  text-wrap: balance;
}
.article .dateline {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.prose {
  margin-top: 36px;
  font-family: var(--font-read);
  font-size: 1.25rem;
  line-height: 1.6;
  letter-spacing: 0;
  text-wrap: pretty;
}
.prose h2,
.prose h3 {
  margin: 1.8em 0 0.5em;
  font-family: var(--font-display);
}
.prose h2 {
  font-size: 1.625rem;
}
.prose h3 {
  font-size: 1.3125rem;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin: 0 0 1.1em;
}
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--pen) 40%, transparent);
}
.prose blockquote {
  margin-left: 0;
  padding-left: 1em;
  border-left: 3px solid var(--hl);
  color: var(--ink-soft);
  font-style: italic;
}
.prose code {
  padding: 0.12em 0.36em;
  border-radius: 6px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.82em;
}
.prose pre {
  padding: 1em 1.2em;
  border-radius: 14px;
  background: var(--panel);
  overflow-x: auto;
  font-size: 0.9rem;
}
.prose pre code {
  padding: 0;
  background: none;
}
.prose img {
  border-radius: 14px;
}
.prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* ===================================================== resume/contact */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.resume-block + .resume-block {
  margin-top: 36px;
}
.resume-block h2 {
  margin: 0 0 12px 4px;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.resume-list {
  padding: 4px 0;
  background: var(--paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.resume-list:empty {
  display: none;
}
.resume-list > .empty {
  padding: 16px 20px;
}
.resume-entry {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 20px;
  padding: 16px 20px;
}
.resume-entry + .resume-entry::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 0;
  height: 1px;
  background: var(--hairline);
}
.resume-entry .role {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.014em;
}
.resume-entry .dates {
  color: var(--ink-soft);
  font-size: 0.875rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.resume-entry .org {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.resume-entry p {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 0.9375rem;
  line-height: 1.47;
}
@media (max-width: 520px) {
  .resume-entry {
    grid-template-columns: 1fr;
  }
  .resume-entry .dates {
    order: 3;
    padding-top: 0;
  }
}
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.skill-list li {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--paper-raised);
  box-shadow: var(--shadow-card);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.008em;
}
.resume-download {
  margin-top: 32px;
}
.contact-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: clamp(22px, 3vw, 30px);
  background: var(--paper-raised);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
@media (max-width: 900px) {
  .contact-card {
    position: static;
  }
}
.contact-card h2 {
  font-size: 1.5rem;
}
.contact-lines {
  list-style: none;
  margin: 14px 0 24px;
  padding: 0;
  display: grid;
}
.contact-lines li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9375rem;
}
.contact-lines li:first-child {
  border-top: 1px solid var(--hairline);
}
.contact-lines .label {
  color: var(--ink-soft);
}
.contact-lines a {
  overflow-wrap: anywhere;
}
.contact-card .btn[type="submit"] {
  width: 100%;
}

/* =============================================================== forms */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  align-content: start;
}
.field label {
  margin-left: 2px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.004em;
  color: var(--ink-soft);
}
.field .hint {
  margin-left: 2px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.field .field-error {
  margin-left: 2px;
  color: var(--danger);
  font-size: 0.8125rem;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;      /* 17px also stops iOS zooming into fields */
  letter-spacing: -0.012em;
  transition: box-shadow 200ms ease, border-color 200ms ease, background-color 200ms ease;
}
.contact-card input[type="text"],
.contact-card input[type="email"],
.contact-card textarea {
  background: color-mix(in srgb, var(--panel) 70%, var(--paper-raised));
}
textarea {
  resize: vertical;
  line-height: 1.47;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--pen);
  background: var(--paper-raised);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pen) 22%, transparent);
}
[aria-invalid="true"] {
  border-color: var(--danger) !important;
}
.form-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
}
.form-status.ok {
  color: var(--ok);
}
.form-status.error {
  color: var(--danger);
}
.captcha {
  display: flex;
  justify-content: center;
  min-height: 65px; /* the widget's height, so the form doesn't jump */
  margin: 4px 0 16px;
}
.captcha[hidden] {
  display: none;
}
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ========================================================= 404 page */
.page-head.center {
  text-align: center;
}
.page-head.center p {
  margin-left: auto;
  margin-right: auto;
}

/* ===================================================== accessibility */

/* Reduce motion: no sliding or scaling, only gentle fades. The scripts
   read the same setting and swap springs for cross-fades. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
  .btn:active,
  .chip:active,
  .pressable:active,
  .menu-btn:active,
  .theme-btn:active,
  .cal-day:active,
  .post-list > li:active {
    transform: none !important;
  }
  .menu-btn .bar,
  .theme-btn svg,
  .more-link::after,
  .chev-link::after,
  .cal-num {
    transition: none;
  }
}

/* Reduce transparency: solid surfaces instead of glass. */
@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .menu-sheet {
    background: var(--paper-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .site-header::after {
    opacity: 1;
  }
}

/* Increased contrast: firmer text, borders on every surface. */
@media (prefers-contrast: more) {
  :root {
    --ink-soft: #3a3a3c;
    --ink-faint: #48484a;
    --hairline: #8e8e93;
  }
  .site-header {
    background: var(--paper-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .site-header::after {
    opacity: 1;
  }
  .achievement,
  .plain-list,
  .cal-card,
  .cal-side,
  .post-list > li,
  .resume-list,
  .contact-card,
  .skill-list li {
    box-shadow: 0 0 0 1px var(--ink-soft);
  }
}
@media (prefers-contrast: more) {
  :root[data-theme="dark"] {
    --ink-soft: #d1d1d6;
    --ink-faint: #c7c7cc;
  }
}

/* Windows high contrast: let the system colors take over. */
@media (forced-colors: active) {
  .btn,
  .chip,
  .cal-day {
    border: 1px solid ButtonText;
  }
  .seg-thumb,
  .nav-glide {
    display: none;
  }
  .chip[aria-pressed="true"],
  .cal-day[aria-pressed="true"] .cal-num {
    outline: 2px solid Highlight;
  }
}

@media print {
  .site-header,
  .site-footer,
  .menu-btn,
  .hero-actions,
  .filters {
    display: none !important;
  }
  .achievement,
  .plain-list,
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
