/* ───────────────────────── fonts (self-hosted) ───────────────────────── */
@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ───────────────────────── tokens ───────────────────────── */
:root {
  --bg: #f3efe2;          /* warm beige base, a hint of green */
  --bg-2: #ece3d2;
  --ink: #2b2f22;         /* olive-black text */
  --muted: #6b6956;
  --faint: #9a9683;
  --olive: #6e7c45;
  --olive-2: #98a56f;     /* sage */
  --olive-3: #c9d1ad;
  --gold: #c39a4c;
  --gold-2: #e5c98d;
  --cream: #fffaf0;
  --grad: linear-gradient(100deg, var(--olive) 0%, #8c8f4e 45%, var(--gold) 100%);
  --glass: linear-gradient(140deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.24));
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 30px 80px -32px rgba(74, 64, 34, 0.38), 0 2px 6px rgba(74, 64, 34, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --line: rgba(43, 47, 34, 0.1);
  --line-strong: rgba(43, 47, 34, 0.2);
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
::selection { background: var(--olive-3); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 8px; }

/* ───────────────────────── glass ───────────────────────── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(1.35);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
}

/* ───────────────────────── background scene ───────────────────────── */
.scene { position: fixed; inset: -10%; z-index: -2; overflow: hidden; pointer-events: none; }
/* barely-there colour stains, drifting very slowly */
.stain { position: absolute; border-radius: 50%; filter: blur(120px); will-change: transform; }
.s1 { width: 60vmax; height: 50vmax; top: -10vmax; right: -10vmax; background: #b3bf8a; opacity: 0.5; animation: drift1 60s ease-in-out infinite alternate; }
.s2 { width: 55vmax; height: 45vmax; bottom: -12vmax; left: -12vmax; background: #ecd9ae; opacity: 0.4; animation: drift2 72s ease-in-out infinite alternate; }
.s3 { width: 40vmax; height: 35vmax; top: 35%; left: 35%; background: #fffaf0; opacity: 0.55; animation: drift3 80s ease-in-out infinite alternate; }
.s4 { width: 45vmax; height: 38vmax; top: 50%; right: 0%; background: #c4cd9f; opacity: 0.45; animation: drift1 90s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(-8vw, 10vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(10vw, -8vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-12vw, 6vh) scale(0.92); } }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .42 0 0 0 0 .32 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────────────────────── nav ───────────────────────── */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 28px;
  width: min(calc(100% - 32px), 760px);
  padding: 8px 8px 8px 22px; border-radius: 999px;
}
.brand { font-weight: 600; letter-spacing: -0.02em; margin-right: auto; }
.brand span { color: var(--gold); }
.nav nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav nav a { transition: color 0.2s; }
.nav nav a:hover, .nav nav a.active { color: var(--ink); }
.nav nav a.active { font-weight: 500; }
.nav-cta {
  font-size: 14px; font-weight: 500; padding: 9px 18px; border-radius: 999px;
  background: var(--olive); color: var(--cream);
  box-shadow: 0 6px 18px -6px rgba(110, 124, 69, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.nav-cta:hover { transform: translateY(-1px); background: #5f6c3a; }

/* ───────────────────────── shared ───────────────────────── */
section { position: relative; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--olive); font-weight: 500; }
h1, h2 { margin: 0; font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; }
h2 { font-size: clamp(48px, 8vw, 104px); }
.section-head { margin-bottom: clamp(40px, 6vw, 72px); }

.corner-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.pill {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  letter-spacing: 0.08em; color: var(--ink); transition: background 0.3s, border-color 0.3s;
}
.pill:hover { background: rgba(255, 255, 255, 0.6); border-color: var(--olive-2); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ───────────────────────── hero ───────────────────────── */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: 110px; padding-bottom: 60px; }
.hero-card {
  width: 100%; border-radius: 36px; padding: clamp(22px, 3.2vw, 40px);
  display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px);
}
.hero-body { display: grid; grid-template-columns: minmax(200px, 0.75fr) 1.4fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.portrait {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 380px; justify-self: center;
  border-radius: 50%; padding: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2));
  box-shadow: 0 30px 60px -24px rgba(74, 64, 34, 0.45), inset 0 1px 0 #fff;
}
.portrait::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 200deg, var(--olive-2), var(--gold-2), var(--cream), var(--olive-2));
  filter: blur(18px); opacity: 0.9; animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.intro h1 { font-size: clamp(46px, 7.4vw, 104px); margin: 0; line-height: 1.04; }
.hero-text { padding-top: 8px; border-top: 1px solid var(--line); }
.hero-text .lead { margin-top: clamp(20px, 3vw, 32px); }
.intro h1 em {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 1.08em; /* optical match: the serif's lowercase is smaller than the sans */
  margin-left: -0.02em; padding-right: 0.06em; letter-spacing: 0.02em;
  -webkit-text-stroke: 0.028em transparent; /* thickens the thin serif; the gradient fills the stroke too */
}
.h-line { display: block; }
.fairy { display: inline-block; font-size: 0.72em; margin-left: -0.12em; vertical-align: -0.02em; animation: flutter 4s ease-in-out infinite; }
@keyframes flutter { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.lead { font-size: clamp(17px, 1.5vw, 21px); color: var(--muted); max-width: 44em; margin: 0 0 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.icon-btn {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--cream);
  box-shadow: 0 10px 24px -10px rgba(43, 47, 34, 0.55);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { transform: translateY(-3px); background: var(--olive); }

/* ───────────────────────── resume ───────────────────────── */
.resume { padding-top: clamp(80px, 10vw, 140px); padding-bottom: clamp(80px, 10vw, 140px); }
.timeline { display: grid; grid-template-columns: 0.85fr 1.4fr; gap: clamp(28px, 5vw, 80px); }

.year-panel {
  position: sticky; top: 24vh; align-self: start; border-radius: 30px; padding: 30px 30px 24px;
}
.year-big {
  font-size: clamp(60px, 7vw, 100px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.9;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), filter 0.35s;
}
.year-big.word { font-size: clamp(46px, 5.2vw, 76px); letter-spacing: -0.04em; }
.year-big.swap { opacity: 0; transform: translateY(16px); filter: blur(8px); }
.year-range { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink); }
.year-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.year-count { font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
.year-count b { color: var(--ink); font-weight: 600; }

.track { position: relative; padding-left: 44px; }
.rail { position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.rail-fill { position: absolute; inset: 0; background: linear-gradient(180deg, var(--olive), var(--gold)); transform-origin: top; transform: scaleY(0); }

.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.group-label {
  margin: 34px 0 6px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--olive); font-weight: 600;
  display: flex; align-items: center; gap: 14px;
}
.group-label:first-child { margin-top: 0; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* fade the card's contents, not the card itself: opacity on the card would switch off its glass blur */
.e { position: relative; transform: translateX(14px); transition: transform 0.7s var(--ease); }
.e .e-card > * { opacity: 0.45; transition: opacity 0.7s var(--ease); }
.e.seen { transform: none; }
.e.seen .e-card > * { opacity: 0.8; }
.e.active { transform: none; }
.e.active .e-card > * { opacity: 1; }
.e::before {
  content: ""; position: absolute; left: -44px; top: 50%; margin-top: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
  transition: border-color 0.5s, box-shadow 0.5s, background 0.5s;
}
.e.seen::before, .e.active::before { border-color: var(--olive); background: var(--olive); }
.e.active::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 6px rgba(195, 154, 76, 0.2); }

.e-card { border-radius: 24px; padding: clamp(20px, 2.6vw, 28px) clamp(22px, 3vw, 32px); transition: transform 0.5s var(--ease), box-shadow 0.5s; }
.e.active .e-card { transform: scale(1.015); }
.e-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.e h3 { margin: 0; font-size: clamp(21px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.e .org { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); }
.e .dates {
  flex: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line);
}
.e.current .dates { background: var(--olive); color: var(--cream); border-color: transparent; }
.e .note { margin: 14px 0 0; color: var(--muted); font-size: 16px; padding-left: 16px; position: relative; }
.e .note::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.e.pro h3 { font-size: clamp(24px, 2.6vw, 34px); }

/* ───────────────────────── projects ───────────────────────── */
.projects { padding-bottom: clamp(80px, 10vw, 140px); }
.building { border-radius: 36px; padding: clamp(24px, 3.2vw, 40px); overflow: hidden; }
.building-line { margin: 0 0 12px; font-size: clamp(34px, 5.4vw, 72px); letter-spacing: -0.04em; line-height: 1.05; font-weight: 500; }
.rotator { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.caret { display: inline-block; width: 3px; height: 0.85em; margin-left: 6px; vertical-align: -0.08em; background: var(--olive); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.building-sub { margin: 0; color: var(--muted); max-width: 36em; }

/* ───────────────────────── newsletter ───────────────────────── */
.newsletter { padding-bottom: clamp(70px, 9vw, 120px); scroll-margin-top: 90px; }
.news-card {
  border-radius: 36px; padding: clamp(26px, 4vw, 52px);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  background: linear-gradient(140deg, rgba(232, 238, 214, 0.75), rgba(255, 250, 240, 0.4));
}
.news-title { font-size: clamp(34px, 4.6vw, 58px); margin-bottom: 16px; }
.news-title em { color: var(--olive); }
.news-text p:last-child { margin: 0; color: var(--muted); }
.field {
  display: flex; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.8); border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px -14px rgba(74, 64, 34, 0.35);
}
.field:focus-within { border-color: var(--olive-2); }
.field input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 16px;
  font: inherit; font-size: 16px; color: var(--ink); outline: none;
}
.field input::placeholder { color: var(--faint); }
.field button {
  flex: none; border: 0; cursor: pointer; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 500; background: var(--olive); color: var(--cream);
  transition: background 0.3s;
}
.field button:hover { background: #5f6c3a; }
.field button:disabled { opacity: 0.6; cursor: progress; }
.news-status { min-height: 1.5em; margin: 12px 4px 0; font-size: 15px; font-weight: 500; }
.news-status.ok { color: var(--olive); }
.news-status.err { color: #a2512f; }
.news-fine { margin: 2px 4px 0; font-size: 13px; color: var(--faint); }

/* ───────────────────────── footer ───────────────────────── */
.footer {
  max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.foot-icons { display: flex; gap: 10px; }
.foot-icons a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--glass-border); transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.foot-icons a:hover { background: var(--olive); color: var(--cream); transform: translateY(-2px); }
.foot-icons svg { width: 20px; height: 20px; }
.footer .small { margin: 0; font-size: 13px; color: var(--faint); }
.heart { display: inline-block; color: var(--olive); font-size: 1.15em; line-height: 1; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 40%, 100% { transform: scale(1); } 10%, 30% { transform: scale(1.2); } 20% { transform: scale(1.05); } }

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 900px) {
  .hero { min-height: auto; padding-top: 96px; }
  .hero-body { grid-template-columns: minmax(150px, 0.7fr) 1.4fr; gap: 28px; }
  .intro h1 { font-size: clamp(40px, 7vw, 64px); }
  .timeline { grid-template-columns: 1fr; }
  .year-panel {
    top: 80px; z-index: 5; padding: 14px 20px; border-radius: 22px;
    display: flex; align-items: center; gap: 16px;
  }
  .year-big { font-size: 42px; }
  .year-big.word { font-size: 30px; }
  .year-range { margin-top: 0; font-size: 18px; }
  .year-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: column; align-items: flex-end; gap: 4px; }
  .news-card { grid-template-columns: 1fr; }
    }
@media (max-width: 560px) {
  .hero-body { grid-template-columns: 84px 1fr; gap: 14px; }
  .portrait { padding: 5px; }
  .intro h1 { font-size: 8vw; }
  .h-line { white-space: nowrap; }
  body { font-size: 16px; }
  .nav { gap: 14px; padding-left: 18px; }
  .nav nav { display: none; }
  .hero-card, .building, .news-card { border-radius: 28px; }
  .year-group { display: none; }
  .track { padding-left: 32px; }
  .e::before { left: -32px; }
  .e-head { flex-direction: column; gap: 10px; }
  .e .dates { order: -1; }
  .field { flex-direction: column; border-radius: 22px; }
  .field button { width: 100%; }
}

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