/* ==========================================================================
   CH Hospital - Premium Website Launch Experience
   Design System & Animation Styles
   ========================================================================== */

:root {
  /* Core Color Palette */
  --bg-color: #F8FBFA;
  --primary-color: #1E8F78;
  --primary-dark: #156C5A;
  --primary-light: #25A58B;
  --accent-color: #73D9A3;
  --accent-soft: rgba(115, 217, 163, 0.2);
  --primary-soft: rgba(30, 143, 120, 0.08);
  --primary-glow: rgba(30, 143, 120, 0.24);
  
  --text-main: #16332D;
  --text-muted: #52746B;
  --text-light: #81A198;
  
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(30, 143, 120, 0.12);
  
  /* Typography */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(22, 51, 45, 0.04);
  --shadow-md: 0 8px 24px rgba(22, 51, 45, 0.06), 0 2px 6px rgba(30, 143, 120, 0.04);
  --shadow-btn: 0 8px 24px rgba(30, 143, 120, 0.22), 0 2px 4px rgba(30, 143, 120, 0.1);
  --shadow-btn-hover: 0 14px 32px rgba(30, 143, 120, 0.32), 0 4px 8px rgba(30, 143, 120, 0.14);

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   Ambient Decorative Background
   -------------------------------------------------------------------------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.65;
  transition: opacity 1.2s ease;
}

.glow-top-right {
  top: -10vw;
  right: -5vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(115, 217, 163, 0.18) 0%, rgba(30, 143, 120, 0.05) 50%, transparent 70%);
}

.glow-bottom-left {
  bottom: -15vw;
  left: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(30, 143, 120, 0.12) 0%, rgba(115, 217, 163, 0.04) 50%, transparent 70%);
}

.bg-geometry {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Main Viewport & Layering
   -------------------------------------------------------------------------- */
.launch-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 1.5rem;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring), filter 0.5s var(--ease-spring);
}

/* --------------------------------------------------------------------------
   Screen 1: Landing Screen
   -------------------------------------------------------------------------- */
.landing-screen {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.landing-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  filter: blur(4px);
  pointer-events: none;
  transition: opacity 0.35s ease-out, transform 0.4s ease-out, filter 0.35s ease-out, visibility 0.4s;
}

.landing-content {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: heroAppear 0.9s var(--ease-spring) both;
}

@keyframes heroAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Badge Pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.95rem;
  background: rgba(30, 143, 120, 0.08);
  border: 1px solid rgba(30, 143, 120, 0.16);
  border-radius: 100px;
  margin-bottom: 2rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(115, 217, 163, 0.35);
  animation: pulseDot 2.2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.7;
  }
}

.badge-text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

/* Logo Presentation */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
  max-width: 100%;
}

.hospital-logo {
  width: auto;
  max-width: 290px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(22, 51, 45, 0.04));
  transition: transform 0.3s ease;
}

/* Brand Text */
.brand-text-block {
  margin-bottom: 1.5rem;
}

.hospital-title {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.45rem;
}

.tagline {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  line-height: 1.45;
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 100px;
  border: 1px solid rgba(22, 51, 45, 0.05);
}

.indicator-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.indicator-item svg {
  color: var(--primary-color);
  flex-shrink: 0;
}

.indicator-divider {
  color: var(--text-light);
  opacity: 0.5;
  font-size: 0.65rem;
}

/* Launch Button */
.action-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.launch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: auto;
  min-width: 210px;
  padding: 1.05rem 2.6rem;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  outline: none;
  overflow: hidden;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-spring), background 0.28s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.launch-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-btn-hover);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.launch-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 14px rgba(30, 143, 120, 0.25);
}

.launch-btn:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

.launch-btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.btn-text {
  position: relative;
  z-index: 2;
}

.btn-arrow {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  transition: transform 0.28s var(--ease-spring);
}

.launch-btn:hover:not(:disabled) .btn-arrow {
  transform: translateX(4px);
}

/* Button Shine Effect */
.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
  pointer-events: none;
  z-index: 1;
}

.launch-btn:hover:not(:disabled) .btn-shine {
  left: 150%;
}

.accessibility-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.85rem;
  font-weight: 500;
}

.accessibility-hint kbd {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(22, 51, 45, 0.06);
  border: 1px solid rgba(22, 51, 45, 0.12);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Screen 2: Countdown Experience
   -------------------------------------------------------------------------- */
.countdown-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10;
}

.countdown-screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.countdown-backdrop-ring {
  position: absolute;
  width: clamp(280px, 45vw, 550px);
  height: clamp(280px, 45vw, 550px);
  border-radius: 50%;
  border: 1.5px solid rgba(30, 143, 120, 0.08);
  box-shadow: 0 0 60px rgba(115, 217, 163, 0.08), inset 0 0 60px rgba(30, 143, 120, 0.04);
  pointer-events: none;
  animation: ringPulse 2.1s infinite ease-in-out;
}

@keyframes ringPulse {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

.countdown-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.countdown-number {
  font-size: clamp(8rem, 25vw, 22rem);
  font-weight: 800;
  line-height: 1;
  color: var(--primary-color);
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  user-select: none;
  text-shadow: 0 8px 30px rgba(30, 143, 120, 0.18);
  will-change: transform, opacity, filter;
  opacity: 0;
}

/* Cinematic Countdown Step Animation */
/* 
   Timing: 1.0s (1000ms) total
   - 0% - 20%: scale up from 0.86, fade in
   - 20% - 75%: hold steady with slight gentle breathing
   - 75% - 100%: scale up to 1.08, fade & blur out
*/
.countdown-number.animate-beat {
  animation: countdownStep 1s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes countdownStep {
  0% {
    opacity: 0;
    transform: scale(0.86);
    filter: blur(6px);
  }
  20% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
  75% {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(1.09);
    filter: blur(6px);
  }
}

/* --------------------------------------------------------------------------
   Screen 3: Final Launching Screen
   -------------------------------------------------------------------------- */
.launching-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
}

.launching-screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: launchingFadeIn 0.45s var(--ease-spring) forwards;
}

@keyframes launchingFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.launching-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
}

.launching-logo-wrap {
  margin-bottom: 2rem;
  animation: logoSoftGlow 1.2s ease-in-out infinite alternate;
}

@keyframes logoSoftGlow {
  0% {
    transform: translateY(0);
    filter: drop-shadow(0 4px 10px rgba(30, 143, 120, 0.08));
  }
  100% {
    transform: translateY(-3px);
    filter: drop-shadow(0 10px 24px rgba(30, 143, 120, 0.18));
  }
}

.launching-logo {
  max-width: 250px;
  height: auto;
}

.launching-status {
  margin-bottom: 2.2rem;
}

.launching-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary-color);
  line-height: 1.15;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.launching-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.launch-progress-bar {
  width: 180px;
  height: 3px;
  background: rgba(30, 143, 120, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
  border-radius: 4px;
  animation: progressFill 0.7s ease-out forwards;
}

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .launch-viewport {
    padding: 1rem;
  }

  .landing-content {
    padding: 2rem 1.25rem;
    border-radius: 22px;
  }

  .badge-pill {
    margin-bottom: 1.5rem;
    padding: 0.32rem 0.8rem;
  }

  .hospital-logo {
    max-width: 230px;
  }

  .hospital-title {
    font-size: 1.75rem;
  }

  .trust-indicators {
    font-size: 0.72rem;
    padding: 0.5rem 0.8rem;
    gap: 0.45rem;
    margin-bottom: 1.8rem;
  }

  .launch-btn {
    width: 100%;
    max-width: 280px;
    padding: 0.95rem 1.8rem;
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .hospital-logo {
    max-width: 190px;
  }

  .hospital-title {
    font-size: 1.5rem;
  }

  .trust-indicators {
    display: none; /* keep clean on tiny screens */
  }
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion Preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .countdown-number.animate-beat {
    animation: simpleBeat 1s linear forwards !important;
  }

  @keyframes simpleBeat {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
  }

  .countdown-backdrop-ring,
  .launching-logo-wrap,
  .badge-dot {
    animation: none !important;
  }
}
