/* ═══════════════════════════════════════════════════════
   Homepage Styles — hero, service grid, section headings
   Applied only on the redesigned scrolling homepage.
   ═══════════════════════════════════════════════════════ */

/* ── Transparent Nav (homepage only) ─────────────────── */

.ts-nav--transparent {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  transform: translateY(-100%);
}

.ts-nav--transparent.ts-nav--revealed {
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

:root:not(.dark-mode) .ts-nav--transparent {
  box-shadow: none;
}

.ts-nav--transparent.ts-nav--scrolled {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-bottom-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root:not(.dark-mode) .ts-nav--transparent.ts-nav--scrolled {
  box-shadow: 0 1px 8px rgba(0, 20, 60, 0.06);
}

/* ── Hero ────────────────────────────────────────────── */

.ts-hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 3rem 6rem;
  background: linear-gradient(170deg, var(--bg) 0%, var(--surface) 60%, var(--surface-variant) 100%);
  overflow: hidden;
  z-index: 0;
}

/* Spacer reserves scroll room for the fixed hero + parallax */
.ts-hero-spacer {
  height: 100vh;
}

@media (min-width: 801px) {
  .ts-hero-spacer {
    height: 120vh;
  }
}

/* Content wrapper scrolls over the fixed hero.
   Starts transparent so it doesn't create a visible "curtain"
   sweeping up during parallax. JS adds --visible after reveal. */
.ts-content {
  position: relative;
  z-index: 1;
}

.ts-content.ts-content--visible {
  background: var(--bg);
}

.ts-hero__inner {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.ts-hero__text {
  text-align: left;
}

.ts-hero__headline {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

/* Headline split into two separately-animated lines */
.ts-hero__line {
  display: block;
  opacity: 0;
}

.ts-hero__line--2 {
  color: var(--primary);
}

.ts-hero__subtitle {
  font-family: var(--heading-font);
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.ts-hero__detail {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 520px;
}

.ts-hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Hero Visual (logo container) ────────────────────── */

.ts-hero__visual {
  width: 37vw;
  max-width: 480px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo link inside hero — override shared .logo-link grid/aspect styles
   so it just passes through the visual container's sizing */
.ts-hero__visual .logo-link {
  display: contents;
}

.ts-hero__logo-wrap {
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
}

/* ── Ask Section (standalone, above CTA) ─────────────── */

.ts-ask-section {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--surface);
}

.ts-ask-section__inner {
  max-width: 560px;
  margin: 0 auto;
}

.ts-ask-section__swami {
  width: 72px;
  height: auto;
  margin: 0 auto 1.2rem;
  display: block;
}

.ts-ask-section__heading {
  font-family: var(--heading-font);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.ts-ask-section__sub {
  font-size: 1rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

/* Override #askForm hero entrance animation inside ask section */
.ts-ask-section #askForm {
  opacity: 1;
  transform: none;
}

/* (Services grid, section headings, CTA section moved to visual-identity.css) */

/* ── Hero Parallax (word extraction effect) ──────────── */

.ts-hero__parallax {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Inline keyword spans within the detail paragraph */
.ts-hero__keyword {
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Clone overlays — positioned exactly over the source keywords by JS */
.ts-hero__keyword-clone {
  position: absolute;
  opacity: 0;
  color: var(--ink-muted);
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  will-change: transform, opacity;
  transform-origin: left center;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 800px) {
  .ts-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .ts-hero__text {
    text-align: center;
    order: 2;
  }

  .ts-hero__visual {
    width: clamp(200px, 35vw, 280px);
    min-width: 200px;
    max-width: none;
    order: 1;
    justify-self: center;
  }

  .ts-hero__headline {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

  .ts-hero__subtitle {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: 0.75rem;
  }

  .ts-hero__detail {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .ts-hero__actions {
    justify-content: center;
    padding-top: 1vh;
  }

  .ts-hero__actions .ts-btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
  }

  .ts-hero {
    padding: calc(var(--nav-height, 56px) + 5vh) 1.5rem 1rem;
    align-items: flex-start;
  }
}

/* ── Hero Entrance Animation (initial state for GSAP) ── */

.ts-hero__subtitle,
.ts-hero__detail,
.ts-hero__actions,
.ts-hero__visual {
  opacity: 0;
}

/* Headline opacity handled per-line via .ts-hero__line (opacity: 0) */

/* ── What We Do stagger entrance (fade only, no translateY) ── */
/* Section and children start fully transparent so the content
   doesn't create visible scroll motion over the fixed hero. */

.ts-stagger-entrance {
  height: 100vh;
  box-sizing: border-box;
  overflow: clip;
  padding: 5vh 2rem 3vh;
  background: transparent;
}

.ts-stagger-entrance .ts-section__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ts-stagger-entrance .ts-section__heading {
  font-size: clamp(1.3rem, 4vh, 2.2rem);
  margin-bottom: 0.5vh;
}

.ts-stagger-entrance .ts-section__sub {
  margin-bottom: 1vh;
}

.ts-stagger-entrance .ts-accent-bar {
  margin-bottom: 2vh;
}

.ts-stagger-entrance .ts-services-grid {
  flex: 1;
  gap: 1.5vh;
  grid-auto-rows: 1fr;
}

.ts-stagger-entrance .ts-service-card {
  padding: 1.5vh 1.5rem;
}

.ts-stagger-entrance .ts-service-card__icon {
  width: clamp(32px, 5.5vh, 56px);
  height: clamp(32px, 5.5vh, 56px);
  margin-bottom: 0.8vh;
}

.ts-stagger-entrance .ts-service-card__title {
  font-size: clamp(0.9rem, 1.8vh, 1.2rem);
  margin-bottom: 0.4vh;
}

.ts-stagger-entrance .ts-service-card__desc {
  font-size: clamp(0.8rem, 1.5vh, 0.92rem);
}

.ts-stagger-entrance .ts-service-card__cta {
  margin-top: auto;
  font-size: clamp(0.8rem, 1.4vh, 0.9rem);
}

.ts-stagger-entrance.ts-entrance--visible {
  background: var(--surface);
}

.ts-stagger-entrance .ts-section__heading,
.ts-stagger-entrance .ts-section__sub,
.ts-stagger-entrance .ts-accent-bar,
.ts-stagger-entrance .ts-service-card {
  opacity: 0;
}

/* Mobile: remove 100vh lock, let content flow naturally */
@media (max-width: 800px) {
  .ts-stagger-entrance {
    height: auto;
    overflow: visible;
    padding: 3rem 1.25rem;
  }

  .ts-stagger-entrance .ts-section__inner {
    height: auto;
  }

  .ts-stagger-entrance .ts-services-grid {
    flex: none;
    grid-auto-rows: auto;
    gap: 1rem;
  }

  .ts-stagger-entrance .ts-service-card {
    padding: 1.25rem;
  }

  .ts-stagger-entrance .ts-section__heading {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .ts-stagger-entrance .ts-section__sub {
    margin-bottom: 0.5rem;
  }

  .ts-stagger-entrance .ts-accent-bar {
    margin-bottom: 1.5rem;
  }
}

/* ── Reduced Motion ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ts-hero__line,
  .ts-hero__subtitle,
  .ts-hero__detail,
  .ts-hero__actions,
  .ts-hero__visual {
    opacity: 1;
  }

  .ts-hero__parallax {
    display: none;
  }

  .ts-content {
    background: var(--bg);
  }

  .ts-stagger-entrance {
    background: var(--surface);
  }

  .ts-stagger-entrance .ts-section__heading,
  .ts-stagger-entrance .ts-section__sub,
  .ts-stagger-entrance .ts-accent-bar,
  .ts-stagger-entrance .ts-service-card {
    opacity: 1;
  }
}
