/* ============================================
   HERO
   ============================================ */
.home-hero {
  position: relative;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.home-hero__overlay {
  position: absolute;
  inset: 0;
  background-image:
    /* darker centre so the headline reads over the photo */
    radial-gradient(
      ellipse 60% 50% at 50% 50%,
      rgba(0, 0, 0, 0.55) 0%,
      transparent 100%
    ),
    /* header strip on top, fade into the page at the bottom */
    linear-gradient(
        0deg,
        var(--color-black) 0%,
        transparent 35%,
        transparent 80%,
        rgba(0, 0, 0, 0.6) 100%
      );
  z-index: 1;
}

.home-hero__bg {
  position: absolute;
  inset: 0;
  filter: brightness(0.7);
  animation: hero-zoom 30s ease-in-out infinite alternate;
}

.home-hero__bg picture {
  display: contents;
}

.home-hero__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Slow "Ken Burns" drift — keeps the photo alive */
@keyframes hero-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

/* Hidden until the intro timeline in script_home.js takes over
   (class is set in <head> and removed when the intro ends) */
.hero-intro header,
.hero-intro .home-hero__bg,
.hero-intro .home-hero__content h1,
.hero-intro .home-hero__sub,
.hero-intro .home-hero__actions > * {
  opacity: 0;
}

.home-hero__content {
  position: relative;
  max-width: 1040px;
  padding: 2rem;
  z-index: 10;
}

.home-hero h1 {
  font-size: 4rem;
  font-weight: 600;
  text-wrap: balance;
}

/* "Solutions" on its own line under "Professional Smart Home" */
.home-hero__brand {
  display: block;
  width: fit-content; /* gradient spans only the word, not the whole line */
  margin-inline: auto;
}

.home-hero__sub {
  font-size: 1.15rem;
  font-weight: 300;
  opacity: 0.85;
}

.home-hero__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* Pinned to the bottom of the hero, away from the headline cluster */
.home-hero__trust {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3rem;
  z-index: 10;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.75;
}

.home-hero__trust strong {
  font-weight: 700;
}

.home-hero__trust li + li::before {
  content: "•";
  margin-right: 1.5rem;
  opacity: 0.5;
}

/* ============================================
   OFFER
   ============================================ */
.offer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 3rem;
}

.offer-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 76px;
  padding: 0 0.25rem;
  color: var(--color-white);
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* last row closes the grid with a bottom line */
.offer-item:nth-last-child(-n + 3) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover fill from left */
.offer-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 64, 0, 0.1),
    rgba(255, 255, 255, 0.02) 70%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.offer-item::after {
  content: "→";
  position: absolute;
  right: 0.5rem;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.offer-item__num {
  position: relative;
  width: 1.4rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.35;
}

.offer-item__icon {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
  transition:
    opacity 0.3s ease,
    color 0.3s ease;
}

/* Typography from .row-title (styles_common.css) */
.offer-item__title {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlighted row: fill from the left, orange icon, title nudge, arrow.
   Mouse: on hover. Touch screens: the row at the scroll line gets
   .is-active (scroll highlight in script_common.js), so a tap does not
   leave a second row lit. */
@media (hover: hover) {
  .offer-item:hover::before {
    transform: scaleX(1);
  }

  .offer-item:hover::after {
    opacity: 0.7;
    transform: translateX(0);
  }

  .offer-item:hover .offer-item__icon {
    opacity: 1;
    color: var(--color-neon-orange);
  }

  .offer-item:hover .offer-item__title {
    transform: translateX(6px);
  }
}

.offer-item.is-active::before {
  transform: scaleX(1);
}

.offer-item.is-active::after {
  opacity: 0.7;
  transform: translateX(0);
}

.offer-item.is-active .offer-item__icon {
  opacity: 1;
  color: var(--color-neon-orange);
}

.offer-item.is-active .offer-item__title {
  transform: translateX(6px);
}

/* ============================================
   APP SHOWCASE — CSS phone mockups
   ============================================ */
.showcase {
  align-items: center;
  overflow: hidden;
  /* soft glow behind the phones */
  background:
    radial-gradient(
      ellipse 50% 45% at 50% 55%,
      rgba(110, 160, 255, 0.12),
      transparent 70%
    ),
    var(--color-black);
}

.showcase__phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.showcase__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
}

/* Side phones sit lower and a little smaller — gives depth */
.showcase__item--side {
  margin-top: 4rem;
}

.showcase__item--side .phone {
  --phone-w: clamp(130px, 14.5vw, 215px);
}

/* Phone body: thin dark bezel with a metal-like edge */
.phone {
  --phone-w: clamp(150px, 17vw, 250px);
  width: var(--phone-w);
  aspect-ratio: 9 / 19.5;
  padding: calc(var(--phone-w) * 0.035);
  border-radius: calc(var(--phone-w) * 0.16);
  background: #0b0b0d;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.18),
    inset 0 0 0 4px #1c1c20,
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(110, 160, 255, 0.08);
}

.phone__screen {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--phone-w) * 0.13);
  overflow: hidden;
  background: #000;
}

.phone__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Phones: the clamp() minimums (150 + 2×130 px) are wider than a phone
   screen, so size all three from the viewport width instead */
@media (max-width: 600px) {
  .showcase {
    padding-inline: 1rem;
  }

  .showcase__phones {
    gap: 2.5vw;
  }

  .showcase__item {
    gap: 1rem;
  }

  .showcase__item--side {
    margin-top: 2.5rem;
  }

  .phone {
    --phone-w: 32vw;
  }

  .showcase__item--side .phone {
    --phone-w: 25vw;
  }

  .showcase__item figcaption {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-align: center;
  }
}

/* ============================================
   CONTROL INTERFACES
   ============================================ */
.control-interfaces__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.control-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  cursor: default;
  /* Hover lift uses `translate`, not `transform`: GSAP animates `transform`
     on entrance, and a CSS transition on the same property makes the cards
     get stuck at different heights (e.g. after reloading mid-page). */
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    translate 0.3s ease;
}

.control-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.control-card--premium::before {
  background: radial-gradient(
    circle at 30% 0%,
    rgba(212, 175, 55, 0.12) 0%,
    transparent 70%
  );
}

.control-card--apple::before {
  background: radial-gradient(
    circle at 30% 0%,
    rgba(167, 139, 250, 0.12) 0%,
    transparent 70%
  );
}

.control-card--google::before {
  background: radial-gradient(
    circle at 30% 0%,
    rgba(66, 133, 244, 0.12) 0%,
    transparent 70%
  );
}

.control-card--opensource::before {
  background: radial-gradient(
    circle at 30% 0%,
    rgba(65, 203, 112, 0.12) 0%,
    transparent 70%
  );
}

/* Mouse: hover. Touch screens: the card at the scroll line gets .is-active
   (same look without the lift), so a tap does not leave a second card lit. */
@media (hover: hover) {
  .control-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-hover);
    translate: 0 -4px;
  }

  .control-card:hover::before {
    opacity: 1;
  }
}

.control-card.is-active {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.control-card.is-active::before {
  opacity: 1;
}

.control-card__badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
}

.control-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.7;
}

.control-card__logo-bg {
  fill: #000;
}

.control-card__logo-path {
  fill: #fff;
}

/* ============================================
   VOICE CONTROL
   ============================================ */

/* Paints above its neighbours so the orb can overlap them */
.voice-control {
  z-index: 2;
  min-height: 70vh;
  justify-content: center;
  overflow-x: clip; /* the orb is wider than a phone screen; up and down it may still overlap */
}

.voice-control__wave {
  position: absolute;
  inset: 0;
  opacity: 0.7;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

/* On narrow screens the 15:1 canvas is only ~25px tall — scale it up from
   the centre; the edges run off-screen and are clipped by the container */
@media (max-width: 900px) {
  .voice-control__wave {
    overflow: hidden;
  }

  .voice-control__wave canvas {
    transform: scale(1.8);
    transform-origin: 50% 0;
  }
}

/* Keep text clear of the orb */
.voice-control .section-header {
  max-width: min(880px, 55%);
}

.voice-control__assistants {
  position: relative;
  display: flex;
  flex-wrap: nowrap; /* all assistants in one row */
  gap: 1rem;
  z-index: 2;
}

.voice-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 60px; /* not clickable, so no hover look */
}

.voice-item__icon {
  flex-shrink: 0;
}

.voice-item__logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.voice-item__name {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.voice-item__via {
  font-size: 0.75rem;
  opacity: 0.4;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* --- HomePod with expanding air rings --- */
.voice-orb {
  --ring: 110, 160, 255; /* soft blue, matches hero glow */
  --ring-alt: 150, 130, 255; /* violet tint */
  position: absolute;
  top: 97%; /* sinks into the next section */
  right: 0;
  width: min(60vw, 1300px);
  aspect-ratio: 1;
  transform: translate(38%, -50%); /* part of the orb hides off-screen */
  pointer-events: none;
  z-index: 1;
}

.voice-orb__img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.8));
  z-index: 2;
}

/* Static glow under the speaker */
.voice-orb__halo {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--ring), 0.35) 0%,
    rgba(var(--ring-alt), 0.12) 45%,
    transparent 70%
  );
  filter: blur(20px);
  animation: voice-halo 4s ease-in-out infinite;
}

/* Rings start at the speaker edge and drift outwards */
.voice-orb__ring {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    transparent 58%,
    rgba(var(--ring), 0.28) 66%,
    rgba(var(--ring-alt), 0.18) 70%,
    transparent 74%
  );
  filter: blur(3px);
  opacity: 0;
  animation: voice-ring 6s cubic-bezier(0.25, 0.6, 0.4, 1) infinite;
}

.voice-orb__ring:nth-of-type(2) {
  animation-delay: -1.5s;
}
.voice-orb__ring:nth-of-type(3) {
  animation-delay: -3s;
}
.voice-orb__ring:nth-of-type(4) {
  animation-delay: -4.5s;
}

@keyframes voice-ring {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: scale(2.55);
    opacity: 0;
  }
}

@keyframes voice-halo {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.56);
  }
}

/* --- Floating island over the blocks: one icon per system ---
   A glass pill at the bottom; the block in view has its icon lit */
.block-nav {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 900;
  display: flex;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px) scale(0.96);
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s ease;
}

.block-nav.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.block-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.45);
  transition:
    color 0.3s ease,
    background 0.3s ease;
}

.block-nav a:hover {
  color: var(--color-white);
}

.block-nav a.is-active {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.12);
}

.block-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Wider screens only: on phones there is no room for nine icons */
@media (max-width: 600px) {
  .block-nav {
    display: none;
  }
}

.home-block {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.home-block__content {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 5rem var(--section-pad-x);
  gap: 5rem;
  z-index: 1;
}

.home-block__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Key points — short feature list in two columns */
.home-block__points {
  --point-row: 4.2rem; /* fits a title + two lines of text */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* 3 rows, filled column by column: the left column always gets
     3 points, the rest go to the right — same layout in every block */
  grid-template-rows: repeat(3, minmax(var(--point-row), auto));
  grid-auto-flow: column;
  gap: 1.1rem 2rem;
  list-style: none;
  margin: 0.5rem 0 0;
}

/* Point text and marker: .points; tags: .tags (styles_common.css) */
.home-block:hover .tags > * {
  opacity: 0.85;
  border-color: rgba(255, 255, 255, 0.3);
}

.home-block__image {
  flex: 1;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

/* <picture> only swaps the file on phones — keep the img as the box's child */
.home-block__image picture {
  display: contents;
}

/* Photo always fills the frame and is cropped from the centre —
   3:2 on desktop, 16:9 on phones (top and bottom trimmed evenly) */
.home-block__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: brightness(0.8);
  transition: filter 0.3s ease;
}

/* Soft black fade on all four edges — for photos on a dark background,
   so the frame melts into the page. Two gradients (sides + top/bottom)
   are intersected into one mask. */
.home-block__image--fade {
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-composite: intersect;
}

/* Hover brightening only for real mouse pointers */
@media (hover: hover) {
  .home-block:hover .home-block__image img {
    filter: brightness(0.9);
  }
}

/* Touch screens have no hover: a tap was "lighting up" the photo.
   Show photos at full brightness from the start instead. */
@media (hover: none) {
  .home-block__image img {
    filter: none;
  }
}

/* ============================================
   MOTION PREFERENCES
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .home-hero__bg,
  .voice-orb__ring,
  .voice-orb__halo {
    animation: none;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .offer__grid,
  .control-interfaces__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .offer-item:nth-last-child(3) {
    border-bottom: none;
  }
}

@media (max-width: 1100px) {
  .voice-control__assistants {
    flex-wrap: wrap;
  }
}

@media (max-width: 1024px) {
  .home-block__content {
    padding: 4rem;
    gap: 3rem;
  }
}

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

  .home-hero__trust {
    flex-direction: column;
    gap: 0.4rem;
  }

  .home-hero__trust li + li::before {
    display: none;
  }

  /* Offer */
  .offer__grid {
    grid-template-columns: 1fr;
  }

  .offer-item {
    height: 64px;
  }

  .offer-item:nth-last-child(2) {
    border-bottom: none;
  }

  .offer-item__title {
    font-size: 0.95rem;
  }

  /* Cards & grids */
  .control-interfaces__grid {
    grid-template-columns: 1fr;
  }

  /* Voice */
  .voice-control {
    min-height: 0;
    padding-bottom: 0;
  }

  .voice-control .section-header {
    max-width: 100%;
  }

  .voice-control__assistants {
    flex-direction: column;
  }

  .voice-orb {
    position: relative;
    top: auto;
    right: auto;
    order: 3; /* below the text on phones */
    width: 145vw;
    margin: -10vw -2rem -34vw auto;
    transform: translateX(8%);
  }

  /* Detail blocks on phones: label, title, photo, description, point titles
     (no point text), tags. The text column is unwrapped so the photo can sit
     right under the title; script_home.js animates the pieces, not the column. */
  .home-block {
    min-height: auto;
  }

  .home-block__content {
    flex-direction: column;
    align-items: stretch;
    padding: 3.5rem 2rem;
    gap: 1.25rem;
  }

  .home-block__text {
    display: contents;
  }

  .home-block__text .section-label {
    order: 1;
  }

  .home-block__text .section-title {
    order: 2;
  }

  .home-block__image {
    order: 3;
    flex: none;
    width: 100%;
    margin: 0.5rem 0;
    aspect-ratio: 16 / 9;
  }

  .home-block__text .section-sub {
    order: 4;
  }

  .home-block__tags {
    order: 6;
  }

  /* point titles only, in two columns */
  .home-block__points {
    order: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none; /* no reserved rows on phones */
    grid-auto-flow: row;
    gap: 0.6rem 1.2rem;
    margin: 0;
  }

  .home-block__points li {
    font-size: 0; /* hides the point text after the title */
  }

  .home-block__points li::before {
    top: 0.6rem;
  }

  .home-block__points strong {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
  }
}

/* Interface cards on phones: compact, logo in one row with the title,
   all cards as tall as the tallest one */
@media (max-width: 600px) {
  .control-interfaces__grid {
    gap: 1rem;
    grid-auto-rows: 1fr;
  }

  .control-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.75rem;
    padding: 2.6rem 1.4rem 1.5rem; /* room for the badge above the title */
  }

  .control-card__badge {
    top: 1.1rem;
    right: 1.4rem;
  }

  .control-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .control-card .card-text {
    grid-column: 1 / -1;
  }
}

