/* ==========================================================================
   VIGNAN MAHOTSAV 2027 - FULLSCREEN POSTER & COUNTDOWN TIMER
   ========================================================================== */

@font-face {
  font-family: 'Artographie Black';
  src: url('fonts/ArtographieBlack-PERSONAL_USE.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gangs of Three';
  src: url('fonts/GangsOfThree.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mahotsav Mirza';
  src: url('fonts/Mirza-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mahotsav Mirza';
  src: url('fonts/Mirza-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mahotsav Mirza';
  src: url('fonts/Mirza-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mahotsav Mirza';
  src: url('fonts/Mirza-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background-color: #000;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   PULL-TO-REFRESH INDICATOR (Mobile View)
   ========================================================================== */
.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 10, 6, 0.94);
  border: 1.5px solid rgba(212, 163, 115, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 183, 3, 0.35);
  color: #f7e7ce;
  padding: 7px 18px;
  border-radius: 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.12s ease-out;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pull-refresh-indicator.visible {
  opacity: 1;
}

.pull-refresh-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffb703;
  transition: transform 0.12s ease-out;
}

.pull-refresh-icon svg {
  display: block;
}

.pull-refresh-indicator.refreshing .pull-refresh-icon svg {
  animation: spin-pull-refresh 0.75s linear infinite;
}

@keyframes spin-pull-refresh {
  100% {
    transform: rotate(360deg);
  }
}

/* Video preloader: the poster remains visible while the video buffers. */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #170504;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.preloader.is-finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-fallback,
.preloader-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preloader-fallback {
  background: #170504;
}

.preloader-video {
  display: block;
  object-fit: cover;
  /* Slightly crop the lower edge to keep the generated sparkle out of view. */
  transform: scale(1.2) translate3d(0, 0, 0);
  transform-origin: center top;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.preloader.is-ready .preloader-video {
  opacity: 1;
}

/*
   Fill the available width while keeping the poster and countdown within
   the visible viewport.
*/
.poster-container {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* Preserve the artwork's proportions and keep its header visible. */
.poster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.mobile-branding {
  display: none;
}

/* ==========================================================================
   COUNTDOWN TIMER OVERLAY - EXACT MATCH & RESPONSIVE PLACEMENT
   ========================================================================== */
.countdown-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 6.5%;
  width: min(48%, 600px);
  min-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: auto;
}

/* Top Header: —— ✦ EVENT STARTS IN ✦ —— */
.timer-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.8vh;
}

.line-wing {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(220, 175, 125, 0.6) 40%, rgba(220, 175, 125, 0.9) 100%);
}

.line-wing.right {
  background: linear-gradient(90deg, rgba(220, 175, 125, 0.9) 0%, rgba(220, 175, 125, 0.6) 60%, transparent 100%);
}

.title-center {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.8rem;
  white-space: nowrap;
}

.diamond-sparkle {
  color: #ffeedb;
  font-size: 0.85rem;
  filter: drop-shadow(0 0 5px rgba(255, 200, 120, 0.9));
  line-height: 1;
}

.title-text {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 1.1vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.35rem;
  color: #f7e7ce;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

/* 4 Rounded Digit Cards */
.digits-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 0.8vw, 0.9rem);
  width: 100%;
  margin-bottom: 0.8vh;
}

.digit-card {
  background: rgba(18, 7, 4, 0.85);
  border: 1.5px solid rgba(212, 163, 115, 0.55);
  border-radius: clamp(8px, 0.8vw, 14px);
  padding: clamp(0.5rem, 0.8vw, 0.9rem) 0.3rem clamp(0.4rem, 0.6vw, 0.7rem) 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px 2px rgba(255, 230, 180, 0.2),
    0 8px 25px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.digit-card:hover {
  border-color: rgba(255, 183, 3, 0.9);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 3px rgba(255, 230, 180, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.9),
    0 0 15px rgba(255, 183, 3, 0.3);
}

.number-val {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.8rem, 2.7vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.95),
    0 0 15px rgba(255, 200, 100, 0.35);
  letter-spacing: 0.05rem;
}

.unit-label {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.6rem, 0.75vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.18rem;
  color: #e5a96a;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* Bottom Footer: —— IDEAS ✦ PEOPLE ✦ POSSIBILITIES —— */
.timer-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.motto-text {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 0.9vw, 1rem);
  padding: 0 0.8rem;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.62rem, 0.78vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.22rem;
  color: #d4a373;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.diamond-dot {
  color: #d4a373;
  font-size: 0.55rem;
  opacity: 0.85;
}

/* Floating Fullscreen button in top right */
.fullscreen-btn {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  background: rgba(20, 8, 4, 0.65);
  border: 1px solid rgba(212, 163, 115, 0.4);
  color: #f7e7ce;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  opacity: 0.4;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fullscreen-btn:hover {
  opacity: 1;
  background: rgba(35, 14, 7, 0.9);
  border-color: #ffb703;
  color: #ffb703;
}

/* ==========================================================================
   MOBILE & PORTRAIT SCREEN ADJUSTMENTS (e.g. 1080x2340, phones, portrait tablets)
   ========================================================================== */
@media (orientation: portrait), (max-width: 1024px) {

  /* Ensure preloader video covers mobile/tablet screen cleanly without desktop scaling */
  .preloader-video {
    transform: translate3d(0, 0, 0);
    object-fit: cover;
    will-change: opacity;
  }

  .mobile-branding {
    position: absolute;
    top: max(0.75rem, env(safe-area-inset-top));
    left: 0;
    z-index: 5;
    display: flex;
    width: 100%;
    padding: 0 0.85rem;
    flex-direction: column;
    align-items: center;
    color: #260b0a;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
  }

  .mobile-logo-row {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .mobile-logo-group {
    display: flex;
    align-items: center;
    gap: clamp(0.55rem, 1.2vw, 1rem);
  }

  .mobile-vignan-logo,
  .mobile-edition-logo,
  .mobile-university-logo {
    display: block;
    width: auto;
    object-fit: contain;
  }

  .mobile-vignan-logo {
    margin-top: -30px;
    height: clamp(80px, 12vw, 120px);
    max-width: 40vw;
  }

  .mobile-edition-logo {
    height: clamp(2.35rem, 6vw, 3.8rem);
  }

  .mobile-university-logo {
    height: clamp(2.7rem, 7vw, 4.5rem);
    max-width: 43vw;
  }

  .mobile-event-type {
    margin-top: clamp(0.4rem, 1.8vw, 0.75rem);
    font-family: 'Mahotsav Mirza', Georgia, serif;
    font-size: clamp(0.9rem, 2.8vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-event-name {
    display: flex;
    margin-top: clamp(0.35rem, 1.8vw, 0.7rem);
    width: 100%;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .mobile-vignan-word {
    margin-right: clamp(0.12rem, 0.7vw, 0.28rem);
    font-family: 'Artographie Black', Impact, sans-serif;
    /* Six vertical letters together match the Mahotsav capital height. */
    font-size: clamp(0.48rem, 1.5vw, 0.85rem);
    font-weight: 900;
    line-height: 0.8;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    flex-shrink: 0;
  }

  .mobile-event-name h1 {
    margin: 0;
    min-width: 0;
    font-family: 'Gangs of Three', Impact, sans-serif;
    font-size: clamp(2rem, 8.5vw, 4.8rem);
    font-weight: 400;
    line-height: 0.8;
    letter-spacing: -0.035em;
    white-space: nowrap;
    text-shadow: 0.06em 0.08em 0 #ffd664;
    overflow: hidden;
  }

  .mobile-event-details {
    margin-top: clamp(0.45rem, 2vw, 0.8rem);
    font-family: 'Mahotsav Mirza', Georgia, serif;
    width: 100%;
    font-size: clamp(0.9rem, 2.8vw, 1.65rem);
    font-weight: 600;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-event-details span {
    display: inline-block;
    margin: 0 0.12em;
  }

  .countdown-overlay {
    width: min(92%, 580px);
    min-width: unset;
    bottom: 5%;
  }

  .title-text {
    font-size: clamp(0.75rem, 1.4vw, 1.05rem);
    letter-spacing: clamp(0.15rem, 0.35vw, 0.28rem);
  }

  .number-val {
    font-size: clamp(1.5rem, 3.8vw, 2.6rem);
  }

  .unit-label {
    font-size: clamp(0.55rem, 0.9vw, 0.78rem);
    letter-spacing: 0.1rem;
  }

  .motto-text {
    font-size: clamp(0.55rem, 0.9vw, 0.8rem);
    letter-spacing: clamp(0.1rem, 0.2vw, 0.18rem);
    gap: clamp(0.4rem, 0.9vw, 0.85rem);
  }

  .digits-container {
    gap: clamp(0.35rem, 0.9vw, 0.75rem);
  }

  .digit-card {
    border-radius: clamp(6px, 1vw, 12px);
    padding: clamp(0.4rem, 0.9vw, 0.8rem) clamp(0.2rem, 0.5vw, 0.5rem);
  }
}