/* ---------- Tokens ---------- */
:root {
  --bg: #faf7f2;
  --bg-alt: #f2ece2;
  --surface: #ffffff;
  --text: #1d1a15;
  --muted: #5f584d;
  --border: #e4dccf;
  --accent: #b4532a;       /* warm terracotta */
  --accent-ink: #ffffff;
  --accent-soft: #f6e3d8;
  --success: #2f7d4f;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --maxw: 1120px;
  --shadow: 0 1px 2px rgba(29, 26, 21, .04), 0 8px 24px rgba(29, 26, 21, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16140f;
    --bg-alt: #1e1b15;
    --surface: #221f18;
    --text: #f1ece3;
    --muted: #b3aa9b;
    --border: #3a352b;
    --accent: #e98a5e;
    --accent-ink: #1d1a15;
    --accent-soft: #3b261b;
    --success: #6cc792;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 400; }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 400; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9em;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .8em 1.5em; border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  font: 600 .95rem/1 var(--sans); text-decoration: none;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: .55em 1.1em; font-size: .875rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font: 600 1.3rem/1 var(--serif); text-decoration: none; }
.logo-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { text-decoration: none; font-size: .95rem; color: var(--muted); font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--text); }

.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 10px 8px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 6px 0; border-radius: 2px; transition: transform .2s ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 16px 20px; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(64px, 12vw, 140px) 0 clamp(56px, 8vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { max-width: 15em; }
.hero-photo { position: relative; }
.hero-photo::before {
  content: ""; position: absolute; inset: -14px -14px 14px 14px; border-radius: 50%;
  background: var(--accent-soft); z-index: 0;
}
.hero-photo img { position: relative; z-index: 1; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: 160px; margin-left: 14px; }
  .hero-photo::before { inset: -8px -8px 8px 8px; }
}
.availability {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: .875rem; font-weight: 500; color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  padding: .45em 1em; border-radius: 999px; margin-bottom: 2em;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } html { scroll-behavior: auto; } }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2em; }
.hero-ctas.center { justify-content: center; }

/* ---------- Stats ---------- */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-grid > div { padding: 28px 20px; border-left: 1px solid var(--border); }
.stats-grid > div:first-child { border-left: 0; padding-left: 0; }
.stats strong { display: block; font: 400 1.7rem/1.15 var(--serif); margin-bottom: 6px; }
.stats span { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid > div { padding: 20px 12px; border-left: 0; }
  .stats-grid > div:nth-child(even) { border-left: 1px solid var(--border); padding-left: 16px; }
  .stats-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stats-grid > div:nth-child(odd) { padding-left: 0; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 40px; max-width: 40em; }
.section-intro { color: var(--muted); font-size: 1.1rem; }
.grid { display: grid; gap: 20px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: 500 .9rem/1 var(--sans); color: var(--muted);
  background: transparent; border: 1px solid var(--border);
  padding: .65em 1.1em; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Work cards ---------- */
.work-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 400px) { .work-grid { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card[hidden] { display: none; }
.card-tag {
  align-self: flex-start; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: .35em .8em; border-radius: 6px;
}
.card h3 { font-size: 1.35rem; margin-top: .2em; }
.card-meta { font-size: .875rem; color: var(--muted); margin-bottom: .8em; }
.card > p:not(.card-tag):not(.card-meta):not(.card-result) { font-size: .975rem; }
.card-result { font-size: .9rem; font-weight: 600; color: var(--success); margin-top: auto; padding-top: .4em; }
.card-result::before { content: "↗ "; }
.card-link { font-weight: 600; font-size: .95rem; color: var(--accent); text-decoration: none; margin-top: .4em; }
.card-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Services ---------- */
.services-grid { grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); }
.service { padding: 32px 28px 28px 0; border-bottom: 1px solid var(--border); }
.service:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--border); }
.service p { color: var(--muted); margin: 0; }
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .service:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .service:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--border); }
}
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .service, .service:nth-child(even) { padding: 24px 0; border-left: 0; }
}

/* ---------- Labels & chips ---------- */
.label { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .875rem; padding: .4em .9em; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.industries { margin-top: 48px; }

/* ---------- Experience timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.role { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding: 32px 0; border-top: 1px solid var(--border); }
.role:last-child { border-bottom: 1px solid var(--border); }
.role-when { font-size: .9rem; font-weight: 600; color: var(--accent); padding-top: .35em; }
.role-body h3 { font-size: 1.45rem; margin-bottom: .2em; }
.role-org { color: var(--muted); font-size: .95rem; margin-bottom: 1em; }
.role-body ul { margin: 0; padding-left: 1.1em; }
.role-body li { margin-bottom: .45em; }
.role-body li::marker { color: var(--accent); }
@media (max-width: 760px) {
  .role { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-body p { color: var(--muted); font-size: 1.05rem; }
.about-body strong { color: var(--text); }
.about-side { display: grid; gap: 32px; padding: 32px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); }
.edu { margin: 0; font-weight: 500; }
.edu span { color: var(--muted); font-weight: 400; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-side { padding: 24px; }
}

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { max-width: 760px; }
.contact .lede { margin: 0 auto; }
.contact-email { margin-top: 24px; color: var(--muted); font-size: .95rem; }
.contact-email a { text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .875rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }
