/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  /* Colors */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-grey-900: #212121;
  --color-grey-800: #424242;
  --color-grey-700: #616161;
  --color-purple-500: #1a49ef;
  --color-purple-400: #486df2;
  --color-purple-200: #a3b6f9;
  --color-purple-100: #d1dbfc;
  --color-purple-50: #ecf0fe;
  --color-footer-bg: #f0f4fe;
  --color-card-divider: #e6e9ef;
  --color-frame-dark: #2a2a2a;
  --color-dot-border: #bfc0c1;
  --color-dot-border-active: #5e718d;
  --color-dot-progress: #075ee8;
  --color-glass: rgba(255, 255, 255, 0.72);

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Poppins", var(--font-sans);

  /* Layout */
  --content-width: 1536px;
  --gutter: clamp(16px, 6.667vw, 96px);
  --column-gap: 32px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Section tabs (kept in sync with the real height by section-tabs.js) */
  --tabs-height: 65px;

  /* Effects */
  --glass-blur: saturate(180%) blur(20px);

  /* Motion */
  --carousel-interval: 3s;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-grey-800);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-purple-500);
  outline-offset: 2px;
  border-radius: 4px;
}

section[id] {
  scroll-margin-top: var(--tabs-height);
}

.container {
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--color-purple-500);
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

.text-accent {
  color: var(--color-purple-500);
}

/* ==========================================================================
   Intro (header + hero)
   ========================================================================== */
.intro {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--color-white);
}

.intro > .container {
  position: relative;
  z-index: 1;
}

.intro__decor {
  position: absolute;
  inset: 0 auto 0 50%;
  width: min(100%, calc(var(--content-width) + 2 * var(--gutter)));
  transform: translateX(-50%);
  pointer-events: none;
}

.intro__decor img {
  position: absolute;
  top: 0;
  left: 32.5%;
  width: 93.6%;
  max-width: none;
  height: auto;
  aspect-ratio: 1348 / 631;
  object-fit: contain;
  mix-blend-mode: difference;
}

.site-header {
  padding-top: clamp(16px, 1.67vw, 24px);
}

.brand {
  display: inline-block;
  color: var(--color-purple-400);
  font-family: var(--font-brand);
  font-size: 20px;
  line-height: 28px;
  text-decoration: none;
}

.hero {
  container-type: inline-size;
  padding-top: clamp(56px, 9.72vw, 140px);
  padding-bottom: clamp(48px, 10.28vw, 148px);
}

.hero__role {
  color: var(--color-grey-700);
  font-size: clamp(18px, 1.67vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.12px;
}

.hero__title {
  margin-top: 12px;
  color: var(--color-grey-900);
  /* "Solving complex problems" is ~12.85em wide, so 1/13 of the
     content width keeps it on line one at every screen size. */
  font-size: min(96px, 100cqi / 13);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.2px;
}

.hero__break--mobile {
  display: none;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 4px 16px;
  border: 1px solid var(--color-purple-200);
  border-radius: var(--radius-pill);
  background: var(--color-purple-50);
  color: var(--color-grey-900);
  white-space: nowrap;
}

/* ==========================================================================
   Section tabs (sticky)
   ========================================================================== */
.section-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-white);
}

/* Frosted glass: content scrolling underneath shows through, blurred. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .section-tabs {
    background: var(--color-glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
}

.section-tabs__list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-purple-100);
  overflow-x: auto;
  scrollbar-width: none;
}

.section-tabs__list::-webkit-scrollbar {
  display: none;
}

.section-tabs__item {
  flex: 0 1 273.67px;
  min-width: 0;
}

.section-tabs__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 12px 16px;
  color: var(--color-grey-800);
  font-size: 20px;
  line-height: 30px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease;
}

.section-tabs__link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--color-purple-500);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}

.section-tabs__link:hover {
  color: var(--color-purple-500);
}

.section-tabs__link:focus-visible {
  outline-offset: -2px;
}

.section-tabs__link[aria-current="true"] {
  color: var(--color-purple-500);
  font-weight: 700;
}

.section-tabs__link[aria-current="true"]::after {
  transform: scaleX(1);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section--work {
  padding-top: 40px;
}

.section--product {
  padding-top: clamp(48px, 4.44vw, 64px);
  padding-bottom: clamp(48px, 6.25vw, 90px);
}

.section--automations {
  padding-top: clamp(48px, 5.42vw, 78px);
  padding-bottom: clamp(48px, 7.22vw, 104px);
}

.section-header__title {
  color: var(--color-grey-900);
  font-size: clamp(24px, 2.08vw, 30px);
  font-weight: 400;
  line-height: 1.5;
  text-transform: uppercase;
}

.section-header__description {
  margin-top: 4px;
}

.section-header + .feature {
  margin-top: clamp(32px, 3.89vw, 56px);
}

.divider-gradient {
  height: 2px;
  margin: 0;
  border: 0;
  background: url("../assets/icons/line4.svg") center / 100% 2px no-repeat;
}

/* ==========================================================================
   Feature row (media + details) — used by projects, Kindlr and automations
   ========================================================================== */
.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--column-gap);
  align-items: start;
}

.feature + .feature {
  margin-top: 48px;
}

.feature__media {
  overflow: hidden;
  aspect-ratio: 608 / 342;
  border-radius: var(--radius-lg);
  background: var(--color-purple-50);
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__media--product {
  aspect-ratio: 608 / 322;
  margin-top: 9px;
  border-radius: 0;
  background: none;
}

.feature__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  min-width: 0;
}

.feature__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature__title {
  color: var(--color-grey-900);
  font-size: clamp(20px, 1.67vw, 24px);
  font-weight: 700;
  line-height: 1.5;
}

.feature__description {
  max-width: 96%;
}

/* Custom bullets so the dots sit exactly on the content's left edge. */
.outcome-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.outcome-list li {
  position: relative;
  padding-left: 16px;
}

/* Centred on the first line: (24px line-height - 5px dot) / 2 */
.outcome-list li::before {
  content: "";
  position: absolute;
  top: 9.5px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.outcome-list strong {
  font-weight: 700;
}

/* ==========================================================================
   Links & buttons
   ========================================================================== */
.link-cta,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-purple-500);
  font-weight: 700;
  text-decoration: none;
}

.link-cta__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 1.67px;
  transition: transform 0.2s var(--ease-out);
}

.link-cta:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-cta:hover .link-cta__icon,
.button-secondary:hover .link-cta__icon {
  transform: translate(2px, -2px);
}

.button-secondary {
  flex-shrink: 0;
  min-width: 343px;
  height: 56px;
  padding-inline: 12px;
  border: 1px solid var(--color-purple-500);
  border-radius: var(--radius-lg);
  transition: background-color 0.2s ease;
}

.button-secondary:hover {
  background: var(--color-purple-50);
}

.button-secondary:active {
  background: var(--color-purple-100);
}

.view-all {
  display: flex;
  align-items: center;
  gap: 42px;
  margin-top: 64px;
}

.view-all::before,
.view-all::after {
  content: "";
  flex: 1;
  height: 2px;
  background: url("../assets/icons/line2.svg") center / 100% 2px no-repeat;
}

/* ==========================================================================
   AI automations list
   ========================================================================== */
.automation-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.automation + .automation {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-card-divider);
}

.automation__title {
  color: var(--color-grey-900);
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
  font-feature-settings: "liga" 0;
}

.automation__description {
  max-width: 96%;
  margin-top: 4px;
}

/* ==========================================================================
   Carousel
   ========================================================================== */
.carousel {
  min-width: 0;
}

.carousel__stage {
  position: relative;
  aspect-ratio: 608 / 342;
  border-radius: var(--radius-lg);
  background: var(--color-purple-50);
}

/* Inset matches the 538×303 frame placed inside the 608×342 background */
.carousel__viewport {
  position: absolute;
  inset: 5.848% 5.757% 5.556%;
  overflow: hidden;
  border: 4px solid var(--color-frame-dark);
  border-radius: var(--radius-lg);
  background: var(--color-frame-dark);
}

.carousel__track {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.6s var(--ease-out);
}

.carousel__slide {
  flex: 0 0 100%;
  height: 100%;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.carousel__dots[hidden] {
  display: none;
}

/* The button provides a comfortable hit area; the pill inside is the visual dot */
.carousel__dot {
  display: inline-flex;
  padding: 8px 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.carousel__dot:focus-visible {
  outline-offset: 0;
}

.carousel__dot-pill {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--color-dot-border);
  border-radius: var(--radius-pill);
  background: var(--color-white);
  transition: width 0.3s var(--ease-out), border-color 0.3s ease;
}

.carousel__dot:hover .carousel__dot-pill {
  border-color: var(--color-dot-border-active);
}

.carousel__dot.is-active .carousel__dot-pill {
  width: 24px;
  border-color: var(--color-dot-border-active);
}

.carousel__dot-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-dot-progress);
  transform: scaleX(0);
  transform-origin: left center;
}

.carousel__dot.is-active .carousel__dot-pill::before {
  animation: carousel-progress var(--carousel-interval) linear forwards;
}

/* Pause autoplay while the user is reading or navigating with the keyboard */
.carousel.is-paused .carousel__dot-pill::before,
.carousel:has(:focus-visible) .carousel__dot-pill::before {
  animation-play-state: paused;
}

@media (hover: hover) {
  .carousel:hover .carousel__dot-pill::before {
    animation-play-state: paused;
  }
}

@keyframes carousel-progress {
  to {
    transform: scaleX(1);
  }
}

/* ==========================================================================
   Logos
   ========================================================================== */
.logos {
  padding-block: 24px;
}

.logo-strip {
  --logo-scale: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px 74px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo-strip img {
  width: calc(var(--logo-w) * var(--logo-scale));
  height: auto;
  object-fit: cover;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 24px;
  padding-top: clamp(40px, 4.44vw, 64px);
  background: var(--color-footer-bg);
}

.site-footer__message {
  max-width: 928px;
  color: var(--color-black);
  font-size: clamp(36px, 4.44vw, 64px);
  font-weight: 500;
  line-height: 1.094;
  letter-spacing: -0.01em;
}

.site-footer__email {
  display: inline-block;
  margin-top: 32px;
  color: var(--color-grey-900);
  font-size: clamp(18px, 1.39vw, 20px);
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.site-footer__email:hover {
  color: var(--color-purple-500);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer__bottom {
  margin-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--color-purple-100);
}

.site-footer__copyright {
  padding-block: 20px;
  color: var(--color-grey-700);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .section-tabs__link {
    font-size: 18px;
  }
}

/* Tablet & below: stack media above details */
@media (max-width: 860px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .feature__media--product {
    margin-top: 0;
  }

  .feature__description,
  .automation__description {
    max-width: none;
  }

  .view-all {
    gap: 24px;
    margin-top: 48px;
  }

  .logo-strip {
    --logo-scale: 0.8;
    gap: 24px 48px;
  }

  .intro__decor img {
    left: 15%;
    width: 160%;
  }
}

/* Mobile */
@media (max-width: 600px) {
  body {
    font-size: 14px;
    line-height: 22px;
  }

  .brand {
    font-size: 14px;
    line-height: 20px;
  }

  /* Let the wave pattern run the full height of the intro on narrow screens. */
  .intro__decor img {
    left: 20%;
    width: auto;
    height: 100%;
  }

  /* More breathing room so the hero fills more of the first screen. */
  .hero {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .hero__role {
    font-size: 16px;
    line-height: 24px;
  }

  /* Three lines on mobile: "Solving complex / problems at scale / with AI".
     The longest line is ~8.6em, so 1/8.8 of the width always fits. */
  .hero__title {
    margin-top: 16px;
    font-size: min(44px, 100cqi / 8.8);
    line-height: 1.1;
  }

  .hero__break--mobile {
    display: inline;
  }

  .hero__break--desktop {
    display: none;
  }

  .chip-list {
    gap: 8px;
    margin-top: 32px;
  }

  .chip {
    height: 28px;
    padding-inline: 10px;
    font-size: 12px;
    line-height: 16px;
  }

  .section-tabs .container {
    padding-inline: 0;
  }

  /* Tabs line up with the page gutter and sit further apart. */
  .section-tabs__list {
    gap: 24px;
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }

  .section-tabs__item {
    flex: 0 0 auto;
  }

  .section-tabs__link {
    height: 52px;
    padding: 8px 0;
    font-size: 14px;
    line-height: 22px;
  }

  .section--work {
    padding-top: 24px;
  }

  .feature + .feature {
    margin-top: 40px;
  }

  .feature__body {
    gap: 24px;
  }

  /* Re-centre the bullet on the shorter 22px mobile line. */
  .outcome-list li::before {
    top: 8.5px;
  }

  .automation__title {
    font-size: 18px;
    line-height: 27px;
  }

  .view-all {
    gap: 16px;
    margin-top: 40px;
  }

  .button-secondary {
    min-width: 0;
    height: 48px;
    padding-inline: 20px;
  }

  .logo-strip {
    --logo-scale: 0.6;
    gap: 20px 32px;
  }

  .site-footer__message {
    font-size: clamp(32px, 9vw, 36px);
  }

  .site-footer__email {
    font-size: 14px;
    line-height: 22px;
  }
}

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

  .carousel__track,
  .carousel__dot-pill,
  .section-tabs__link::after,
  .link-cta__icon {
    transition: none;
  }
}
