/* styles_index.css — start page only. Shared parts (header, typography,
   buttons, statement, trust, CTA band, contact, popup) come from
   styles_common.css, the graph styles from styles_building.css */

body.page-index {
  background-color: var(--color-black);
}

/* ============================================
   HERO — a darkened photo as a backdrop
   ============================================ */
.index-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: var(--color-black);
}

.index-hero__room,
.index-hero__room img,
.index-hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

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

.index-hero__dark {
  filter: brightness(0.55);
}

/* Keeps the title readable and fades into the black below */
.index-hero__shade {
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, rgba(0, 0, 0, 0.5) 0%, transparent 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 55%, var(--color-black) 100%);
}

/* Hidden until the intro timeline in script_index.js takes over */
.hero-intro header,
.hero-intro .index-hero__room,
.hero-intro .index-hero h1,
.hero-intro .index-hero__actions > * {
  opacity: 0;
}

.index-hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  padding: 0 2rem;
}

/* Same size as the Home and Building hero headlines */
.index-hero h1 {
  font-size: 4rem;
  font-weight: 600;
  text-wrap: balance;
}

.index-hero__brand {
  display: block;
  width: fit-content;
  margin-inline: auto;
}


.index-hero__actions {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

@media (max-width: 768px) {
  .index-hero h1 {
    font-size: 2.6rem;
  }
}

/* ============================================
   PATHS — two large cards: Home and Building
   ============================================ */
.paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.path {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(60vh, 560px);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  isolation: isolate;
  transition: border-color 0.4s ease;
}

.path__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.path__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Text sits on a dark fade at the bottom of the card */
.path__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 40%, transparent 75%);
}

/* Building card: the three laptops of the Building hero on the Building blue */
.path--building .path__media {
  background:
    radial-gradient(ellipse at 60% 30%, rgba(30, 60, 120, 0.55) 0%, transparent 65%),
    #05070c;
}

.path__trio {
  margin-top: 4.5rem;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
  .path:hover .path__trio {
    transform: scale(1.04);
  }
}

.path__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2.5rem;
}

/* the label sits over a photo, so a bit brighter than elsewhere */
.path .section-label {
  opacity: 0.6;
}

.path__title {
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.path__body .section-sub {
  max-width: 440px;
}

/* side by side: room for two lines of text in both cards, so the titles
   stand on one line even when one text is shorter */
@media (min-width: 901px) {
  .path__body .section-sub {
    min-height: 2lh;
  }
}

/* "Explore" with an arrow, like the buttons */
.path__more {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-white);
}

.path__more::after {
  content: "→";
  display: inline-block;
  margin-left: 0.4em;
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .path:hover {
    border-color: var(--line-strong);
  }

  .path:hover .path__media > img {
    transform: scale(1.04);
  }

  .path:hover .path__more {
    color: var(--color-active);
  }

  .path:hover .path__more::after {
    transform: translateX(4px);
  }
}

@media (max-width: 900px) {
  .paths {
    grid-template-columns: 1fr;
  }

  .path {
    min-height: calc((100svh - 7rem) / 2); /* both cards fit on one phone screen */
  }
}

@media (max-width: 600px) {
  .path__body {
    padding: 1.75rem;
  }
}

/* ============================================
   BMS — text, screenshots and the link to Building
   ============================================ */
.index-bms {
  background: var(--color-black);
  padding: var(--section-pad-y) var(--section-pad-x);
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

@media (max-width: 600px) {
  .index-bms {
    padding: 5rem 1.5rem;
    gap: 2.5rem;
  }
}

/* ============================================
   SMART HOME INTRO — text left, photo slider right (like a Home block)
   ============================================ */
.intro__content {
  display: flex;
  align-items: center;
  gap: 5rem;
}

.intro__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.intro__points {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.intro__more {
  margin-top: 1rem;
}

/* --- Slider --- */
.slider {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Photos lie on top of each other and cross-fade */
.slider__frame {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 20px;
  overflow: hidden;
  touch-action: pan-y; /* horizontal swipe is ours, vertical scrolls the page */
}

.slider__item {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.slider__item.is-active {
  opacity: 1;
}

.slider__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
  /* slow zoom while the photo is on screen */
  transform: scale(1.06);
  transition: transform 6s ease-out;
}

.slider__item.is-active img {
  transform: scale(1);
}

/* Name of the photo, bottom left — on phones the list is far below */
.slider__item figcaption {
  position: absolute;
  left: 1.25rem;
  bottom: 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* Controls: dots in a frosted pill + a round play/pause button */
.slider__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.slider__dots {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* The button is a larger tap area around a small dot */
.slider__dot {
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0 5px;
  border: 0;
  background: none;
  cursor: pointer;
}

.slider__dot span {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: width 0.4s ease, background 0.3s ease;
}

@media (hover: hover) {
  .slider__dot:hover span {
    background: rgba(255, 255, 255, 0.6);
  }
}

/* Active dot stretches into a pill that fills up while the photo plays */
.slider__dot.is-active span {
  width: 40px;
  background: rgba(255, 255, 255, 0.35);
}

.slider__dot span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: left;
}

.slider__dot.is-active span::after {
  transform: scaleX(var(--progress, 0));
}

/* Round arrow buttons on both sides of the dots */
.slider__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-white);
  cursor: pointer;
  transition: background 0.3s ease;
}

@media (hover: hover) {
  .slider__arrow:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

.slider__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Phones: a compact row, a bit smaller than on desktop */
@media (max-width: 600px) {
  .slider__controls {
    gap: 0.5rem;
  }

  .slider__dots {
    height: 38px;
    padding: 0 0.45rem;
  }

  .slider__dot {
    height: 38px;
    padding: 0 4px;
  }

  .slider__dot span {
    width: 7px;
    height: 7px;
  }

  .slider__dot.is-active span {
    width: 28px;
  }

  .slider__arrow {
    width: 38px;
    height: 38px;
  }

  .slider__arrow svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 900px) {
  .intro__points {
    grid-template-columns: 1fr;
  }

  /* Phones: heading and text first, then the photos, then the list and
     the button. The text box dissolves so its parts can be reordered. */
  .intro__content {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  .intro__text {
    display: contents;
  }

  .slider {
    order: 1;
    margin: 1rem 0;
  }

  .intro__points {
    order: 2;
  }

  .intro__more {
    order: 3;
    align-self: flex-start;
  }
}

/* Phones: no list, the slider already names each system */
@media (max-width: 600px) {
  .intro__points {
    display: none;
  }

  .intro__more {
    margin-top: 1.5rem;
  }
}

/* ============================================
   BMS — screenshots under the graph and the link to Building
   ============================================ */
.screens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.screens__item {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
}

.screens__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.index-bms__more {
  align-self: flex-start;
}

@media (max-width: 900px) {
  .screens {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PROCESS — four steps on a line. The orange part of the line grows
   as a light runs along it and lights the dots it reaches (script_index.js
   sets --progress). Vertical on phones.
   ============================================ */
.steps__list {
  --progress: 0;
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}

/* grey track + orange fill, level with the dots */
.steps__list::before,
.steps__list::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 1px;
  background: var(--line-strong);
}

.steps__list::after {
  background: var(--color-active);
  transform: scaleX(var(--progress));
  transform-origin: left;
}

.steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 2.5rem;
}

.steps__dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--color-black);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.steps__item.is-on .steps__dot {
  background: var(--color-active);
  border-color: var(--color-active);
  box-shadow: 0 0 14px rgba(255, 64, 0, 0.6);
}

.steps__item .card-num {
  transition: color 0.3s ease;
}

.steps__item.is-on .card-num {
  color: var(--color-active);
  opacity: 1;
}

@media (max-width: 900px) {
  .steps__list {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-left: 2.5rem;
  }

  .steps__list::before,
  .steps__list::after {
    left: 6px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
  }

  .steps__list::after {
    transform: scaleY(var(--progress));
    transform-origin: top;
  }

  .steps__item {
    padding-top: 0;
  }

  .steps__dot {
    left: calc(-2.5rem);
  }
}

/* ============================================
   CONTROL STRIP — under the Smart Home intro: the apps and assistants
   in one row across the whole section, dimmed until hover
   ============================================ */
.control-strip {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.control-strip__list {
  list-style: none;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.control-strip__list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

/* App icons: the logo files are square icons with a dark background */
.control-strip__list img {
  width: 36px;
  height: 36px;
  border-radius: 22%;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .control-strip__list li:hover {
    color: var(--color-white);
  }

  .control-strip__list li:hover img {
    opacity: 1;
  }
}

/* Phones: two columns of three */
@media (max-width: 600px) {
  .control-strip__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1rem;
  }

  .control-strip__list li {
    font-size: 0.9rem;
  }
}

/* ============================================
   ZOOM SCENE — pinned for a few screens of scroll. The SVG is drawn by
   script_index.js; the scroll moves the camera (a transform on the world
   group) and fades the captions in and out. Same look as the BMS graph.
   ============================================ */
.zoom {
  position: relative;
  background: var(--color-black);
}

.zoom__stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.zoom__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Soft fading edges, like the graph on Building */
.zoom__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, var(--color-black), transparent 6%, transparent 94%, var(--color-black)),
    linear-gradient(to bottom, var(--color-black) 0%, transparent 12%, transparent 90%, var(--color-black));
  pointer-events: none;
}

/* Three captions in one place; the script fades them one into another */
.zoom__captions {
  position: absolute;
  z-index: 1;
  top: calc(var(--header-h) + 2.5rem);
  left: 0;
  right: 0;
  display: grid;
  padding: 0 1.5rem;
  pointer-events: none;
}

.zoom__caption {
  grid-area: 1 / 1;
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  opacity: 0;
}

.zoom__caption span {
  display: block;
}

.zoom__muted {
  color: rgba(255, 255, 255, 0.45);
}

/* --- Scene --- */
.zoom__svg .edge {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

/* data running along the lines */
.zoom__svg .edge--flow {
  stroke-dasharray: 2 6;
  animation: zoom-flow 1.4s linear infinite;
}

.zoom__svg .edge--main {
  stroke: rgba(255, 64, 0, 0.7);
}

@keyframes zoom-flow {
  to {
    stroke-dashoffset: -8;
  }
}

.zoom__svg .node {
  fill: #0b0b0d;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
}

.zoom__svg .icon {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom__svg .label {
  fill: rgba(255, 255, 255, 0.55);
  font-size: 5.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
}

.zoom__svg .hub {
  fill: #0b0b0d;
  stroke: rgba(255, 64, 0, 0.85);
  stroke-width: 1.2;
}

.zoom__svg .hub-title {
  fill: var(--color-white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-anchor: middle;
  dominant-baseline: central;
}

.zoom__svg .hub-title--main {
  font-size: 28px;
}

@media (prefers-reduced-motion: reduce) {
  .zoom__svg .edge--flow {
    animation: none;
  }
}

/* "Keep scrolling" under the scene, with a gently bobbing arrow */
.zoom__hint {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.zoom__hint svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: zoom-hint 1.6s ease-in-out infinite;
}

@keyframes zoom-hint {
  50% {
    transform: translateY(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zoom__hint svg {
    animation: none;
  }
}

/* ============================================
   WHO WE WORK WITH — the names in one row, thin lines between them
   ============================================ */
.audience__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audience__list li {
  padding: 2.5rem 1rem;
  text-align: center;
}

.audience__list li + li {
  border-left: 1px solid var(--line);
}

/* Phones: two by two */
@media (max-width: 768px) {
  .audience__list {
    grid-template-columns: 1fr 1fr;
  }

  .audience__list li {
    padding: 1.75rem 0.5rem;
  }

  .audience__list li:nth-child(3) {
    border-left: 0;
  }

  .audience__list li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* --- Process: the running light, the dot pop and the glow --- */

/* Bright head of the line, where the fill ends */
.steps__spark {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: calc(var(--progress) * 100%);
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 10px 3px rgba(255, 64, 0, 0.9),
    0 0 30px 8px rgba(255, 64, 0, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.steps__list:not(.is-done) .steps__spark {
  opacity: calc(var(--progress) * 1000); /* hidden until it starts */
}

/* Dot pops when the light reaches it, then settles a bit larger */
.steps__item.is-on .steps__dot {
  animation: steps-pop 0.6s ease-out;
  transform: scale(1.2);
}

@keyframes steps-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.9);
  }
  100% {
    transform: scale(1.2);
  }
}

/* Soft orange light behind the step that is reached */
.steps__item::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -114px; /* a 240 px circle centred on the dot */
  left: -114px;
  width: 240px;
  height: 240px;
  background: radial-gradient(closest-side, rgba(255, 64, 0, 0.22), transparent);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.steps__item.is-on::before {
  opacity: 1;
}

.steps__list {
  isolation: isolate; /* keeps the glow behind the text */
}

@media (max-width: 900px) {
  .steps__spark {
    top: calc(var(--progress) * 100%);
    left: 6px;
    margin: -5px 0 0 -4.5px;
  }

  .steps__item::before {
    left: calc(-2.5rem - 114px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .steps__item.is-on .steps__dot {
    animation: none;
  }
}

/* ============================================
   TRUST LOGO — above the numbers. Revealed from left to right, then a
   soft orange light passes over the letters every 4 s (the logo file is
   used as a mask for the light). script_index.js adds .is-shown.
   ============================================ */
.trust__brand {
  display: flex;
  justify-content: center;
  margin-top: 4rem; /* more room after the process steps */
}

.trust__brand-inner {
  position: relative;
  display: block;
  height: clamp(40px, 6vw, 72px);
  aspect-ratio: 576.8 / 77; /* the logo's own proportions */
}

.trust__brand img {
  display: block;
  width: 100%;
  height: 100%;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s cubic-bezier(0.6, 0, 0.2, 1);
}

.trust__brand.is-shown img {
  clip-path: inset(0 0 0 0);
}

.trust__shine {
  position: absolute;
  inset: 0;
  -webkit-mask: url(img/logos/logo_bgsolutions.svg) center / 100% 100% no-repeat;
  mask: url(img/logos/logo_bgsolutions.svg) center / 100% 100% no-repeat;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 120, 60, 1) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 110% 0;
  pointer-events: none;
}

.trust__brand.is-shown .trust__shine {
  /* every 4 s: the light crosses in the first ~40 %, then rests */
  animation: trust-shine 4s ease-in-out 0.9s infinite; /* right behind the reveal */
}

@keyframes trust-shine {
  0% {
    background-position: 110% 0;
  }
  40%,
  100% {
    background-position: -10% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trust__brand img {
    clip-path: none;
    transition: none;
  }

  .trust__brand.is-shown .trust__shine {
    animation: none;
  }
}

/* Larger button for the two "Explore" links that lead to Smart Home and BMS */
.btn--large {
  padding: 1.25rem 2.75rem;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .btn--large {
    padding: 1.15rem 2.25rem;
  }
}

/* --- Process: after the run, everything fades back to the quiet look --- */
.steps__list::after {
  transition: opacity 1.4s ease;
}

.steps__list.is-faded::after {
  opacity: 0;
}

/* slower transitions for the fade than for lighting up */
.steps__list.is-faded .steps__dot {
  transition:
    background 1.4s ease,
    border-color 1.4s ease,
    box-shadow 1.4s ease,
    transform 1.4s ease;
}

.steps__list.is-faded .card-num {
  transition: color 1.4s ease;
}

.steps__list.is-faded .steps__item::before {
  transition: opacity 1.4s ease;
}
