/* style.css - Adapted for school theme, toned down pink to more neutral blues/greys for professionalism */

/* =========================
   CSS CUSTOM PROPERTIES
========================= */
:root {
  /* Updated Color Palette for Dark Theme */
  --primary: #60a5fa;
  --primary-light: #93c5fd;
  --primary-dark: #2563eb;
  --background: #0f172a;
  --surface: rgba(30, 41, 59, 0.8);
  --surface-solid: #1e293b;
  --text: #f8fafc;
  --text-light: #cbd5e1;
  --border: #334155;
  
  /* Updated Shadows for Dark Theme */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Font Sizes */
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;

  /* Border Radius */
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

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

/* Falling shapes */
.shape {
  position: absolute;
  top: -100px;
  background: rgba(255, 255, 255, 0.1);
  animation: fall-spin linear infinite;
  z-index: -1;
  backdrop-filter: blur(3px);
}

@keyframes fall-spin {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Shape variations */
.shape:nth-child(4n + 1) {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.shape:nth-child(4n + 2) {
  clip-path: circle(50% at 50% 50%);
}

.shape:nth-child(4n + 3) {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.shape:nth-child(4n + 4) {
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background-color: var(--background);
  line-height: 1.5;
  position: relative;
  overflow: auto;
  background-image: url("./backround.svg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: rgba(29, 29, 29, 0.8);
  background-blend-mode: multiply;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

/* Navigation */
.nav {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-inner {
  height: auto;
  display: flex;
  align-items: center;
}

.nav-inner {
  height: 70px;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.logo:hover {
  opacity: 1;
  background-color: rgba(96, 165, 250, 0.1);
}

/* Hero Section */
.hero {
  padding: var(--spacing-xl) 0;
}

.hero-card {
  background-color: var(--surface);
  border-radius: 1rem;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
  backdrop-filter: blur(8px);
}

.avatar-container {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.avatar-halo {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--primary-light));
  opacity: 0.1;
}

.tag-row {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-sm);
}

.tag {
  background-color: var(--primary-dark);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  color: var(--text);
}

.hero-description {
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

/* Sections */
.section-animate {
  padding: var(--spacing-xl) 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: var(--spacing-lg);
  color: var(--text);
}

/* Links Grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.link-card {
  background-color: var(--surface);
  padding: var(--spacing-md);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background-color: rgba(51, 65, 85, 0.9);
  border-color: var(--primary);
}

.link-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

/* Footer */
.footer {
  background-color: var(--surface-solid);
  border-top: 1px solid var(--border);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
}

/* Music Control */
.music-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.music-button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.2s;
  padding: 8px;
}

.music-button:hover {
  transform: scale(1.1);
}

.music-button.playing {
  background: var(--primary-light);
}

.volume-control {
  width: 100px;
  display: none;
}

.music-control:hover .volume-control {
  display: block;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* When music is playing, overlay music-note icons on falling shapes */
body.music-playing .shape::before {
  content: "♪";
  position: absolute;
  color: var(--primary-light);
  font-size: 1.5rem;
  opacity: 0.6;
}

/* Landing Overlay */
.landing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Make GIF transparent areas render over black (not the page behind) */
  background-color: #000;
  /* Full-bleed animated GIF background; gradient overlay keeps text readable */
  background-image: linear-gradient(135deg, rgba(8,10,20,0.55), rgba(10,12,24,0.65)), url('startpage.gif');
  background-size: cover;
  background-position: center center;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-in-out;
}

.landing-content {
  text-align: center;
  color: white;
  padding: var(--spacing-xl);
  max-width: 900px;
  position: relative; /* allow absolute children like .landing-progress to position relative to this */
}

/* Simple prose spacing for reflection content */
.prose p {
  margin-top: 0.6rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.prose h3 {
  margin-top: 1.1rem;
}

.landing-logo-text {
  font-size: var(--font-3xl);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  display: block;
}

.landing-subtitle {
  font-size: var(--font-lg);
  margin-bottom: var(--spacing-xl);
  opacity: 0.9;
}

.landing-hint {
  font-size: var(--font-sm);
  opacity: 0.7;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Landing spinner (shown when user attempts to enter before page load) */
.landing-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.12);
  border-top-color: var(--primary);
  animation: spin 950ms linear infinite;
  margin: 16px auto 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.landing-spinner-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Landing progress bar (hidden when page ready) */
.landing-progress {
  position: fixed; /* position relative to the viewport so it always sits low on screen */
  left: 50%;
  transform: translateX(-50%);
  bottom: 12vh; /* move lower on the screen */
  width: 320px;
  max-width: 88%;
  height: 14px;
  background: rgba(255,255,255,0.12); /* stronger contrast */
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  box-sizing: border-box;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  z-index: 1100; /* above most overlay content */
}

.landing-progress-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 220ms ease;
  width: 0%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45) inset;
}

.landing-progress-text {
  font-size: 0.85rem;
  color: #fff;
  margin-left: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.landing-overlay.hide-gif {
  /* Remove background-image to stop the GIF after dismissal (keeping gradient as fallback) */
  background-image: linear-gradient(135deg, rgba(8,10,20,0.55), rgba(10,12,24,0.65));
}

/* Variant for cat GIF overlays used on other pages (non-clickable auto overlays) */
.landing-overlay.cat {
  background-color: #000; /* ensure transparent GIF pixels show black */
  background-image: linear-gradient(135deg, rgba(8,10,20,0.65), rgba(10,12,24,0.75)), url('cat.gif');
  background-size: cover;
  background-position: center center;
}

/* Hide the click hint for auto overlays */
.landing-overlay.auto .landing-hint,
.landing-overlay.auto .landing-logo { /* keep logo but hide hint if desired */
  display: none;
}

/* Grade Cards */
.grade-image {
  width: 100%;
  height: 160px;
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius);
  overflow: hidden;
}

.grade-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

/* About Section Boxes */

/* Content Cards for Grade Details */
.content-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.content-card h3 {
  color: var(--text-title);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.content-card p {
  color: var(--text-body);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.content-card ul {
  list-style-type: none;
  padding-left: 0;
}

.content-card ul li {
  color: var(--text-body);
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.content-card ul li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}

.card-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  margin-top: 1rem;
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}

.card-link:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Project Grid Layout */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.about-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

.about-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.quote-box {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.quote-icon {
  font-size: 2rem;
  opacity: 0.2;
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
}

.quote {
  font-size: var(--font-lg);
  font-style: italic;
  margin: var(--spacing-md) 0;
  position: relative;
  padding-left: var(--spacing-md);
}

.quote-author {
  font-size: var(--font-sm);
  opacity: 0.8;
  text-align: right;
  margin-top: var(--spacing-sm);
}

.countdown-box {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.countdown {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--text);
  font-family: 'Roboto Mono', monospace;
  letter-spacing: 2px;
}

.countdown-label {
  display: block;
  font-size: var(--font-sm);
  color: var(--text-light);
  margin-top: var(--spacing-xs);
  letter-spacing: normal;
}

.intro-box {
  background: var(--surface);
}

.about-box-title {
  font-size: var(--font-xl);
  margin-bottom: var(--spacing-sm);
  color: var(--text);
}

.about-text {
  color: var(--text-light);
  line-height: 1.6;
}

/* Background and shapes */
.shape {
  position: absolute;
  top: -100px;
  background: rgba(42, 41, 41, 0.432);
  animation: fall-spin linear infinite;
  z-index: -1;
}

/* Shape variations */
.shape:nth-child(1) {
  left: 5%;
  width: 40px;
  height: 40px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  animation-duration: 4s;
  animation-delay: 0s;
}

.shape:nth-child(2) {
  left: 20%;
  width: 70px;
  height: 70px;
  clip-path: circle(50% at 50% 50%);
  animation-duration: 6s;
  animation-delay: 2s;
}

.shape:nth-child(3) {
  left: 35%;
  width: 50px;
  height: 50px;
  clip-path: ellipse(50% 35% at 50% 50%);
  animation-duration: 5s;
  animation-delay: 1s;
}

.shape:nth-child(4) {
  left: 50%;
  width: 80px;
  height: 80px;
  clip-path: polygon(50% 0%, 90% 35%, 75% 100%, 25% 100%, 10% 35%);
  animation-duration: 7s;
  animation-delay: 3s;
}

.shape:nth-child(5) {
  left: 65%;
  width: 60px;
  height: 60px;
  clip-path: inset(0% 0% 0% 0% round 15%);
  animation-duration: 4.5s;
  animation-delay: 1.5s;
}

/* Animation for falling and spinning */
@keyframes fall-spin {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(60vh) rotate(180deg) scale(1.2);
  }
  80% {
    opacity: 0;
  }
  100% {
    transform: translateY(120vh) rotate(360deg) scale(1);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-card {
    flex-direction: column;
    text-align: center;
  }
  
  .tag-row {
    justify-content: center;
  }
  
  .footer-content {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .quote {
    font-size: var(--font-base);
  }
  
  .countdown {
    font-size: var(--font-xl);
    letter-spacing: 1px;
  }
}

/* Ripple effect for clicks */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transform: scale(0);
  pointer-events: none;
  animation: ripple-anim 900ms ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes ripple-anim {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* Small press animation for interactive elements */
.animate-press {
  transform: translateY(2px) scale(0.995);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow-sm);
}

/* Toast notification */
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.9);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 9999;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
  pointer-events: auto;
}

/* Landing overlay waiting state */
.landing-overlay.waiting {
  cursor: progress;
  opacity: 0.98;
}

/* Background click pulse/hue animation */
.bg-scene {
  transition: transform 500ms ease, filter 500ms ease;
}

.bg-scene.bg-click {
  animation: bg-pulse 700ms ease-out forwards;
}

@keyframes bg-pulse {
  0% {
    transform: scale(1) translateZ(0);
    filter: hue-rotate(0deg) saturate(1);
    opacity: 1;
  }
  30% {
    transform: scale(1.02) translateZ(0);
    filter: hue-rotate(6deg) saturate(1.06);
    opacity: 0.98;
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: hue-rotate(0deg) saturate(1);
    opacity: 1;
  }
}

/* Landing GIF */
.landing-gif {
  display: block;
  margin: 18px auto 8px auto;
  max-width: 420px;
  width: calc(80vw);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform-origin: center;
  animation: gif-enter 900ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes gif-enter {
  from { opacity: 0; transform: scale(0.96); filter: blur(2px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}

@media (max-width: 480px) {
  .landing-gif { max-width: 320px; }
}