/*! ------------------------------------------------
 * Orbits India — Custom Enhancements
 * Layered on top of main.css. Uses the template's own
 * CSS variables (--accent, --accent-rgb, --base…) so the
 * light / dark themes adapt automatically.
 *
 *  01. Theme hooks & tokens
 *  02. Selection / scroll progress / film grain
 *  03. Hero — atmosphere (aurora orbs, orbit ring)
 *  04. Hero — headline reveals & accent words
 *  05. Hero — marquee polish & scroll cue
 *  06. Glass utility
 *  07. Timeline — "From idea to orbit"
 *  08. Spotlight & micro-interactions
 *  09. Accessibility / reduced motion
 * ------------------------------------------------ */

/* ------------------------------------------------ */
/* 01. Theme hooks & tokens                          */
/* ------------------------------------------------ */
:root {
  --ob-glow-2: 159, 139, 231; /* violet echo — matches the hero floaters */
  --ob-ease: cubic-bezier(0.6, 0.01, 0.05, 1);
}

:root[color-scheme="dark"] {
  --ob-glass-bg: rgba(28, 28, 28, 0.5);
  --ob-glass-line: rgba(255, 255, 255, 0.08);
  --ob-glass-line-strong: rgba(255, 255, 255, 0.16);
  --ob-track: rgba(255, 255, 255, 0.08);
  --ob-num-ink: rgba(255, 255, 255, 0.07);
}

:root[color-scheme="light"] {
  --ob-glass-bg: rgba(255, 255, 255, 0.6);
  --ob-glass-line: rgba(22, 22, 22, 0.08);
  --ob-glass-line-strong: rgba(22, 22, 22, 0.16);
  --ob-track: rgba(22, 22, 22, 0.1);
  --ob-num-ink: rgba(22, 22, 22, 0.07);
}

/* ------------------------------------------------ */
/* 02. Selection / scroll progress / film grain      */
/* ------------------------------------------------ */
::selection {
  background: rgba(var(--accent-rgb), 0.9);
  color: #161616;
}

.ob-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.3rem;
  z-index: 1500;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), rgb(var(--ob-glow-2)));
  pointer-events: none;
}

.ob-grain {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------ */
/* 02b. Loader — orbit progress dial                 */
/* ------------------------------------------------ */
.ob-loader {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24rem;
  height: 24rem;
  pointer-events: none;
}

@media only screen and (min-width: 768px) {
  .ob-loader {
    width: 30rem;
    height: 30rem;
  }
}

@media only screen and (min-width: 1200px) {
  .ob-loader {
    width: 34rem;
    height: 34rem;
  }
}

.ob-loader::before {
  content: '';
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(var(--accent-rgb), 0.07) 0%,
      rgba(var(--accent-rgb), 0.03) 45%,
      transparent 70%);
}

.ob-loader svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ob-loader__track {
  fill: none;
  stroke: var(--st-muted);
  stroke-width: 1.5;
}

.ob-loader__dashes {
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.35);
  stroke-width: 1;
  stroke-dasharray: 3 9;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: ob-spin 30s linear infinite reverse;
}

.ob-loader__progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.8));
}

.ob-loader__spin {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.ob-loader__sat {
  fill: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 1));
}

/* the count sits inside the dial — cap the largest font tier, steady digits,
   and style the % as a small accent superscript */
@media only screen and (min-width: 1600px) {
  .loader__count span {
    font-size: 10rem;
  }
}

.loader__count .count__text {
  font-variant-numeric: tabular-nums;
}

.loader__count .count__percent {
  font-size: 2.2rem;
  color: var(--accent);
  align-self: flex-start;
  margin-top: 1rem;
  margin-left: 0.4rem;
}

/* ------------------------------------------------ */
/* 03. Hero — atmosphere                             */
/* ------------------------------------------------ */
/* NOTE: deliberately NO z-index anywhere in the hero — a stacking context on
   __top would isolate the headline's mix-blend-mode: difference from the page
   background and break its automatic white→black flip in light mode. The orb
   layer is the wrap's first child, and the marquee/headline are positioned,
   so plain DOM paint order already keeps content above the glow. */
.mxd-hero-03__top,
.mxd-hero-03__bottom {
  position: relative;
}

.ob-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* fade the layer out toward its edges so orbs never show a clipped line */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 80%, transparent 100%);
}

/* gaussian-like gradient falloff (no CSS blur — much cheaper to composite) */
.ob-orb {
  position: absolute;
  border-radius: 50%;
}

.ob-orb--1 {
  width: 58vw;
  height: 58vw;
  left: -20vw;
  top: -16vw;
  background: radial-gradient(circle,
      rgba(var(--accent-rgb), 0.12) 0%,
      rgba(var(--accent-rgb), 0.085) 22%,
      rgba(var(--accent-rgb), 0.05) 40%,
      rgba(var(--accent-rgb), 0.022) 54%,
      rgba(var(--accent-rgb), 0.008) 66%,
      transparent 78%);
  animation: ob-drift-1 22s ease-in-out infinite alternate;
}

.ob-orb--2 {
  width: 52vw;
  height: 52vw;
  right: -18vw;
  top: 2vw;
  background: radial-gradient(circle,
      rgba(var(--ob-glow-2), 0.11) 0%,
      rgba(var(--ob-glow-2), 0.075) 22%,
      rgba(var(--ob-glow-2), 0.045) 40%,
      rgba(var(--ob-glow-2), 0.02) 54%,
      rgba(var(--ob-glow-2), 0.007) 66%,
      transparent 78%);
  animation: ob-drift-2 27s ease-in-out infinite alternate;
}

.ob-orb--3 {
  width: 44vw;
  height: 44vw;
  left: 28vw;
  bottom: -20vw;
  background: radial-gradient(circle,
      rgba(var(--accent-rgb), 0.08) 0%,
      rgba(var(--accent-rgb), 0.055) 22%,
      rgba(var(--accent-rgb), 0.032) 40%,
      rgba(var(--accent-rgb), 0.014) 54%,
      rgba(var(--accent-rgb), 0.005) 66%,
      transparent 78%);
  animation: ob-drift-3 31s ease-in-out infinite alternate;
}

@keyframes ob-drift-1 {
  to { transform: translate(7vw, 5vw) scale(1.1); }
}

@keyframes ob-drift-2 {
  to { transform: translate(-6vw, 7vw) scale(0.94); }
}

@keyframes ob-drift-3 {
  to { transform: translate(-8vw, -5vw) scale(1.12); }
}

/* dashed "orbit" ring behind the headline */
.ob-orbit {
  position: absolute;
  left: 50%;
  bottom: -18%;
  transform: translateX(-50%);
  width: min(86rem, 92vw);
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}

.ob-orbit svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ob-orbit__ring {
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.35);
  stroke-width: 1;
  stroke-dasharray: 5 7;
  vector-effect: non-scaling-stroke;
}

.ob-orbit__dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.9));
}

/* ------------------------------------------------ */
/* 04. Hero — headline reveals & accent words        */
/* ------------------------------------------------ */
.mxd-hero-03__headline {
  z-index: 2;
}

/* theme-correct caption color (template hardcodes #fff, invisible in light mode) */
.hero-03-headline__caption {
  color: var(--base-opp);
}

.ob-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em; /* keep descenders inside the mask */
  margin-bottom: -0.08em;
}

.ob-mask__in {
  display: inline-block;
  will-change: transform;
}

.ob-accent-word {
  background: linear-gradient(94deg, var(--accent) 25%, rgb(var(--ob-glow-2)) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.3));
}


/* ------------------------------------------------ */
/* 05. Hero — marquee polish & scroll cue            */
/* ------------------------------------------------ */
.hero-03-marquee__video {
  box-shadow: 0 0 0 1px var(--ob-glass-line-strong),
              0 24px 80px -24px rgba(var(--accent-rgb), 0.4);
  transition: transform 0.6s var(--ob-ease);
}

.hero-03-marquee__video:hover {
  transform: scale(1.03);
}


.ob-scroll-cue {
  position: absolute;
  right: 5rem;
  top: 44%;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 8.8rem;
  height: 8.8rem;
  border-radius: 50%;
  background: var(--ob-glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--ob-glass-line);
}

@media only screen and (min-width: 1200px) {
  .ob-scroll-cue {
    display: flex;
  }
}

.ob-scroll-cue__ring {
  position: absolute;
  inset: 0.5rem;
  animation: ob-spin 18s linear infinite;
}

.ob-scroll-cue__ring text {
  font: 600 0.65rem var(--_font-default);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  fill: var(--base-opp);
  opacity: 0.65;
}

.ob-scroll-cue > i {
  font-size: 1.9rem;
  color: var(--accent);
  animation: ob-nudge 2.2s ease-in-out infinite;
}

@keyframes ob-spin {
  to { transform: rotate(360deg); }
}

@keyframes ob-nudge {
  0%, 100% { transform: translateY(-0.2rem); }
  50% { transform: translateY(0.3rem); }
}

/* ------------------------------------------------ */
/* 06. Glass utility                                 */
/* ------------------------------------------------ */
.ob-glass {
  background: var(--ob-glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--ob-glass-line);
}

/* ------------------------------------------------ */
/* 07. Timeline — "From idea to orbit"               */
/* ------------------------------------------------ */
.ob-timeline .mxd-section-title {
  margin-bottom: 4rem;
}

.ob-timeline__stage {
  position: relative;
}

.ob-timeline__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.ob-tl-track {
  stroke: var(--ob-track);
  stroke-width: 2;
  fill: none;
}

.ob-tl-glowpath {
  stroke: var(--accent);
  stroke-width: 12;
  fill: none;
  opacity: 0.14;
  stroke-linecap: round;
}

.ob-tl-line {
  stroke: url(#obTlGrad);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
}

/* satellite dot lives in HTML (an SVG circle would be stretched by
   the preserveAspectRatio="none" scaling) */
.ob-tl-sat-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin: -0.55rem 0 0 -0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 3px rgba(var(--accent-rgb), 0.75);
  pointer-events: none;
  z-index: 1;
}

.ob-tl-sat-dot::after {
  content: '';
  position: absolute;
  inset: -0.8rem;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.7);
  animation: ob-ping 1.9s ease-out infinite;
}

@keyframes ob-ping {
  0% { transform: scale(0.35); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.ob-timeline__items {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-rows: 1fr;
}

.ob-tl-item {
  display: grid;
  grid-template-columns: 4.8rem 1fr;
  align-items: center;
  min-height: 22rem;
  padding: 1.6rem 0;
}

.ob-tl-node {
  grid-column: 1;
  justify-self: center;
  position: relative;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--base);
  border: 2px solid var(--ob-glass-line-strong);
  transition: background 0.45s var(--ob-ease), border-color 0.45s var(--ob-ease), box-shadow 0.45s var(--ob-ease);
}

.ob-tl-node::after {
  content: '';
  position: absolute;
  inset: -1rem;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  opacity: 0;
  transform: scale(0.4);
}

.ob-tl-item.is-lit .ob-tl-node {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px 2px rgba(var(--accent-rgb), 0.55);
}

.ob-tl-item.is-lit .ob-tl-node::after {
  animation: ob-node-ping 0.9s var(--ob-ease) forwards;
}

@keyframes ob-node-ping {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.6); }
}

.ob-tl-card {
  position: relative;
  grid-column: 2;
  max-width: 46rem;
  margin-left: 1.4rem;
  padding: 3rem 3.2rem 3.2rem;
  border-radius: var(--_radius-m);
  overflow: hidden;
  transition: transform 0.5s var(--ob-ease), box-shadow 0.5s var(--ob-ease), border-color 0.5s var(--ob-ease);
}

.ob-tl-card:hover {
  transform: translateY(-0.4rem);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 24px 60px -28px rgba(var(--accent-rgb), 0.35);
}

.ob-tl-card__num {
  position: absolute;
  top: 0.6rem;
  right: 2rem;
  font: 800 8.4rem/1 var(--_font-accent);
  color: var(--ob-num-ink);
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

.ob-tl-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 50%;
  margin-bottom: 1.8rem;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  font-size: 2.2rem;
  transition: transform 0.5s var(--ob-ease), background 0.5s var(--ob-ease);
}

.ob-tl-card:hover .ob-tl-card__icon {
  transform: rotate(-8deg) scale(1.08);
  background: rgba(var(--accent-rgb), 0.22);
}

.ob-tl-card__title {
  font: 600 2.4rem/1.2 var(--_font-accent);
  color: var(--base-opp);
  margin-bottom: 1rem;
}

.ob-tl-card__text {
  font-size: 1.5rem;
  line-height: 1.65;
  color: var(--base-opp);
  opacity: 0.72;
  margin: 0;
}

@media only screen and (min-width: 992px) {
  .ob-tl-item {
    grid-template-columns: 1fr 16rem 1fr;
    min-height: 24rem;
    padding: 0;
  }

  .ob-tl-node {
    grid-column: 2;
    grid-row: 1;
  }

  .ob-tl-card {
    grid-row: 1;
    margin-left: 0;
  }

  .ob-tl-item:nth-child(odd) .ob-tl-card {
    grid-column: 1;
    justify-self: end;
  }

  .ob-tl-item:nth-child(even) .ob-tl-card {
    grid-column: 3;
    justify-self: start;
  }
}

@media only screen and (max-width: 991px) {
  .ob-timeline__svg {
    width: 4.8rem;
    left: 0;
  }
}

/* ------------------------------------------------ */
/* 08. Spotlight & micro-interactions                */
/* ------------------------------------------------ */
.ob-spot {
  position: relative;
}

.ob-spot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(34rem circle at var(--mx, 50%) var(--my, 50%),
              rgba(var(--accent-rgb), 0.08), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.ob-spot:hover::after {
  opacity: 1;
}

.btn,
.mxd-nav__hamburger,
#color-switcher {
  will-change: transform;
}

.btn-default:hover {
  box-shadow: 0 10px 34px -10px rgba(var(--accent-rgb), 0.45);
}

/* ------------------------------------------------ */
/* 08b. Theme toggle — wet-paint view transition     */
/* ------------------------------------------------ */
/* disable the default cross-fade; the clip-path splat
   animation in orbits-extra.js does all the work */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* dark→light: the new (light) view sits on top and expands out of the button
   (default stacking already puts the new view on top) */

/* light→dark: the old (light) view must sit on top so it can retract
   into the button, revealing the dark view beneath */
html.ob-vt-retract::view-transition-old(root) {
  z-index: 2;
}

html.ob-vt-retract::view-transition-new(root) {
  z-index: 1;
}

/* ------------------------------------------------ */
/* 09. Accessibility / reduced motion                */
/* ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .ob-orb,
  .ob-scroll-cue__ring,
  .ob-scroll-cue > i,
  .ob-tl-sat-dot::after,
  .ob-loader__dashes,
  .ob-orbit__dot {
    animation: none !important;
  }

  .ob-grain {
    display: none;
  }
}
