:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --border: #e6e0d4;
  --text: #2f2a24;
  --muted: #7a7166;
  --accent: #5b7b5a;
  --accent-soft: #e7eee3;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --surface: #24211d;
    --border: #36322c;
    --text: #ece6dc;
    --muted: #a39a8d;
    --accent: #9cbf98;
    --accent-soft: #2c3529;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.0625rem;
}

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

body { overflow-x: clip; }

/* Reading progress bar */
.progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem max(1.5rem, calc((100% - 820px) / 2 + 1.5rem));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: padding .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.nav.scrolled {
  padding-top: .8rem; padding-bottom: .8rem;
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(60, 50, 35, 0.06);
}
.logo { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.nav nav { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .95rem; }
.nav nav a { position: relative; color: var(--muted); transition: color .2s; }
.nav nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform .3s ease;
}
.nav nav a:hover, .nav nav a.active { color: var(--accent); }
.nav nav a:hover::after, .nav nav a.active::after { transform: scaleX(1); }

main { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4.5rem 0 1rem; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h4 { font-size: 1.15rem; }
.subhead { font-size: 1.3rem; margin: 2.75rem 0 1rem; }
section > p { margin-bottom: 1rem; max-width: 65ch; }
.meta { color: var(--muted); font-size: .9rem; }

/* Intro */
.hero { position: relative; isolation: isolate; padding-top: 6rem; padding-bottom: 3rem; }

/* Soft drifting shapes behind the intro */
.blobs { position: absolute; inset: -2rem -6rem; z-index: -1; pointer-events: none; }
.blobs span {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: .55;
  animation: drift 18s ease-in-out infinite alternate;
}
.blobs span:nth-child(1) { width: 340px; height: 340px; background: #cfdcc6; top: 0; right: 0; }
.blobs span:nth-child(2) { width: 260px; height: 260px; background: #ecd9bf; top: 45%; right: 22%; animation-duration: 22s; animation-delay: -6s; }
.blobs span:nth-child(3) { width: 200px; height: 200px; background: #dfe6d2; top: 10%; left: 30%; animation-duration: 26s; animation-delay: -12s; }
@media (prefers-color-scheme: dark) {
  .blobs span { opacity: .18; }
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-40px, 30px) scale(1.08); }
  100% { transform: translate(30px, -20px) scale(.95); }
}

/* Intro text rises in on load, one line after another */
.js .hero > :not(.blobs) { opacity: 0; animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.js .hero > :nth-child(2) { animation-delay: .1s; }
.js .hero > :nth-child(3) { animation-delay: .25s; }
.js .hero > :nth-child(4) { animation-delay: .4s; }
.js .hero > :nth-child(5) { animation-delay: .55s; }
.js .hero > :nth-child(6) { animation-delay: .7s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* Waving hand next to the greeting */
.eyebrow::after { content: ' 👋'; display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1.2s 2; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}

/* Scroll reveal */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.js .reveal.visible { opacity: 1; transform: none; }
.eyebrow { color: var(--accent); font-weight: 500; margin-bottom: .5rem; }
.hero h1 { font-size: clamp(3rem, 9vw, 5rem); letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.lead { font-size: 1.2rem; max-width: 58ch; color: var(--text); margin-bottom: 1.5rem; }

/* Buttons */
.links { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn {
  font-size: .95rem; font-weight: 500;
  padding: .7rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .2s, background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(60, 50, 35, 0.08); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.primary:hover { filter: brightness(1.08); color: var(--surface); }

/* Timeline (experience + education) */
.timeline { position: relative; display: grid; gap: 2rem; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: .5rem; bottom: .5rem;
  width: 2px; border-radius: 2px;
  background: linear-gradient(var(--accent), var(--border));
}
.role { position: relative; }
/* Dot on the line */
.role::before {
  content: ''; position: absolute; left: calc(-2rem + 1px); top: .4rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.role:first-child::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.role h4 { margin-top: .15rem; }
.company { color: var(--accent); font-weight: 500; }
.role ul { padding: .6rem 0 0 1.2rem; }
.role li { margin-bottom: .3rem; }
.role li::marker { color: var(--accent); }

.plain { list-style: none; display: grid; gap: .5rem; }
.plain .meta { margin-left: .5rem; }

#contact { padding-bottom: 2rem; }
footer { text-align: center; padding: 4rem 1rem 3rem; color: var(--muted); font-size: .9rem; }

@media (max-width: 600px) {
  .nav { flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1rem; }
  .nav nav { gap: 1rem; }
  main { padding: 0 1rem; }
  .hero { padding-top: 3rem; }
  section { padding-top: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hero > :not(.blobs), .js .reveal { opacity: 1; transform: none; }
}
