/* Page padding constant (same as theme switch offset) */
:root {
  --page-gutter: 1.5rem;
}

@media (min-width: 768px) {
  :root {
    --page-gutter: 2rem;
  }
}

/* ─── GPU layers for active animations ─── */
.counter__digit-track {
  will-change: transform;
}

/* ─── Preloader ─── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.preloader__svg {
  position: fixed;
  width: 160px;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1002;
}



/* ─── Ambient background ─── */
.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  /* No background here — body bg shows through, avoiding repaint on theme switch */
  transform: translateZ(0);
  will-change: opacity;
}

/* ── Mesh: brand-colored aurora beams (static) ── */
.ambient__mesh {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 40% 100% at 8% 30%, rgba(29, 207, 150, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 90% at 92% 75%, rgba(29, 207, 150, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 80% 40% at 50% 5%, rgba(150, 205, 188, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 35% 80% at 20% 85%, rgba(29, 207, 150, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 30% 70% at 85% 40%, rgba(150, 220, 195, 0.2) 0%, transparent 45%);
  filter: blur(32px);
  transform: translateZ(0);
}

.ambient__mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 85% at 75% 25%, rgba(29, 207, 150, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 55% 60% at 15% 60%, rgba(150, 220, 195, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 40% 100% at 95% 55%, rgba(29, 207, 150, 0.22) 0%, transparent 50%);
  filter: blur(28px);
  transform: translateZ(0);
}

/* ── Glass texture overlay ── */
.ambient__glass {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* Static gradients only — no CSS variable references to avoid recalc on theme switch */
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 52px
    ),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.03'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transform: translateZ(0);
}

/* ─── Hero Logo ─── */
.hero__logo-link {
  display: inline-block;
  margin-bottom: 1.25rem;
}

.hero__logo {
  height: clamp(30px, 3.5vw, 44px);
  width: auto;
  display: block;
  margin: 0 auto;
}

/* ─── Pill buttons ─── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  color: var(--metal-text);
  text-shadow: 0 1px 0 var(--metal-text-shadow);
  /* 3D pill — convex face using metal tokens */
  background:
    /* Specular sheen at top */
    radial-gradient(ellipse 55% 30% at 50% 5%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
    /* Soft upper highlight */
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 10%),
    /* Main convex radial body */
    radial-gradient(ellipse 86% 76% at 50% 38%, var(--metal-light) 0%, var(--metal-mid) 100%);
  /* Side walls via inset shadow for depth */
  box-shadow:
    inset 3px 0 0 0 var(--metal-mid),
    inset -3px 0 0 0 var(--metal-mid),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 3px rgba(0, 0, 0, 0.04),
    0 6px 18px rgba(29, 207, 150, 0.05),
    0 4px 10px var(--metal-shadow);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.35s ease;
  cursor: pointer;
  overflow: hidden;
}

/* Sharp specular highlight strip */
.btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 22%;
  right: 22%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 30%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.6) 70%,
    transparent 100%
  );
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn__icon {
  width: 1.15em;
  height: 1.15em;
  transition: transform 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    inset 3px 0 0 0 var(--metal-mid),
    inset -3px 0 0 0 var(--metal-mid),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 3px rgba(0, 0, 0, 0.04),
    0 10px 30px rgba(29, 207, 150, 0.08),
    0 6px 16px var(--metal-shadow);
}

.btn:hover::before {
  opacity: 0.4;
  transform: scaleX(1.1);
}

.btn:hover .btn__icon {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    inset 3px 0 0 0 var(--metal-mid),
    inset -3px 0 0 0 var(--metal-mid),
    inset 0 2px 5px rgba(0, 0, 0, 0.1),
    0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn--large {
  padding: 1.15rem 2.5rem;
  font-size: 1.05rem;
}

/* ─── Main / Hero ─── */
.main {
  position: relative;
  z-index: 2;
  background: var(--bg);
  margin-bottom: 50vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem var(--page-gutter);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero__body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr minmax(180px, 240px);
  align-items: center;
  gap: 2rem;
  margin: 0;
}

.hero__side {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.hero__side--left {
  align-items: flex-start;
  text-align: left;
}

.hero__side--right {
  align-items: flex-end;
  text-align: right;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  position: relative;
  z-index: 2;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  color: var(--text);
  margin-bottom: 1.1rem;
  line-height: 0.9;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__title-word {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  line-height: 0.9;
}

.hero__title-word span {
  display: inline-flex !important;
  align-items: center;
  vertical-align: top;
  line-height: 0.9;
}

.hero__description {
  max-width: 620px;
  margin: 0 auto 0.9rem;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--text-soft);
}

.hero__hook {
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero__cta {
  display: inline-flex;
}

/* ─── Counters ─── */
.counter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero__side--left .counter {
  align-items: flex-start;
  text-align: left;
}

.hero__side--right .counter {
  align-items: flex-end;
  text-align: right;
}

.counter__value {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.05em;
}

.counter__digits {
  display: inline-flex;
  align-items: center;
  height: 1em;
}

.counter__digit {
  position: relative;
  width: 0.6em;
  height: 1em;
  overflow: hidden;
}

.counter__digit-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: center;
  transform: translateY(0);
  will-change: transform;
}

.counter__digit-track span,
.counter__symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1em;
  line-height: 1;
  padding: 0;
}

.counter__suffix {
  font-size: 0.7em;
  font-weight: 500;
  color: var(--brand);
}

.counter__label {
  font-size: clamp(0.65rem, 1vw, 0.78rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Clients Ticker ─── */
.clients {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.clients__label {
  font-family: 'Sora', sans-serif;
  font-size: clamp(0.7rem, 1.1vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.clients__ticker {
  width: 100%;
  overflow: hidden;
  position: relative;
  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%);
}

.clients__track {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: max-content;
  animation: ticker-slide 34s linear infinite;
}

.clients__track:hover {
  animation-play-state: paused;
}

.clients__item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
}

.clients__item img {
  height: 28px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: var(--client-logo-filter);
  transition: filter 0.35s ease, transform 0.35s ease;
}

.clients__item img:hover {
  filter: var(--client-logo-filter-hover);
  transform: scale(1.06);
}

@keyframes ticker-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .clients__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

/* ─── Footer ─── */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: 50vh;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  background: var(--footer-bg);
  color: var(--footer-color);
  padding: 1.5rem var(--page-gutter);
  overflow: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
  /* subtle grid */
  background-image:
    linear-gradient(var(--footer-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--footer-grid) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center top;
}

.footer__lettermark {
  flex: 1;
  height: auto;
  max-height: 100%;
  width: auto;
  opacity: 1;
  pointer-events: none;
  align-self: flex-end;
}

.lettermark__path {
  fill: var(--footer-logo-fill);
}

html[data-theme="dark"] .lettermark__path {
  fill: var(--footer-logo-fill);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .lettermark__path {
    fill: var(--footer-logo-fill);
  }
}

.footer__content {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 320px;
}

.footer__tagline {
  font-size: 0.85rem;
  color: var(--footer-text);
  line-height: 1.5;
  text-align: right;
  transition: color 0.5s ease;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--footer-text);
  text-align: right;
  transition: color 0.5s ease;
}

/* ─── Theme switch ─── */
.theme-switch {
  position: fixed;
  bottom: var(--page-gutter);
  left: var(--page-gutter);
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.theme-switch:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.theme-switch__icon {
  width: 20px;
  height: 20px;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.theme-switch__icon--moon {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

html[data-theme="dark"] .theme-switch__icon--sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

html[data-theme="dark"] .theme-switch__icon--moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .theme-switch__icon--sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
  }
  html:not([data-theme]) .theme-switch__icon--moon {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-switch__icon--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
  html:not([data-theme]) .theme-switch__icon--moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
  }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero__body {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero__side {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
  }

  .hero__side--left .counter,
  .hero__side--right .counter {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .header__logo {
    height: 40px;
  }

  .btn {
    padding: 0.75rem 1.2rem;
    font-size: 0.82rem;
  }

  .btn--large {
    padding: 1rem 1.75rem;
    font-size: 0.95rem;
  }

  .hero {
    padding: 2.5rem var(--page-gutter) 1.5rem;
  }

  .footer {
    flex-direction: column;
    align-items: center;
  }

  .footer__content {
    align-items: center;
    margin-left: 0;
    max-width: 100%;
    width: 100%;
    order: -1;
  }

  .footer__tagline {
    text-align: center;
  }

  .footer__copy {
    text-align: center;
  }

  .footer__lettermark {
    flex: 1;
    width: 100%;
    max-width: 100%;
    align-self: flex-end;
  }
}

@media (max-width: 600px) {
  .hero__side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
