:root {
  color-scheme: light dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  --accent: #e46b14;
  --primary: #088f8f;
  --bg: #140a21;
  --text: #f1f5f9;
  --muted: #9facbd;
  --dimmed: #64748b;
  --copy-line-height: 1.4;
  --copy-gap: 0.5rem;
  --content-width: 38rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --layout-gap: var(--space-6);
  --heading-line-height: 1.35rem;
  --dot-size: 0.625rem;
  --dot-top: calc((var(--heading-line-height) - var(--dot-size)) / 2);
  --travel-dot-size: 0.375rem;
  --travel-line-height: 1.15rem;
  --travel-padding: var(--space-3);
  --travel-bottom-padding: 0rem;
  --travel-dot-top: calc(var(--travel-padding) + (var(--travel-line-height) - var(--travel-dot-size)) / 2);
  /* Desktop geometry aligns the fixed nav, timeline spine, and text column. */
  --desktop-spine-x: 2rem;
  --timeline-text-gap: var(--layout-gap);
  --desktop-spine-gap: var(--timeline-text-gap);
  --desktop-nav-width: 5ch;
  --desktop-nav-gap: var(--timeline-text-gap);
  --desktop-layout-offset: calc(var(--desktop-nav-width) + var(--desktop-nav-gap) - var(--desktop-spine-x));
  --desktop-shell-width: calc(52rem + var(--desktop-layout-offset));
  /* Visual alignment with the first timeline row while the nav is fixed. */
  --desktop-nav-top: 13.75rem;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 120% at 0% 0%, rgb(8 143 143 / 0.24), transparent 55%),
    radial-gradient(140% 140% at 100% 0%, rgb(228 107 20 / 0.16), transparent 55%),
    var(--bg);
}

.page-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--desktop-shell-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 5rem calc(1.25rem + var(--desktop-layout-offset));
}

.site-nav {
  position: fixed;
  top: var(--desktop-nav-top);
  left: max(1.25rem, calc((100vw - var(--desktop-shell-width)) / 2 + 1.25rem));
  z-index: 10;
  display: grid;
  width: var(--desktop-nav-width);
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: var(--copy-line-height);
}

.site-nav a {
  color: rgb(228 107 20 / 0.72);
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a:hover {
  transform: translateX(0.12rem);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--heading-line-height) 0 var(--space-3) var(--desktop-spine-x);
}

.hero-body {
  display: flex;
  align-items: center;
  gap: var(--layout-gap);
}

.portrait-link {
  display: block;
  flex: 0 0 7.5rem;
  color: inherit;
  text-decoration: none;
}

.portrait-frame {
  display: block;
  width: 7.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 999px;
  box-shadow: 0 1.25rem 3rem -1.6rem rgb(228 107 20 / 0.75);
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(2);
  transform-origin: 53% 20%;
}

.intro {
  max-width: var(--content-width);
}

.intro h1 {
  white-space: nowrap;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 400;
}

h1 {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

h2,
h3 {
  font-size: 1rem;
  line-height: var(--heading-line-height);
}

h1 a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: var(--copy-gap) 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: var(--copy-line-height);
}

.hero-tagline {
  max-width: 31rem;
  margin-top: var(--space-2);
  text-wrap: balance;
}

.social-links {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dimmed);
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.social-link svg {
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  fill: currentColor;
}

.social-link:hover {
  transform: translateY(1px);
}

.linkedin-link:hover {
  color: #0a66c2;
}

.github-social-link:hover,
.email-link:hover,
.print-link:hover {
  color: var(--text);
}

.divider {
  --divider-gutter: calc(var(--desktop-spine-x) + var(--desktop-spine-gap));
  width: min(calc(100% - var(--divider-gutter)), var(--content-width));
  height: 1px;
  margin: var(--space-3) 0 var(--space-3) var(--divider-gutter);
  background: linear-gradient(90deg, transparent, rgb(100 116 139 / 0.32), rgb(228 107 20 / 0.62), rgb(100 116 139 / 0.32), transparent);
}

.page-content {
  --spine-x: var(--desktop-spine-x);
  --timeline-gutter: calc(var(--desktop-spine-x) + var(--desktop-spine-gap));
  position: relative;
  flex: 1 0 auto;
  padding: var(--space-3) 0 var(--space-2) var(--timeline-gutter);
}

.page-content::before,
.page-content::after {
  content: "";
  position: absolute;
  top: calc(var(--space-3) + var(--dot-top));
  bottom: 0;
  left: var(--spine-x);
  transform: translateX(-50%);
  pointer-events: none;
}

.page-content::before {
  width: 1px;
  background: rgb(228 107 20 / 0.46);
}

.page-content::after {
  width: 1.6rem;
  background: rgb(228 107 20 / 0.085);
  filter: blur(1.15rem);
}

.page-section,
.timeline-card {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-width));
  margin: 0 auto 0 0;
  padding: 0 0 0.25rem;
}

.page-section::before,
.timeline-item::before,
.subsection::before {
  content: "";
  position: absolute;
  left: calc(var(--spine-x) - var(--timeline-gutter));
  transform: translateX(-50%);
  width: var(--dot-size);
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0.9rem rgb(228 107 20 / 0.38);
}

.page-section::before,
.timeline-item::before {
  top: var(--dot-top);
}

.page-section + .page-section {
  margin-top: var(--layout-gap);
}

.about-copy p:first-child {
  margin-top: 0;
}

.about-list {
  margin: var(--copy-gap) 0 0;
  padding-left: var(--space-4);
  color: var(--muted);
  line-height: var(--copy-line-height);
}

.about-list li + li {
  margin-top: var(--copy-gap);
}

.about-list strong {
  color: var(--text);
  font-weight: 400;
}

.timeline {
  position: relative;
  display: grid;
  gap: var(--layout-gap);
  width: 100%;
  margin: 0 auto;
}

.timeline-item {
  position: relative;
  z-index: 1;
  display: grid;
}

.timeline-group::before {
  content: none;
}

.subsections {
  display: grid;
  gap: 0;
  margin-top: 0;
}

.subsection {
  position: relative;
  padding: var(--layout-gap) 0 0;
}

.subsections > .subsection:first-child {
  padding-top: 0;
}

.subsection::before {
  top: calc(var(--layout-gap) + var(--dot-top));
}

.subsections > .subsection:first-child::before {
  top: var(--dot-top);
}

.timeline-gap {
  padding: var(--layout-gap) 0 var(--travel-bottom-padding);
}

.subsection.timeline-gap::before {
  top: calc(var(--layout-gap) + (var(--travel-line-height) - var(--travel-dot-size)) / 2);
  left: calc(var(--spine-x) - var(--timeline-gutter));
  width: var(--travel-dot-size);
  background: var(--dimmed);
  box-shadow: none;
}

.timeline-gap h2,
.timeline-gap h3,
.timeline-gap .subsection-date {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: var(--copy-line-height);
  letter-spacing: 0.02em;
}

.timeline-gap .subsection-date {
  display: inline;
  margin-top: 0;
}

.timeline-card a {
  color: var(--primary);
  text-decoration-color: rgb(8 143 143 / 0.45);
  text-underline-offset: 0.18em;
}

.github-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.24em;
  text-decoration: none;
  vertical-align: baseline;
}

.github-link svg {
  width: 0.88em;
  height: 0.88em;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: -0.08em;
}

.github-link:hover {
  color: var(--text);
}

.github-link-text {
  text-decoration: underline;
  text-decoration-color: rgb(8 143 143 / 0.45);
  text-underline-offset: 0.18em;
}

.github-link:hover .github-link-text {
  text-decoration-color: currentColor;
}

.subsection p {
  margin-top: var(--copy-gap);
}

.subsection ul {
  max-width: 100%;
  margin: var(--copy-gap) 0 0;
  padding-left: var(--space-4);
  color: var(--muted);
  line-height: var(--copy-line-height);
  list-style: disc;
}

.subsection li + li {
  margin-top: var(--copy-gap);
}

.subsection-date {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: var(--copy-line-height);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.subsection-date-inline {
  display: inline;
  margin-top: 0;
}

.page-footer {
  --spine-x: var(--desktop-spine-x);
  --timeline-gutter: calc(var(--desktop-spine-x) + var(--desktop-spine-gap));
  position: relative;
  margin-top: auto;
  padding: 4rem 0 0 var(--timeline-gutter);
}

.page-footer p {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  margin: 0;
  margin-left: calc(var(--spine-x) - var(--timeline-gutter));
  padding-left: var(--space-3);
  color: var(--dimmed);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: var(--copy-line-height);
}

.copyright-symbol {
  position: absolute;
  top: 50%;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  line-height: inherit;
  transform: translate(-50%, -50%);
}

@media (max-width: 52rem) {
  .page-shell {
    width: min(100%, 52rem);
    padding-left: 1.25rem;
  }

  .site-nav {
    position: static;
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: min(100%, 52rem);
    margin: 0 auto;
    margin-bottom: var(--space-3);
    padding: var(--space-3) 1.25rem 0;
  }

  .site-nav a:hover {
    transform: translateY(1px);
  }

  .hero {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
    text-align: center;
  }

  .hero-body {
    flex-direction: column;
    align-items: center;
  }

  .social-links {
    justify-content: center;
  }

  .page-content,
  .page-footer {
    --spine-x: 0.75rem;
    --timeline-gutter: 2.1rem;
    width: min(100%, calc(var(--content-width) + var(--timeline-gutter)));
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
  }

  .divider {
    --divider-gutter: 2.1rem;
    margin-right: auto;
    margin-left: auto;
  }
}

@media print {
  @page {
    margin: 14mm 16mm;
  }

  :root {
    color-scheme: light;
    --copy-line-height: 1.2;
    --copy-gap: 0.2rem;
    --bg: #ffffff;
    --text: #111827;
    --muted: #374151;
    --dimmed: #6b7280;
    --primary: #111827;
    --accent: #111827;
  }

  body {
    background: #ffffff;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .hero {
    padding-top: 0;
    padding-bottom: 0.25rem;
  }

  .site-nav,
  .page-footer,
  .print-link {
    display: none;
  }

  .social-links {
    display: flex;
  }

  .social-link {
    color: var(--dimmed);
  }

  .divider {
    margin: 0.35rem auto;
  }

  .timeline {
    gap: 0.75rem;
  }

  .page-content {
    padding-right: 0;
    padding-left: 0;
  }

  .timeline::before,
  .timeline::after,
  .page-content::before,
  .page-content::after,
  .page-section::before,
  .timeline-item::before,
  .subsection::before,
  .subsection.timeline-gap::before {
    display: none;
  }

  .subsection {
    padding: 0.72rem 0 0.78rem;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .subsections > .subsection:first-child {
    padding-top: 0;
  }

  h2,
  h3,
  p,
  .subsection ul {
    font-size: 11pt;
    line-height: var(--copy-line-height);
  }

  h2,
  h3 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .subsection-date,
  .timeline-gap h2,
  .timeline-gap h3,
  .timeline-gap .subsection-date {
    font-size: 9.5pt;
    line-height: var(--copy-line-height);
  }

  .subsection ul {
    margin-top: var(--copy-gap);
    padding-left: 1.1rem;
  }

  .subsection li + li {
    margin-top: 0.18rem;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }

  .portrait-frame {
    box-shadow: none;
  }
}
