/* ============================================
   FAHAD & HAFSA — SHARED DESIGN SYSTEM
   Theme: Celestial Luxury — Dark navy starfield,
   champagne gold, ivory, deep romantic elegance
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Cinzel:wght@400;600;700&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap");

:root {
  --navy: #080c1a;
  --navy-mid: #0d1530;
  --navy-light: #162040;
  --gold: #d4af7a;
  --gold-bright: #f0d090;
  --gold-dim: #9a7a50;
  --ivory: #f5f0e8;
  --ivory-dim: rgba(245, 240, 232, 0.7);
  --blush: #e8a0a0;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(212, 175, 122, 0.25);
  --shadow-gold: 0 0 30px rgba(212, 175, 122, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  background: var(--navy);
  color: var(--ivory);
  overflow-x: hidden;
  /* Only hide system cursor on non-touch devices */
  cursor: auto;
}

/* Custom cursor — desktop only, hidden on touch */
@media (pointer: fine) {
  body {
    cursor: none;
  }
}

/* ---- Custom Cursor (desktop/mouse only) ---- */
.cursor,
.cursor-trail {
  display: none; /* hidden by default; JS enables on mouse devices */
}

/* ---- Starfield Canvas ---- */
#starCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  will-change: transform; /* GPU layer hint */
}

/* ---- Grain overlay ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* ---- Navigation ---- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 26, 0.95) 0%,
    transparent 100%
  );
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 122, 0.12);
}
.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 6px;
}
.nav-links li a {
  display: block;
  padding: 10px 24px;
  border-radius: 40px;
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--ivory-dim);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--navy);
  background: var(--gold);
  text-shadow: none;
}
.nav-links li a .nav-urdu {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 0.9rem;
  display: block;
  line-height: 1;
  margin-bottom: 1px;
}

/* ---- Password Lock Screen ---- */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.lock-screen.unlocking {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
.lock-icon-wrap {
  font-size: 3rem;
  margin-bottom: 30px;
  animation: lock-float 3s ease-in-out infinite;
  position: relative;
}
@keyframes lock-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.lock-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(212, 175, 122, 0.2),
    transparent 70%
  );
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.lock-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--gold-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.lock-subtitle {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ivory-dim);
  margin-bottom: 40px;
}
.lock-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  padding: 0 20px;
}
.lock-input-wrap {
  position: relative;
  width: 100%;
}
.lock-input {
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--ivory);
  font-family: "Cinzel", serif;
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.lock-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 122, 0.2);
}
.lock-btn {
  width: 100%;
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: 8px;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}
.lock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 122, 0.4);
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}
.lock-hint {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--gold-dim);
  opacity: 0.7;
  letter-spacing: 0.05em;
  text-align: center;
}
.lock-error {
  color: var(--blush);
  font-size: 0.9rem;
  font-style: italic;
  min-height: 20px;
  transition: opacity 0.3s;
}

/* ---- Decorative Divider ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 50px auto;
  max-width: 400px;
  color: var(--gold-dim);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(25px);
  box-shadow: var(--shadow-gold), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: 40px;
  transition: all 0.4s ease;
}
.glass-card:hover {
  border-color: rgba(212, 175, 122, 0.4);
  box-shadow: 0 0 50px rgba(212, 175, 122, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(-4px);
}

/* ---- Gold Button ---- */
.btn-gold {
  display: inline-block;
  padding: 13px 32px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 40px;
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}
.btn-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  z-index: -1;
}
.btn-gold:hover {
  color: var(--navy);
  border-color: var(--gold);
  box-shadow: 0 5px 25px rgba(212, 175, 122, 0.3);
}
.btn-gold:hover::before {
  transform: translateX(0);
}

/* ---- Popup Overlay ---- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 26, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  animation: fadeIn 0.3s ease;
  padding: 16px;
}
.popup-overlay.open {
  display: flex;
}
.popup-box {
  background: linear-gradient(160deg, var(--navy-mid), var(--navy-light));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 50px 45px 40px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(212, 175, 122, 0.1);
}
.popup-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--ivory-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  /* Ensure close button is always tappable on mobile */
  min-width: 44px;
  min-height: 44px;
}
.popup-close:hover {
  background: rgba(212, 175, 122, 0.15);
  color: var(--gold);
  transform: rotate(90deg);
}

/* ---- Petals ---- */
.petal-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -40px;
  font-size: 18px;
  animation: petal-fall linear forwards;
  opacity: 0;
  /* Offload to GPU */
  will-change: transform, opacity;
}
@keyframes petal-fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) translateX(0);
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(720deg) translateX(60px);
  }
}

/* ---- Shimmer on name cards ---- */
.shimmer-card {
  position: relative;
  overflow: hidden;
}
.shimmer-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(212, 175, 122, 0.1),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0s;
}
.shimmer-card:hover::after {
  left: 125%;
  transition: left 0.6s ease;
}

/* ---- Typewriter ---- */
.typewriter-text {
  display: inline;
}
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ---- Keyframe utilities ---- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}
@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links li a {
    padding: 8px 14px;
    font-size: 0.65rem;
  }
  .nav-links li a .nav-urdu {
    font-size: 0.75rem;
  }
  .glass-card {
    padding: 25px;
  }
  .popup-box {
    padding: 50px 18px 28px;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .nav-links li a {
    padding: 7px 10px;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }
  .nav-links li a .nav-urdu {
    font-size: 0.7rem;
  }
}
