:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #8d8d8d;
  --soft: #5b5b5b;
  --accent: #6f6a4b;      /* olive, echoing the reference */
  --card: #f4f4f3;
  --card-2: #ebebea;
  --line: #e6e6e4;
  --footer: #0e0e0e;
  --radius: 14px;
  --max: 1040px;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --head: "Poppins", system-ui, sans-serif;
  --script: "Mrs Saint Delafield", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { padding: 26px 0 10px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo {
  font-family: var(--script);
  font-size: 46px;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  transform: rotate(-4deg);
  display: inline-block;
  padding: 4px 6px 0;
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 30px; }
.nav a.link {
  text-decoration: none;
  font-size: 15px;
  color: var(--soft);
  position: relative;
  padding: 4px 0;
}
.nav a.link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--ink); transition: right .25s ease;
}
.nav a.link:hover, .nav a.link.active { color: var(--ink); }
.nav a.link:hover::after, .nav a.link.active::after { right: 0; }
.social { display: flex; gap: 12px; margin-left: 8px; }
.social a { display: grid; place-items: center; width: 22px; height: 22px; color: var(--ink); }
.social svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 0 58px; }
.hero p {
  margin: 0 auto;
  max-width: 760px;
  font-family: var(--head);
  font-weight: 200;
  font-size: clamp(22px, 3.2vw, 31px);
  line-height: 1.45;
  color: var(--muted);
}
.hero strong { color: var(--ink); font-weight: 600; }
.hero .role { color: var(--accent); font-weight: 600; }
/* SAP Ariba badge (hero) */
.brand-badge {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  margin: 0 auto 34px;
  padding: 16px 30px 14px;
  background: #f4f3f0;              /* matches the logo artwork background */
  border: 1px solid #e7e4dc;
  border-radius: 18px;
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.35);
  animation: badgeIn .9s cubic-bezier(.2,.7,.2,1) both;
  overflow: hidden;
}
.brand-badge::after {                /* gold accent bar echoing the Ariba mark */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #1b6fd1, #f0ab00);
}
.brand-badge img { height: 62px; width: auto; display: block; }
.brand-label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.brand-caption { font-size: 13px; color: var(--soft); text-wrap: balance; }
@keyframes badgeIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .brand-badge { animation: none; } }
@media (max-width: 640px) {
  .brand-badge { padding: 12px 18px 12px; margin-bottom: 24px; }
  .brand-badge img { height: 44px; }
  .brand-caption { font-size: 12px; }
}

.availability {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 26px; font-size: 14px; color: var(--soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.availability i { width: 8px; height: 8px; border-radius: 50%; background: #3f9d5b; box-shadow: 0 0 0 4px #3f9d5b22; }

/* ---------- Stats ---------- */
.stats { display: flex; justify-content: center; gap: clamp(24px, 6vw, 72px); margin: 34px 0 0; flex-wrap: wrap; }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--head); font-weight: 600; font-size: 34px; color: var(--ink); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* ---------- Work grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 44px; padding-bottom: 40px; }
.card {
  position: relative;
  display: block;
  text-decoration: none;
  background: var(--card);
  aspect-ratio: 1 / 1.02;
  overflow: hidden;
  border-radius: 2px;
}
.card h3 {
  position: absolute; top: 16px; left: 22px; right: 22px; margin: 0; z-index: 2;
  font-family: var(--head); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px);
  color: #5e5e5e; line-height: 1.15;
}
.card .sub {
  position: absolute; top: calc(16px + 1.2em + 14px); left: 22px; z-index: 2;
  font-size: 14px; color: var(--muted);
}
.card .art {
  position: absolute; inset: 22% 10% 8%;
  display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.card .art svg, .card .art img { width: 100%; height: 100%; object-fit: contain; }
.card .meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 14px 22px; font-size: 13px; color: var(--soft);
  display: flex; justify-content: space-between; gap: 12px;
  background: linear-gradient(transparent, rgba(244,244,243,.95) 40%);
  opacity: 0; transform: translateY(8px); transition: .3s ease;
}
.card:hover .art, .card:focus-visible .art { transform: scale(1.05) translateY(-4px); }
.card:hover .meta, .card:focus-visible .meta { opacity: 1; transform: none; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Expertise carousel ---------- */
.section-title { text-align: center; font-size: 17px; font-weight: 500; margin: 60px 0 22px; letter-spacing: .01em; }
.carousel { position: relative; padding: 0 44px; margin-bottom: 56px; }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  scroll-behavior: smooth; padding: 4px 2px;
}
.track::-webkit-scrollbar { display: none; }
.tile {
  scroll-snap-align: start; aspect-ratio: 1; border-radius: var(--radius);
  background: var(--card); position: relative; overflow: hidden;
  padding: 14px 16px;
}
.tile h4 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 19px; color: #505050; line-height: 1.15; }
.tile p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.3; }
.tile .art { position: absolute; inset: 42% 14% 8%; }
.tile .art svg { width: 100%; height: 100%; }
.tile.dark { background: #161616; }
.tile.dark h4 { color: #fff; } .tile.dark p { color: #a9a9a9; }
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 56px; border: 0; background: none; cursor: pointer; color: #bdbdbd;
}
.arrow:hover { color: var(--ink); }
.arrow svg { width: 22px; height: 44px; }
.arrow.prev { left: 0; } .arrow.next { right: 0; }

/* ---------- Page (about / resume / project) ---------- */
.page { padding: 48px 0 80px; }
.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.page h1 { font-family: var(--head); font-weight: 600; font-size: clamp(32px, 5vw, 50px); line-height: 1.1; margin: 0 0 18px; }
.lead { font-family: var(--head); font-weight: 300; font-size: clamp(19px, 2.2vw, 23px); color: var(--soft); line-height: 1.5; max-width: 760px; }
.about-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 56px; align-items: start; margin-top: 30px; }
.portrait { background: var(--card); aspect-ratio: 4/5; display: grid; place-items: center; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .initials { font-family: var(--script); font-size: 110px; color: #3a3a3a; transform: rotate(-6deg); }
.prose p { margin: 0 0 1.1em; color: #333; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 28px; }
.facts dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.facts a { text-decoration: none; border-bottom: 1px solid var(--line); }
.facts a:hover { border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.chips li { font-size: 14px; background: var(--card); border-radius: 999px; padding: 5px 13px; color: #3c3c3c; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 15px;
  transition: background .2s;
}
.btn:hover { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn svg { width: 16px; height: 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* Resume */
.resume-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
.resume-head h1 { margin: 0; }
.resume-head .actions { margin: 0; }
.r-section { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.r-section > h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 6px 0 0; }
.job { margin-bottom: 30px; }
.job:last-child { margin-bottom: 0; }
.job-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.job h3 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 19px; }
.job .when { color: var(--muted); font-size: 15px; white-space: nowrap; }
.job .where { color: var(--accent); font-size: 15px; margin: 2px 0 8px; }
.job ul, .p-list { margin: 0; padding-left: 18px; color: #333; }
.job li, .p-list li { margin: 4px 0; }
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 36px; }
.skill-groups h3 { margin: 0 0 4px; font-size: 16px; font-weight: 500; }

/* Project */
.back { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.back:hover { color: var(--ink); }
.p-hero { background: var(--card); aspect-ratio: 16/7; display: grid; place-items: center; margin: 30px 0 40px; overflow: hidden; }
.p-hero .art { width: min(360px, 60%); aspect-ratio: 1; }
.p-hero img { width: 100%; height: 100%; object-fit: cover; }
.p-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; }
.p-side dl { margin: 0; display: grid; gap: 16px; }
.p-side dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.p-side dd { margin: 2px 0 0; }
.p-body h2 { font-family: var(--head); font-weight: 600; font-size: 20px; margin: 30px 0 10px; }
.next-proj { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 56px; padding-top: 22px; gap: 16px; }
.next-proj a { text-decoration: none; color: var(--soft); }
.next-proj a:hover { color: var(--ink); }
.next-proj b { display: block; font-family: var(--head); color: var(--ink); font-size: 20px; }

/* Footer */
.site-footer { background: var(--footer); color: #e8e8e8; text-align: center; font-size: 13px; padding: 7px 16px; }

/* Loading / reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card .art, .track { transition: none; scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .track { grid-auto-columns: calc((100% - 20px) / 2); }
  .about-grid, .p-body { grid-template-columns: 1fr; gap: 32px; }
  .portrait { max-width: 360px; }
  .r-section { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .wrap { flex-direction: column; gap: 6px; }
  .logo { font-size: 40px; }
  .nav { gap: 22px; }
  .hero { padding: 34px 0 40px; }
  .grid { grid-template-columns: 1fr; gap: 22px; }
  .card .meta { opacity: 1; transform: none; }
  .carousel { padding: 0; }
  .arrow { display: none; }
  .track { grid-auto-columns: 70%; }
  .facts, .skill-groups { grid-template-columns: 1fr; }
  .p-hero { aspect-ratio: 4/3; }
}
