/* ===================================================
   GLOBAL STYLES — Personal Portfolio
   Dark space aesthetic with warm gold/amber accents
   =================================================== */

/* --- Twemoji emoji images --- */
img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.05em;
  vertical-align: -0.1em;
  display: inline;
}

/* --- Google Fonts import --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --bg-dark: #080818;
  --bg-card: #0f0f2d;
  --bg-card-hover: #171740;
  --accent-gold: #f4a261;
  --accent-warm: #e76f51;
  --highlight: #ffd166;
  --text-primary: #ffffff;
  --text-secondary: #8888aa;
  --border: rgba(244, 162, 97, 0.2);
  --border-hover: rgba(244, 162, 97, 0.55);
  --glow: rgba(244, 162, 97, 0.3);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Larger radii for the cartoonish, rounded look */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 50px;
  --transition: 0.2s ease;
  /* Cartoon-style offset shadow used on cards */
  --cartoon-shadow: 5px 5px 0 rgba(244, 162, 97, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* ===================================================
   STAR BACKGROUND ANIMATION
   Tiny white dots that gently twinkle across the page
   =================================================== */

/* Stars are generated via JS in script.js and attached to #stars-container */
#stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50%       { opacity: var(--max-opacity, 0.7); transform: scale(1); }
}

/* ===================================================
   INTRO OVERLAY — text + photos on top of globe
   =================================================== */

#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.intro-word {
  position: absolute;
  font-family: 'Playfair Display', serif;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 4.5rem);
  font-weight: 400;
  text-transform: lowercase;
  line-height: 1;
}

.intro-photo {
  position: absolute;
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 4px;
}

/* Hide scattered photos on desktop, show stack instead */
.mobile-photo { display: none; }

#photo-stack {
  position: absolute;
  left: 83%;
  top: 35%;
  width: 130px;
  height: 130px;
  cursor: pointer;
  pointer-events: auto;
}


.stack-photo {
  position: absolute;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform-style: preserve-3d;
}

.stack-photo.tilting {
  transition: box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 20px 40px rgba(124, 143, 247, 0.3), 0 8px 20px rgba(0,0,0,0.4);
  filter: brightness(1.1);
  z-index: 9999 !important;
}

#sphoto1  { transform: translate(0px, 0px) rotate(-6deg);   z-index: 10; }
#sphoto2  { transform: translate(3px, 3px) rotate(-2deg);   z-index: 9; }
#sphoto3  { transform: translate(6px, 6px) rotate(3deg);    z-index: 8; }
#sphoto4  { transform: translate(9px, 9px) rotate(7deg);    z-index: 7; }
#sphoto5  { transform: translate(12px, 12px) rotate(-4deg); z-index: 6; }
#sphoto6  { transform: translate(15px, 15px) rotate(1deg);  z-index: 5; }
#sphoto7  { transform: translate(18px, 18px) rotate(5deg);  z-index: 4; }
#sphoto8  { transform: translate(21px, 21px) rotate(-3deg); z-index: 3; }
#sphoto9  { transform: translate(24px, 24px) rotate(6deg);  z-index: 2; }
#sphoto10 { transform: translate(27px, 27px) rotate(-1deg); z-index: 1; }

#intro-scroll-spacer {
  height: 500px;
  position: relative;
  z-index: 0;
  pointer-events: none;
}

/* ===================================================
   GLOBE SECTION — full-viewport container.
   The hero text is absolutely positioned on top of the
   globe canvas so there is one seamless background.
   =================================================== */

#globe-section {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

/* Hero text — left-side panel floating over the globe */
#hero {
  position: absolute;
  /* Vertically centred on the left edge */
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 10;
  text-align: left;
  padding: 48px 64px 48px 48px;
  max-width: 460px;
  /* Mouse/touch passes through so globe drag still works */
  pointer-events: none;
  /* Gradient: dark on the left, fades out toward the globe */
  background: linear-gradient(
    to right,
    rgba(10, 10, 26, 0.88) 55%,
    transparent 100%
  );
}

#hero h1 {
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  /* Cartoon-style offset shadow: warm amber layer + dark depth */
  text-shadow:
    3px 3px 0 rgba(244, 162, 97, 0.35),
    0 6px 24px rgba(0, 0, 0, 0.85);
}

#hero h1 .emoji {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(3deg); }
}

/* Decorative gold accent line under the h1 */
#hero h1::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 14px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent-gold), var(--accent-warm));
}

#hero .subtitle {
  margin-top: 20px;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.6;
}

#hero .subtitle span {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Globe canvas — fills the full section */
#globe-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#globe-container:active {
  cursor: grabbing;
}

/* ===================================================
   GLOBE PIN MARKERS
   =================================================== */

.globe-pin {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.pin-flag {
  font-size: 40px;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  pointer-events: auto;
}

.globe-pin:hover .pin-flag {
  transform: scale(1.3);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.9));
}

/* ===================================================
   TOOLTIP CARD
   Appears near hovered pin, positioned to avoid off-screen
   =================================================== */

#globe-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  max-width: 280px;
  min-width: 200px;
  width: max-content;
}

#globe-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.tooltip-card {
  background: var(--bg-card);
  border: 2px solid rgba(124, 143, 247, 0.5);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 18px rgba(184, 169, 247, 0.15);
  backdrop-filter: blur(10px);
}

.tooltip-emoji {
  font-size: 1.4rem;
  display: inline;
  margin-right: 6px;
}

.tooltip-location {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  display: inline;
}

.tooltip-year {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin: 4px 0 6px;
  letter-spacing: 0.04em;
}

.tooltip-blurb {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.tooltip-btn {
  display: inline-block;
  width: auto;
  padding: 6px 14px;
  background: linear-gradient(135deg, #7c8ff7, #b8a9f7);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.tooltip-btn:hover {
  opacity: 0.92;
  transform: scale(1.04);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}


/* ===================================================
   GUESS THE DESTINATION GAME
   =================================================== */

#guess-game {
  position: fixed;
  left: 2rem;
  bottom: 2rem;
  z-index: 100;
  width: 260px;
  padding: 1.1rem 1.2rem;
  background: rgba(10, 10, 31, 0.92);
  border: 1px solid rgba(124, 143, 247, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#guess-game.visible {
  opacity: 1;
  pointer-events: all;
}

.guess-header {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.guess-input-row {
  display: flex;
  gap: 0.4rem;
}

#guess-input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(124, 143, 247, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.3s ease;
}

#guess-input:focus {
  border-color: #7c8ff7;
}

#guess-input::placeholder {
  color: #8892b0;
}

#guess-btn {
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: #7c8ff7;
  color: #000;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: none !important;
  transition: background 0.3s ease;
}

#guess-btn:hover {
  background: #b8a9f7;
}

#guess-feedback {
  margin-top: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: #b8a9f7;
  min-height: 1.2em;
  transition: opacity 0.3s ease;
}

#guess-game.correct .guess-header {
  color: #7c8ff7;
}

#guess-game.correct #guess-input,
#guess-game.correct #guess-btn {
  display: none;
}

#guess-game.correct #guess-feedback {
  font-size: 0.9rem;
  color: #ffffff;
  line-height: 1.5;
}

@media (max-width: 768px) {
  #guess-game {
    left: 50%;
    transform: translateX(-50%);
    bottom: 4.5rem;
    width: calc(100vw - 2rem);
    max-width: 320px;
    padding: 0.9rem 1rem;
  }

  #newsletter-float {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 1rem;
  }
}

/* ===================================================
   NEWSLETTER FLOATING CARD
   =================================================== */

#newsletter-float {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 100;
  width: fit-content;
  max-width: 100%;
  padding: 1.25rem 1.25rem 0.75rem;
  background: rgba(10, 10, 31, 0.92);
  border: 1px solid rgba(124, 143, 247, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#newsletter-float.visible {
  opacity: 1;
  pointer-events: all;
}

.nf-header {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.3rem;
}

.nf-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: #8892b0;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

#newsletter-float iframe {
  width: 100%;
  max-width: 100%;
  height: 150px;
  border: none;
  border-radius: 20px;
  overflow: hidden;
}

#newsletter-float a {
  padding: 0.6rem 1.25rem;
  white-space: nowrap;
  width: fit-content;
}

/* ===================================================
   CUSTOM STAR CURSOR
   =================================================== */

* {
  cursor: none !important;
}

#star-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}

#star-cursor.big {
  font-size: 28px;
  transform: translate(-50%, -50%) rotate(20deg);
}

/* ===================================================
   UTILITY ANIMATIONS
   =================================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ===================================================
   MOBILE RESPONSIVENESS
   =================================================== */

@media (max-width: 768px) {
  .intro-word {
    font-size: clamp(2rem, 6vw, 4rem);
  }
  .intro-photo {
    width: 80px;
    height: 80px;
  }
  .mobile-photo { display: none; }
  #photo-stack {
    display: block;
    left: 35%;
    top: 10%;
    bottom: auto;
    width: 90px;
    height: 90px;
    transform: translateX(-50%);
  }
  .stack-photo {
    width: 80px;
    height: 80px;
  }

  /* Reposition "avneet" and "world" on mobile */
  .intro-word:nth-child(4) { left: 60% !important; top: 16% !important; }
  .intro-word:nth-child(8) { left: 65% !important; top: 74% !important; }

  /* On mobile, hero moves to top-centre over the globe */
  #hero {
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    text-align: center;
    padding: 32px 24px 0;
    max-width: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 26, 0.82) 0%, transparent 100%);
  }

  #hero h1::after {
    margin: 10px auto 0;
  }

  /* On mobile, tooltip appears at the bottom of the globe area,
     not floating near the pin (handled in JS) */
  #globe-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    max-width: calc(100vw - 32px);
    min-width: 0;
    width: calc(100vw - 32px);
  }

  #globe-tooltip.visible {
    transform: translateX(-50%) translateY(0);
  }

  .social-btn {
    padding: 16px 20px;
    min-width: 80px;
  }

  .newsletter-form,
  .game-form {
    flex-direction: column;
    align-items: center;
  }

  .newsletter-form input,
  .game-form input {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  #hero h1 {
    font-size: 1.8rem;
  }

  .contact-inner {
    gap: 48px;
  }
}

/* ===================================================
   SOCIAL ICONS — floating random positions
   =================================================== */
#social-bar {
  display: contents;
}

#social-bar a {
  position: fixed;
  z-index: 100;
  color: #8892b0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: top 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              left 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.6s ease,
              color 0.3s ease;
}

#social-bar a.floating-visible {
  opacity: 1;
  pointer-events: all;
}

#social-bar a svg {
  width: 28px;
  height: 28px;
}

#social-bar a:hover {
  color: #7c8ff7;
}

.social-line {
  display: none;
}

.social-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 31, 0.9);
  color: #c8d0e8;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#social-bar a:hover .social-tooltip {
  opacity: 1;
}

@media (max-width: 768px) {
  #social-bar a {
    display: none;
  }
}
