@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Mali:wght@400;600;700&display=swap");

:root {
  --bg-color: #1a1a2e;
  --terminal-bg: rgba(22, 33, 62, 0.9);
  --primary-blue: #89cff0; /* Pastel Blue - Cinnamoroll */
  --secondary-pink: #ffb7c5; /* Neon Pink - Soft side */
  --accent-green: #00ff00; /* Code Green */
  --accent-red: #ff4757; /* Alert Red */
  --white: #ffffff;
  --gray: #a4b0be;

  --font-code: "JetBrains Mono", monospace;
  --font-cute: "Mali", cursive;

  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
  background-color: var(--bg-color);
  color: var(--white);
  font-family: var(--font-cute);
  overflow-x: hidden;
  min-height: 100vh;
  /* Fixed: Use flex but allow scrolling nicely */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0; /* Add padding to prevent touching edges */
  
  background-image:
    radial-gradient(
      circle at 10% 20%,
      rgba(137, 207, 240, 0.1) 0%,
      transparent 20%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(255, 183, 197, 0.1) 0%,
      transparent 20%
    );
  animation: bg-pulse 10s infinite alternate;
}

/* Animations */
@keyframes bg-pulse {
  0% {
    background-size: 100% 100%;
  }
  100% {
    background-size: 110% 110%;
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes glitch {
  0% {
    text-shadow:
      2px 2px var(--secondary-pink),
      -2px -2px var(--primary-blue);
  }
  25% {
    text-shadow:
      -2px 2px var(--secondary-pink),
      2px -2px var(--primary-blue);
  }
  50% {
    text-shadow:
      2px -2px var(--secondary-pink),
      -2px 2px var(--primary-blue);
  }
  75% {
    text-shadow:
      -2px -2px var(--secondary-pink),
      2px 2px var(--primary-blue);
  }
  100% {
    text-shadow:
      2px 2px var(--secondary-pink),
      -2px -2px var(--primary-blue);
  }
}

/* Layout */
.container {
  width: 90%;
  max-width: 1200px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Terminal Window wrapper */
.terminal-window {
  background: var(--terminal-bg);
  border-radius: 15px;
  box-shadow: var(--glass-shadow);
  border: var(--glass-border);
  /* overflow: hidden;  <-- Removed to prevent cutting off content on mobile */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative; /* For toggle button positioning if needed */
}

.terminal-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 15px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red {
  background: #ff5f56;
}
.dot.yellow {
  background: #ffbd2e;
}
.dot.green {
  background: #27c93f;
}

.terminal-title {
  font-family: var(--font-code);
  color: var(--gray);
  font-size: 0.8rem;
  margin-left: 10px;
  opacity: 0.7;
}

.terminal-body {
  padding: 30px;
  position: relative;
}

/* Hero Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.profile-card {
  position: relative;
  width: 300px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--primary-blue);
  box-shadow: 0 0 15px rgba(137, 207, 240, 0.3);
  animation: float 6s ease-in-out infinite;
  text-align: center;
}

.profile-img-container {
  width: 150px;
  height: 150px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--secondary-pink);
  box-shadow: 0 0 20px var(--secondary-pink);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 2rem;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.profile-role {
  font-family: var(--font-code);
  color: var(--secondary-pink);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tag {
  background: rgba(137, 207, 240, 0.1);
  color: var(--primary-blue);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-family: var(--font-code);
  border: 1px solid rgba(137, 207, 240, 0.3);
}

.hero-console {
  flex: 1;
  min-width: 300px;
  font-family: var(--font-code);
}

.command-line {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.prompt {
  color: var(--secondary-pink) !important;
}

.delayed-show {
    opacity: 0;
    display: none;
}

/* Fix float animation conflict */
.profile-card.scale-in-center {
  display: block !important;
  animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both, float 6s ease-in-out infinite 0.5s;
}

.scale-in-center {
    display: block !important;
	-webkit-animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
	        animation: scale-in-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

@-webkit-keyframes scale-in-center {
  0% {
    -webkit-transform: scale(0);
            transform: scale(0);
    opacity: 1;
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}
@keyframes scale-in-center {
  0% {
    -webkit-transform: scale(0);
            transform: scale(0);
    opacity: 1;
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}

.command {
  color: var(--white);
}

.typewriter {
  overflow: hidden;
  border-right: 0.15em solid var(--primary-blue);
  white-space: nowrap;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-blue);
  }
}

.console-output {
  color: var(--gray);
  line-height: 1.6;
  font-size: 0.95rem;
}

.console-output h3 {
  color: var(--secondary-pink);
  margin: 15px 0 5px;
}

.console-output li {
  list-style: none;
  margin-left: 20px;
}

.console-output li::before {
  content: "> ";
  color: var(--primary-blue);
}

/* Sections */
.section-title {
  font-size: 2rem;
  text-align: center;
  margin: 40px 0 30px;
  text-shadow: 0 0 10px var(--primary-blue);
}

/* Stats */
/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Force 4 columns on Desktop */
  gap: 20px;
}

/* Mobile: 2x2 Grid "Widgets" Style */
@media (max-width: 768px) {
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Force 2 equal columns */
    gap: 12px !important;
    padding: 5px !important;
    overflow: visible !important;
  }
  
  .stats-grid::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    min-width: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 12px 8px !important; /* Compact padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 1 / 0.8; /* Make them look like widgets */
  }
  
  .stat-card h3 {
      font-size: 0.85rem !important;
      margin-bottom: 5px;
  }

  .stat-card p {
      font-size: 0.7rem !important;
      line-height: 1.2;
  }
  
  .stat-rank {
      width: 28px;
      height: 28px;
      font-size: 0.75rem;
      top: -10px;
      right: -8px;
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  position: relative;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--secondary-pink);
}

.stat-rank {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  background: var(--bg-color);
  border: 2px solid var(--secondary-pink);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: var(--secondary-pink);
  box-shadow: 0 0 10px var(--secondary-pink);
}

/* Timeline */
.timeline {
  position: relative;
  margin: 20px 0;
  padding-left: 30px;
  border-left: 2px dashed var(--gray);
}

.timeline-item {
  margin-bottom: 30px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 5px;
  width: 10px;
  height: 10px;
  background: var(--bg-color);
  border: 2px solid var(--primary-blue);
  border-radius: 50%;
}

.timeline-date {
  font-family: var(--font-code);
  color: var(--primary-blue);
  font-size: 0.85rem;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  margin-top: 5px;
}

/* Certificates in Timeline */
.cert-grid {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.cert-img {
    height: 80px;
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(0,0,0,0.2);
}

.cert-img:hover {
    transform: scale(2.5);
    z-index: 100;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-color: var(--secondary-pink);
    position: relative;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  font-size: 0.8rem;
  color: var(--gray);
}

.heart {
  color: var(--secondary-pink);
  display: inline-block;
  animation: heart-beat 1.5s infinite;
}

@keyframes heart-beat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Image Modal (Zoom) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.9); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(137, 207, 240, 0.5);
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--secondary-pink);
    text-decoration: none;
    cursor: pointer;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-family: var(--font-code);
}


/* Easter Egg / Pink Mode */
body.pink-mode {
  --bg-color: #2b1b22;
  --terminal-bg: rgba(62, 22, 43, 0.9);
  --primary-blue: #ffb7c5; /* Swap colors */
  --secondary-pink: #89cff0;
}

/* --- Theme Toggle & View Transition --- */
.theme-toggle {
    position: fixed; /* Fixed to viewport */
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 2000; /* High z-index to stay on top */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(15deg);
    border-color: var(--secondary-pink);
    color: var(--secondary-pink);
}

/* Icons state */
.moon-icon { display: none; }
body.pink-mode .sun-icon { display: none; }
body.pink-mode .moon-icon { 
    display: block; 
    fill: var(--primary-blue); /* Cute moon fill */
    stroke: none;
}
.sun-icon {
    stroke: #ffbd2e; /* Sunny yellow */
}

/* Dancing Cinnamoroll */
.cinnamoroll-stage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    z-index: 9999;
    pointer-events: none;
    display: none; /* Hidden by default */
}

.cinnamoroll-dance {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cinnamoroll-stage.active {
    display: block;
    animation: dance-pop 1s ease-in-out forwards;
}

@keyframes dance-pop {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2) rotate(10deg); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1) rotate(-10deg); }
    60% { transform: translate(-50%, -50%) scale(1.1) rotate(10deg); }
    80% { transform: translate(-50%, -50%) scale(1) rotate(-5deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
}

/* View Transition API */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px; /* More breathing room */
        width: 95%; /* Prevent full width hugging */
        gap: 25px;
    }
    
    .terminal-body {
        padding: 25px; /* More internal spacing */
    }

    .hero {
        flex-direction: column-reverse; 
        gap: 35px; /* Separate profile and console more */
    }

    .hero-console {
        width: 100%;
        min-width: 0; /* Prevention of flex overflow */
    }
    
    .console-output {
        font-size: 0.9rem; /* Slightly larger text */
        line-height: 1.7;
    }

    .profile-card {
        width: 100%;
        height: auto;
    }

    .stat-card:hover {
        transform: translateY(-2px); /* Reduce motion on touch */
    }

    .timeline {
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -26px;
    }

    .modal-content {
        width: 95%;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
    }

    /* Mobile: Simplify reveal animation */
    .scale-in-center {
        animation: fade-in-up 0.5s ease-out forwards !important;
    }
    
    @keyframes fade-in-up {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .timeline-item {
        margin-bottom: 40px; /* More space between items */
    }

    .timeline-content {
        padding: 20px; /* Roomier content box */
    }

    .timeline-date {
        margin-bottom: 10px; /* Give date some air */
        display: block;
    }
}
