/**
 * Index page – full responsive (Beacons / shahidanwarllc.com parity)
 * 320px phones → 4K desktop | portrait + landscape
 */

/* ─── Base page shell ─── */
body.index-page {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

body.index-page {
  --content-max: 600px; /* MuiContainer maxWidthSm */
  --page-gutter: 20px; /* reference horizontal padding */
  --stack-width: 100%;
  /* Beacons link spacing */
  --link-gap: 0.5rem;
  --link-radius: 9999px;
  --link-icon: 2.5rem;
  --link-icon-gap: 0.5rem;
  --link-side-pad: 0.75rem;
  --link-pad-left: calc(var(--link-side-pad) + var(--link-icon) + var(--link-icon-gap));
  --link-hover-scale: 1.02;
  --link-anim-duration: 0.25s;
  --link-anim-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --avatar-size: 6rem;
  --index-bottom-space: calc(6.5rem + var(--safe-bottom));
}

body.index-page .container {
  width: 100%;
  max-width: var(--content-max) !important;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--index-bottom-space);
  overflow-x: hidden;
}

body.index-page .background,
body.index-page .background-img {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── Centered column (profile + links + cards + video) ─── */
body.index-page .profile,
body.index-page .links {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
  box-sizing: border-box;
}

body.index-page .profile {
  margin-top: calc(var(--topbar-h) + var(--safe-top) + clamp(2.25rem, 8vw, 3.25rem));
}

body.index-page .profile-pic {
  width: var(--avatar-size);
  height: var(--avatar-size);
  margin-bottom: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.index-page .profile-name-card {
  margin-bottom: 0.875rem;
  max-width: 100%;
  border-radius: var(--link-radius);
  background: var(--brand);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.index-page .profile-name {
  font-size: var(--text-size-main);
  font-weight: normal;
  color: var(--text-main);
}

body.index-page .subscribe-notice {
  width: 100%;
  max-width: 100%;
  border-radius: var(--link-radius);
  color: var(--text-main);
  font-size: var(--text-size-sub);
}

body.index-page .official-topbar {
  width: 100%;
  margin-top: 0.625rem;
  border-radius: var(--link-radius);
  background: var(--brand);
}

body.index-page .profile-name-card .verified-icon {
  width: var(--verified-size);
  height: var(--verified-size);
}

body.index-page .official-topbar p {
  font-size: var(--text-size-main);
  line-height: 1.45;
  color: var(--text-main);
}

body.index-page .official-topbar p strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Subscribe + Share – Beacons match (index) */
body.index-page .profile-buttons .subscribe-btn,
body.index-page .profile-buttons .share-btn {
  height: var(--top-btn-h);
  min-height: var(--top-btn-h);
  max-height: var(--top-btn-h);
  background: var(--top-btn-bg);
  color: var(--top-btn-fg);
}

body.index-page .profile-buttons .subscribe-btn {
  padding-top: 0;
  padding-bottom: 0;
}

body.index-page .profile-buttons .subscribe-btn .btn-label,
body.index-page .profile-buttons .subscribe-btn .btn-icon-wrap i {
  color: var(--top-btn-fg);
}

body.index-page .profile-buttons .share-btn {
  width: var(--top-btn-h);
  min-width: var(--top-btn-h);
  max-width: var(--top-btn-h);
  background: var(--top-btn-bg);
}

body.index-page .profile-buttons .share-btn .share-icon-svg {
  color: var(--top-btn-fg);
}

/* ─── Top bar – align with column on tablet+ ─── */
@media (min-width: 48rem) {
  body.index-page .profile-buttons {
    left: 50%;
    right: auto;
    width: min(var(--content-max), calc(100% - var(--page-gutter) * 2));
    max-width: var(--content-max);
    transform: translateX(-50%);
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
    box-sizing: border-box;
  }

  body.index-page .profile-pic {
    --avatar-size: 6.5rem;
  }
}

/* ─── Pill links ─── */
body.index-page .links {
  margin-top: 1rem;
  padding-bottom: clamp(1.5rem, 5vw, 2.5rem);
}

body.index-page .links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  margin: 0 0 var(--link-gap);
  padding: 0 var(--link-side-pad) 0 var(--link-pad-left);
  border-radius: var(--link-radius);
  border: none;
  background: var(--brand);
  color: var(--text-main);
  text-align: center;
  text-decoration: none;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  -webkit-tap-highlight-color: transparent;
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.index-page .links {
  overflow: visible;
}

body.index-page .links a .link-text span,
body.index-page .links a .link-text small {
  transition: none;
  transform: none;
}

body.index-page .links a > img,
body.index-page .links a .link-text > img {
  position: absolute;
  left: var(--link-side-pad);
  top: 50%;
  transform: translateY(-50%);
  width: var(--link-icon);
  height: var(--link-icon);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

body.index-page .links a .link-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  width: 100%;
  text-align: center;
}

body.index-page .links a .link-text span {
  display: block;
  width: 100%;
  font-size: var(--text-size-main);
  font-weight: normal;
  line-height: 1.32;
  color: var(--text-main);
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.index-page .links a .link-text small {
  display: block;
  width: 100%;
  margin-top: 0.125rem;
  font-size: var(--text-size-sub);
  line-height: 1.3;
  color: var(--text-sub);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Hover animation → index-link-animation.css (Beacons parity) */

/* ─── Cards (Ask Me / 1:1) – shahidanwarllc.com MuiCard ─── */
body.index-page {
  --card-bg: #504c4f;
  --card-text: #bbbebf;
  --card-btn-bg: #bbbebf;
  --card-btn-text: #141e2d;
}

body.index-page .cards-container {
  width: 100%;
  max-width: 100%;
  margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
  gap: clamp(0.75rem, 3vw, 1.25rem);
  padding-inline: 0;
}

body.index-page .card,
body.index-page .card.card-beacons {
  width: 100%;
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 36px;
  padding: 24px 24px 36px;
  overflow: visible;
  box-shadow: none !important;
}

@media (hover: hover) {
  body.index-page .cards-container .card.card-beacons:hover {
    box-shadow: none !important;
  }
}

body.index-page .card h3 {
  font-size: clamp(1rem, 4vw, 1.25rem);
  color: var(--card-text);
}

body.index-page .card p,
body.index-page .info-row {
  font-size: clamp(0.8125rem, 2.8vw, 1rem);
  color: var(--card-text);
}

body.index-page .card .info-row .icon-text i,
body.index-page .card .info-row i {
  color: var(--card-text);
}

body.index-page .action-btn {
  width: min(100%, 20rem);
  font-size: clamp(0.875rem, 3vw, 1rem);
  font-weight: 600;
  border-radius: 36px;
  background: var(--card-btn-bg);
  color: var(--card-btn-text);
  transition: var(--beacons-transition) !important;
}

/* ─── Video player ─── */
body.index-page .art-player-wrap--home {
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
  margin-bottom: clamp(1.5rem, 5vw, 3rem);
  border: none;
  box-shadow: none;
  border-radius: clamp(0.75rem, 3vw, 1rem);
  padding-inline: 0;
}

/* 320px–425px – full page scroll (cookie + contact + video clearance) */
@media (max-width: 26.5625rem) {
  html {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    scroll-padding-bottom: calc(6.5rem + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
  }

  body.index-page {
    --index-bottom-space: calc(15rem + var(--safe-bottom));
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  body.index-page .container {
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    padding-bottom: var(--index-bottom-space) !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: pan-y;
  }

  body.index-page .profile,
  body.index-page .links,
  body.index-page .cards-container,
  body.index-page .art-player-wrap--home {
    touch-action: pan-y;
  }

  body.index-page .art-player-wrap--home {
    z-index: 12 !important;
    overflow: hidden !important;
    margin-bottom: clamp(3rem, 14vw, 5rem) !important;
    isolation: isolate;
  }

  /* Menus stay inside player – page scroll not blocked by tall overlays */
  body.index-page .art-player-wrap--home .shahid-quality-panel,
  body.index-page .art-player-wrap--home .shahid-settings-panel,
  body.index-page .art-player-wrap--home .art-setting-panel.shahid-settings-subpanel {
    max-height: min(200px, calc(56.25cqi - var(--art-bottom-height, 48px) - 12px)) !important;
  }

  body.index-page .contact-float-btn {
    top: auto !important;
    bottom: calc(5.25rem + var(--safe-bottom)) !important;
    transform: none !important;
  }

  body.index-page .contact-float-btn:hover,
  body.index-page .contact-float-btn:active {
    transform: scale(1.03) !important;
  }

  body.index-page .cookie-bar {
    z-index: 1000;
  }
}

/* ─── Cookie bar – Beacons / shahidanwarllc.com (bottom-left snackbar) ─── */
body.index-page .cookie-bar {
  position: fixed;
  left: 8px !important;
  right: auto !important;
  transform: none !important;
  width: calc(100% - 16px) !important;
  max-width: none !important;
  bottom: calc(8px + var(--safe-bottom)) !important;
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 12px;
  background: #504c4f;
  color: #bbbebf;
  border: none;
  border-radius: 36px;
  box-shadow: none;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
}

body.index-page .cookie-bar p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #bbbebf;
  text-align: left;
  font-family: Helvetica, Arial, sans-serif;
}

body.index-page .cookie-bar a {
  color: #bbbebf;
  text-decoration: underline;
  font-weight: 500;
}

body.index-page .cookie-bar a:hover {
  color: #d1d1d1;
}

body.index-page .cookie-buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  flex-shrink: 0;
}

body.index-page .cookie-buttons button,
body.index-page .cookie-buttons #reject-btn,
body.index-page .cookie-buttons #accept-btn {
  padding: 4px 5px;
  min-height: 31px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  border: none !important;
  border-radius: 36px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  background: #141e2d !important;
  color: #bbbebf !important;
  box-shadow: none !important;
}

body.index-page .cookie-buttons button:hover,
body.index-page .cookie-buttons #reject-btn:hover,
body.index-page .cookie-buttons #accept-btn:hover {
  background: #1c2a42 !important;
  opacity: 0.95;
}

@media (min-width: 48rem) {
  body.index-page .cookie-bar {
    left: 24px !important;
    width: calc(100% - 24px) !important;
    max-width: 988px !important;
    bottom: calc(24px + var(--safe-bottom)) !important;
    flex-direction: row;
    align-items: center;
  }

  body.index-page .cookie-buttons {
    margin-left: 8px;
  }
}

@media (max-width: 47.9375rem) {
  body.index-page .cookie-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  body.index-page .cookie-bar p {
    text-align: left;
  }

  body.index-page .cookie-buttons {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
    justify-content: flex-end;
  }
}

/* ─── Toast ─── */
body.index-page .toast {
  bottom: calc(var(--index-bottom-space) + 0.5rem);
  max-width: min(calc(100vw - 2rem), var(--content-max));
}

/* ─── Share popup ─── */
body.index-page .share-popup-overlay {
  padding: max(1rem, var(--safe-top)) max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom)) max(1rem, var(--safe-left));
}

body.index-page .share-popup {
  width: min(100%, 22rem);
  max-height: min(90vh, 32rem);
  overflow-y: auto;
}

/* ─── Ask Me / 1:1 popups ─── */
body.index-page #popup1.popup-box,
body.index-page #popup2.popup-box {
  width: min(calc(100vw - 1.5rem), 26.25rem);
  max-height: min(92dvh, 40rem);
}

/* ─── Product popup ─── */
body.index-page #productPopup.popup-overlay {
  padding: var(--page-gutter);
  align-items: center;
  justify-content: center;
}

body.index-page #productPopup .popup-box {
  width: min(100%, 52rem);
  max-height: min(92dvh, 36rem);
  border-radius: clamp(0.75rem, 3vw, 1rem);
}

/* ─── Contact button ─── */
body.index-page .contact-float-btn {
  z-index: 9000;
  max-width: calc(100vw - var(--page-gutter) * 2);
  border-radius: var(--link-radius);
}

/* ═══════════════════════════════════════════
   BREAKPOINTS – all devices
   ═══════════════════════════════════════════ */

/* Extra small phones (≤320px) */
@media (max-width: 20rem) {
  body.index-page {
    --page-gutter: 20px;
    --link-icon: 2.375rem;
    --link-side-pad: 0.625rem;
    --link-pad-y-icon: 0.6875rem;
    --link-pad-y-text: 0.875rem;
    --avatar-size: 5rem;
    --index-bottom-space: calc(11.5rem + var(--safe-bottom));
  }

  body.index-page .profile-buttons .subscribe-btn .btn-label {
    display: none;
  }

  body.index-page .profile-buttons .subscribe-btn {
    width: var(--top-btn-h);
    min-width: var(--top-btn-h);
    max-width: var(--top-btn-h);
    padding: 0;
  }

  body.index-page .contact-float-btn span {
    display: none;
  }

  body.index-page .contact-float-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

/* Small phones (321px – 479px) */
@media (min-width: 20.0625rem) and (max-width: 29.9375rem) {
  body.index-page {
    --page-gutter: 20px;
    --link-icon: 2.5rem;
    --link-side-pad: 0.75rem;
    --index-bottom-space: calc(11.5rem + var(--safe-bottom));
  }

  body.index-page .profile-buttons .subscribe-btn .btn-label {
    max-width: 5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.index-page .contact-float-btn {
    right: max(0.5rem, var(--safe-right));
    bottom: calc(4.75rem + var(--safe-bottom));
    top: auto;
    transform: none;
    font-size: 0.6875rem;
    padding: 0.4375rem 0.625rem;
  }

  body.index-page .contact-float-btn:hover,
  body.index-page .contact-float-btn:active {
    transform: scale(1.03);
  }
}

/* Large phones (480px – 767px) */
@media (min-width: 30rem) and (max-width: 47.9375rem) {
  body.index-page .contact-float-btn {
    right: max(0.5rem, var(--safe-right));
    bottom: calc(var(--index-bottom-space) - 0.25rem);
    top: auto;
  }
}

/* Tablets (768px – 1023px) */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
  body.index-page {
    --page-gutter: 20px;
    --content-max: 600px;
  }

  body.index-page .cookie-buttons {
    margin-left: 8px;
    flex-wrap: nowrap;
  }

  body.index-page .contact-float-btn {
    right: max(0.75rem, var(--safe-right));
    bottom: calc(5rem + var(--safe-bottom));
    top: auto;
    transform: none;
  }
}

/* Laptops (1024px – 1439px) */
@media (min-width: 64rem) and (max-width: 89.9375rem) {
  body.index-page {
    --content-max: 600px;
    --page-gutter: 20px;
  }
}

/* Large desktop (1440px+) */
@media (min-width: 90rem) {
  body.index-page {
    --content-max: 600px;
  }

  body.index-page .profile,
  body.index-page .links {
    max-width: none;
  }
}

/* Landscape phones / short viewports */
@media (max-height: 32rem) and (orientation: landscape) {
  body.index-page .profile {
    margin-top: calc(var(--topbar-h) + var(--safe-top) + 1rem);
  }

  body.index-page .profile-pic {
    --avatar-size: 4.5rem;
    margin-bottom: 0.5rem;
  }

  body.index-page .official-topbar {
    padding: 0.5rem 0.75rem;
  }

  body.index-page .art-player-wrap--home {
    margin-bottom: 1rem;
  }

  body.index-page .container {
    padding-bottom: calc(5rem + var(--safe-bottom));
  }
}

/* Very wide screens – column stays narrow (Beacons) */
@media (min-width: 120rem) {
  body.index-page .background-img {
    object-position: center center;
  }
}

/* Touch targets (accessibility) */
@media (pointer: coarse) {
  body.index-page .profile-buttons .subscribe-btn,
  body.index-page .profile-buttons .share-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.index-page .links a,
  body.index-page .links a .link-text,
  body.index-page .links a > img {
    transition: none;
  }

  body.index-page .card,
  body.index-page .contact-float-btn {
    transition: none;
  }
}
