/* Shared QHome behaviour and accessibility layer. Page-specific visual systems remain in each source page. */
:root {
  --qhome-focus: #007f9d;
  --qhome-shadow: 0 12px 30px rgba(16, 71, 90, 0.14);
}

html { scroll-behavior: smooth; }

html.qhome-js body {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

html.qhome-js.qhome-ready body {
  opacity: 1;
  transform: none;
}

html.qhome-leaving body {
  opacity: 0;
  transform: translateY(-4px);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(0, 137, 168, 0.45);
  outline-offset: 3px;
}

.qhome-scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 10000;
  width: var(--qhome-scroll-progress, 0%);
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, #00a7bf, #16b769);
  box-shadow: 0 1px 8px rgba(0, 137, 168, 0.35);
  transition: width 80ms linear;
}

.main-nav a.qhome-current,
.mobile-nav a.qhome-current {
  color: var(--teal, #0089a8) !important;
  font-weight: 800;
}

.main-nav a.qhome-current::after {
  content: "";
  position: absolute;
  right: 14%;
  bottom: -8px;
  left: 14%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.qhome-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #0096b3, #00758f);
  box-shadow: var(--qhome-shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.qhome-back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.qhome-back-to-top:hover { box-shadow: 0 16px 34px rgba(16, 71, 90, 0.24); }

.qhome-global-toast {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 1001;
  max-width: min(340px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  background: #17384f;
  box-shadow: var(--qhome-shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.qhome-global-toast.is-visible {
  opacity: 1;
  transform: none;
}

html.qhome-motion-enabled .qhome-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 440ms ease-out, transform 440ms cubic-bezier(.2,.7,.2,1);
}

html.qhome-motion-enabled .qhome-reveal.is-inview {
  opacity: 1;
  transform: none;
}

.faq-item.qhome-filter-hidden { display: none !important; }

.faq-question[aria-expanded="true"] {
  color: var(--teal, #0089a8);
}

.faq-answer[hidden] { display: none !important; }

.app-dialog .qhome-dialog-copy {
  margin: 0;
  color: var(--muted, #687b89);
  line-height: 1.7;
}

.app-dialog .qhome-dialog-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--teal, #0089a8);
  font-weight: 800;
}

@media (hover: hover) and (pointer: fine) {
  .service-plan-card,
  .segment-card,
  .case-card,
  .device-card,
  .faq-item,
  .ecosystem-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .service-plan-card:hover,
  .segment-card:hover,
  .case-card:hover,
  .device-card:hover,
  .faq-item:hover,
  .ecosystem-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--qhome-shadow);
  }
}

@media (max-width: 720px) {
  .qhome-back-to-top { width: 42px; height: 42px; }
  .main-nav a.qhome-current::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  html.qhome-js body { opacity: 1; transform: none; }
  html.qhome-motion-enabled .qhome-reveal { opacity: 1; transform: none; }
}

/* Home hero calibration: keep the first viewport informative without letting
   the visual dominate the page, especially on narrow screens. */
main > .hero {
  height: clamp(318px, 27vw, 332px);
}

main > .hero .hero-media {
  width: min(59%, 720px);
  background-image: url("hero-visual.jpg");
}

main > .hero .hero-copy {
  width: 435px;
  padding-top: 24px;
}

main > .hero h1 { font-size: 46px; }
main > .hero .hero-points { margin-top: 18px; }

@media (max-width: 820px) {
  main > .hero {
    height: auto;
    min-height: 0;
  }

  main > .hero .hero-media {
    width: 100%;
    height: 260px;
  }

  main > .hero .hero-inner { padding-top: 260px; }
  main > .hero .hero-copy {
    width: 100%;
    padding: 16px 0 22px;
  }

  main > .hero .hero-points {
    width: 100%;
    margin-top: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  main > .hero .point-card {
    min-height: 58px;
    min-width: 0;
    padding: 8px;
  }
}

@media (max-width: 560px) {
  main > .hero .hero-media { height: 220px; }
  main > .hero .hero-inner { padding-top: 220px; }
  main > .hero h1 { font-size: clamp(34px, 9vw, 38px); }

  main > .hero .hero-copy > p {
    margin: 9px 0 14px;
    font-size: 12px;
    line-height: 1.6;
  }

  main > .hero .hero-actions { gap: 9px; }
  main > .hero .btn { height: 44px; }

  main > .hero .hero-points {
    margin-top: 14px;
    gap: 6px;
  }

  main > .hero .point-card {
    min-height: 66px;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 6px;
  }

  main > .hero .point-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    border-radius: 6px;
  }

  main > .hero .point-card img {
    width: 20px;
    height: 20px;
  }

  main > .hero .point-card strong {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }

  main > .hero .point-card small { display: none; }
}

.qhome-member-data-note {
  width: min(1120px, calc(100% - 40px));
  margin: 20px auto -4px;
  padding: 10px 14px;
  border: 1px solid #b9d8ee;
  border-radius: 10px;
  background: #eef8ff;
  color: #245370;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .qhome-member-data-note {
    width: calc(100% - 28px);
    margin-top: 14px;
    padding: 9px 12px;
    font-size: 12px;
  }
}
