:root {
  --bg: #fdfcfa;
  --bg-alt: #f6f4ef;
  --text: #14161a;
  --text-muted: #5b6270;
  --border: #e8e4dc;
  --accent: #4f46e5;
  --accent-2: #a855f7;
  --accent-3: #06b6d4;
  --accent-dark: #3730c7;
  --radius: 14px;
  --max-width: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --font-serif: 'Fraunces', Georgia, serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}

body.preload { opacity: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; margin-bottom: 4px; }

p { margin: 0 0 12px; color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; }

.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 2000;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--text);
  mix-blend-mode: difference;
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--text);
  mix-blend-mode: difference;
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.25s var(--ease);
}

.cursor-ring.hovering {
  width: 52px;
  height: 52px;
}

body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button {
  cursor: none;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  z-index: 1000;
  transition: width 0.1s linear;
}

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

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.stat-grid .stat-card:nth-child(1) { transition-delay: 0ms; }
.stat-grid .stat-card:nth-child(2) { transition-delay: 90ms; }
.stat-grid .stat-card:nth-child(3) { transition-delay: 180ms; }
.stat-grid .stat-card:nth-child(4) { transition-delay: 270ms; }

.cert-grid .cert-card:nth-child(1) { transition-delay: 0ms; }
.cert-grid .cert-card:nth-child(2) { transition-delay: 80ms; }
.cert-grid .cert-card:nth-child(3) { transition-delay: 160ms; }
.cert-grid .cert-card:nth-child(4) { transition-delay: 240ms; }


/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(253, 252, 250, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px -20px rgba(20, 22, 26, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
}

.logo-dot { color: var(--accent); }

.main-nav { display: flex; gap: 24px; }

.main-nav a {
  position: relative;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding-bottom: 4px;
  transition: color 0.25s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.main-nav a.active { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.55);
}

.btn-outline { border-color: var(--border); color: var(--text); }

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Hero */
.hero { position: relative; padding: 100px 0 72px; overflow: hidden; }

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  will-change: transform;
  transition: transform 0.2s linear;
}

.blob-1 { width: 420px; height: 420px; background: var(--accent); top: -140px; left: -80px; animation: float-1 12s ease-in-out infinite; }
.blob-2 { width: 360px; height: 360px; background: var(--accent-2); top: 40px; right: -100px; animation: float-2 14s ease-in-out infinite; }
.blob-3 { width: 300px; height: 300px; background: var(--accent-3); bottom: -160px; left: 30%; animation: float-3 16s ease-in-out infinite; }

@keyframes float-1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, 30px); } }
@keyframes float-2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 40px); } }
@keyframes float-3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -30px); } }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20,22,26,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,22,26,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 0%, black 40%, transparent 100%);
}

.hero .container { z-index: 1; }

.hero h1 { font-size: 2.9rem; max-width: 820px; }
.hero-sub { max-width: 640px; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; }

/* Pull-quote */
.quote-section {
  position: relative;
  padding: 72px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.dot-texture {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(20,22,26,0.14) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 70% 100% at 50% 50%, black 20%, transparent 90%);
  pointer-events: none;
}

.quote-container { text-align: center; max-width: 860px; }

.quote-section .kicker { color: var(--text-muted); }

blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.4;
  color: var(--text);
}

blockquote p { color: inherit; margin: 0; }

/* Proof / stats */
.proof {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
}

.proof .kicker { color: var(--text-muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}

.stat-card:hover {
  transform: translateY(-4px);
  background: #fff;
  box-shadow: 0 20px 40px -28px rgba(20, 22, 26, 0.35);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* Sections */
section { padding: 72px 0; position: relative; }

.section-sub { margin-top: -8px; margin-bottom: 32px; font-size: 1rem; }

/* Experience / case studies */
.experience .container { max-width: 880px; }

.case-study {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  background: #fff;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
}

.case-study:hover {
  box-shadow: 0 24px 48px -30px rgba(20, 22, 26, 0.4);
  border-color: #d8dbe3;
}

.case-index {
  position: absolute;
  top: 12px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
}

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.case-study.flagship { border: none; padding: 33px; }

.case-study.flagship::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotate-border 5s linear infinite;
  z-index: 0;
}

.case-study.flagship > * { position: relative; z-index: 1; }

@keyframes rotate-border { to { --angle: 360deg; } }

.case-tag {
  display: inline-block;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.case-tag-alt { background: var(--text-muted); }

.case-company { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }

.case-intro {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.case-note {
  font-style: italic;
  font-size: 0.88rem;
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin-bottom: 16px;
}

.case-list { margin: 0; padding-left: 20px; }
.case-list li { color: var(--text); margin-bottom: 8px; }

.case-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.award-chip {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 6px 14px;
}

/* Skills marquee */
.skills { padding-bottom: 56px; }
.skills .container { margin-bottom: 28px; }

.marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.marquee-track { display: flex; width: max-content; animation: marquee-scroll 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 14px; padding-right: 14px; }

@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.tool-chip:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--accent);
  box-shadow: 0 12px 24px -16px rgba(79, 70, 229, 0.5);
}

.tool-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.tool-logo img { width: 22px; height: 22px; object-fit: contain; }

.tool-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tool-logo-static {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-hubspot { background: #FF7A59; }
.logo-n8n { background: #EA4B71; }
.logo-apollo { background: #1a73e8; }
.logo-ga { background: #E37400; }
.logo-linkedin { background: #0A66C2; }
.logo-zoho { background: #E42527; }
.logo-clay { background: #d97706; }
.logo-6sense { background: #ff5024; }
.logo-demandbase { background: #6236ff; }
.logo-zoominfo { background: #ff6a39; }
.logo-sql { background: #334155; font-size: 0.6rem; }
.logo-python { background: #3776AB; }
.logo-gtm { background: #246FDB; }
.logo-firebase { background: #FFCA28; }
.logo-tableau { background: #E97627; }
.logo-powerbi { background: #F2C811; }
.logo-snowflake { background: #29B5E8; }
.logo-looker { background: #4285F4; }
.logo-meta { background: #0866FF; }
.logo-pm { background: #4f46e5; }

/* Certifications */
.certifications { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 12px;
}

.cert-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s var(--ease);
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -28px rgba(20, 22, 26, 0.35);
  border-color: #d8dbe3;
}

.cert-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
}

.cert-logo img { width: 34px; height: 34px; object-fit: contain; }

.cert-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.cert-logo-static {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.cert-card h3 { font-size: 1rem; margin-bottom: 4px; }
.cert-issuer { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* Built & shipped */
.built { overflow: hidden; }

.built-bg {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent 70%);
  pointer-events: none;
}

.built-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--max-width);
  margin: 12px auto 0;
  padding: 0 24px;
}

.built-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 12px;
  scrollbar-width: none;
}

.built-track::-webkit-scrollbar { display: none; }

.built-slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 240px;
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s var(--ease);
}

.built-slide:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -28px rgba(20, 22, 26, 0.35);
  border-color: #d8dbe3;
}

.built-slide h3 { font-size: 1rem; margin: 0; }

.built-logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  max-width: 130px;
  background: #14161a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.built-logo-tile img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.built-logo-mono {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mono-citerank { color: #5b8def; }
.mono-aurahale { color: #e0a45c; }

.carousel-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.carousel-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.carousel-dots button.active {
  background: var(--accent);
  transform: scale(1.3);
}

@media (max-width: 640px) {
  .built-slide { width: 200px; padding: 20px; }
  .carousel-arrow { width: 36px; height: 36px; }
}

/* About */
.about {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.about-bg {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12), transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.about-copy { max-width: 620px; }
.about p { color: var(--text); }

.about-photo-wrap {
  position: sticky;
  top: 100px;
}

.about-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px -30px rgba(20, 22, 26, 0.35);
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { position: static; order: -1; max-width: 240px; }
}

.consulting-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Contact */
.contact-grid { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.contact-links { display: flex; flex-direction: column; gap: 12px; min-width: 260px; }

.contact-link {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.contact-link:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 12px 24px -18px rgba(79, 70, 229, 0.5);
}

.contact-label { color: var(--text-muted); font-size: 0.85rem; }
.contact-value { font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; }
.site-footer p { margin: 0; font-size: 0.85rem; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .built-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .hero h1 { font-size: 2.1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { flex-direction: column; align-items: flex-start; }
  .blob { opacity: 0.2; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
