/* ---------- Tokens ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece5;
  --text: #16161a;
  --muted: #5b5b66;
  --border: #e3dfd5;
  --accent: #e5484d;
  --accent-ink: #ffffff;
  --accent-soft: #fde6e4;
  --ok: #1f9d55;
  --shadow: 0 1px 2px rgb(20 20 30 / .04), 0 8px 24px -12px rgb(20 20 30 / .12);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 18px;
  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e11; --surface: #16161b; --surface-2: #1d1d23; --text: #ececf1; --muted: #9b9ba8;
    --border: #27272f; --accent: #ff6369; --accent-soft: #3a1a1c; --ok: #3dd68c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e11; --surface: #16161b; --surface-2: #1d1d23; --text: #ececf1; --muted: #9b9ba8;
  --border: #27272f; --accent: #ff6369; --accent-soft: #3a1a1c; --ok: #3dd68c;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow {
  font: 500 13px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.eyebrow.center { text-align: center; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--text); color: var(--bg); text-decoration: none;
  font: 600 15px/1 var(--font-body); cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn svg { width: 18px; height: 18px; transition: transform .2s ease; }
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff; font: 700 13px/1 var(--font-display); letter-spacing: .02em;
}
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.header-actions { display: flex; align-items: center; gap: 8px; }

:root .i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

.menu-btn { display: none; }
.mobile-nav { border-top: 1px solid var(--border); padding: 8px var(--gutter) 16px; background: var(--bg); }
.mobile-nav a { display: block; padding: 12px 0; text-decoration: none; font: 600 20px/1.2 var(--font-display); border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px;
  padding-top: clamp(32px, 7vw, 88px); padding-bottom: clamp(32px, 5vw, 56px);
}
.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%,100% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { font-size: clamp(52px, 9vw, 112px); line-height: .95; letter-spacing: -0.04em; margin: 24px 0 24px; }
.lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.5; color: var(--muted); max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 36px; font: 400 13px/1.4 var(--font-mono); color: var(--muted); }
.hero-meta li { display: inline-flex; align-items: center; gap: 20px; }
.hero-meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--border); margin-left: -12px; margin-right: -8px; }

.hero-art { position: relative; justify-self: center; width: min(100%, 420px); }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 110%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
}
.portrait::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px; opacity: .55;
  -webkit-mask-image: radial-gradient(80% 60% at 50% 30%, #000, transparent);
          mask-image: radial-gradient(80% 60% at 50% 30%, #000, transparent);
}
.portrait img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 76%; height: auto; }
.chip {
  position: absolute; padding: 10px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  font: 500 13px/1 var(--font-mono); color: var(--text); white-space: nowrap;
}
.chip .mono { color: var(--accent); margin-right: 4px; }
.chip-a { top: 14%; left: -12%; animation: float 7s ease-in-out infinite; }
.chip-b { bottom: 12%; right: -10%; animation: float 8s ease-in-out -2s infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Stats ---------- */
.stats dl {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stats dl > div { padding: 28px 24px; display: flex; flex-direction: column-reverse; gap: 6px; }
.stats dl > div + div { border-left: 1px solid var(--border); }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { font: 700 clamp(34px, 4vw, 48px)/1 var(--font-display); letter-spacing: -0.03em; }

/* ---------- Sections ---------- */
.section { padding-top: clamp(72px, 10vw, 128px); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(32px, 4.6vw, 54px); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); }
.prose p { font-size: 18px; color: var(--muted); }
.prose p + p { margin-top: 1.1em; }
.prose p:first-child { color: var(--text); font-size: 20px; }
.stack { display: grid; gap: 24px; align-content: start; }
.stack-group h3 { font: 500 13px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}

/* Services */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 28px; }
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 22px; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 16px; }

/* Experience */
.timeline { border-top: 1px solid var(--border); }
.timeline li {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--border);
}
.when { font: 500 14px/1.9 var(--font-mono); color: var(--muted); }
.timeline h3 { font-size: 22px; margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.timeline .at { font: 500 15px/1.4 var(--font-body); color: var(--accent); letter-spacing: 0; }
.timeline p:not(.when) { color: var(--muted); max-width: 68ch; }

.edu { margin-top: 48px; padding: 28px 32px; border-radius: var(--radius); background: var(--surface-2); }
.edu dl { display: grid; gap: 12px; }
.edu dl > div { display: grid; grid-template-columns: 168px 1fr; gap: 24px; }
.edu dt { font: 500 14px/1.9 var(--font-mono); color: var(--muted); }
.edu dd { color: var(--muted); }
.edu strong { color: var(--text); font-weight: 600; }

/* Clients */
.clients { padding-top: clamp(64px, 8vw, 96px); }
.logos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.logos li {
  display: grid; place-items: center; height: 96px; padding: 18px 22px; border-radius: 16px;
  background: #fff; border: 1px solid var(--border);
}
.logos img { max-height: 44px; width: auto; object-fit: contain; opacity: .8; transition: opacity .3s, transform .3s; }
.logos li:hover img { opacity: 1; transform: scale(1.04); }

/* Testimonials */
.quotes { columns: 3 320px; column-gap: 20px; }
.quote {
  break-inside: avoid; margin: 0 0 20px; padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px;
}
.quote blockquote { margin: 0; }
.quote blockquote p { font-size: 16px; line-height: 1.65; }
.quote blockquote p::before { content: "“"; display: block; font: 700 48px/0.6 var(--font-display); color: var(--accent); margin: 8px 0 12px; }
.quote.featured { background: var(--text); color: var(--bg); border-color: var(--text); }
.quote.featured blockquote p { font: 500 20px/1.5 var(--font-display); letter-spacing: -0.01em; }
.quote.featured figcaption span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.quote.featured figcaption strong { color: var(--bg); }
.quote figcaption { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.quote figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.quote figcaption span { display: flex; flex-direction: column; color: var(--muted); line-height: 1.4; }
.quote figcaption strong { color: var(--text); font-weight: 600; font-size: 15px; }

/* Contact */
.contact {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px);
  padding: clamp(28px, 5vw, 56px); border-radius: 28px; background: var(--surface); border: 1px solid var(--border);
}
.contact h2 { font-size: clamp(40px, 5.6vw, 68px); margin-bottom: 20px; }
.email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 32px 0 24px; }
.email {
  font: 600 clamp(18px, 2.2vw, 24px)/1.3 var(--font-display); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .3s;
  overflow-wrap: anywhere;
}
.email:hover { background-size: 100% 2px; }
.copied { font: 500 13px/1 var(--font-mono); color: var(--ok); }
.contact-list { display: grid; gap: 10px; font-size: 16px; }
.contact-list .k { display: inline-block; width: 92px; font: 500 13px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.socials a {
  display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  text-decoration: none; font-size: 14px; font-weight: 500; transition: border-color .2s, background-color .2s;
}
.socials a:hover { border-color: var(--text); background: var(--bg); }

.form { display: grid; gap: 18px; align-content: start; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 132px; }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--accent); }
.form-error { color: var(--accent); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; }

/* Footer */
.site-footer { margin-top: clamp(72px, 10vw, 120px); border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; font-size: 14px; color: var(--muted); }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { width: min(100%, 360px); }
  .about-grid, .contact { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .logos { grid-template-columns: repeat(3, 1fr); }
  .stats dl { grid-template-columns: repeat(2, 1fr); }
  .stats dl > div:nth-child(3) { border-left: 0; }
  .stats dl > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-name { display: none; }
  .header-actions .btn-sm { display: none; }
  .timeline li, .edu dl > div { grid-template-columns: 1fr; gap: 6px; }
  .when { line-height: 1.4; }
  .logos { grid-template-columns: repeat(2, 1fr); }
  .logos li { height: 80px; }
  .stats dl > div { padding: 20px 16px; }
  .chip-a { left: -4%; }
  .chip-b { right: -4%; }
  .quote.featured blockquote p { font-size: 18px; }
  .edu { padding: 24px; }
  .hero-meta { gap: 6px 16px; }
  .hero-meta li + li::before { display: none; }
}

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