/* Design tokens. Content never lives here; see content/ for that. */
:root {
  --bg: #1c2433;
  --text: #c8cdd5;
  --muted: #8a919c;
  --accent: #e6e9ed;
  --rule: #8a919c;
  --glow: #e4c56f;
  --font: Verdana, Geneva, system-ui, -apple-system, sans-serif;
  --measure: 42rem;
  --gap: 2.5rem;
  --menu-width: 6.5rem;
  --date-col: 6.5rem;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
}
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
  display: grid;
  grid-template-columns: var(--menu-width) minmax(0, 1fr);
  column-gap: 2rem;
  align-items: start;
  /* Short pages: keep the menu and content at the top instead of spreading the
     leftover height between the stacked rows on mobile. */
  align-content: start;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Left menu */
.menu ul { list-style: none; margin: 0; padding: 0; }
.site-name + ul { margin-top: 1.5rem; }
.menu li { margin: 0 0 0.35rem; }
.menu a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.site-name { color: var(--accent); }

main { min-width: 0; }

footer {
  margin-top: 4rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .page { grid-template-columns: minmax(0, 1fr); row-gap: 2.25rem; padding: 1.5rem 1rem 0; }
  .menu ul { display: flex; flex-wrap: wrap; gap: 1.25rem; }
  .site-name + ul { margin-top: 0.75rem; }
  .menu li { margin: 0; }
  footer { margin-top: 3rem; }
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--rule);
}
.timeline-entry {
  position: relative;
  margin: 0 0 1.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--date-col);
  column-gap: 1rem;
}
.timeline-entry > * { grid-column: 1; }
.timeline-entry .dates { grid-column: 2; grid-row: 1; }
.timeline-entry:last-child { margin-bottom: 0; }
.orb {
  position: absolute;
  left: calc(-1.25rem - 4px);
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.org { color: var(--accent); }
.dates { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.9rem; line-height: inherit; }
.role { color: var(--muted); font-size: 0.9rem; }
.role a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.role a:hover { color: var(--accent); }
.entry-body { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.entry-body ul { margin: 0; padding-left: 1.1rem; }
.entry-body li { margin: 0 0 0.25rem; }

.is-upcoming .orb {
  background: var(--glow);
  box-shadow: 0 0 6px 1px color-mix(in srgb, var(--glow) 55%, transparent);
}

/* Landing timeline: compact, capped in height, fading into a scroll */
.timeline-scroll {
  max-height: 22rem;
  overflow-y: auto;
  padding: 0 0.5rem 3rem 4px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.timeline-scroll::-webkit-scrollbar { display: none; }
/* Dates on the landing timeline are short ("2024 – 2025"), so give roles more room. */
.recent { --date-col: 5.25rem; }
.recent .timeline-entry { margin-bottom: 1rem; }
.recent .org { font-size: 0.9rem; }
.recent .dates, .recent .role { font-size: 0.8rem; }
.recent .orb { top: 0.55em; }

@media (prefers-reduced-motion: no-preference) {
  .is-upcoming .orb { animation: wink 3.2s ease-in-out infinite; }
  @keyframes wink {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px 1px color-mix(in srgb, var(--glow) 55%, transparent); }
    50% { opacity: 0.5; box-shadow: 0 0 1px 0 color-mix(in srgb, var(--glow) 20%, transparent); }
  }
  .timeline-entry {
    animation: entry-in 300ms ease-out both;
    animation-delay: calc(var(--i) * 60ms);
  }
  @keyframes entry-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
}

/* Project panels: bordered rectangles in an ordered grid */
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.panel { border: 1px solid var(--rule); border-radius: 3px; padding: 1rem 1.1rem; margin: 0; }
.panel h3 { font-size: 1rem; font-weight: 400; margin: 0; display: inline; }
.panel .year { color: var(--muted); font-size: 0.85rem; margin-left: 0.5rem; }
.panel .summary { margin: 0.25rem 0 0; }
.panel .link { display: inline-block; margin-top: 0.25rem; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 640px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
}

/* Landing page */
/* The blurb gets the wider column and a generous gutter separates it from Experience. */
.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: 4rem;
  row-gap: var(--gap);
  align-items: start;
}
/* The name is the page's one serif moment: a single line beside the photo.
   It is optically centered: the eye reads the body of the letters (cap height to
   baseline, 0.65em in Petrona), not the lone descender, so that block sits dead center
   on the photo. The photo is 1.17em + 5px so the "q" (0.26em below the baseline)
   still lands about 2.5px inside its bottom edge.
   Both scale with the column (cqi) so the name never runs into the timeline. */
.about { container-type: inline-size; }
.about-head {
  --name: clamp(28px, calc((100cqi - 24px) * 0.155), 56px);
  display: flex; align-items: center; gap: 1rem; margin: 0 0 1.25rem;
}
.about-head h1 {
  font-family: Petrona, Georgia, serif;
  font-weight: 300;
  font-size: var(--name);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
  /* Fallback: with line-height 1 the cap block sits about 0.03em above the line box's
     center (this depends on the platform's font metrics), so nudge it down. */
  position: relative;
  top: 0.03em;
}
/* Where supported, trim the line box to cap height and baseline, which come from the
   glyphs, not platform metrics, so flex centering centers the cap block exactly. */
@supports (text-box: trim-both cap alphabetic) {
  .about-head h1 { text-box: trim-both cap alphabetic; top: 0; }
}
.avatar {
  display: block; width: calc(var(--name) * 1.17 + 5px); height: calc(var(--name) * 1.17 + 5px);
  border-radius: 4px; flex-shrink: 0;
}
h1 { font-size: 1.5rem; font-weight: 400; margin: 0 0 0.15rem; color: var(--accent); }
.blurb p { margin: 0 0 1rem; }
.blurb a { text-decoration: underline; text-underline-offset: 2px; }
.label {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.links { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}
.button:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.icon { flex-shrink: 0; }
.projects { margin-top: var(--gap); }

@media (max-width: 800px) {
  .landing { grid-template-columns: minmax(0, 1fr); }
}
/* Side by side, the timeline is sized to 80% of the About column instead of a
   fixed cap; contain: size keeps it from stretching the row itself. */
@media (min-width: 801px) {
  .landing { align-items: stretch; }
  .recent { display: flex; flex-direction: column; }
  .timeline-scroll { flex: none; height: 80%; max-height: none; min-height: 12rem; contain: size; }
}

/* Reading pages and lists */
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }
.prose a { text-decoration: underline; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.posts { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.posts li { margin: 0 0 1.5rem; }
.posts .dates { margin-left: 0.5rem; }
.posts .summary { margin: 0.25rem 0 0; }
