:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-deep: #2c47f5;
  --radius-lg: 28px;
  --radius-md: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1080px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.4s var(--ease),
    background 0.4s var(--ease),
    transform 0.5s var(--ease);
}

.nav.is-scrolled {
  border-bottom-color: var(--hairline);
}

.nav.is-hidden {
  transform: translateY(-100%);
}

.nav-inner {
  width: min(1080px, calc(100% - 48px));
  margin-inline: auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-brand img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  color: var(--blue) !important;
  font-weight: 500;
}

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 980px;
  background: rgba(0, 0, 0, 0.04);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.nav-github:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 12px 24px;
  border-radius: 980px;
  text-decoration: none;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    background 0.25s ease,
    color 0.25s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.35);
}

.btn-ghost {
  color: var(--blue);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.45);
}

.btn-ghost:hover {
  background: rgba(0, 113, 227, 0.06);
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      52% 44% at 50% 108%,
      rgba(44, 71, 245, 0.16),
      transparent 70%
    ),
    radial-gradient(
      40% 34% at 78% -6%,
      rgba(0, 113, 227, 0.08),
      transparent 70%
    );
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero-avatar img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-inline: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

.hero-eyebrow {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.hero-title {
  margin-top: 14px;
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.grad {
  background: linear-gradient(96deg, #2c47f5 0%, #0071e3 48%, #00a2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 26px auto 0;
  max-width: 560px;
  font-size: clamp(17px, 2.3vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: -0.015em;
}

.hero-sub strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-sub .text-link {
  position: relative;
}

.hero-sub .text-link:hover {
  text-decoration: none;
}

.hero-sub .text-link strong {
  transition: color 0.3s ease;
}

.hero-sub .hai-icon {
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.24em;
  vertical-align: -0.08em;
  color: var(--ink);
  transition: color 0.3s ease;
}

.hero-sub .text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(96deg, #2c47f5 0%, #0071e3 48%, #00a2ff 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-sub .text-link:hover::after,
.hero-sub .text-link:focus-visible::after {
  transform: scaleX(1);
}

.hero-sub .text-link:hover strong,
.hero-sub .text-link:focus-visible strong,
.hero-sub .text-link:hover .hai-icon,
.hero-sub .text-link:focus-visible .hai-icon {
  color: var(--blue);
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  animation: bob 2.4s ease-in-out infinite;
}

.hero-scroll svg {
  display: block;
}

@keyframes bob {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 7px);
  }
}

/* ---------- Load-in / scroll reveals ---------- */

.load-fade {
  opacity: 0;
  transform: translateY(18px);
  animation: loadFade 1s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes loadFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Sections ---------- */

.section {
  padding: 140px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(36px, 5.6vw, 60px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin-top: 72px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--hairline) 0%,
    rgba(0, 113, 227, 0.5) 100%
  );
}

.timeline-item {
  position: relative;
  padding: 0 0 56px 44px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #c7c7cc;
}

.timeline-marker-now {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(0, 113, 227, 0.15);
}

.timeline-tag {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.timeline-tag-now {
  color: var(--blue);
}

.timeline-body h3 {
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.timeline-body p {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.text-link {
  color: var(--blue);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* ---------- Work cards ---------- */

.card {
  margin-top: 72px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-buddy {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 24px;
}

.card-copy {
  padding: 56px 24px 56px 56px;
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.card-brand img {
  height: 26px;
  width: auto;
}

.card-copy h3 {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.card-copy p {
  color: var(--ink-soft);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.card-copy p + p {
  margin-top: 12px;
}

.card-points {
  list-style: none;
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.card-points li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.card-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.card-media {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 40px 0 40px 16px;
  background: linear-gradient(135deg, #eef2f9 0%, #dfe6f3 100%);
}

.browser-frame {
  background: #fff;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 18px 50px rgba(29, 41, 81, 0.18);
  overflow: hidden;
  transform: translateX(24px);
  transition: transform 0.9s var(--ease);
}

.card-buddy.is-visible .browser-frame {
  transform: translateX(12px);
}

.browser-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #f2f2f4;
  border-bottom: 1px solid var(--hairline);
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d8d8dc;
}

.browser-bar span:nth-child(1) {
  background: #ff5f57;
}
.browser-bar span:nth-child(2) {
  background: #febc2e;
}
.browser-bar span:nth-child(3) {
  background: #28c840;
}

/* ---------- Clients marquee ---------- */

.clients {
  margin-top: 56px;
}

.clients-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  transform: translateZ(0);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 72px;
  width: max-content;
  animation: marquee 36s linear infinite;
  padding-right: 72px;
  will-change: transform;
  backface-visibility: hidden;
}

.marquee-track img {
  height: 34px;
  width: auto;
  opacity: 0.55;
  filter: grayscale(1);
}

.marquee-track img.logo-wide {
  height: 20px;
}

.marquee-track img.logo-tall {
  height: 52px;
}

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

/* ---------- CF247 card ---------- */

.card-cf247 {
  background: linear-gradient(135deg, #21103f 0%, #3c1a78 55%, #5a2bb8 100%);
  color: #fff;
}

.card-cf247 .card-copy {
  padding: 64px;
  max-width: 720px;
}

.card-brand-light {
  color: rgba(255, 255, 255, 0.7);
}

.card-cf247 h3 {
  color: #fff;
}

.card-cf247 p {
  color: rgba(255, 255, 255, 0.72);
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.chips li {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 7px 14px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- hai ---------- */

.section-dark {
  position: relative;
  background: #000;
  color: #f5f5f7;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 72px 0;
}

.hai-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      46% 38% at 50% 0%,
      rgba(44, 71, 245, 0.35),
      transparent 70%
    ),
    radial-gradient(
      30% 26% at 82% 68%,
      rgba(0, 162, 255, 0.12),
      transparent 70%
    );
  pointer-events: none;
}

.hai-inner {
  position: relative;
  text-align: center;
}

.hai-logo {
  width: clamp(120px, 16vw, 170px);
  margin-inline: auto;
  color: #fff;
}

.hai-logo svg {
  width: 100%;
  height: auto;
}

.hai-badge {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #9fc2ff;
  padding: 7px 16px;
  border-radius: 980px;
  border: 1px solid rgba(159, 194, 255, 0.25);
  background: rgba(44, 71, 245, 0.12);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4d8dff;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(77, 141, 255, 0.55);
  }
  60% {
    box-shadow: 0 0 0 7px rgba(77, 141, 255, 0);
  }
}

.hai-title {
  margin-top: 22px;
  font-size: clamp(38px, 6.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
  background: linear-gradient(180deg, #ffffff 30%, #a8b6d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hai-sub {
  margin: 22px auto 0;
  max-width: 480px;
  font-size: clamp(16px, 2.2vw, 19px);
  color: rgba(245, 245, 247, 0.62);
  letter-spacing: -0.01em;
}

.hai-grid {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  text-align: left;
}

.hai-feature {
  padding: 30px 26px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition:
    transform 0.5s var(--ease),
    background 0.4s ease,
    border-color 0.4s ease;
}

.hai-feature:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.hai-feature-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(77, 141, 255, 0.14);
  color: #7caeff;
  margin-bottom: 18px;
}

.hai-feature-icon svg {
  width: 20px;
  height: 20px;
}

.hai-feature h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #f5f5f7;
}

.hai-feature p {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(245, 245, 247, 0.56);
  letter-spacing: -0.005em;
}

/* ---------- Contact ---------- */

.section-contact {
  text-align: center;
  padding: 160px 0;
}

.contact-sub {
  margin: 20px auto 0;
  max-width: 420px;
  color: var(--ink-soft);
  font-size: 17px;
  letter-spacing: -0.01em;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .section {
    padding: 96px 0;
  }

  .card-buddy {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .card-copy {
    padding: 40px 28px 32px;
  }

  .card-media {
    padding: 0 0 0 28px;
  }

  .browser-frame,
  .card-buddy.is-visible .browser-frame {
    transform: translate(0, 24px);
    border-radius: 14px 0 0 0;
  }

  .card-cf247 .card-copy {
    padding: 44px 28px;
  }

  .nav-links {
    gap: 18px;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .timeline-item {
    padding-left: 36px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .load-fade {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }

  .hero-scroll {
    animation: none;
  }

  .pulse-dot {
    animation: none;
  }
}
