/* ---------- Tokens ---------- */
:root {
  --bg: #faf9f5;
  --surface: #f0eee6;
  --surface-2: #e8e6dc;
  --ink: #141413;
  --ink-2: #3d3d3a;
  --muted: #6b6a64;
  --line: #e3e0d5;
  --accent: #c96442;
  --accent-ink: #a9512f;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 14px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -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;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}

.section {
  padding: clamp(72px, 10vw, 128px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: #2c2c2a;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ---------- Header ---------- */
/* Flat bar at the top of the page; a frosted pill once you scroll. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0;
  transition: padding 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-header.is-scrolled {
  padding: 12px 12px 0;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: max-width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    height 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    padding 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.is-scrolled .header-inner {
  max-width: 760px;
  height: 54px;
  padding: 0 7px 0 22px;
  background: rgba(250, 249, 245, 0.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-color: rgba(20, 20, 19, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 10px 30px -14px rgba(20, 20, 19, 0.28), 0 2px 6px -3px rgba(20, 20, 19, 0.08);
}

.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: font-size 0.4s ease;
}

.is-scrolled .wordmark {
  font-size: 19px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  position: relative;
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

/* Sliding highlight behind the active section link. */
.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(20, 20, 19, 0.07), 0 1px 3px rgba(20, 20, 19, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}

.nav-indicator.is-on {
  opacity: 1;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

main {
  padding-top: 68px;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 9vw, 120px) 0 clamp(64px, 9vw, 112px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent-ink);
}

.hero-lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  max-width: 38em;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.portrait {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 5;
  max-width: 420px;
  justify-self: end;
  width: 100%;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

/* ---------- Impact ---------- */
.impact-label {
  margin-bottom: 16px;
}

.impact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 36px 28px 36px 0;
}

.stat + .stat {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.stat-value {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.stat-label {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Experience ---------- */
.roles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.role {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.role:last-child {
  border-bottom: 1px solid var(--line);
}

.role-when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 6px;
}

.role-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 27px);
  line-height: 1.2;
  margin: 0 0 4px;
}

.role-org {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15.5px;
}

.role-org a {
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.role-org a:hover {
  text-decoration-color: currentColor;
}

.role-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 46em;
}

.role-points li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
}

.role-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.role-points strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project:hover {
  border-color: var(--surface-2);
}

.project.featured {
  grid-column: 1 / -1;
  background: var(--ink);
  color: var(--bg);
}

.project.featured .project-desc,
.project.featured .tag {
  color: #c8c6bd;
}

.project.featured .tag {
  border-color: #3d3d3a;
}

.project.featured .project-link {
  color: var(--bg);
}

.project-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.project-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  margin: 0 0 12px;
}

.project-desc {
  margin: 0 0 24px;
  color: var(--ink-2);
  max-width: 44em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.tag {
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--surface-2);
  color: var(--ink-2);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}

.project-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
}

.about-copy p {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 18px;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(40px, 7vw, 88px);
  text-align: center;
}

.contact .section-title {
  font-size: clamp(34px, 5vw, 56px);
  margin-bottom: 18px;
}

.contact p {
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 auto 32px;
}

.contact .hero-actions {
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 48px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a {
  text-decoration: none;
}

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

.footer-links {
  display: flex;
  gap: 20px;
}

/* ---------- Hero load sequence ---------- */
.load {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--d, 0s);
}

.hero-title em {
  animation: focus-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes focus-in {
  from {
    opacity: 0;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .load,
  .hero-title em {
    animation: none;
  }
  * {
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .portrait {
    order: -1;
    justify-self: start;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
  }

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

  .stat {
    padding: 28px 20px 28px 0;
  }

  .stat + .stat {
    padding-left: 20px;
  }

  .stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .role {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .role-when {
    padding-top: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .projects {
    grid-template-columns: 1fr;
  }

  .project {
    padding: 26px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav .btn {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 22px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 40px -20px rgba(20, 20, 19, 0.3);
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 0;
    border-radius: 0;
    font-size: 17px;
    border-bottom: 1px solid var(--line);
  }

  .nav-links li:last-child a {
    border-bottom: 0;
  }

  .nav-indicator {
    display: none;
  }

  .is-scrolled .header-inner {
    padding: 0 6px 0 20px;
  }

  .is-scrolled .menu-toggle {
    width: 40px;
    height: 40px;
    border-color: transparent;
  }

  .nav-links .mobile-only {
    display: block;
  }
}

@media (min-width: 721px) {
  .nav-links .mobile-only {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .impact {
    grid-template-columns: 1fr;
  }

  .stat,
  .stat + .stat {
    padding: 24px 0;
    border-left: 0;
  }

  .stat + .stat {
    border-top: 1px solid var(--line);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ---------- Company links ---------- */
.org-link {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--accent);
  transition: color 0.2s ease;
}

.org-link svg {
  display: inline-block;
  position: relative;
  top: -0.45em;
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.12em;
  transition: transform 0.2s ease;
}

.org-link:hover {
  color: var(--accent-ink);
}

.org-link:hover svg {
  transform: translate(1px, -1px);
}

.hero-title .org-link {
  font-weight: 500;
  text-decoration-thickness: 2px;
}

.hero-title .org-link svg {
  width: 0.24em;
  height: 0.24em;
  top: -0.62em;
  margin-left: 0.06em;
  stroke-width: 1.4;
}

/* ---------- Experience detail ---------- */
.role-summary {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 17.5px;
  max-width: 44em;
}

.role-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.role-more {
  overflow: hidden;
}

.role-more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 0;
  user-select: none;
}

.role-more summary::-webkit-details-marker {
  display: none;
}

.role-more summary svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.role-more[open] summary svg {
  transform: rotate(45deg);
}

.role-more summary:hover {
  color: var(--accent-ink);
}

.role-more .more-open,
.role-more[open] .more-closed {
  display: none;
}

.role-more[open] .more-open {
  display: inline;
}

.role-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  padding: 24px 0 4px;
}

.role-topic h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.role-topic p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
}

.role-topic strong {
  color: var(--ink);
  font-weight: 600;
}

.role-stack {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}


@media (max-width: 720px) {
  .role-detail {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.section-title em {
  font-style: italic;
  color: var(--accent-ink);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.more-link svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.more-link:hover svg {
  transform: translate(2px, -2px);
}

/* ---------- Hero byline ---------- */
.hero-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
}

.hero-byline img {
  display: none;
}

.hero-byline div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}

.byline-name {
  display: none;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.byline-place {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}

/* On mobile the big portrait is hidden, so a small one joins the byline. */
@media (max-width: 900px) {
  .portrait {
    display: none;
  }

  .byline-name {
    display: block;
  }

  .hero-byline img {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    object-position: 50% 22%;
    background: var(--surface);
    flex: none;
  }

  .hero {
    padding-top: 32px;
  }
}
