/* Afterglow homepage: a résumé in midnight blue, lit by one animated ribbon. */
main {
  overflow-x: clip;
}

.intro {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-areas:
    "copy portrait"
    "facts facts";
  align-items: center;
  gap: 56px 72px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: clamp(56px, 8vw, 112px) clamp(48px, 6vw, 80px);
}
#afterglow-canvas {
  position: absolute;
  top: -40px;
  right: calc(var(--gutter) * -1);
  z-index: -1;
  width: 720px;
  max-width: calc(100% + var(--gutter));
  height: 580px;
  opacity: 0.62;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse, #000 30%, transparent 72%);
  mask-image: radial-gradient(ellipse, #000 30%, transparent 72%);
  animation: glow-in 1.6s ease-out both;
}
.intro-portrait {
  grid-area: portrait;
  justify-self: end;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 8px rgba(var(--accent-rgb), 0.06);
  animation: rise 1s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.intro-copy {
  grid-area: copy;
  display: grid;
  justify-items: start;
}
.intro-copy > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.intro-copy > :nth-child(2) {
  animation-delay: 0.1s;
}
.intro-copy > :nth-child(3) {
  animation-delay: 0.18s;
}
.intro-copy > :nth-child(n + 4) {
  animation-delay: 0.26s;
}
.intro h1 {
  margin-left: -0.04em;
  font-size: clamp(64px, 9vw, 116px);
  line-height: 0.95;
}
.intro-role {
  max-width: 24ch;
  margin-top: 20px;
  color: var(--text);
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}
.intro-summary {
  max-width: 58ch;
  margin-top: 18px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.7;
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}
.intro-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
}
.intro-links a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.intro-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  animation: rise 0.9s 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.intro-facts > div {
  padding: 20px 24px 0;
  border-left: 1px solid var(--line);
}
.intro-facts > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.intro-facts dt {
  color: var(--muted);
  font-size: 13px;
}
.intro-facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.resume-section {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 24px 56px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: clamp(56px, 7vw, 88px);
  border-top: 1px solid var(--line);
}
.section-rail {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  display: grid;
  justify-items: start;
  gap: 12px;
}
.section-rail h2 {
  font-size: clamp(40px, 4vw, 52px);
}
.section-rail p {
  max-width: 220px;
  font-size: 15px;
}

.roles,
.title-history,
.degrees,
.highlights {
  margin: 0;
  padding: 0;
  list-style: none;
}
.role {
  padding-block: 36px;
  border-top: 1px solid var(--line);
}
.role:first-child {
  padding-top: 0;
  border-top: 0;
}
.role:last-child {
  padding-bottom: 0;
}
.role-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.role-header h3 {
  font-size: 24px;
}
.role-meta {
  font-size: 14px;
}
.title-history li,
.role-title,
.degrees li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  color: var(--text);
  font-weight: 600;
}
.role-title {
  margin-top: 6px;
}
.role-dates {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.title-history {
  position: relative;
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-left: 22px;
}
.title-history::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 4px;
  width: 1px;
  background: var(--line);
}
.title-history li {
  position: relative;
}
.title-history li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: -22px;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
}
.title-history li:first-child::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}
.title-history li + li {
  color: var(--muted);
  font-weight: 400;
}
.role-summary {
  max-width: 68ch;
  margin-top: 14px;
  color: var(--soft);
}

.ledger {
  margin: 28px 0 0;
  padding: 22px 28px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.ledger figcaption {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.ledger dl {
  display: grid;
  margin: 0;
}
.ledger dl > div {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-block: 9px;
}
.ledger dt {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 12px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.45;
}
.ledger dt::after {
  content: "";
  flex: 1 0 24px;
  margin-bottom: 0.45em;
  border-bottom: 2px dotted #3a4766;
}
.ledger dd {
  margin: 0;
  color: var(--accent);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
}
.ledger-note {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
  margin-top: 32px;
}
.highlights h4 {
  font-size: 16px;
}
.highlights h4::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.highlights p {
  margin-top: 6px;
  color: var(--soft);
  font-size: 15px;
}

.activity {
  --activity-0: #1c2539;
  --activity-1: #394a67;
  --activity-2: #587096;
  --activity-3: #7b9cca;
  --activity-4: #9ec7ff;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.activity-summary {
  max-width: 52ch;
  color: var(--soft);
  font-size: 18px;
}
.activity-summary strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.activity-scroll {
  min-height: 170px;
  padding: 18px 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.activity-months,
.activity-grid {
  display: grid;
  grid-template-columns: repeat(var(--activity-weeks, 53), minmax(0, 1fr));
  column-gap: 3px;
  min-width: 680px;
}
.activity-months {
  height: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}
.activity-months span {
  grid-row: 1;
  white-space: nowrap;
}
.activity-grid {
  grid-template-rows: repeat(7, auto);
  grid-auto-flow: column;
  row-gap: 3px;
}
.activity-grid span {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--activity-0);
}
.activity [data-level="1"] {
  background: var(--activity-1);
}
.activity [data-level="2"] {
  background: var(--activity-2);
}
.activity [data-level="3"] {
  background: var(--activity-3);
}
.activity [data-level="4"] {
  background: var(--activity-4);
}
.activity-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  color: var(--muted);
  font-size: 14px;
}
.activity-updated,
.activity-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.activity-legend {
  gap: 4px;
}
.activity-legend span {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--activity-0);
}
.activity-legend span:first-of-type {
  margin-left: 6px;
}
.activity-legend span:last-of-type {
  margin-right: 6px;
}
.activity-unavailable .activity-scroll,
.activity-unavailable .activity-updated,
.activity-unavailable .activity-legend {
  display: none;
}

.degrees {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.skills {
  margin: 0;
}
.skills > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 2px 24px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.skills > div:first-child {
  padding-top: 0;
  border-top: 0;
}
.skills dt {
  color: var(--muted);
  font-size: 15px;
}
.skills dd {
  margin: 0;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 32px;
}
.project {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
}
.project img {
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.project p {
  color: var(--soft);
  font-size: 15px;
}
.project .project-stack {
  color: var(--muted);
  font-size: 14px;
}

.outside {
  display: grid;
  justify-items: start;
  gap: 24px;
}
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
.photo-strip .photo-button {
  aspect-ratio: 4 / 5;
}

.contact {
  display: grid;
  justify-items: start;
  gap: 20px;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: clamp(72px, 10vw, 128px);
  border-top: 1px solid var(--line);
}
.contact h2 {
  font-size: clamp(60px, 8vw, 104px);
}
.contact p {
  max-width: 46ch;
  color: var(--soft);
  font-size: 18px;
}
.contact-email {
  color: var(--text);
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
}
.contact-email:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.contact .intro-actions {
  margin-top: 12px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes glow-in {
  from {
    opacity: 0;
  }
}

@media (max-width: 1050px) {
  .intro {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 48px 40px;
  }
  .resume-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .section-rail {
    position: static;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
  }
  .section-rail p {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "portrait"
      "copy"
      "facts";
    gap: 28px;
    padding-block: 36px 48px;
  }
  #afterglow-canvas {
    top: -70px;
    right: -150px;
    width: 460px;
    max-width: none;
    height: 400px;
    opacity: 0.5;
  }
  .intro-portrait {
    justify-self: start;
    width: 112px;
    border-radius: 24px;
    box-shadow:
      0 16px 40px rgba(0, 0, 0, 0.45),
      0 0 0 6px rgba(var(--accent-rgb), 0.06);
  }
  .intro h1 {
    font-size: clamp(56px, 17vw, 84px);
  }
  .intro-role {
    margin-top: 14px;
  }
  .intro-summary {
    font-size: 16px;
  }
  .intro-actions {
    width: 100%;
    margin-top: 28px;
  }
  .intro-actions .button {
    flex: 1 1 140px;
  }
  .activity-summary {
    font-size: 16px;
  }
  .activity-scroll {
    margin-inline: -4px;
    padding: 14px 14px 16px;
    border-radius: 16px;
  }
  .intro-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .intro-facts > div,
  .intro-facts > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .intro-facts dd {
    margin: 0;
    text-align: right;
  }
  .resume-section {
    padding-block: 48px;
  }
  .role {
    padding-block: 32px;
  }
  .role-header h3 {
    font-size: 22px;
  }
  .ledger {
    margin-inline: -4px;
    padding: 18px 18px 16px;
    border-radius: 16px;
  }
  .ledger dl > div {
    padding-block: 8px;
  }
  .ledger dt {
    font-size: 14px;
  }
  .ledger dd {
    font-size: 18px;
  }
  .highlights {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .skills > div {
    grid-template-columns: minmax(0, 1fr);
  }
  .projects {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .photo-strip {
    display: flex;
    width: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .photo-strip::-webkit-scrollbar {
    display: none;
  }
  .photo-strip .photo-button {
    flex: 0 0 68%;
    scroll-snap-align: start;
  }
  .contact {
    gap: 16px;
  }
  .contact p {
    font-size: 16px;
  }
  .contact .intro-actions .button {
    flex: 1 1 100%;
  }
}

@media (max-width: 370px) {
  .intro h1 {
    font-size: 54px;
  }
  .intro-role {
    font-size: 19px;
  }
  .intro-facts > div,
  .intro-facts > div:first-child {
    flex-direction: column;
    gap: 2px;
  }
  .intro-facts dd {
    text-align: left;
  }
  .ledger dd {
    font-size: 17px;
  }
}
