/* ===== Tokens ===== */
:root {
  --bg: #fbfaf8;
  --bg-alt: #f3f1ec;
  --ink: #1c1b19;
  --ink-soft: #57534e;
  --ink-faint: #8a857e;
  --line: #e6e2da;
  --accent: #b4541f;        /* warm terracotta */
  --accent-soft: #f0e3d8;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(28,27,25,.04), 0 12px 32px rgba(28,27,25,.06);
  --radius: 16px;
  --maxw: 1080px;
  --ff-display: "Fraunces", Georgia, serif;
  --ff-body: "Inter", system-ui, -apple-system, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

.container { width: min(var(--maxw), 92vw); margin-inline: auto; }
.accent { color: var(--accent); }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,248,.78);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav__brand { font-family: var(--ff-display); font-weight: 600; font-size: 1.15rem; letter-spacing: .2px; }
.nav__links { display: flex; align-items: center; gap: 24px; }
.nav__links a { font-size: .92rem; color: var(--ink-soft); font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  background: var(--ink); color: var(--bg) !important;
  padding: 8px 16px; border-radius: 999px; font-weight: 600 !important;
  transition: transform .2s, background .2s;
}
.nav__cta:hover { transform: translateY(-1px); background: var(--accent); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(180,84,31,.28); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ===== Hero ===== */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 80px); }
.hero__inner {
  display: grid; grid-template-columns: 1.25fr .85fr;
  gap: clamp(32px, 6vw, 72px); align-items: center;
}
.hero__eyebrow {
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 20px;
}
.hero__title {
  font-family: var(--ff-display); font-weight: 500;
  font-size: clamp(2.3rem, 5.6vw, 4.1rem); line-height: 1.05;
  letter-spacing: -.02em; margin-bottom: 24px;
}
.hero__lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-soft); max-width: 48ch; }
.hero__lede strong { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.hero__photo {
  position: relative;
  border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5; max-height: 480px; margin-inline: auto;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hero__photo::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(28,27,25,.06); border-radius: 24px;
}

.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: clamp(48px, 6vw, 72px); padding-top: 40px; border-top: 1px solid var(--line);
}
.hero__stats li { display: flex; flex-direction: column; gap: 6px; }
.stat__num { font-family: var(--ff-display); font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 600; color: var(--accent); }
.stat__label { font-size: .9rem; color: var(--ink-faint); line-height: 1.4; }

/* ===== Sections ===== */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--alt { background: var(--bg-alt); }
.section__kicker {
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.section__title {
  font-family: var(--ff-display); font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; letter-spacing: -.015em;
}
.section__hint { color: var(--ink-faint); margin-top: 14px; font-size: .95rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.prose p { color: var(--ink-soft); margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* Feature callout (CSpotlight) */
.feature {
  display: inline-flex; flex-direction: column; gap: 4px;
  margin-top: 24px; padding: 16px 20px;
  background: var(--accent-soft); border-radius: 12px;
  border: 1px solid transparent; transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-2px); border-color: var(--accent); }
.feature__label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.feature__title { font-family: var(--ff-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }

/* ===== Timeline (collapsible) ===== */
.timeline { margin-top: 48px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line);
}
.timeline__item { position: relative; padding-left: 40px; padding-bottom: 16px; }
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 20px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent); z-index: 1;
}

.timeline__item details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .25s;
}
.timeline__item details[open] { box-shadow: 0 16px 40px rgba(28,27,25,.09); }
.timeline__item summary {
  list-style: none; cursor: pointer; padding: 20px 24px;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 4px 16px; position: relative;
}
.timeline__item summary::-webkit-details-marker { display: none; }
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; grid-column: 1; }
.timeline__role { font-family: var(--ff-display); font-size: 1.25rem; font-weight: 600; }
.timeline__org { font-weight: 600; color: var(--accent); font-size: .98rem; }
.timeline__date { font-size: .82rem; color: var(--ink-faint); white-space: nowrap; }
.timeline__summary { grid-column: 1; color: var(--ink-soft); font-size: .95rem; margin-top: 2px; }
.timeline__chev {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  width: 11px; height: 11px; border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint); transform: rotate(45deg);
  transition: transform .25s; margin-right: 4px;
}
.timeline__item details[open] .timeline__chev { transform: rotate(-135deg); }
.timeline__item summary:hover .timeline__chev { border-color: var(--accent); }

.timeline__points { padding: 4px 24px 24px; }
.timeline__points li { position: relative; padding-left: 22px; margin-bottom: 10px; color: var(--ink-soft); font-size: .95rem; }
.timeline__points li:last-child { margin-bottom: 0; }
.timeline__points li::before {
  content: ""; position: absolute; left: 4px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55;
}

/* ===== Writing + Podcast (combined) ===== */
.media-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(36px, 6vw, 72px); align-items: start; }

/* Writing — small stacked cards */
.post-list { display: flex; flex-direction: column; gap: 16px; margin-top: 36px; }
.post {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28,27,25,.1); border-color: var(--accent-soft); }
.post__tag { font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.post__title { font-family: var(--ff-display); font-weight: 600; font-size: 1.22rem; line-height: 1.28; margin: 10px 0 0; }
.post__sub { color: var(--ink-soft); font-size: .92rem; margin-top: 6px; }
.post__link { margin-top: 14px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.see-more { margin-top: 24px; }
.see-more a { color: var(--ink-soft); font-weight: 600; border-bottom: 2px solid var(--accent); padding-bottom: 2px; transition: color .2s; }
.see-more a:hover { color: var(--ink); }

/* Podcast — single card */
.podcast-card {
  margin-top: 36px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: flex-start;
}
.podcast-card__art {
  width: 120px; aspect-ratio: 1; border-radius: 20px;
  background: linear-gradient(140deg, var(--accent), #7d3411);
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(180,84,31,.28);
  color: #fff; text-align: center; margin-bottom: 20px;
}
.podcast-card__art span { font-family: var(--ff-display); font-weight: 600; font-size: 1.5rem; line-height: 1.05; }
.podcast-card__desc { color: var(--ink-soft); font-size: .98rem; margin-bottom: 22px; }

/* ===== Contact ===== */
.contact { max-width: 720px; }
.contact__lede { color: var(--ink-soft); margin-top: 18px; font-size: 1.1rem; max-width: 52ch; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 26px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 26px; }
.contact__links a { font-weight: 600; color: var(--ink-soft); position: relative; transition: color .2s; }
.contact__links a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 2px;
  background: var(--accent); transition: width .25s;
}
.contact__links a:hover { color: var(--ink); }
.contact__links a:hover::after { width: 100%; }

/* ===== Feature group (About) ===== */
.feature-group { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.skill-group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.skill-group__name {
  font-family: var(--ff-display); font-weight: 600; font-size: .98rem;
  color: var(--ink); margin-bottom: 14px;
}
.skill-group__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-tag {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  font-size: .8rem; color: var(--ink-soft); font-weight: 500;
  transition: background .2s, border-color .2s;
}
.skill-tag:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ===== Research ===== */
.research-grid { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; }
.research-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.research-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(28,27,25,.1); }
.research-card details { width: 100%; }
.research-card summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.research-card summary::-webkit-details-marker { display: none; }
.research-card details[open] .timeline__chev { transform: rotate(-135deg); }
.research-card__points { margin-top: 16px; }
.research-card__title {
  font-family: var(--ff-display); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); margin-bottom: 14px;
}
.research-card__points { padding: 0; }
.research-card__points li {
  position: relative; padding-left: 20px; margin-bottom: 10px;
  color: var(--ink-soft); font-size: .95rem;
}
.research-card__points li:last-child { margin-bottom: 0; }
.research-card__points li::before {
  content: ""; position: absolute; left: 4px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55;
}

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--ink-faint); font-size: .88rem; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
/* ===== Built section ===== */
.built-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.built-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none; color: inherit;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.built-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.built-card__header { display: flex; align-items: center; justify-content: space-between; }
.built-card__icon { font-size: 22px; color: var(--accent); }
.built-card__badge {
  font-size: 11px; font-weight: 600; letter-spacing: .6px;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 20px;
  padding: 3px 10px;
}
.built-card__name {
  font-family: var(--ff-display); font-size: 1.5rem; font-weight: 600;
  letter-spacing: -.3px; color: var(--ink);
}
.built-card__desc { font-size: 15px; color: var(--ink-soft); line-height: 1.6; }
.built-card__tags {
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0;
}
.built-card__tags li {
  font-size: 12px; background: var(--bg-alt);
  border-radius: 6px; padding: 3px 10px; color: var(--ink-soft);
}
.built-card__cta { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: auto; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__photo { max-width: 360px; aspect-ratio: 4 / 5; }
  .grid-2 { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 640px) {
  .hero__stats { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  .nav__links { gap: 14px; }
  .nav__links a:not(.nav__cta) { display: none; }
  .timeline__date { flex-basis: 100%; }
}
