@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@1,400&display=swap');

:root {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --muted: #888888;
  --stroke: #1f1f1f;
  --font-display: 'Instrument Serif', serif;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 999999 !important;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.loading-label {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0;
  transform: translateY(-20px);
}

@media (min-width: 768px) {
  .loading-label {
    top: 3rem;
    left: 3rem;
    font-size: 0.875rem;
  }
}

.rotating-words {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-wrapper {
  position: relative;
  height: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word {
  position: absolute;
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(245, 245, 245, 0.8);
  font-size: 2.25rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
}

@media (min-width: 768px) {
  .word { font-size: 3.75rem; }
}

@media (min-width: 1024px) {
  .word { font-size: 4.5rem; }
}

.loading-counter {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  font-family: var(--font-display);
  color: var(--text);
  font-size: 3.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(20px);
}

@media (min-width: 768px) {
  .loading-counter {
    bottom: 3rem;
    right: 3rem;
    font-size: 5rem;
  }
}

@media (min-width: 1024px) {
  .loading-counter { font-size: 7rem; }
}

.loading-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: rgba(31, 31, 31, 0.5);
}

.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #89AACC 0%, #4E85BF 100%);
  box-shadow: 0 0 8px rgba(137, 170, 204, 0.35);
  transform-origin: left;
  transition: transform 0.1s linear;
}

/* Page content fade-in */
.main-page-content {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.main-page-content.is-loaded {
  opacity: 1;
}
