:root {
  /* Warm near-black instead of #000; greys are tinted to match */
  --bg: #ffffff;
  --ink: #121110;
  --muted: #a8a49e;
  --soft: #75716b;
  --rule: #efeeec;
  --rule-strong: #d6d3cf;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --ink: #eceae6;
    --muted: #7a7670;
    --soft: #aaa69f;
    --rule: #2b2927;
    --rule-strong: #57534e;
  }
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

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

/* Links: soft, thick underline that darkens on hover */

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 200ms var(--ease), color 200ms var(--ease);
}

a:hover {
  text-decoration-color: var(--rule-strong);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--rule-strong);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Layout */

.site {
  width: min(608px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 128px;
}

@media (max-width: 640px) {
  .site {
    padding-top: 64px;
  }
}

/* Header */

.site-header {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.avatar-link {
  display: inline-block;
  align-self: flex-start;
  border-radius: 50%;
  text-decoration: none;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  background: var(--rule);
  transition: transform 300ms var(--ease-out);
}

.avatar-link:hover .avatar {
  transform: scale(1.08) rotate(-4deg);
}

.name {
  font-weight: 500;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 24px;
  margin-top: 48px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex-shrink: 0;
  padding-bottom: 4px;
  color: var(--muted);
  text-decoration: none;
}

.tab:hover {
  color: var(--soft);
}

.tab::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 1px;
  background: var(--rule);
  opacity: 0;
  filter: blur(2px);
  transform: scaleX(0.6);
  transition: opacity 250ms var(--ease), filter 250ms var(--ease), transform 300ms var(--ease-out);
}

.tab[aria-current="page"]::after {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

main {
  margin-top: 48px;
}

/* Lists: title over muted meta */

.list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  list-style: none;
}

.item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.item-title {
  color: var(--ink);
  font-weight: 400;
  font-size: inherit;
}

.item-meta {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

a.item .item-title,
summary.item .item-title {
  transition: color 200ms var(--ease);
}

a.item:hover .item-title,
summary.item:hover .item-title {
  color: var(--soft);
}

/* Expandable roles */

.job summary {
  cursor: pointer;
  list-style: none;
  border-radius: 4px;
}

.job summary::-webkit-details-marker {
  display: none;
}

.job-body {
  padding: 12px 0 4px;
  color: var(--soft);
  line-height: 1.65;
}

.job[open] .job-body {
  animation: reveal 400ms var(--ease-out) both;
}

.job-body ul {
  margin-top: 8px;
  padding-left: 1.1em;
}

.job-body li + li {
  margin-top: 6px;
}

.job-body li::marker {
  color: var(--muted);
}

/* About */

.prose {
  line-height: 1.65;
}

.prose p + p {
  margin-top: 1.1em;
}

.prose h2,
.prose h3 {
  margin: 2em 0 0.75em;
  font-size: inherit;
  font-weight: 500;
}

.prose ul,
.prose ol {
  margin: 1em 0;
  padding-left: 1.2em;
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
}

.prose code {
  font-size: 0.92em;
}

.group {
  margin-top: 48px;
}

.label {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: inherit;
  font-weight: 400;
}

.links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
  list-style: none;
}

/* Posts */

.post-header {
  margin-bottom: 32px;
}

.post-header h1 {
  font-weight: 500;
}

.back {
  margin-top: 48px;
  color: var(--muted);
}

.back a {
  text-decoration: none;
}

.back a:hover {
  color: var(--ink);
}

/* Entrance: staggered fade, lift and un-blur */

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(4px);
  }
}

.reveal {
  animation: reveal 600ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .job[open] .job-body {
    animation: none;
  }

  .tab::after,
  .avatar {
    transition: none;
  }
}
