/* 
  365 Days with GT <3 
  Premium NotebookLM-Style Card Stack Stylesheet
  Font: Google Sans & Outfit fallback
*/

@import url('https://fonts.cdnfonts.com/css/google-sans');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Elegant Color Palette: Charcoal, Rose Gold, Soft Amethysts */
  --bg-dark: #090a0f;
  --card-bg: rgba(20, 22, 28, 0.96);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-rose: #ff7597;
  --accent-gold: #f59e0b;
  --accent-violet: #8b5cf6;
  
  --font-main: 'Google Sans', 'Outfit', sans-serif;
  
  /* Soft Gradient Colors for dynamic backglow */
  --glow-color-1: rgba(255, 117, 151, 0.35); /* Rose Gold */
  --glow-color-2: rgba(139, 92, 246, 0.35);  /* Violet */
  --glow-color-3: rgba(245, 158, 11, 0.25);  /* Warm Amber */
  --glow-color-4: rgba(16, 185, 129, 0.25);  /* Emerald Mint */
}

/* Reset & Scroll Prevention */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden; /* Strictly prevent scroll on desktop */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

body.modal-active {
  overflow: hidden !important;
}

/* Glow Wrapper to prevent iOS scrolling/zoom shifts */
.glow-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  contain: paint;
}

/* Dynamic shifting back-glow covering the behind-card space */
.global-blur-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(
    circle, 
    var(--glow-color-1) 0%, 
    var(--glow-color-2) 40%, 
    var(--glow-color-3) 80%,
    transparent 100%
  );
  filter: blur(80px);
  opacity: 0.85;
  pointer-events: none;
  transition: background 1.5s ease;
  will-change: transform;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

@keyframes floatGlow {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translate(0px, 0px);
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) translate(15px, -15px);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translate(0px, 0px);
  }
}

/* Subtle background overlay patterns for micro-textures */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Header Styles */
header {
  width: 100%;
  max-width: 1200px;
  padding: 2.5rem 2rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  position: relative;
}

.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #ff8da1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 4px 20px rgba(255, 117, 151, 0.15);
}

h1 span.heart {
  color: var(--accent-rose);
  -webkit-text-fill-color: var(--accent-rose);
  animation: pulseHeart 1.5s infinite ease-in-out;
  display: inline-block;
}

@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
}

/* Card Stack Viewport & Container */
.viewport {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 5;
  overflow: visible; /* Let preview cards extend outwards */
  pointer-events: none; /* Let clicks pass through empty spaces to header/footer */
}

.card-container-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 580px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* Cards Stack */
.card-stack {
  position: relative;
  width: 380px;
  height: 540px;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* Base Card Styles */
.card {
  position: absolute;
  width: 380px;
  height: 540px;
  border-radius: 28px;
  user-select: none;
  pointer-events: none; /* Only active card should receive flip clicks */
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: scale(0.6) translateX(0) rotate(0deg);
  z-index: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/* Pre-glow layer behind cards */
.card-glow-auras {
  position: absolute;
  inset: -15px;
  border-radius: 40px;
  filter: blur(35px);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  transform: translate3d(0, 0, -220px) scale(1.25);
  -webkit-transform: translate3d(0, 0, -220px) scale(1.25);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* State Classes: Active, Left Peek, Right Peek, Hidden */

/* Active Card in Center */
.card.active {
  opacity: 1;
  transform: scale(1) translateX(0) rotate(0deg);
  z-index: 10;
  pointer-events: auto; /* Active card is interactive! */
}

.card.active .card-glow-auras {
  opacity: 0.85;
}

/* Left Peeking Card */
.card.prev-peeking {
  opacity: 0.35;
  transform: scale(0.82) translateX(-112%) rotate(-2deg);
  z-index: 5;
  pointer-events: auto; /* Allows clicking to navigate */
  cursor: pointer;
}

/* Right Peeking Card */
.card.next-peeking {
  opacity: 0.35;
  transform: scale(0.82) translateX(112%) rotate(2deg);
  z-index: 5;
  pointer-events: auto; /* Allows clicking to navigate */
  cursor: pointer;
}

/* Fully hidden states (left/right overflow) */
.card.hidden-left {
  opacity: 0;
  transform: scale(0.7) translateX(-200%) rotate(-10deg);
  z-index: 1;
}

.card.hidden-right {
  opacity: 0;
  transform: scale(0.7) translateX(200%) rotate(10deg);
  z-index: 1;
}

/* Interactive 3D Flipper Setup */
.card-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d; /* iOS Safari compatibility */
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  cursor: pointer;
}

.card-flipper.flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg); /* iOS Safari compatibility */
}

/* Card Faces */
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /* iOS Safari compatibility */
  border-radius: 28px;
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* FRONT FACE: Display image and visual metadata */
.card-front {
  background-color: #161821;
  transform: rotateY(0deg) translate3d(0, 0, 1px); /* iOS Safari mirroring fix */
  -webkit-transform: rotateY(0deg) translate3d(0, 0, 1px);
}

.card-image-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

.card:hover .card-image {
  transform: scale(1.05);
}

/* Dark gradient overlay on image to read labels easily */
.card-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom, 
    rgba(0, 0, 0, 0.1) 0%, 
    rgba(0, 0, 0, 0.2) 60%, 
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Info overlay on front */
.front-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.25rem 2rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-number {
  display: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-rose);
  text-transform: uppercase;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* BACK FACE: Elegant Memory Message */
.card-back {
  background: var(--card-bg);
  transform: rotateY(180deg) translate3d(0, 0, 1px); /* iOS Safari mirroring fix */
  -webkit-transform: rotateY(180deg) translate3d(0, 0, 1px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 2.25rem;
  position: relative;
}

/* Glowing back pattern */
.card-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: radial-gradient(
    circle at top center, 
    rgba(255, 117, 151, 0.08) 0%, 
    transparent 70%
  );
  pointer-events: none;
}

.back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.25rem;
}

.back-header .label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-rose);
  text-transform: uppercase;
}

.back-header .heart-icon {
  font-size: 1.1rem;
  color: var(--accent-rose);
  opacity: 0.8;
}

.memory-text-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 0;
}

.memory-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.memory-message {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(243, 244, 246, 0.85);
  font-weight: 400;
  word-wrap: break-word;
}

.back-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.25rem;
}

.signature {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.signature span {
  color: var(--accent-rose);
  font-weight: 600;
}

.tap-hint {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Preloader for when images are loading */
.preloader {
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 117, 151, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-rose);
  animation: spin 1s infinite cubic-bezier(0.55, 0.15, 0.45, 0.85);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Empty State / Local Dev Instructions (when images aren't present) */
.fallback-card-content {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1b1e29 0%, #11131c 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  text-align: center;
  gap: 1.5rem;
  z-index: 2;
}

.fallback-icon {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.04);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-rose);
  animation: pulseIcon 2s infinite alternate ease-in-out;
}

@keyframes pulseIcon {
  0% { transform: scale(1); box-shadow: 0 0 0 0px rgba(255, 117, 151, 0.1); }
  100% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(255, 117, 151, 0.1); }
}

.fallback-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
}

.fallback-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Controls Bar at bottom */
.controls-bar {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem 2.5rem;
  z-index: 10;
  position: relative;
}

.navigation-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: var(--accent-rose);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pagination-fraction {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.pagination-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  max-width: 320px;
  overflow: hidden;
  padding: 0.25rem 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.dot.active {
  background: var(--accent-rose);
  width: 18px;
  border-radius: 10px;
}

.instruction-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.75;
}

.instruction-hint key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-family: inherit;
  color: #ffffff;
}

/* RESPONSIVE DESIGN - STYLES FOR TABLETS & MOBILES */

@media (max-width: 1024px) {
  .card-container-wrapper {
    height: 520px;
  }
  
  .card-stack {
    width: 320px;
    height: 480px;
  }
  
  .card {
    width: 320px;
    height: 480px;
  }
  
  .card.prev-peeking {
    transform: scale(0.82) translateX(-108%) rotate(-2deg);
  }
  
  .card.next-peeking {
    transform: scale(0.82) translateX(108%) rotate(2deg);
  }
}

@media (max-width: 768px) {
  header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  h1 {
    font-size: 1.6rem;
  }
  
  .brand-tag {
    display: none; /* Hide brand tag on smaller screens to keep clean */
  }

  .card-container-wrapper {
    height: 460px;
  }
  
  .card-stack {
    width: 290px;
    height: 430px;
  }
  
  .card {
    width: 290px;
    height: 430px;
    border-radius: 24px;
  }
  
  .card-front, .card-back {
    border-radius: 24px;
  }
  
  .card.prev-peeking {
    transform: scale(0.8) translateX(-105%) rotate(-1deg);
    opacity: 0.25;
  }
  
  .card.next-peeking {
    transform: scale(0.8) translateX(105%) rotate(1deg);
    opacity: 0.25;
  }
  
  .front-info {
    padding: 1.5rem;
  }
  
  .card-title {
    font-size: 1.25rem;
  }
  
  .card-back {
    padding: 2rem 1.5rem;
  }
  
  .memory-title {
    font-size: 1.15rem;
  }
  
  .memory-message {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  
  .back-header, .back-footer {
    padding-bottom: 0.75rem;
    padding-top: 0.75rem;
  }
  
  .controls-bar {
    padding: 1rem 1.5rem 1.5rem;
  }
  
  .nav-btn {
    width: 44px;
    height: 44px;
  }
  
  .global-blur-glow {
    width: 350px;
    height: 350px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  header {
    padding: 1.25rem 1rem 0.5rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .subtitle {
    font-size: 0.75rem;
  }

  .card-container-wrapper {
    height: 420px;
  }

  .card-stack {
    width: 250px;
    height: 380px;
  }

  .card {
    width: 250px;
    height: 380px;
  }

  .card.prev-peeking {
    transform: scale(0.82) translateX(-102%) rotate(-0.5deg);
    opacity: 0.12; /* Keep slightly visible on sides but very low opacity to avoid clutter */
  }

  .card.next-peeking {
    transform: scale(0.82) translateX(102%) rotate(0.5deg);
    opacity: 0.12;
  }

  .front-info {
    padding: 1.25rem 1rem;
    gap: 0.25rem;
  }

  .card-number {
    font-size: 0.75rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-date {
    font-size: 0.7rem;
  }

  .card-back {
    padding: 1.5rem 1.25rem;
  }

  .memory-title {
    font-size: 1.05rem;
  }

  .memory-message {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
  }
  
  .navigation-controls {
    gap: 1.25rem;
  }

  .instruction-hint {
    display: none; /* No keys on mobile anyway */
  }
}

/* --- Portfolio Specific Styles --- */
.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

#portfolio-screen {
  padding: 3rem 4rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  max-width: 1200px;
  margin: auto;
}

#memory-screen {
  opacity: 0;
  pointer-events: none;
  display: none;
  z-index: 5;
}

/* Portfolio Left Column */
.portfolio-left {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(20, 22, 28, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 3rem 2rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.profile-img-container {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-img-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-rose) 0%, var(--accent-violet) 70%, transparent 100%);
  filter: blur(8px);
  opacity: 0.55;
  animation: rotateGlowCircle 8s infinite linear;
}

@keyframes rotateGlowCircle {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 2;
  background: #11131c;
}

.profile-name {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.profile-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  line-height: 1.4;
}

/* Elegant Secret Glowing Dot (Gateway Trigger) */
.secret-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose), 0 0 20px var(--accent-rose);
  cursor: pointer;
  /*animation: secretDotPulse 2.5s infinite ease-in-out;*/
  transition: transform 0.3s ease, background-color 0.3s ease;
  vertical-align: middle;
}

/*.secret-dot:hover {
  transform: scale(1.6);
  background-color: #ff9fb4;
  box-shadow: 0 0 15px #ff9fb4, 0 0 30px #ff9fb4;
}*/

@keyframes secretDotPulse {
  0%, 100% {
    opacity: 0.5;
    box-shadow: 0 0 6px rgba(255, 117, 151, 0.6);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 117, 151, 1), 0 0 25px rgba(255, 117, 151, 0.8);
  }
}

.profile-bio {
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(243, 244, 246, 0.75);
  margin-bottom: 1.75rem;
}

.contact-info-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.contact-item a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-item a:hover {
  color: var(--accent-rose);
}

.contact-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-rose);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.social-badges {
  display: flex;
  gap: 0.75rem;
}

.social-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.social-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--accent-rose);
  transform: translateY(-2px);
}

/* Portfolio Right Column (CV Data Glassmorphic Box) */
.portfolio-right {
  flex: 1;
  max-width: 620px;
  background: rgba(20, 22, 28, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.25rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  height: 520px;
  display: flex;
  flex-direction: column;
}

/* Tabs System */
.tabs-header {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
  gap: 1.5rem;
}

.tab-trigger {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.tab-trigger::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-rose);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-trigger.active {
  color: #ffffff;
}

.tab-trigger.active::after {
  transform: scaleX(1);
}

.tabs-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom Scrollbar for tab contents */
.tabs-content::-webkit-scrollbar {
  width: 4px;
}
.tabs-content::-webkit-scrollbar-track {
  background: transparent;
}
.tabs-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.tabs-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tab-pane {
  display: none;
  animation: tabFadeIn 0.5s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

/* Experience timeline styles */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-left: 12px;
  padding-top: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 1.25rem;
  border-left: 1.5px solid rgba(255, 117, 151, 0.25);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.item-role {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.item-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.item-company {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-rose);
  margin-bottom: 0.4rem;
}

.item-desc-list {
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.item-desc-list li {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Skills grid style */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skills-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-rose);
  margin-bottom: 0.75rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(243, 244, 246, 0.85);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(255, 117, 151, 0.08);
  border-color: rgba(255, 117, 151, 0.25);
  color: var(--accent-rose);
  transform: translateY(-1px);
}

/* Extracurriculars and interests */
.extra-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.extra-item {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1rem;
  align-items: flex-start;
}

.extra-icon {
  font-size: 1.25rem;
  background: rgba(255, 117, 151, 0.06);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 117, 151, 0.15);
  color: var(--accent-rose);
  flex-shrink: 0;
}

.extra-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.extra-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.extra-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Password Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.password-card {
  background: rgba(20, 22, 28, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  width: 340px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.modal-overlay.active .password-card {
  transform: scale(1);
}

.password-icon {
  font-size: 2rem;
  color: var(--accent-rose);
  margin-bottom: 0.75rem;
  animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.password-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.password-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.password-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.2em;
}

.password-input::placeholder {
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.15);
}

.password-input:focus {
  border-color: var(--accent-rose);
  box-shadow: 0 0 10px rgba(255, 117, 151, 0.2);
}

.password-buttons {
  display: flex;
  gap: 1rem;
}

.modal-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.modal-btn.primary {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: #ffffff;
}

.modal-btn.primary:hover {
  background: #ff5c84;
  border-color: #ff5c84;
  box-shadow: 0 0 15px rgba(255, 117, 151, 0.4);
}

.error-msg {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: -1rem;
  margin-bottom: 1.25rem;
  display: none;
}

.error-msg.shake-anim {
  display: block;
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Screen Transitions */
.fade-out {
  opacity: 0 !important;
  transform: scale(0.95) !important;
  filter: blur(10px) !important;
  pointer-events: none !important;
}

.fade-in {
  display: flex !important;
  pointer-events: auto !important;
  z-index: 10 !important;
  animation: screenFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: scale(1.05) translateY(15px); filter: blur(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* Responsive Portfolio Breakpoints */
@media (max-width: 1024px) {
  body {
    overflow-y: auto !important; /* Allow the entire page to scroll on mobile! */
  }

  .modal-overlay {
    align-items: flex-start;
    padding-top: 12vh; /* Align password screen near top-center on mobile */
  }

  .screen {
    position: relative;
    height: auto;
    min-height: 100vh;
  }

  #portfolio-screen {
    flex-direction: column;
    padding: 3rem 1.5rem;
    gap: 2.5rem;
    overflow-y: visible;
    max-height: none;
    align-items: center;
    justify-content: flex-start;
  }
  
  .portfolio-left {
    flex: none;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem 1.5rem;
  }
  
  .portfolio-right {
    width: 100%;
    max-width: 500px;
    height: auto; /* Let it grow naturally! */
    min-height: auto;
    padding: 2rem 1.5rem;
    overflow: visible;
  }

  .tabs-content {
    overflow-y: visible !important; /* Disable internal right pane scrolling! */
    height: auto !important;
  }
}

@media (max-width: 480px) {
  #portfolio-screen {
    padding: 2rem 1rem;
    gap: 1.75rem;
  }
  
  .profile-name {
    font-size: 1.75rem;
  }
  
  .profile-img-container {
    width: 120px;
    height: 120px;
    margin-bottom: 1.25rem;
  }
  
  .portfolio-left, .portfolio-right {
    padding: 1.25rem;
    border-radius: 20px;
  }
  
  .tabs-header {
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .tab-trigger {
    font-size: 0.85rem;
  }
  
  .social-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
  
  .password-card {
    width: 90%;
    max-width: 310px;
    padding: 2rem 1.5rem;
  }
}

/* --- Theme Toggle Switch Button --- */
.theme-toggle-btn {
  position: fixed;
  top: 2.25rem;
  right: 2.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 90;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  outline: none;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  color: var(--accent-rose);
}

.theme-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  transition: transform 0.5s ease;
}

.theme-toggle-btn .sun-icon {
  display: none;
}

/* Light Mode Styling Rules & Variable Overrides */
body.light-mode {
  --bg-dark: #f1f3f7;
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-border: rgba(0, 0, 0, 0.08);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --accent-rose: #db2777; /* Saturated magenta for contrast */
  --accent-gold: #c2410c;
  --accent-violet: #6d28d9;
}

body.light-mode .global-blur-glow {
  opacity: 0.38;
}

body.light-mode::before {
  background-image: 
    radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

body.light-mode .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1f2937;
}

body.light-mode .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--accent-rose);
}

body.light-mode .theme-toggle-btn .moon-icon {
  display: none;
}

body.light-mode .theme-toggle-btn .sun-icon {
  display: block;
}

body.light-mode .portfolio-left,
body.light-mode .portfolio-right {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

body.light-mode .profile-name,
body.light-mode .item-role,
body.light-mode .extra-title {
  color: #111827;
}

body.light-mode .profile-title {
  color: #4b5563;
}

body.light-mode .contact-item {
  color: #4b5563;
}

body.light-mode .social-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

body.light-mode .social-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--accent-rose);
}

body.light-mode .tab-trigger.active {
  color: #000000;
}

body.light-mode .skill-tag {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
  color: #374151;
}

body.light-mode .skill-tag:hover {
  background: rgba(219, 39, 119, 0.05);
  border-color: rgba(219, 39, 119, 0.2);
  color: var(--accent-rose);
}

body.light-mode .extra-item {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.03);
}

body.light-mode .extra-icon {
  background: rgba(219, 39, 119, 0.06);
  border-color: rgba(219, 39, 119, 0.15);
}

body.light-mode .timeline-item {
  border-left-color: rgba(219, 39, 119, 0.2);
}

/* Password light mode */
body.light-mode .password-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .password-title {
  color: #111827;
}

body.light-mode .password-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #000000;
}

body.light-mode .modal-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #374151;
}

body.light-mode .modal-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-btn.primary {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: #ffffff;
}

body.light-mode .modal-btn.primary:hover {
  background: #be185d;
  border-color: #be185d;
}

/* Exit Scrapbook Back Button Styling */
.exit-portal-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.exit-portal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--accent-rose);
  transform: translateY(-1px);
}

body.light-mode .exit-portal-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

body.light-mode .exit-portal-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--accent-rose);
}

/* Light mode overrides inside active card stack */
body.light-mode .card-back {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

body.light-mode .card-back::before {
  background: radial-gradient(
    circle at top center, 
    rgba(219, 39, 119, 0.08) 0%, 
    transparent 70%
  );
}

body.light-mode .memory-title {
  color: #111827;
}

body.light-mode .memory-message {
  color: #374151;
}

body.light-mode .pagination-fraction,
body.light-mode .brand-tag {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

body.light-mode .dot {
  background: rgba(0, 0, 0, 0.15);
}

body.light-mode .dot.active {
  background: var(--accent-rose);
}

body.light-mode .nav-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

body.light-mode .nav-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--accent-rose);
}

body.light-mode .instruction-hint key {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #111827;
}

body.light-mode .fallback-card-content {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

body.light-mode .fallback-title {
  color: #111827;
}

body.light-mode .preloader {
  background: #f1f3f7;
}

body.light-mode .loader-text {
  color: #4b5563;
}

/* --- Added Light Mode Legibility Fixes --- */
body.light-mode .profile-bio {
  color: #374151 !important; /* Rich charcoal for bios in light mode */
}

body.light-mode .password-subtitle {
  color: #4b5563 !important;
}

body.light-mode .password-input {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #111827 !important; /* Perfect legibility for passwords in light mode */
}

body.light-mode .password-input::placeholder {
  color: rgba(0, 0, 0, 0.3) !important;
}

body.light-mode #main-title {
  background: linear-gradient(135deg, #111827 30%, var(--accent-rose) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: 0 4px 20px rgba(219, 39, 119, 0.12) !important;
}

body.light-mode .subtitle {
  color: #4b5563 !important;
}

body.light-mode .instruction-hint {
  color: #4b5563 !important;
}



