:root {
  --bg: #faf9f6;
  --fg: #1c1b19;
  --muted: #6e6b64;
  --faint: #a19d94;
  --line: #e7e4dd;
  --accent: #2a7a7c;
  --underline: rgba(42, 122, 124, 0.35);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #ebe9e4;
    --muted: #a19d94;
    --faint: #6e6b64;
    --line: #2b2a27;
    --accent: #72c4c4;
    --underline: rgba(114, 196, 196, 0.4);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--underline);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

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

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 24px 64px;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 64px;
}

.avatar {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--line);
}

.avatar canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

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

/* The sprite covers the photo block by block; hide the photo only once it is fully built. */
.avatar.is-pixel img {
  opacity: 0;
}

.avatar-btn {
  position: relative;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
}

.avatar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.avatar {
  display: block;
}

.avatar-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.85rem;
  line-height: 26px;
  text-align: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.avatar-btn:hover .avatar-badge,
.avatar-btn:focus-visible .avatar-badge,
.avatar-btn.is-playing .avatar-badge {
  opacity: 1;
  transform: scale(1);
}

.avatar-btn.is-playing .avatar-badge {
  background: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.roles {
  margin: 10px 0 14px;
  font-size: 1.05rem;
  color: var(--muted);
}

.roles a {
  color: var(--fg);
}

.role {
  display: block;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.links a {
  color: var(--muted);
  text-decoration: none;
}

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

/* Sections */
section {
  margin-bottom: 64px;
}

h2 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

section > p {
  margin: 0 0 16px;
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

li,
blockquote {
  text-wrap: pretty;
}

blockquote {
  margin: 32px 0 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--fg);
}

/* Entries: date column on the left, details on the right. */
.entry {
  display: grid;
  grid-template-columns: 112px 1fr;
  column-gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.entry-head {
  display: contents;
}

.date {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding-top: 2px;
  color: var(--faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.entry h3,
.entry-sub,
.entry ul {
  grid-column: 2;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}

h3 a {
  text-decoration: none;
}

.muted {
  color: var(--faint);
  font-weight: 400;
}

.entry-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.entry ul,
.projects {
  margin: 0;
  padding-left: 1.1em;
}

.entry li,
.projects li {
  margin-bottom: 8px;
  font-size: 0.97rem;
}

.entry li::marker,
.projects li::marker {
  color: var(--faint);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links {
  align-items: center;
}

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

@media (max-width: 600px) {
  .page {
    padding: 48px 20px 40px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 48px;
  }

  .avatar {
    width: 104px;
    height: 104px;
  }

  h1 {
    font-size: 2.4rem;
  }

  section {
    margin-bottom: 48px;
  }

  blockquote {
    font-size: 1.2rem;
  }

  .entry {
    grid-template-columns: 1fr;
  }

  .date,
  .entry h3,
  .entry-sub,
  .entry ul {
    grid-column: 1;
    grid-row: auto;
  }

  .date {
    order: 2;
    padding-top: 0;
  }

  .entry h3 {
    order: 1;
  }

  .entry-sub {
    order: 3;
  }

  .entry ul {
    order: 4;
  }
}
