:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #37352f;
  --body: #66635e;
  --muted: #787774;
  --faint: #9b9a97;
  --border: #e9e8e5;
  --hover: rgba(55, 53, 47, 0.055);
  --cover: #eef2ff;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
}

html.dark {
  color-scheme: dark;
  --background: #000000;
  --foreground: #ededed;
  --body: #a6a6a6;
  --muted: #a6a6a6;
  --faint: #858585;
  --border: #252525;
  --hover: rgba(255, 255, 255, 0.07);
  --cover: #101424;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--body);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

a { color: inherit; }
button { font: inherit; }
::selection { background: rgba(35, 83, 255, 0.2); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  opacity: 1;
  transition: opacity 560ms ease, visibility 560ms;
}
.splash.is-leaving { opacity: 0; visibility: hidden; }
.splash__art {
  margin: 0;
  color: var(--foreground);
  font: min(1.39vw, 13px)/1.22 var(--mono);
  white-space: pre;
  user-select: none;
}
.splash__art::after {
  content: '000000000019 · 1231006505 · 2083236893';
  display: block;
  margin-top: 1.25rem;
  color: var(--faint);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0;
  animation: block-mark-in 420ms ease 1.75s forwards;
}
@keyframes block-mark-in { to { opacity: 0.55; } }

.site {
  width: min(100% - 2.5rem, 34rem);
  margin-inline: auto;
  padding: 2.5rem 0 4rem;
}
.home-site, .work-site, .writing-site { padding-top: 1.25rem; }
.home-site { opacity: 0; translate: 0 6px; transition: opacity 560ms ease, translate 620ms ease; }
body.is-ready .home-site { opacity: 1; translate: 0 0; }
body.no-splash .home-site { opacity: 1; translate: none; transition: none; }

.topbar { display: flex; align-items: center; gap: 0.75rem; }
.nav {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.15;
  text-decoration: none;
  transition: color 150ms ease;
}
.nav a[aria-current='page'], .nav a:hover, .nav a:focus-visible { color: var(--foreground); }

.theme-toggle {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--foreground); background: var(--hover); }
.theme-toggle svg { width: 0.95rem; height: 0.95rem; }
.theme-toggle .moon { display: none; }
html.dark .theme-toggle .sun { display: none; }
html.dark .theme-toggle .moon { display: block; }

.lifespan { margin-top: 0.9rem; }
.lifespan__readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--body);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: -0.025em;
  line-height: 1.35;
  white-space: nowrap;
}
.lifespan__readout [data-lifespan-age] { color: var(--foreground); font-variant-numeric: tabular-nums; }
.lifespan__unit, .lifespan__percent { color: var(--muted); }
.lifespan__percent { flex: none; }
.lifespan__track {
  height: 0.35rem;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: var(--border);
}
.lifespan__fill {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--foreground);
}
.lifespan__fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--background);
  border-radius: 50%;
  background: var(--foreground);
  content: '';
  transform: translate(50%, -50%);
}
.lifespan__expectancy {
  position: relative;
  color: var(--body);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
}
.lifespan__tooltip {
  position: absolute;
  z-index: 2;
  top: calc(100% + 0.6rem);
  left: 0;
  width: max-content;
  max-width: min(16rem, calc(100vw - 2.5rem));
  padding: 0.33rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, -0.2rem);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}
.lifespan__tooltip::after {
  position: absolute;
  top: -0.28rem;
  left: 0.65rem;
  width: 0.48rem;
  height: 0.48rem;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--background);
  content: '';
  transform: rotate(45deg);
}
.lifespan__expectancy:hover .lifespan__tooltip,
.lifespan__expectancy:focus-visible .lifespan__tooltip { opacity: 1; transform: translate(0, 0); }

main { margin-top: 1.5rem; }
.lifespan + main { transition: margin-top 150ms ease; }
.lifespan:has(.lifespan__expectancy:hover) + main,
.lifespan:has(.lifespan__expectancy:focus-visible) + main { margin-top: 2.7rem; }
.bio { display: grid; gap: 0.75rem; }
.bio p { margin: 0; text-wrap: pretty; }
.prose-link {
  color: var(--foreground);
  text-decoration: none;
  transition: opacity 150ms ease;
}
.prose-link:hover { opacity: 0.65; }

.cover {
  margin-inline: 0;
  margin-top: 1.35rem;
}
.cover img {
  display: block;
  width: 100%;
  height: auto;
}
.photo-gallery__frame {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background: var(--cover);
}
.photo-gallery .photo-gallery__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-gallery__frame::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.35));
  content: '';
  pointer-events: none;
}
.photo-gallery__controls {
  position: absolute;
  z-index: 1;
  bottom: 0.5rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  translate: -50% 0;
}
.photo-gallery__arrow,
.photo-gallery__autoplay {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  transition: opacity 150ms ease, transform 150ms ease;
}
.photo-gallery__autoplay { position: absolute; z-index: 1; right: 0.5rem; bottom: 0.5rem; }
.photo-gallery__arrow:hover,
.photo-gallery__arrow:focus-visible,
.photo-gallery__autoplay:hover,
.photo-gallery__autoplay:focus-visible {
  opacity: 0.75;
  transform: scale(1.08);
}
.photo-gallery__arrow:focus-visible,
.photo-gallery__autoplay:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.photo-gallery__arrow svg,
.photo-gallery__autoplay svg { width: 1rem; height: 1rem; }
.photo-gallery__autoplay .photo-gallery__play-icon,
.photo-gallery__autoplay.is-paused .photo-gallery__pause-icon { display: none; }
.photo-gallery__autoplay.is-paused .photo-gallery__play-icon { display: block; }
.photo-gallery__dots { display: flex; align-items: center; justify-content: center; gap: 0.15rem; }
.photo-gallery__dot {
  display: grid;
  width: 0.55rem;
  height: 1.25rem;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.photo-gallery__dot[hidden] { display: none; }
.photo-gallery__dot::before {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  content: '';
}
.photo-gallery__dot[aria-current='true']::before { background: #ffffff; }
.photo-gallery__dot:hover::before { background: rgba(255, 255, 255, 0.85); }
.photo-gallery__dot:focus-visible { outline: 2px solid #ffffff; outline-offset: 1px; }
.cover figcaption {
  margin-top: 0.5rem;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.35;
}

.socials {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.4rem;
}
.socials a { color: var(--faint); transition: color 150ms ease; }
.socials a:hover, .socials a:focus-visible { color: var(--foreground); }
.socials svg { display: block; width: 1rem; height: 1rem; }
.visitor-count {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.7rem;
  line-height: 1;
  white-space: nowrap;
}
.visitor-count [data-visitor-count] { color: var(--foreground); }

.projects { display: grid; gap: 1.8rem; }
.project h1, .project h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}
.project p { margin: 0.22rem 0 0; color: var(--body); }
/* Work */

.work-site { width: min(100% - 2.5rem, 34rem); --work-section-gap: 2rem; }
.work-main { margin-top: var(--work-section-gap); }
.work-main > h1,
.work-project h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}
.work-list { display: grid; gap: 2.5rem; margin-top: 1.5rem; }
.work-project > p { margin: 0.25rem 0 0; color: var(--body); }
.tarot-project { padding: 1.25rem; background: #edf3ff; }
.project-heading { display: flex; align-items: center; gap: 0.75rem; }
.project-heading img { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.project-heading a { color: #667085; font-family: var(--sans); font-size: 0.75rem; text-decoration: none; }
.project-heading a:hover, .project-heading a:focus-visible { color: #1646c0; }
.tarot-project .release-list { margin-top: 1rem; padding: 0; border: 0; border-top: 1px solid #d1ddf4; }
.tarot-project .release-row { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: 0.55rem 0; border: 0; border-bottom: 1px solid #d1ddf4; color: #667085; font-family: var(--sans); font-size: 0.75rem; }
.tarot-project .release-row > span { display: inline; margin: 0; }
.tarot-project .release-row > span:first-child { color: #303846; }
.tarot-project .release-row a { color: inherit; font-size: inherit; text-decoration-color: #b9c8e5; text-underline-offset: 0.18em; }
.tarot-project .release-row a:hover, .tarot-project .release-row a:focus-visible { color: #1646c0; }
.research-section { margin-top: var(--work-section-gap); }
.research-section > h2,
.research-paper h4 {
  margin: 0;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}
.research-list { margin-top: 1rem; border-top: 1px solid var(--border); }
.research-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  cursor: pointer;
  list-style: none;
}
.research-group > summary::-webkit-details-marker { display: none; }
.research-group > summary::after {
  width: 0.45rem;
  height: 0.45rem;
  flex: none;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: '';
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
.research-group[open] > summary::after { transform: rotate(225deg); }
.research-group > summary:hover,
.research-group > summary:focus-visible { color: var(--foreground); }
.research-group > summary h3 { margin: 0; font: inherit; }
.research-paper { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.research-paper p { margin: 0.5rem 0 0; }
.research-paper .research-authors { color: var(--faint); font-family: var(--sans); font-size: 0.75rem; }
.research-authors a { text-decoration-color: var(--border); text-underline-offset: 0.18em; }
.research-paper > a,
.research-links { margin-top: 0.7rem; font-family: var(--sans); font-size: 0.78rem; }
.research-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.research-links a { text-decoration-color: var(--border); text-underline-offset: 0.18em; }
.research-paper a:hover,
.research-paper a:focus-visible { color: var(--foreground); }
.work-site .socials { margin-top: 4rem; }

/* Writing */

.writing-main { margin-top: 2rem; }
.writing-main h1 {
  margin: 0;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
}
.writing-intro { margin: 0.75rem 0 0; }
.writing-list { margin-top: 2rem; border-top: 1px solid var(--border); }
.writing-empty { margin: 1rem 0 0; color: var(--muted); }
.writing-entry { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.writing-entry h2 { margin: 0; font-size: 1rem; font-weight: 400; }
.writing-entry h2 a { color: var(--foreground); text-decoration: none; }
.writing-entry h2 a:hover, .writing-entry h2 a:focus-visible { text-decoration: underline; text-underline-offset: 0.16em; }
.writing-entry time { color: var(--faint); font-family: var(--sans); font-size: 0.75rem; }
.writing-entry p { margin: 0.4rem 0 0; }
.writing-article-main { margin-top: 3.5rem; }
.writing-page { --article-accent: #286f78; }
html.dark .writing-page { --article-accent: #8acbd2; }
.writing-page.article-color-blue { --article-accent: #365f9a; }
html.dark .writing-page.article-color-blue { --article-accent: #a8c5ec; }
.writing-page.article-color-rust { --article-accent: #a4523e; }
html.dark .writing-page.article-color-rust { --article-accent: #e0a18f; }
.writing-post { border-top: 2px solid var(--article-accent); padding-top: 1.3rem; }
.writing-post__meta { margin: 0; color: var(--article-accent); font-family: var(--sans); font-size: 0.75rem; line-height: 1.4; }
.writing-post h1 { margin: 0.7rem 0 0; color: var(--foreground); font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 400; line-height: 1.18; text-wrap: balance; }
.writing-post__dek { margin: 0.75rem 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.4; }
.writing-post__body { margin-top: 2.5rem; }
.writing-post__body p, .writing-post__body li { line-height: 1.7; }
.writing-post__body p { margin: 0 0 1.3rem; }
.writing-post__body h2 { margin: 2.2rem 0 0.8rem; color: var(--foreground); font-size: 1.3rem; font-weight: 400; line-height: 1.3; }
.writing-post__body h3 { margin: 1.8rem 0 0.65rem; color: var(--foreground); font-size: 1.08rem; font-weight: 400; }
.writing-post__body a { color: var(--foreground); text-decoration-color: var(--article-accent); text-underline-offset: 0.2em; }
.writing-post__body a:hover { color: var(--article-accent); }
.writing-post__body blockquote { margin: 2rem 0; padding: 0.15rem 0 0.15rem 1.1rem; border-left: 2px solid var(--article-accent); color: var(--foreground); font-size: 1.1rem; font-style: italic; line-height: 1.5; }
.writing-post__body blockquote p { margin: 0; line-height: inherit; }
.writing-post__body ul, .writing-post__body ol { margin: 0 0 1.3rem; padding-left: 1.4rem; }
.writing-post__body li + li { margin-top: 0.4rem; }
.writing-post__body figure { margin: 2rem 0; }
.writing-post__body figure img { display: block; width: 100%; height: auto; }
.writing-post__body figcaption { margin-top: 0.5rem; color: var(--faint); font-family: var(--sans); font-size: 0.75rem; }
.writing-back { display: inline-block; margin-top: 2rem; color: var(--muted); font-family: var(--sans); font-size: 0.8rem; }
.writing-preview-tools { margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); font-family: var(--sans); }
.writing-preview-tools p { margin: 0 0 0.6rem; color: var(--faint); font-size: 0.75rem; }
.writing-preview-colors { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.writing-preview-colors button { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 0.2rem; background: transparent; color: var(--muted); font-size: 0.75rem; cursor: pointer; }
.writing-preview-colors button[aria-pressed='true'] { border-color: var(--article-accent); color: var(--foreground); }
.writing-preview-colors button:hover, .writing-preview-colors button:focus-visible { color: var(--foreground); }
.writing-preview-colors button::before { display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.4rem; border-radius: 50%; background: var(--swatch); content: ''; }
.writing-site .socials { margin-top: 4rem; }

html.dark .tarot-project { background: #111827; }
html.dark .project-heading a,
html.dark .tarot-project .release-row { color: #9099aa; }
html.dark .tarot-project .release-list,
html.dark .tarot-project .release-row { border-color: #26334b; }
html.dark .tarot-project .release-row > span:first-child { color: #d9e2f2; }
html.dark .tarot-project .release-row a { color: inherit; text-decoration-color: #3a4965; }
@media (max-width: 36rem) {
  .work-site { width: min(100% - 2.5rem, 34rem); }
  .writing-article-main { margin-top: 3rem; }
  .tarot-project .release-row { align-items: flex-start; }
  .tarot-project .release-row > span:last-child { text-align: right; }
}

@media (max-width: 36rem) {
  .site { padding-top: 3rem; }
  .home-site, .work-site, .writing-site { padding-top: 1.75rem; }
  .topbar { gap: 0.5rem; }
  .nav { gap: 0.5rem; }
  .nav a { font-size: 0.95rem; }
  .lifespan__readout { font-size: 0.67rem; }
  .lifespan__tooltip { left: -3.5rem; max-width: min(12rem, calc(100vw - 2.5rem)); transform: translate(0, -0.2rem); white-space: normal; }
  .lifespan__expectancy:hover .lifespan__tooltip,
  .lifespan__expectancy:focus-visible .lifespan__tooltip { transform: translate(0, 0); }
  .bio { gap: 1.6rem; }
  .cover { margin-top: 1.6rem; }
  .socials { margin-top: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .splash { display: none; }
  .home-site { opacity: 1; translate: none; }
}
