/* ==========================================================================
   HSI AbdullahRoy - Media Landing Page Design System
   Pure Vanilla CSS (Tokens, Mobile-First Layout, Desktop Parity, Glassmorphism)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Color Palette */
  --bg-black: #000000;
  --bg-navy: #00224F;
  --blue-glow: #004390;
  --red-glow: #D43636;
  --brand-orange: #FF9900;
  --brand-red: #FF2D55;
  --brand-yellow: #FFCC00;
  --text-white: #FFFFFF;
  --text-muted: #AEAEB2;
  
  /* Glassmorphism Surface Tokens */
  --surface-glass: rgba(0, 0, 0, 0.65);
  --surface-glass-hover: rgba(0, 34, 79, 0.45);
  --border-glass: rgba(255, 255, 255, 0.2);
  --border-glass-hover: rgba(255, 255, 255, 0.5);
  --icon-stroke: #FFFFFF;
  
  /* Desktop Specifications from Figma (11:2 Landing Page Media) */
  --card-width-desktop: 192px;
  --card-height-desktop: 234px;
  --card-radius-desktop: 20px;
  --icon-well-desktop: 80px;
  --btn-width-desktop: 260px;
  --btn-height-desktop: 60px;
  --btn-radius-desktop: 10px;
  
  /* Mobile Dimensions */
  --card-radius-mobile: 16px;
  --icon-well-mobile: 56px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  background-color: var(--bg-black);
  color: var(--text-white);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-width: 320px;
  overflow-x: hidden;
  background-color: var(--bg-black);
  position: relative;
}

/* ==========================================================================
   Atmospheric Glow Background Canvas
   ========================================================================== */
.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Top linear gradient mesh fading from deep navy to pitch black */
.bg-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 65vh;
  background: linear-gradient(180deg, var(--bg-navy) 0%, rgba(0, 34, 79, 0.45) 45%, rgba(0, 0, 0, 0) 100%);
  opacity: 0.95;
}

/* Blue ambient glow at top / center */
.glow-blue-ambient {
  position: absolute;
  width: 750px;
  height: 550px;
  left: -80px;
  top: -50px;
  background: radial-gradient(ellipse at center, var(--blue-glow) 0%, rgba(0, 67, 144, 0.4) 45%, transparent 70%);
  filter: blur(85px);
  opacity: 0.8;
}

/* Red ambient glow across middle and behind phone */
.glow-red-ambient {
  position: absolute;
  width: 900px;
  height: 480px;
  right: -50px;
  top: 240px;
  background: radial-gradient(ellipse at center, var(--red-glow) 0%, rgba(212, 54, 54, 0.35) 45%, transparent 70%);
  filter: blur(95px);
  opacity: 0.6;
}

.glow-center-ambient {
  position: absolute;
  width: 600px;
  height: 400px;
  left: 25%;
  top: 350px;
  background: radial-gradient(ellipse at center, rgba(0, 67, 144, 0.25) 0%, transparent 65%);
  filter: blur(80px);
  opacity: 0.6;
}

/* ==========================================================================
   Page & Stage Containers
   ========================================================================== */
.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.site-stage {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px 28px;
}

/* ==========================================================================
   Mobile Layout: Header, Titles, Corner Phone
   ========================================================================== */
.hero-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.logo-link {
  display: inline-block;
  outline: none;
}

.logo-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(0, 67, 144, 0.45));
  transition: transform 0.25s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

/* Mobile corner phone preview */
.mobile-phone-preview {
  position: absolute;
  top: -12px;
  right: -6px;
  width: 135px;
  z-index: 2;
  pointer-events: auto;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.75));
}

.mobile-phone-img {
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(3deg);
  transition: transform 0.35s ease;
}

.mobile-phone-preview:hover .mobile-phone-img {
  transform: rotate(0deg) scale(1.04);
}

/* Hero Titles */
.hero-titles {
  position: relative;
  z-index: 3;
  margin-bottom: 24px;
  max-width: calc(100% - 110px);
}

.eyebrow-text {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--brand-orange) 0%, var(--brand-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-bottom: 6px;
}

.headline-text {
  font-size: 36px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-white);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 12px;
}

.subtitle-text {
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 95%;
}

/* Desktop Phone Stage (Hidden on Mobile) */
.desktop-phone-stage {
  display: none;
}

/* ==========================================================================
   Resource Cards (Mobile: 2x3 Grid)
   ========================================================================== */
.resource-section {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 6px;
  margin-bottom: 28px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

/* Resource Card Base */
.resource-card {
  min-height: 160px;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius-mobile);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              box-shadow 0.25s ease;
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0.6;
}

.resource-card:hover, .resource-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-glass-hover);
  background-color: var(--surface-glass-hover);
  box-shadow: 0 14px 30px rgba(0, 34, 79, 0.45), 0 0 16px rgba(255, 255, 255, 0.08);
}

.resource-card:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
}

.resource-card:active {
  transform: translateY(-1px) scale(0.99);
}

/* Icon Well inside Card */
.card-icon-well {
  width: var(--icon-well-mobile);
  height: var(--icon-well-mobile);
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.12) 0%, rgba(0, 67, 144, 0.3) 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.resource-card:hover .card-icon-well {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.45);
}

.card-icon-well svg {
  width: 25px;
  height: 25px;
  stroke: var(--icon-stroke);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.card-title {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.015em;
  word-break: break-word;
}

/* Mobile 6th Card: Join Now Action Card */
.card-cta-mobile {
  background: linear-gradient(135deg, #FF3366 0%, #FF1A4B 60%, #E60039 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(255, 45, 85, 0.35);
}

.card-cta-mobile::before {
  display: none;
}

.card-cta-mobile .cta-mobile-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.card-cta-mobile:hover, .card-cta-mobile:focus-visible {
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, #FF4D79 0%, #FF2654 60%, #F50041 100%);
  box-shadow: 0 14px 32px rgba(255, 45, 85, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Desktop Dedicated Join Button (Hidden on Mobile) */
.desktop-cta-container {
  display: none;
}

/* Footer */
.footer-container {
  width: 100%;
  text-align: center;
  padding: 16px 0 6px;
  margin-top: auto;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-white);
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

/* ==========================================================================
   Tablet Breakpoint (640px - 1023px)
   ========================================================================== */
@media (min-width: 640px) and (max-width: 1023px) {
  .site-stage {
    padding: 32px 24px 28px;
  }
  
  .hero-titles {
    max-width: calc(100% - 180px);
  }
  
  .logo-img {
    width: 80px;
    height: 80px;
  }
  
  .eyebrow-text {
    font-size: 30px;
  }
  
  .headline-text {
    font-size: 48px;
  }
  
  .subtitle-text {
    font-size: 17px;
  }
  
  .mobile-phone-preview {
    width: 180px;
    top: -15px;
    right: 0;
  }
  
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  
  .resource-card {
    min-height: 175px;
    padding: 22px 12px 18px;
  }
  
  .card-icon-well {
    width: 64px;
    height: 64px;
  }
  
  .card-title {
    font-size: 14px;
  }
}

/* ==========================================================================
   Desktop Breakpoint (≥ 1024px) - Exactly Matches Expected Reference Image
   ========================================================================== */
@media (min-width: 1024px) {
  .page-container {
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .site-stage {
    max-width: 1040px;
    width: 100%;
    min-height: auto;
    padding: 24px 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: auto;
  }

  /* Header & Logo at Top-Left */
  .hero-header {
    margin-bottom: 16px;
  }

  .logo-img {
    width: 80px;
    height: 80px;
  }

  .mobile-phone-preview {
    display: none;
  }

  /* Left-Hand Hero Titles */
  .hero-titles {
    max-width: 660px;
    margin-bottom: 22px;
  }

  .eyebrow-text {
    font-size: 38px;
    line-height: 1.15;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
    white-space: nowrap;
  }

  .headline-text {
    font-size: 72px;
    line-height: 1.02;
    letter-spacing: -0.05em;
    margin-bottom: 20px;
    white-space: nowrap;
  }

  .subtitle-text {
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -0.02em;
    max-width: 540px;
  }

  /* Desktop 3D Phone Mockup:
     Scaled down to 365px max-width / 580px max-height so it comfortably sits
     behind Cards 4 & 5 and NEVER overlaps the footer */
  .desktop-phone-stage {
    display: block;
    position: absolute;
    right: 0px;
    top: 5px;
    width: 365px;
    max-height: 580px;
    z-index: 1;
    pointer-events: none;
  }

  .desktop-phone-img {
    width: 100%;
    max-height: 580px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.9)) drop-shadow(0 10px 25px rgba(0, 67, 144, 0.35));
    animation: gentleFloatDesktop 6s ease-in-out infinite;
  }

  @keyframes gentleFloatDesktop {
    0%, 100% {
      transform: translateY(0px) rotate(0deg);
    }
    50% {
      transform: translateY(-6px) rotate(0.4deg);
    }
  }

  .phone-glow-halo {
    position: absolute;
    width: 380px;
    height: 380px;
    top: 40%;
    left: 45%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(212, 54, 54, 0.45) 0%, rgba(0, 67, 144, 0.35) 45%, transparent 70%);
    filter: blur(75px);
    z-index: -1;
  }

  /* 5 Resource Cards:
     Cards 4 & 5 sit directly over the phone with frosted glass */
  .resource-section {
    position: relative;
    z-index: 2;
    margin-top: 10px;
    margin-bottom: 0;
    width: 1040px;
  }

  .resource-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 1040px;
  }

  .resource-card {
    flex: 0 0 var(--card-width-desktop);
    width: var(--card-width-desktop);
    min-height: 215px;
    height: 215px;
    border-radius: var(--card-radius-desktop);
    padding: 24px 14px 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--border-glass);
  }

  .resource-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glass-hover);
    background-color: rgba(0, 34, 79, 0.45);
    box-shadow: 0 16px 36px rgba(0, 34, 79, 0.55), 0 0 20px rgba(255, 255, 255, 0.1);
  }

  .card-icon-well {
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
  }

  .card-icon-well svg {
    width: 30px;
    height: 30px;
  }

  .card-title {
    font-size: 14.5px;
    line-height: 1.35;
  }

  /* Hide mobile 6th card on desktop */
  .card-cta-mobile {
    display: none;
  }

  /* Centered "Join Now" Button below 5 Cards */
  .desktop-cta-container {
    display: flex;
    justify-content: center;
    margin-top: 28px;
    width: 100%;
  }

  .desktop-join-btn {
    width: var(--btn-width-desktop);
    height: 54px;
    background: var(--brand-red);
    border-radius: var(--btn-radius-desktop);
    color: var(--text-white);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(255, 45, 85, 0.45), 0 0 24px rgba(255, 45, 85, 0.25);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    outline: none;
  }

  .desktop-join-btn:hover, .desktop-join-btn:focus-visible {
    transform: translateY(-3px) scale(1.02);
    background: #FF1744;
    box-shadow: 0 14px 38px rgba(255, 45, 85, 0.65), 0 0 32px rgba(255, 45, 85, 0.35);
  }

  .desktop-join-btn:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 4px;
  }

  .desktop-join-btn:active {
    transform: translateY(0) scale(0.99);
  }

  /* Footer on desktop */
  .footer-container {
    margin-top: 28px;
    padding-bottom: 12px;
  }

  .footer-copy {
    font-size: 12px;
    color: var(--text-white);
    opacity: 0.8;
  }
}

/* ==========================================================================
   Interactive Modal Dialog
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #0A111E;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  padding: 32px 28px 28px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 45px rgba(0, 67, 144, 0.45);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.modal-backdrop.is-open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-icon-container {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, rgba(0, 67, 144, 0.4) 80%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-container svg {
  width: 34px;
  height: 34px;
  stroke: var(--text-white);
  stroke-width: 2;
  fill: none;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-white);
  margin-bottom: 12px;
}

.modal-description {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 26px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-primary-btn {
  width: 100%;
  height: 52px;
  background: var(--brand-red);
  border-radius: 12px;
  color: var(--text-white);
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(255, 45, 85, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.modal-primary-btn:hover {
  transform: translateY(-2px);
  background: #FF1744;
  box-shadow: 0 12px 28px rgba(255, 45, 85, 0.6);
}

.modal-secondary-btn {
  width: 100%;
  height: 46px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

/* Accessibility: Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
