/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Noto+Serif+Sinhala:wght@400;500;600;700&display=swap');

/* ===== CSS Custom Properties ===== */
:root {
  --clr-bg-deep: #060a1a;
  --clr-bg: #0a0e27;
  --clr-bg-card: rgba(15, 20, 50, 0.7);
  --clr-gold: #d4a853;
  --clr-gold-light: #f0d48a;
  --clr-gold-dark: #a07830;
  --clr-white: #f5f5f5;
  --clr-white-soft: rgba(245, 245, 245, 0.8);
  --clr-accent: #4e7cff;
  --clr-glass: rgba(255, 255, 255, 0.06);
  --clr-glass-border: rgba(255, 255, 255, 0.1);
  --clr-overlay: rgba(6, 10, 26, 0.65);

  --ff-heading: 'Inter', sans-serif;
  --ff-poem: 'Playfair Display', serif;
  --ff-sinhala: 'Noto Serif Sinhala', serif;
  --ff-body: 'Inter', sans-serif;

  --fs-hero: clamp(2.2rem, 8vw, 5rem);
  --fs-h2: clamp(1.6rem, 5vw, 2.8rem);
  --fs-h3: clamp(1.1rem, 3vw, 1.5rem);
  --fs-body: clamp(0.9rem, 2.5vw, 1.05rem);
  --fs-small: clamp(0.75rem, 2vw, 0.85rem);

  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  overflow-x: hidden;
}

body {
  font-family: var(--ff-body);
  background: var(--clr-bg-deep);
  color: var(--clr-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

/* ===== Section Base ===== */
.section {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  scroll-snap-align: start;
  overflow: hidden;
}

.section__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--clr-overlay);
}

.section__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ===== Navigation Dots ===== */
.nav-dots {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-dots__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.nav-dots__dot.active {
  background: var(--clr-gold);
  border-color: var(--clr-gold-light);
  box-shadow: 0 0 10px rgba(212, 168, 83, 0.5);
  transform: scale(1.3);
}

/* ===== SECTION 1 — Hero ===== */
#hero {
  justify-content: flex-end;
  padding-bottom: 80px;
}

#hero .section__bg {
  background-image: url('images/ruhuna-bg.jpg');
}

#hero .section__bg::after {
  background: linear-gradient(
    to top,
    rgba(6, 10, 26, 0.95) 0%,
    rgba(6, 10, 26, 0.5) 40%,
    rgba(6, 10, 26, 0.25) 70%,
    rgba(6, 10, 26, 0.15) 100%
  );
}

/* ===== SECTION 1.5 — Poem ===== */
#poem {
  padding: 0;
  justify-content: flex-start;
}

#poem .section__bg {
  background-image: url('images/science faculty entrance.png');
}

#poem .section__bg::after {
  background: rgba(6, 10, 26, 0.85); /* High opacity for readability */
}

#poem .section__content {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.poem-scroller-container {
  height: 70vh;
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  /* Fade out top and bottom for smooth scroll effect */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.poem-scroller {
  animation: scrollPoem 35s linear infinite;
}

.poem-scroller:hover {
  animation-play-state: paused;
}

.hero__logo {
  width: auto;
  height: 120px;
  object-fit: contain;
  margin-bottom: 16px;
  animation: fadeInDown 1s ease-out 0.2s both;
}

.hero__badge {
  display: inline-block;
  font-family: var(--ff-heading);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--clr-gold);
  border: 1px solid var(--clr-gold);
  padding: 6px 20px;
  border-radius: 30px;
  margin-bottom: 14px;
  animation: fadeInDown 1s ease-out 0.4s both;
}

.hero__title {
  font-family: var(--ff-heading);
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero__title span {
  display: block;
  background: linear-gradient(135deg, var(--clr-gold-light), var(--clr-gold), var(--clr-gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-family: var(--ff-heading);
  font-size: var(--fs-h3);
  font-weight: 300;
  color: var(--clr-white-soft);
  margin-bottom: 24px;
  animation: fadeInUp 1s ease-out 0.8s both;
}

.hero__poem {
  font-family: var(--ff-sinhala);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 500;
  color: var(--clr-white-soft);
  line-height: 2.2;
  max-width: 440px;
  padding: 20px 24px;
  text-align: center;
  margin: 0 auto;
}

.hero__intro {
  font-size: var(--fs-body);
  color: rgba(245, 245, 245, 0.65);
  line-height: 1.8;
  max-width: 480px;
  animation: fadeInUp 1s ease-out 1.2s both;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: bounce 2s infinite 2s;
}

.hero__scroll-hint svg {
  width: 20px;
  height: 20px;
  stroke: var(--clr-gold);
}

/* ===== SECTION 2 — Resources ===== */
#resources .section__bg {
  background: linear-gradient(135deg, #0a0e27 0%, #121940 50%, #0a0e27 100%);
}

#resources .section__bg::after {
  background: none;
}

.resources__heading {
  font-family: var(--ff-heading);
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-bottom: 8px;
}

.resources__heading span {
  color: var(--clr-gold);
}

.resources__sub {
  font-size: var(--fs-small);
  color: rgba(245, 245, 245, 0.5);
  margin-bottom: 32px;
}

.link-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 40px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--clr-glass);
  border: 1px solid var(--clr-glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.link-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--clr-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 168, 83, 0.1);
}

.link-card__icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.link-card__icon--whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
}

.link-card__icon--facebook {
  background: linear-gradient(135deg, #1877f2, #0d5bbf);
}

.link-card__icon--youtube {
  background: linear-gradient(135deg, #ff0000, #cc0000);
}

.link-card__icon--drive {
  background: linear-gradient(135deg, #4285f4, #34a853);
}

.link-card__text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.link-card__text p {
  font-size: var(--fs-small);
  color: rgba(245, 245, 245, 0.5);
}

.link-card__arrow {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.1rem;
  transition: var(--transition);
}

.link-card:hover .link-card__arrow {
  color: var(--clr-gold);
  transform: translateX(4px);
}

/* From 47th Section */
.from-seniors {
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid var(--clr-glass-border);
}

.from-seniors__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-gold);
  margin-bottom: 16px;
}

.from-seniors__label::before {
  content: '🎓';
  font-size: 1.1rem;
}

/* ===== SECTION 3 — Thurana ===== */
#thurana {
  min-height: auto;
  padding-top: 80px;
  padding-bottom: 80px;
}

#thurana .section__bg {
  background: linear-gradient(180deg, #0a0e27 0%, #0f1535 40%, #0a0e27 100%);
}

#thurana .section__bg::after {
  background: none;
}

.thurana__heading {
  font-family: var(--ff-heading);
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-bottom: 6px;
}

.thurana__heading span {
  color: var(--clr-gold);
}

.thurana__sub {
  font-size: var(--fs-small);
  color: rgba(245, 245, 245, 0.5);
  margin-bottom: 28px;
}

/* Video Players — Vertical Mobile-friendly */
.thurana__videos {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin-bottom: 28px;
}

.thurana__video-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--clr-glass-border);
  background: var(--clr-bg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.thurana__video-card video {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}

.thurana__video-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--clr-white-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thurana__video-card:hover .thurana__video-label,
.thurana__video-card:focus-within .thurana__video-label {
  opacity: 1;
}

.thurana__video-label::before {
  content: '▶';
  color: var(--clr-gold);
  font-size: 0.65rem;
}

/* Image Gallery */
.thurana__gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.thurana__gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--clr-glass-border);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.thurana__gallery-item:hover {
  border-color: var(--clr-gold);
  transform: scale(1.02);
}

.thurana__gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.thurana__gallery-item:hover img {
  transform: scale(1.08);
}

.thurana__gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
}

/* ===== SECTION 4 — Farewell ===== */
#farewell .section__bg {
  background: linear-gradient(180deg, #0a0e27 0%, #12183a 50%, #0a0e27 100%);
}

#farewell .section__bg::after {
  background: none;
}

.farewell__collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}

.farewell__collage-item {
  aspect-ratio: 1;
  overflow: hidden;
}

.farewell__collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
  filter: brightness(0.85);
}

.farewell__collage-item:hover img {
  filter: brightness(1);
  transform: scale(1.1);
}

.farewell__collage-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.farewell__heading {
  font-family: var(--ff-heading);
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-bottom: 8px;
}

.farewell__heading span {
  color: var(--clr-gold);
}

.farewell__message {
  font-family: var(--ff-poem);
  font-size: var(--fs-body);
  color: var(--clr-white-soft);
  line-height: 1.9;
  max-width: 480px;
  margin-bottom: 24px;
}

.farewell__wish {
  font-family: var(--ff-heading);
  font-size: var(--fs-h3);
  font-weight: 700;
  background: linear-gradient(135deg, var(--clr-gold-light), var(--clr-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 28px;
}

.farewell__footer {
  font-size: var(--fs-small);
  color: rgba(245, 245, 245, 0.3);
  padding-top: 20px;
  border-top: 1px solid var(--clr-glass-border);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Scroll Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===== Keyframes ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  60% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes scrollPoem {
  0% { transform: translateY(100vh); }
  100% { transform: translateY(-120%); }
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .section {
    padding: 80px 40px;
  }

  .section__content {
    max-width: 700px;
  }

  .link-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .thurana__gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .farewell__collage {
    max-width: 500px;
  }

  .nav-dots {
    right: 24px;
  }
}
