/* ═══════════════════════════════════════════════════════
   Visual Identity System — Tsunami Swami Redesign
   Shared visual language applied across all pages.
   ═══════════════════════════════════════════════════════ */

/* ── Heading Font ─────────────────────────────────────── */

:root {
  --heading-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4,
.ts-nav__brand,
.faq-title,
.hero-title,
.services-title,
.service-card-title,
.service-detail-title,
.service-detail-section-title {
  font-family: var(--heading-font);
}

/* ── Section System ────────────────────────────────────
   Alternating backgrounds create visual rhythm on scrolling pages. */

.ts-section {
  padding: 5rem 2rem;
  position: relative;
}

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

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

.ts-section--surface-alt {
  background: var(--surface-variant);
}

/* ── Section Headings ─────────────────────────────────── */

.ts-section__heading {
  font-family: var(--heading-font);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.ts-section__sub {
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  text-align: center;
}

/* ── CTA Section ──────────────────────────────────────── */

.ts-cta-section {
  text-align: center;
}

.ts-cta-section p {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

/* ── Services Grid ────────────────────────────────────── */

.ts-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

/* Light mode: subtle gradient for hero areas */
:root:not(.dark-mode) .ts-section--hero-gradient {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.dark-mode .ts-section--hero-gradient {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

/* ── Accent Decorations ──────────────────────────────── */

.ts-accent-bar {
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 1rem 0 1.5rem;
}

.ts-accent-bar--center {
  margin-left: auto;
  margin-right: auto;
}

/* ── Card Elevation ──────────────────────────────────── */

.ts-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.ts-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--accent);
}

:root:not(.dark-mode) .ts-card {
  box-shadow: 0 2px 8px rgba(0, 20, 60, 0.06);
}

/* ── Icon Treatments ──────────────────────────────────── */

.ts-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ts-icon-circle svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.ts-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.6rem;
}

/* ── Scroll Reveal ────────────────────────────────────
   Elements start hidden, revealed by scroll-animate.js via GSAP. */

.ts-reveal {
  opacity: 0;
  transform: translateY(24px);
}

.ts-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Subpage Visual Depth ─────────────────────────────── */

.ts-page-content .component:nth-child(even) {
  background: var(--surface);
  margin-left: -3rem;
  margin-right: -3rem;
  padding: 2.5rem 3rem;
  border-radius: 14px;
}

:root:not(.dark-mode) .ts-page-content {
  background: var(--bg);
}

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

/* ── Quote Block Enhancement ──────────────────────────── */

.component--quote blockquote {
  border-left: none;
  padding-left: 0;
  margin: 0;
}

/* ── Swami Character Accents ──────────────────────────── */

.ts-swami-accent {
  width: 80px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  color: var(--primary);
}

.ts-swami-accent--inline {
  width: 48px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.5rem;
}

.ts-swami-accent--hero {
  width: 120px;
  position: absolute;
  right: -20px;
  top: -30px;
  opacity: 0.7;
  pointer-events: none;
}

/* ── CTA Card ─────────────────────────────────────────── */

.ts-cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  text-align: center;
}

:root:not(.dark-mode) .ts-cta-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-variant) 100%);
  box-shadow: 0 4px 16px rgba(0, 20, 60, 0.08);
}

.ts-cta-card h3 {
  font-family: var(--heading-font);
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.ts-cta-card p {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
}

/* Hide CTA swami when chat/ask section is active (homepage) */
body.chat-enabled .ts-cta-swami {
  display: none;
}

/* ── Buttons ──────────────────────────────────────────── */

.ts-btn {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--heading-font);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.ts-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
}

.ts-btn--outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.ts-btn--outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
  text-decoration: none;
}

/* ── Button Wave Ripple ──────────────────────────────── */

.ts-btn::after {
  content: '';
  position: absolute;
  left: var(--ripple-x, 50%);
  top: var(--ripple-y, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ts-btn--outline::after {
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 20%, transparent) 0%, transparent 70%);
}

.ts-btn.ts-btn--ripple::after {
  animation: ts-ripple 0.6s ease-out forwards;
}

@keyframes ts-ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 0.5;
  }
  100% {
    width: 400px;
    height: 400px;
    opacity: 0;
  }
}

/* ── Service Cards (shared between homepage + services index) ── */

.ts-service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.ts-service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px var(--shadow);
  border-color: var(--accent);
  text-decoration: none;
  color: inherit;
}

:root:not(.dark-mode) .ts-service-card {
  box-shadow: 0 2px 8px rgba(0, 20, 60, 0.05);
}

.ts-service-card__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.ts-service-card__title {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.35rem;
}

.ts-service-card__desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.ts-service-card__cta {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--secondary);
  font-weight: 600;
}

/* ── "Why Us" Grid ──────────────────────────────────── */

.ts-why-us {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.ts-why-us__item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ts-why-us__item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--shadow);
}

:root:not(.dark-mode) .ts-why-us__item {
  box-shadow: 0 2px 8px rgba(0, 20, 60, 0.05);
}

.ts-why-us__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.ts-why-us__icon svg {
  width: 22px;
  height: 22px;
}

.ts-why-us__text h4 {
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.3rem;
}

.ts-why-us__text p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Section Detail Cards (service detail, about) ───── */

.ts-detail-section {
  margin: 0 2rem 2.5rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

:root:not(.dark-mode) .ts-detail-section {
  box-shadow: 0 2px 10px rgba(0, 20, 60, 0.05);
}

.ts-detail-section h2 {
  font-family: var(--heading-font);
  font-size: 1.3rem;
  color: var(--secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ts-detail-section h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.3rem;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Back Link (pill style) ───────────────────────────── */

.ts-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--surface-variant);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s ease;
}

.ts-back-link:hover {
  background: var(--accent);
  color: var(--primary);
  text-decoration: none;
}

/* ── Skeleton Loaders ────────────────────────────────── */

.ts-skeleton {
  pointer-events: none;
  overflow: hidden;
  position: relative;
}

.ts-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--primary) 8%, transparent) 50%,
    transparent 100%
  );
  animation: ts-shimmer 1.8s ease-in-out infinite;
}

.ts-skeleton-block {
  background: color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: 14px;
  margin-bottom: 1rem;
}

.ts-skeleton-text {
  height: 0.9em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--border) 50%, transparent);
  margin-bottom: 0.6rem;
}

.ts-skeleton-text--title {
  width: 65%;
  height: 1.2em;
  margin-bottom: 0.8rem;
}

.ts-skeleton-text--short {
  width: 35%;
}

@keyframes ts-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── 404 Page ────────────────────────────────────────── */

.ts-404 {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

.ts-404__swami {
  width: 120px;
  height: auto;
  margin-bottom: 1.5rem;
  animation: ts-404-wobble 3s ease-in-out infinite;
}

.ts-404__code {
  font-family: var(--heading-font);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin: 0 0 0.5rem;
  opacity: 0.15;
}

.ts-404__message {
  font-family: var(--heading-font);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.ts-404__hint {
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 420px;
  line-height: 1.6;
  margin: 0 0 2rem;
}

.ts-404__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

@keyframes ts-404-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

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

@media (max-width: 767px) {
  .ts-section {
    padding: 3.5rem 1.25rem;
  }

  .ts-page-content .component:nth-child(even) {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding: 2rem 1.25rem;
    border-radius: 0;
  }

  .ts-why-us {
    grid-template-columns: 1fr;
  }

  .ts-detail-section {
    margin: 0 1.25rem 2rem;
  }

  .ts-services-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile service cards: horizontal icon+title, description below */
  .ts-service-card {
    padding: 1.25rem;
  }

  .ts-service-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .ts-service-card__header .ts-service-card__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .ts-service-card__header .ts-service-card__title {
    margin-bottom: 0;
  }

  .ts-service-card__desc {
    font-size: 0.85rem;
  }

  .ts-service-card__cta {
    font-size: 0.85rem;
    margin-top: 0.75rem;
  }
}

/* ── Small Mobile (375px) ────────────────────────────── */

@media (max-width: 400px) {
  .ts-section {
    padding: 3rem 1rem;
  }

  .ts-swami-accent {
    width: 64px;
  }
}

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

/* ── Static Prefill (bot-readable, human-invisible) ──── */
/* Build-time content for readability filters (Perplexity, ChatGPT browse).
   Invisible to sighted users; JS overwrites the parent container on load. */
.sr-prefill {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ts-reveal {
    opacity: 1;
    transform: none;
  }

  .ts-card:hover,
  .ts-service-card:hover,
  .ts-btn:hover,
  .ts-btn--primary:hover,
  .ts-btn--outline:hover {
    transform: none;
  }

  .ts-btn.ts-btn--ripple::after,
  .ts-404__swami,
  .ts-skeleton::after {
    animation: none;
  }

  /* Disable view transitions */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0s;
  }
}
