/* ---------- Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --text: #0f172a;
  --muted: #5b6577;
  --line: #e3e7ef;
  --accent: #1e90ff;
  --accent-2: #ffc843;
  --accent-ink: #ffffff;
  --glow: rgba(30, 144, 255, 0.18);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-elev: #131824;
  --text: #e8ecf4;
  --muted: #8d97a8;
  --line: #222a39;
  --glow: rgba(30, 144, 255, 0.22);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- 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: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--glow);
}
.btn--sm {
  padding: 9px 18px;
  font-size: 14px;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--accent);
  box-shadow: none;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--accent);
}
.i-sun {
  display: none;
}
:root[data-theme="dark"] .i-sun {
  display: block;
}
:root[data-theme="dark"] .i-moon {
  display: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.logo span {
  color: var(--accent);
}
.nav__links {
  display: flex;
  gap: 28px;
  font-size: 15px;
  color: var(--muted);
}
.nav__links a {
  transition: color 0.2s;
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}
.nav__links a.is-active {
  font-weight: 500;
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 48px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 14px;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
}
.rotator {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), #7c5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.3s, transform 0.3s;
}
.rotator.is-out {
  opacity: 0;
  transform: translateY(8px);
}
.lead {
  max-width: 34em;
  margin: 24px 0 36px;
  font-size: 18px;
  color: var(--muted);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__photo {
  position: relative;
  justify-self: center;
  width: min(380px, 80vw);
  aspect-ratio: 1;
}
.hero__avatar {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: #3d5b6d;
}
.hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the source photo is an off-centre circle with transparent corners */
  transform: scale(1.22);
  transform-origin: 56% 46%;
}
.hero__ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--accent), #7c5cff, var(--accent-2), var(--accent));
  opacity: 0.8;
  animation: spin 14s linear infinite;
}
.hero__ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}
.section__head {
  margin-bottom: 48px;
}
.kicker {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.section h2 {
  font-size: clamp(30px, 4vw, 44px);
}

/* Services */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}
.card img {
  width: 64px;
  height: 64px;
  padding: 10px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
}
.card h3 {
  font-size: 22px;
  margin-bottom: 10px;
}
.card p {
  margin: 0 0 20px;
  color: var(--muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

/* Experience */
.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 180px;
  width: 2px;
  background: var(--line);
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 48px;
  padding-bottom: 40px;
}
.timeline__item:last-child {
  padding-bottom: 0;
}
.timeline__item::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 175px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
}
.timeline__item.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--glow);
}
.timeline__date {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.is-current .timeline__date {
  color: var(--accent);
}
.timeline__body h3 {
  font-size: 22px;
}
.timeline__body p {
  margin: 8px 0 0;
  color: var(--muted);
}
.timeline__body .timeline__org {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.timeline__org a {
  color: var(--accent);
}
.timeline__org a:hover {
  text-decoration: underline;
}
.roles {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}
.roles li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 16px;
  padding: 8px 0 8px 18px;
}
.roles__date {
  grid-row: span 2;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.roles strong {
  font-weight: 600;
}
.roles span:not(.roles__date) {
  grid-column: 2;
  font-size: 15px;
  color: var(--muted);
}
.roles .is-current {
  margin-left: -2px;
  border-left: 2px solid var(--accent);
}
.roles .is-current .roles__date {
  color: var(--accent);
}
.timeline__body .tags {
  margin-top: 14px;
}

/* Clients */
.clients {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.clients img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 0.3s, opacity 0.3s;
}
.clients img:hover {
  filter: none;
  opacity: 1;
}
.quote {
  margin: 0;
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-elev)), var(--bg-elev));
}
.quote p {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.3;
}
.quote footer {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.quote img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* Footer */
.footer {
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footer a:hover {
  color: var(--text);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__photo {
    order: -1;
    width: min(240px, 60vw);
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .clients {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 640px) {
  html {
    scroll-padding-top: 112px;
  }
  .nav__inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 14px;
  }
  .nav__links {
    order: 3;
    width: 100%;
    gap: 22px;
    padding: 10px 0 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .nav__links::-webkit-scrollbar {
    display: none;
  }
  .hero {
    padding: 40px 0 64px;
  }
  .section {
    padding: 64px 0;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card,
  .quote {
    padding: 24px;
  }
  .timeline::before {
    left: 5px;
  }
  .timeline__item {
    grid-template-columns: 1fr;
    padding-left: 32px;
  }
  .timeline__item::before {
    left: 0;
  }
  .roles li {
    grid-template-columns: 1fr;
  }
  .roles__date {
    grid-row: auto;
  }
  .roles span:not(.roles__date) {
    grid-column: auto;
  }
  .timeline__date {
    margin-bottom: 4px;
    font-size: 14px;
  }
}
