/* Colours, fonts and other values used across the site */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --raised: #f1f1ef;
  --ink: #0c0c0c;
  --muted: #6b6b68;
  --line: #e5e5e2;
  --a1: #2f5bff;
  --a2: #6b8cff;
  --tint: #ebf2ec;
  --display: "Inter Tight", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --grad: linear-gradient(100deg, var(--a1), var(--a2));
  color-scheme: light;
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* Layout */
.page {
  position: relative;
  z-index: 1;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* Navigation */
.nav {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 10;
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.mark {
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -.03em;
}

.nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9rem;
}

.nav li a {
  display: block;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  transition: color .2s, background .2s;
}

.nav li a:hover {
  color: var(--ink);
  background: var(--raised);
}

.nav li a.active {
  background: var(--ink);
  color: #fff;
}

/* On small phones the nav stays on one line and the links scroll sideways */
@media (max-width: 560px) {
  .nav-in {
    position: relative;
    flex-wrap: nowrap;
    max-width: 100%;
    gap: 10px;
    padding: 6px 6px 6px 14px;
  }

  .mark {
    flex: none;
  }

  .nav ul {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: .84rem;
  }

  .nav-in.nav-overflow::after {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 1px;
    right: 1px;
    width: 48px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, transparent, var(--surface) 70%);
    pointer-events: none;
  }

  .nav ul::-webkit-scrollbar {
    display: none;
  }

  .nav li a {
    padding: 6px 9px;
  }
}

/* Blue gradient text (logo dot, loading screen) */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: sheen 16s ease-in-out infinite alternate;
}

@keyframes sheen {
  to {
    background-position: 100% 0;
  }
}

/* Sections: each one gets a full-width background */
.band {
  position: relative;
  isolation: isolate;
  padding-block: clamp(72px, 10vw, 128px);
  --band: var(--bg);
}

.band::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: var(--band);
}

#about-me,
#awards {
  --band: var(--tint);
}

/* Extend the first section's colour up behind the nav */
#about-me::before {
  top: -160px;
}

.band-white {
  --band: var(--surface);
}

.band-white::before {
  border-block: 1px solid var(--line);
}

.band-dark {
  --band: #0c0c0c;
  --ink: #fafafa;
  --muted: #a3a3a0;
  --line: #2a2a2a;
  --surface: #161616;
  --raised: #1f1f1f;
  color: var(--ink);
}

#about-me {
  padding-top: clamp(56px, 8vw, 96px);
}

/* Section headings. The words slide up when the section comes into view (see script.js) */
.sec-head {
  margin-bottom: clamp(40px, 6vw, 64px);
}

.sec-head::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 22px;
  border-radius: 4px;
  background: var(--a1);
  transform-origin: left;
}

.band-dark .sec-head::after {
  background: var(--a2);
}

html.reveal-on .sec-head::after {
  transform: scaleX(0);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1) .35s;
}

html.reveal-on .sec-head.in::after {
  transform: none;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -.05em;
  line-height: .95;
}

.sec-head h2::after,
.sec-head .dot {
  content: ".";
  color: var(--a1);
}

.band-dark .sec-head h2::after,
.band-dark .sec-head .dot {
  color: var(--a2);
}

.sec-head h2.split::after {
  content: none;
}

.hw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

.hw > span {
  display: inline-block;
}

html.reveal-on .sec-head.reveal {
  opacity: 1;
  transform: none;
}

html.reveal-on .sec-head .hw > span {
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--i) * 90ms);
}

html.reveal-on .sec-head.in .hw > span {
  transform: none;
}

h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
}

/* Cards with a soft glow that follows the cursor */
.tile {
  position: relative;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  overflow: hidden;
  min-width: 0;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, -100%), color-mix(in srgb, var(--a1) 10%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}

.tile:hover::after {
  opacity: 1;
}

.tile:hover {
  border-color: color-mix(in srgb, var(--a1) 30%, var(--line));
  box-shadow: 0 24px 48px -28px rgba(16, 24, 64, .22);
}

/* About me */
.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: clamp(40px, 5vw, 64px) 24px;
  --body-ink: #3d3d3a;
  --rule: #bdbdb7;
}

.hi {
  grid-column: 1/9;
  grid-row: 1;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: -.045em;
  line-height: 1.05;
  margin-bottom: -32px;
}

.wave {
  display: inline-block;
  transform-origin: 70% 80%;
  animation: wave 2.8s ease-in-out infinite;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }

  10%,
  30% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }
}

.intro-main {
  grid-column: 1/9;
  grid-row: 2;
}

.big-text {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.75vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: -.02em;
  text-wrap: pretty;
}

/* Resume / LinkedIn / GitHub buttons */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid #0c0c0c;
  color: #0c0c0c;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}

.quick-links a:hover {
  background: #0c0c0c;
  color: #fff;
  transform: translateY(-2px);
}

.quick-links .ql-solid {
  background: #0c0c0c;
  color: #fff;
}

.quick-links .ql-solid:hover {
  background: #333;
  border-color: #333;
}

.quick-links svg {
  width: 17px;
  height: 17px;
  flex: none;
}

@media (max-width: 480px) {
  .quick-links {
    gap: 8px;
  }

  .quick-links a {
    gap: 7px;
    padding: 10px 14px;
    font-size: .88rem;
  }

  .quick-links svg {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 380px) {
  .quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-links a {
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    font-size: .82rem;
  }
}

/* Photo */
.photo {
  position: relative;
  grid-column: 10/-1;
  grid-row: 1/3;
  align-self: start;
  margin: 0;
  aspect-ratio: 1/1;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--surface), var(--raised));
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

/* Quote */
.quote {
  grid-column: 8/-1;
  grid-row: 3;
  margin: 0;
  position: relative;
  padding: 28px 0 0;
  border-top: 1px solid var(--rule);
}

.quote::before {
  content: "\201C";
  display: block;
  height: .5em;
  margin-bottom: 6px;
  font: 400 6rem/1 Georgia, "Times New Roman", serif;
  color: var(--ink);
}

.quote p::after {
  content: "\201D";
  display: block;
  height: .5em;
  margin-top: 14px;
  text-align: right;
  font: 400 6rem/1 Georgia, "Times New Roman", serif;
  color: var(--ink);
}

.quote blockquote {
  margin: 0;
}

.quote p {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.75vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}

/* Fun fact */
.fun {
  grid-column: 1/7;
  grid-row: 3;
  align-self: start;
  display: grid;
  gap: 12px;
  justify-items: start;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  color: var(--body-ink);
  font-size: 1.05rem;
  line-height: 1.75;
}

.fun-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  letter-spacing: -.025em;
  line-height: 1.3;
  color: var(--ink);
}

/* Projects: the cards stick and stack on top of each other as you scroll */
.stack {
  display: grid;
  gap: 28px;
}

.stack::after {
  content: "";
  height: clamp(120px, 22vh, 220px);
}

/* script.js sets --n (number of cards) and --depth (how buried a card is) */
.scard {
  position: sticky;
  top: calc(100px + var(--i) * 14px);
  margin-bottom: calc((var(--n, 6) - 1 - var(--i)) * 14px);
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--depth, 0) * .03));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  min-height: 28rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 -12px 40px -24px rgba(16, 24, 64, .18);
}

.scard + .scard {
  margin-top: calc((var(--n, 6) - var(--i)) * -14px);
}

.scard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: #0c0c0c;
  opacity: calc(var(--depth, 0) * .07);
  pointer-events: none;
}

.scard > .s-text,
.scard > .s-img {
  opacity: clamp(0, calc((1.1 - var(--depth, 0)) * 2.5), 1);
}

.s-text {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  align-items: flex-start;
}

.s-num {
  font: 700 clamp(2.5rem, 4.2vw, 3.6rem)/.9 var(--display);
  letter-spacing: -.055em;
  color: transparent;
  -webkit-text-stroke: 1.4px #c4c4bf;
  padding-bottom: 18px;
}

.idx {
  font: 500 .8rem var(--mono);
  color: var(--a1);
}

.s-text h3 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.s-text p {
  color: var(--muted);
}

/* Links inside the project descriptions */
.inline-link {
  color: var(--a1);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}

.inline-link:hover {
  color: #1d3fd6;
}

.s-img {
  position: relative;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  overflow: hidden;
  background: radial-gradient(90% 90% at 75% 10%, color-mix(in srgb, var(--a1) 16%, transparent), transparent 70%), #eef0f5;
}

.scard:nth-child(2) .s-img {
  background: radial-gradient(90% 90% at 20% 90%, color-mix(in srgb, var(--a1) 16%, transparent), transparent 70%), #f0f0ee;
}

.scard:nth-child(3) .s-img {
  background: radial-gradient(100% 80% at 50% 0%, color-mix(in srgb, var(--a2) 22%, transparent), transparent 70%), #eef0f5;
}

.s-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

.scard:hover .s-img img {
  transform: scale(1.03);
}

/* Image display options, added as a class on .s-img:
   fit  - whole image on a black background
   full - whole image, with a blurred copy filling the space behind it
   left - keep the left side of the image in view
   pan  - slowly scroll across a wide image */
.scard .s-img.fit {
  background: #000;
  border-left-color: #000;
}

.s-img.fit img {
  object-fit: contain;
  padding: clamp(12px, 2vw, 24px);
}

.s-img.full img {
  object-fit: contain;
}

.s-img.full img.bg,
.scard:hover .s-img.full img.bg {
  object-fit: cover;
  filter: blur(28px) brightness(.9);
  transform: scale(1.2);
}

.s-img.left img {
  object-position: 0% 50%;
  transform-origin: left center;
}

.scard .s-img.pan {
  background: #0b0c10;
  border-left-color: #0b0c10;
}

.s-img.pan img {
  object-fit: cover;
  object-position: 0% 50%;
  animation: pan 16s ease-in-out infinite alternate;
}

.scard:hover .s-img.pan img {
  transform: none;
  animation-play-state: paused;
}

@keyframes pan {
  to {
    object-position: 100% 50%;
  }
}

/* Tech tags and links under each project */
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  font: 500 .75rem var(--mono);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 6px;
}

.links a,
.more {
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}

.links a:hover,
.more:hover {
  color: var(--a1);
  border-color: var(--a1);
}

.links span,
.more span {
  display: inline-block;
  transition: transform .2s;
}

.links a:hover span,
.more:hover span {
  transform: translate(2px, -2px);
}

.more {
  display: inline-block;
  margin-top: clamp(48px, 7vw, 72px);
}

/* Bigger tap area for small links on touch screens */
@media (pointer: coarse) {
  .links a,
  .more,
  .mark {
    position: relative;
  }

  .links a::after,
  .more::after,
  .mark::after {
    content: "";
    position: absolute;
    inset: -10px -8px;
  }
}

/* Awards & certificates */
.awards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.award {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.award:hover {
  transform: translateY(-4px);
}

.award-img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  appearance: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
  background: radial-gradient(90% 80% at 50% 0%, color-mix(in srgb, var(--a1) 8%, transparent), transparent 70%), var(--raised);
}

.award-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.award:hover .award-img img {
  transform: scale(1.04);
}

/* doc  - letter-style page, shows the top part of the page */
.award-img.doc {
  align-items: start;
  padding: 22px 22px 0;
}

.award-img.doc img {
  position: relative;
  inset: auto;
  height: auto;
  padding: 0;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 10px 30px -12px rgba(16, 24, 64, .35);
  transform-origin: top center;
}

/* land - landscape certificate, shown whole */
.award-img.land img {
  padding: 22px 28px;
  filter: drop-shadow(0 10px 20px rgba(16, 24, 64, .22));
}

.award-note {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
  margin-top: 4px;
}

.cert-ph {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.cert-ph b {
  font-size: 2.6rem;
  line-height: 1;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.award:hover .cert-ph b {
  transform: scale(1.12) rotate(-8deg);
}

.cert-ph small {
  font: 500 .72rem var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.award-body {
  display: grid;
  gap: 6px;
  justify-items: start;
  align-content: start;
  padding: 22px 24px 24px;
  flex: 1;
}

.award-body h3 {
  font-size: 1.2rem;
}

/* "Click to enlarge" label on hover */
.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 8px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 12, 12, .78);
  color: #fff;
  font: 500 .75rem var(--body);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

.award-img:hover .zoom-hint,
.award-img:focus-visible .zoom-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.award-img:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: -4px;
}

/* Certificate pop-up */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 24px);
  animation: lb-in .3s ease;
}

.lightbox::backdrop {
  background: rgba(10, 10, 12, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes lb-in {
  from {
    opacity: 0;
  }
}

.lb-fig {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 16px;
  min-width: 0;
  animation: lb-zoom .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes lb-zoom {
  from {
    transform: scale(.94);
  }
}

.lb-img {
  display: grid;
  place-items: center;
  max-width: 100%;
}

.lb-img img {
  display: block;
  max-width: min(100%, 1200px);
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}

.lb-img .cert-ph {
  width: min(70vw, 640px);
  aspect-ratio: 4/3;
  place-content: center;
  border-radius: 16px;
  background: var(--raised);
}

.lb-img .cert-ph b {
  font-size: 4rem;
}

.lightbox figcaption {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.lightbox figcaption .yr {
  color: #9db2ff;
}

.lightbox figcaption strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.lightbox figcaption .org {
  color: rgba(255, 255, 255, .7);
}

.lb-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 400 1.9rem/1 var(--body);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .5);
}

.lb-btn:focus-visible {
  outline: 2px solid #9db2ff;
  outline-offset: 3px;
}

.lb-close {
  position: fixed;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
}

.lightbox.single .lb-prev,
.lightbox.single .lb-next {
  visibility: hidden;
}

html:has(.lightbox[open]) {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox[open] {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
  }

  .lb-prev,
  .lb-next {
    position: fixed;
    bottom: 20px;
    width: 44px;
    height: 44px;
  }

  .lb-prev {
    left: calc(50% - 56px);
  }

  .lb-next {
    right: calc(50% - 56px);
  }

  .lb-img img {
    max-height: calc(100dvh - 240px);
  }

  .awards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Experience timeline: the line fills in as you scroll */
.tl {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  --line-x: calc(11rem + 36px);
  --fill: 0;
}

.tl::after {
  content: "";
  position: absolute;
  left: calc(var(--line-x) - 1px);
  top: 0;
  width: 3px;
  height: calc(var(--fill) * 100%);
  border-radius: 3px;
  background: linear-gradient(var(--a2), var(--a1));
}

.tl > li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 36px;
}

.tl-date {
  font: 500 .82rem var(--mono);
  color: var(--muted);
  text-align: right;
  padding-top: 6px;
  transition: color .3s;
}

.tl-body {
  position: relative;
  padding: 0 0 56px 40px;
  border-left: 1px solid var(--line);
}

.tl > li:last-child .tl-body {
  padding-bottom: 8px;
}

.tl-body::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: -10px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--band, var(--bg));
  border: 2px solid #cfcfca;
  transition: background .3s, border-color .3s, box-shadow .3s;
}

.tl > li.on .tl-body::before {
  background: var(--a1);
  border-color: var(--a1);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--a1) 15%, transparent);
}

.tl > li.on .tl-date {
  color: var(--a1);
}

.tl-body h3 {
  font-size: 1.5rem;
}

.org {
  color: var(--muted);
}

.tl-body ul {
  margin: 14px 0 0;
  padding-left: 1.1em;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.tl-body ul li::marker {
  color: var(--a1);
}

/* Work and education side by side */
.tl-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 6vw, 88px);
}

.tl-head {
  margin-bottom: 32px;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  letter-spacing: -.035em;
}

.tl-cols .tl {
  --line-x: 0px;
}

.tl-cols .tl > li {
  grid-template-columns: minmax(0, 1fr);
}

.tl-cols .tl-date {
  text-align: left;
  padding: 0 0 8px 40px;
  border-left: 1px solid var(--line);
}

.tl-cols .tl-body::before {
  top: -24px;
}

.tl-cols .tl-body h3 {
  font-size: 1.3rem;
}

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

.yr {
  font: 500 .8rem var(--mono);
  color: var(--a1);
}

/* Contact */
.contact {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
}

#contact {
  padding-block: clamp(56px, 7vw, 88px) clamp(28px, 3vw, 40px);
}

#contact .sec-head {
  margin-bottom: clamp(28px, 4vw, 44px);
}

.contact-big {
  max-width: 18ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -.045em;
  line-height: 1.08;
  text-wrap: balance;
}

.contact-big span {
  color: #7a7a77;
}

.contact-text {
  max-width: 34rem;
  color: var(--muted);
  text-wrap: pretty;
}

/* Email box with copy button */
.mail-field {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(100%, 440px);
  padding: 6px;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  background: #161616;
  transition: border-color .2s;
}

.mail-field:hover {
  border-color: #5a5a57;
}

.mail-text {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  color: #fff;
  font: 500 1rem var(--mono);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-user-select: all;
  user-select: all;
  cursor: text;
}

.mail-field button {
  flex: none;
  padding: 11px 20px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #0c0c0c;
  font: 600 .92rem var(--body);
  cursor: pointer;
  transition: background .2s;
}

.mail-field button:hover {
  background: #d9d9d6;
}

@media (max-width: 480px) {
  .mail-text {
    padding: 10px 8px;
    font-size: .86rem;
  }

  .mail-field button {
    padding: 11px 14px;
  }
}

@media (max-width: 360px) {
  .mail-text {
    font-size: .76rem;
  }
}

/* Hidden visually but still read out by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.contact-icons {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-icons a {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #3a3a3a;
  color: #fff;
  transition: background .2s, color .2s, border-color .2s;
}

.contact-icons a:hover {
  background: #fff;
  color: #0c0c0c;
  border-color: #fff;
}

.contact-icons svg {
  width: 20px;
  height: 20px;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

footer a {
  text-decoration: none;
}

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

.band-dark :focus-visible {
  outline-color: var(--a2);
}

/* Fade sections in as they scroll into view */
html.reveal-on .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease, transform 1s cubic-bezier(.2, .8, .2, 1);
}

html.reveal-on .reveal.in {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 1000px) {
  .intro {
    grid-template-rows: none;
  }

  .hi {
    margin-bottom: -22px;
  }

  .hi,
  .intro-main,
  .quote,
  .fun {
    grid-column: 1/-1;
    grid-row: auto;
  }

  .photo {
    grid-column: 1/-1;
    grid-row: auto;
    order: -1;
    margin-top: 0;
    width: clamp(8rem, 24vw, 11rem);
    aspect-ratio: 1/1;
    border-radius: 20px;
    margin-bottom: -12px;
  }
}

@media (max-width: 860px) {
  .stack::after {
    content: none;
  }

  .scard,
  .scard + .scard {
    margin: 0;
  }

  .scard {
    position: relative;
    top: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .s-img {
    order: -1;
    aspect-ratio: 16/10;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .s-num {
    display: none;
  }
}

@media (max-height: 640px) {
  .scard {
    position: relative;
    top: auto;
  }

  .stack::after {
    content: none;
  }

  .scard,
  .scard + .scard {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .tl {
    --line-x: 0px;
  }

  .tl > li {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-date {
    text-align: left;
    padding: 0 0 8px 40px;
    border-left: 1px solid var(--line);
  }

  .tl-body::before {
    top: -24px;
  }
}

/* Respect the "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none!important;
    transition: none!important;
  }
}

/* Loading screen */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(60vmax 60vmax at 50% 45%, color-mix(in srgb, var(--a1) 9%, var(--bg)), var(--bg) 70%);
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}

.loader-in {
  display: grid;
  gap: 30px;
  justify-items: center;
  text-align: center;
  width: min(100%, 30rem);
  transition: opacity .8s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1);
}

.loader-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 3rem);
  letter-spacing: -.035em;
  line-height: 1.1;
}

.loader .w {
  display: inline-block;
  padding-bottom: .12em;
}

.loader .w > span {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(12px);
  animation: loader-word 1.4s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--i) * .22s + .3s);
}

@keyframes loader-word {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.loader-bar {
  width: min(100%, 14rem);
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.loader-bar i {
  display: block;
  height: 100%;
  background: var(--a1);
  transform-origin: left;
  transform: scaleX(0);
}

.loader-count {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Hide the page while loading, then fade it in */
html.is-loading {
  overflow: hidden;
}

.page {
  transition: opacity 1.2s ease .3s, transform 1.4s cubic-bezier(.2, .8, .2, 1) .3s;
}

html.is-loading .page {
  opacity: 0;
  transform: translateY(20px);
}

html.is-loaded .loader {
  opacity: 0;
  visibility: hidden;
}

html.is-loaded .loader-in {
  opacity: 0;
  transform: translateY(-12px);
}

@media (prefers-reduced-motion: reduce) {
  .loader .w > span {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
