:root {
  --ink: #0f1115;
  --raised: #171a21;
  --line: #262a33;
  --text: #ebe9e4;
  --muted: #8f949e;
  --accent: #7ea6f2; /* the blue behind the portrait */
  --accent-ink: #0f1115;

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", ui-serif, Georgia, serif;
  --max: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--ink);
  background-image: radial-gradient(circle, rgb(126 166 242 / .16) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  padding: .5rem .9rem; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgb(15 17 21 / .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand { font-weight: 800; font-size: 1.125rem; letter-spacing: -.02em; text-decoration: none; }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: clamp(.9rem, 3vw, 2rem); }
.nav nav a { color: var(--muted); text-decoration: none; font-size: .9375rem; transition: color .2s; }
.nav nav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: calc(100svh - 4rem);
  padding-block: 4rem 6rem;
}
.hello { color: var(--accent); font-size: 1.125rem; font-weight: 500; margin-bottom: .75rem; }
h1 {
  font-family: var(--display);
  font-size: clamp(3.25rem, 9vw, 6.75rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.025em;
}
.lede {
  max-width: 34rem;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}
.links { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 2.25rem; }
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(23 26 33 / .6);
  color: var(--muted);
  font-size: .9375rem;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.pill svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.pill:hover { color: var(--accent); border-color: var(--accent); }

.portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 26rem);
}
.portrait::before {
  /* the painting's blue spills onto the page as a soft halo */
  content: "";
  position: absolute; inset: 12% -8% -8% 12%;
  background: var(--accent);
  border-radius: 2rem;
  opacity: .14;
  filter: blur(40px);
  z-index: -1;
}
.portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.75rem;
  outline: 1px solid rgb(255 255 255 / .06);
  outline-offset: -1px;
}

/* one orchestrated load sequence, hero only */
@media (prefers-reduced-motion: no-preference) {
  .load {
    opacity: 0;
    transform: translateY(18px);
    animation: rise .9s var(--ease) forwards;
    animation-delay: calc(var(--d) * 110ms + 80ms);
  }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-title {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--display);
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -.02em;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4.5rem); }
.prose p { color: var(--muted); max-width: 34rem; }
.prose p + p { margin-top: 1.1rem; }
.prose a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }

/* timeline */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; top: .6rem; bottom: .6rem; left: 9.5rem;
  width: 1px; background: var(--line);
}
.timeline li {
  position: relative;
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 2.5rem;
  padding-bottom: 2.25rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: calc(9.5rem - 4px); top: .5rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--muted);
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); }
.when { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.timeline h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.timeline h3 span { color: var(--accent); font-weight: 500; }
.timeline h3 span::before { content: "at "; color: var(--muted); }
.timeline p { margin-top: .35rem; color: var(--muted); max-width: 40rem; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 2rem; }
@media (min-width: 1000px) { .skills { grid-template-columns: repeat(5, 1fr); gap: 1.75rem; } }
.skills h3, .creds h3 { font-size: 1rem; font-weight: 600; margin-bottom: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  padding: .3rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(23 26 33 / .6);
  color: var(--muted);
  font-size: .875rem;
}
.creds {
  display: grid; grid-template-columns: 2fr 1fr; gap: 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.creds li { color: var(--muted); padding-block: .2rem; }
.creds li span { color: var(--text); opacity: .55; font-size: .875rem; margin-left: .35rem; }

/* contact */
.contact-line { color: var(--muted); font-size: clamp(1.125rem, 2vw, 1.375rem); }
.mail {
  display: inline-block;
  margin-top: .75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 4.75rem);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 3px;
  transition: background-size .5s var(--ease), color .3s;
}
.mail:hover { color: var(--accent); background-size: 100% 3px; }

.footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 2.5rem 3rem;
  /* hairline aligned with the content column, not the padded box */
  background: linear-gradient(var(--line), var(--line)) no-repeat top center / calc(100% - 2 * var(--gutter)) 1px;
  color: var(--muted);
  font-size: .875rem;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-block: 2.5rem 4rem; }
  .portrait { order: -1; justify-self: start; width: min(60%, 15rem); }
  .about-grid, .creds { grid-template-columns: 1fr; }
  .timeline::before { left: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: .25rem; padding-left: 1.75rem; }
  .timeline li::before { left: 0; }
  .nav nav a[href="#skills"] { display: none; }
}
@media (max-width: 420px) {
  .nav nav { gap: .9rem; }
}
