/* =========================================================
   Sangeet Shraavana — Custom CSS
   Design tokens + treatments Tailwind utilities can't express
   ========================================================= */

:root {
  --color-ink: #0a0f2b;          /* deep cosmic navy — night sky */
  --color-ivory: #eef3fb;        /* icy moonlight white */
  --color-wine: #1e3a76;         /* mystical royal blue — Shiva's hue */
  --color-gold: #d9a441;         /* trishul gold */
  --color-amber: #e8b64f;        /* ember flame amber */
  --color-ember: #d9702f;        /* fire ember orange */
  --color-muted: #57678a;        /* cool blue-grey */

  --gradient-signature: linear-gradient(115deg, var(--color-ink) 0%, var(--color-wine) 32%, var(--color-gold) 68%, var(--color-amber) 88%, var(--color-ember) 100%);
  --gradient-signature-soft: linear-gradient(115deg, rgba(10, 15, 43, 0.14) 0%, rgba(30, 58, 118, 0.14) 32%, rgba(217, 164, 65, 0.14) 68%, rgba(232, 182, 79, 0.14) 88%, rgba(217, 112, 47, 0.14) 100%);

  /* Shadow system: a quiet resting shadow, and a deeper, warm-tinted shadow on hover */
  --shadow-rest: 0 1px 2px rgba(10, 15, 43, 0.08), 0 6px 16px -4px rgba(10, 15, 43, 0.14);
  --shadow-hover: 0 8px 12px -4px rgba(30, 58, 118, 0.22), 0 24px 48px -12px rgba(10, 15, 43, 0.4);
  --shadow-hover-soft: 0 6px 10px -3px rgba(217, 164, 65, 0.28), 0 16px 32px -10px rgba(10, 15, 43, 0.3);
  --shadow-modal: 0 25px 60px -12px rgba(10, 15, 43, 0.5);

  --font-display: 'Bellefair', serif;
  --font-body: 'Poppins', sans-serif;
  --font-kannada: 'Noto Sans Kannada', sans-serif;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-ivory);
}

.font-display {
  font-family: var(--font-display);
}

.font-kannada {
  font-family: var(--font-kannada);
}

/* ---------- Signature gradient text & elements ---------- */

.gradient-text {
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gradient-line {
  height: 2px;
  background: var(--gradient-signature);
  border: none;
}

.gradient-ring {
  background: var(--gradient-signature);
  padding: 3px;
  border-radius: 9999px;
}

.gradient-bg {
  background: var(--gradient-signature);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-ivory);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-family: var(--font-body);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Focus states (accessible, visible) ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header ---------- */

.site-header {
  backdrop-filter: blur(10px);
  transition: background-color 300ms ease, box-shadow 300ms ease, padding 300ms ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-rest);
}

.nav-link {
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-signature);
  transition: width 250ms ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.nav-link.is-active {
  color: var(--color-wine);
}

/* ---------- Hero slider ---------- */

.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms ease;
  position: absolute;
  inset: 0;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

.hero-indicator {
  width: 28px;
  height: 3px;
  background: rgba(250, 246, 238, 0.35);
  transition: background 250ms ease, width 250ms ease;
}

.hero-indicator.is-active {
  background: var(--color-amber);
  width: 44px;
}

.hero-glow {
  background: radial-gradient(circle at 65% 40%, rgba(232, 182, 79, 0.35), transparent 60%);
}

/* ---------- Course cards (premium layered 3D card) ---------- */

.course-card {
  position: relative;
  border-radius: 1.75rem;
  overflow: hidden;
  background: var(--color-ink);
  box-shadow: var(--shadow-rest);
  transform-style: preserve-3d;
  perspective: 1200px;
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 450ms ease;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--gradient-signature);
  opacity: 0;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 3;
}

.course-card:hover {
  transform: perspective(1200px) rotateX(3deg) rotateY(-3deg) translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.course-card:hover::before {
  opacity: 1;
}

.course-card-media {
  position: relative;
  height: 13rem;
  overflow: hidden;
}

.course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}

.course-card:hover .course-card-media img {
  transform: scale(1.08);
}

.course-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 15, 43, 0) 55%, var(--color-ink) 100%);
}

.course-card-icon-badge {
  position: absolute;
  left: 1.5rem;
  bottom: -1.6rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 9999px;
  background: var(--gradient-signature);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hover-soft);
  border: 3px solid var(--color-ink);
  z-index: 4;
  transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.course-card:hover .course-card-icon-badge {
  transform: translateY(-4px) rotate(-8deg) scale(1.06);
}

.course-card-icon-badge svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-ivory);
}

.course-card-body {
  position: relative;
  padding: 2.5rem 1.5rem 1.5rem;
}

.course-card-level {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  border: 1px solid rgba(217, 164, 65, 0.45);
  color: var(--color-amber);
  transition: background 250ms ease, color 250ms ease;
}

.course-card:hover .course-card-level {
  background: rgba(217, 164, 65, 0.12);
}

/* ---------- Faculty portraits ---------- */

.faculty-ring {
  padding: 4px;
  border-radius: 9999px;
  background: var(--gradient-signature);
}

.faculty-ring img {
  border: 4px solid var(--color-ivory);
  border-radius: 9999px;
}

/* ---------- Testimonial quote mark ---------- */

.quote-mark {
  font-family: var(--font-display);
  line-height: 0.6;
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Gallery lightbox ---------- */

.lightbox-overlay {
  background: rgba(10, 15, 43, 0.94);
}

/* Detail modal card (blog/event popups) */
#detail-modal > div {
  box-shadow: var(--shadow-modal);
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
  transition: box-shadow 350ms ease;
}

.gallery-item:hover {
  box-shadow: var(--shadow-hover-soft);
}

.gallery-item img {
  transition: transform 500ms ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

/* ---------- Scroll reveal (fade + rise, with subtle 3D tilt) ---------- */

.reveal {
  opacity: 0;
  transform: perspective(1000px) translateY(36px) rotateX(6deg);
  transform-origin: bottom center;
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1), transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: perspective(1000px) translateY(0) rotateX(0deg);
}

/* staggered children within a revealing group */
.reveal-stagger > * {
  opacity: 0;
  transform: perspective(1000px) translateY(30px) rotateX(6deg);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: perspective(1000px) translateY(0) rotateX(0deg);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 360ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 450ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 3D hover tilt (cards, portraits, panels) ---------- */

.tilt-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  box-shadow: var(--shadow-rest);
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 350ms ease;
}

.tilt-3d:hover {
  transform: perspective(1000px) rotateX(4deg) rotateY(-4deg) translateY(-6px) translateZ(10px);
  box-shadow: var(--shadow-hover);
}

@media (prefers-reduced-motion: reduce) {
  .tilt-3d:hover {
    transform: none;
    box-shadow: var(--shadow-hover);
  }
}

/* ---------- General shadow utility (non-3D elements: buttons, badges, tiles) ---------- */

.shadow-rest {
  box-shadow: var(--shadow-rest);
  transition: box-shadow 300ms ease, transform 250ms ease;
}

.shadow-rest:hover {
  box-shadow: var(--shadow-hover-soft);
}

/* Buttons: any pill or badge painted with the signature gradient */
.gradient-bg.rounded-full,
.gradient-bg.rounded-lg {
  box-shadow: var(--shadow-rest);
  transition: box-shadow 300ms ease, transform 250ms ease, opacity 250ms ease;
}

.gradient-bg.rounded-full:hover,
.gradient-bg.rounded-lg:hover {
  box-shadow: var(--shadow-hover-soft);
  transform: translateY(-2px);
}

/* Secondary (ivory) buttons, e.g. CTA band actions */
.btn-shadow {
  box-shadow: var(--shadow-rest);
  transition: box-shadow 300ms ease, transform 250ms ease;
}

.btn-shadow:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ---------- Page hero banner (inner pages) ---------- */

.page-hero {
  background:
    linear-gradient(to bottom, rgba(10, 15, 43, 0.5), rgba(10, 15, 43, 0.82)),
    url("../assets/images/decor/page-title-banner.jpg");
  background-size: cover;
  background-position: center 40%;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(217, 164, 65, 0.22), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 118, 0.28), transparent 55%);
}

/* ---------- Back to top ---------- */

#back-to-top {
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease, transform 200ms ease;
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-3px);
}

/* ---------- Background music toggle ---------- */

.music-toggle {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ivory);
  background: var(--gradient-signature);
  box-shadow: var(--shadow-rest);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.music-toggle:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover-soft);
}

.music-toggle:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
}

.music-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.music-bars i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.music-toggle.is-playing .music-bars i {
  animation: music-bar 1s ease-in-out infinite;
}
.music-toggle.is-playing .music-bars i:nth-child(1) { animation-delay: -0.6s; }
.music-toggle.is-playing .music-bars i:nth-child(2) { animation-delay: -0.2s; }
.music-toggle.is-playing .music-bars i:nth-child(3) { animation-delay: -0.8s; }
.music-toggle.is-playing .music-bars i:nth-child(4) { animation-delay: -0.4s; }

@keyframes music-bar {
  0%, 100% { height: 5px; }
  50%      { height: 18px; }
}

/* Not playing: bars sit flat with a slash through them */
.music-toggle:not(.is-playing)::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1.5px rgba(10, 15, 43, 0.55);
}

/* Waiting for the first tap: a soft ring invites it */
.music-toggle.is-waiting {
  animation: music-invite 2.4s ease-out infinite;
}

@keyframes music-invite {
  0%   { box-shadow: var(--shadow-rest), 0 0 0 0 rgba(232, 182, 79, 0.55); }
  70%  { box-shadow: var(--shadow-rest), 0 0 0 14px rgba(232, 182, 79, 0); }
  100% { box-shadow: var(--shadow-rest), 0 0 0 0 rgba(232, 182, 79, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .music-toggle.is-playing .music-bars i { animation: none; height: 12px; }
  .music-toggle.is-waiting { animation: none; }
}

/* ---------- FAQ / accordion ---------- */

.accordion-icon {
  transition: transform 250ms ease;
}

.accordion-item[data-open="true"] .accordion-icon {
  transform: rotate(45deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms ease;
}

/* ---------- Form states ---------- */

.form-error {
  display: none;
}

.form-error.is-visible {
  display: block;
}

.field-invalid {
  border-color: var(--color-wine) !important;
}

/* ---------- Mobile nav ---------- */

#mobile-nav {
  transform: translateX(100%);
  transition: transform 350ms ease;
}

#mobile-nav.is-open {
  transform: translateX(0);
}

/* ---------- Floating music-note decoration (auto-moving, all sections) ---------- */

.decor-host {
  position: relative;
}

.decor-notes {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.decor-note {
  position: absolute;
  top: 112%;
  color: var(--color-gold);
  opacity: 0;
  animation-name: decor-rise;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: top, transform, opacity;
}

@keyframes decor-rise {
  0%   { top: 112%;  transform: translateX(0) rotate(-6deg);                      opacity: 0; }
  10%  { opacity: 0.18; }
  50%  { transform: translateX(var(--decor-sway, 14px)) rotate(7deg); }
  90%  { opacity: 0.18; }
  100% { top: -14%;  transform: translateX(calc(var(--decor-sway, 14px) * -1)) rotate(-5deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .decor-notes {
    display: none;
  }
}

/* ---------- Instrument corner decoration (every section, bottom-right) ---------- */

.decor-corner {
  position: absolute;
  right: 10px;
  bottom: -22px;
  width: clamp(110px, 16vw, 220px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  transform: rotate(-6deg);
  filter: drop-shadow(0 12px 20px rgba(10, 15, 43, 0.25));
}

.decor-corner img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .decor-corner {
    width: clamp(80px, 26vw, 130px);
    right: -16px;
    bottom: -14px;
  }
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-course-filter].is-active,
[data-gallery-filter].is-active {
  background: var(--gradient-signature);
  color: var(--color-ivory);
  border-color: transparent;
}
