@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('data:font/woff2;base64,') format('woff2');
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: linear-gradient(145deg, #0c0d11, #181b23);
  color: #e0e0e0;
  min-height: 100vh;
  text-align: center;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  will-change: scroll-position;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(90, 200, 250, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(90, 200, 250, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 20px;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(20, 20, 25, 0.75);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: padding 0.3s ease, gap 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

header .logo-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  gap: 20px;
  position: relative;
}

header .logo-container > div:first-child {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
  grid-column: 2;
  position: relative;
  z-index: 1;
}

header .logo-container #clock-container {
  grid-column: 3;
  justify-self: end;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  text-align: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  width: clamp(50px, 18vw, 100px);
  height: auto;
  object-fit: contain;
  animation: spin 3s linear infinite;
  transition: transform 0.3s ease;
  will-change: transform;
}

.logo:hover {
  transform: rotate(5deg) scale(1.05);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

h1 {
  font-size: 2.8em;
  color: #5ac8fa;
  font-weight: 700;
}

h2 {
  font-weight: 400;
  font-size: 1.3em;
  color: #c0c0c0;
  min-height: 1.5em;
  position: relative;
  font-family: 'Montserrat', sans-serif;
}

#random-phrase::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.logo-container > div:first-child {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.logo-container > div:first-child > div {
  max-width: 300px;
}

#random-phrase {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: inline-block;
  font-weight: normal;
  font-size: 1rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: clip;
}

nav {
  display: flex;
  justify-content: center;
  gap: 25px;
  background: rgba(22, 23, 27, 0.8);
  padding: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(15px) saturate(180%);
  transition: box-shadow 0.3s ease;
}

nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  will-change: transform, background-color;
  position: relative;
  z-index: 1;
}

nav a:hover {
  background: rgba(90, 200, 250, 0.2);
  color: #5ac8fa;
  box-shadow: 0 4px 20px rgba(90, 200, 250, 0.3), 0 0 0 1px rgba(90, 200, 250, 0.2);
  transform: translateY(-3px) scale(1.05);
}

.carousel-section {
  margin: 3rem auto;
  max-width: 1100px;
  text-align: center;
  color: #fff;
  font-family: system-ui, sans-serif;
  position: relative;
  z-index: 1;
}

.carousel-section h2,
.updates-section h2 {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #58b4ff;
  letter-spacing: 0.03em;
  text-shadow: 0 0 10px rgba(90, 200, 250, 0.3);
}

.updates-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.updates-carousel {
  border-radius: 20px;
  background: linear-gradient(145deg, #0e1014, #171a21);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.updates-carousel:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
}

.update-slide-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.update-slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.updates-carousel:hover .update-slide-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.update-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 30px;
}

.update-slide-text {
  color: #fff;
  font-size: 1.8em;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-family: 'Montserrat', sans-serif;
  animation: slideTextPulse 2s ease-in-out infinite;
}

@keyframes slideTextPulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-5px); }
}

.cinematic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cinematicFadeIn 0.5s ease;
  isolation: isolate;
}

@keyframes cinematicFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cinematic-exit {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 100000;
}

.cinematic-exit:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1) rotate(90deg);
}

.cinematic-content {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
}

.cinematic-image {
  width: 50%;
  height: 100vh;
  object-fit: cover;
  transform: perspective(1000px) rotateY(-15deg) translateX(-10%);
  filter: brightness(1.1);
}

.cinematic-description {
  width: 50%;
  height: 100vh;
  background: #000;
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  transform: perspective(1000px) rotateY(5deg);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8);
}

.cinematic-description h3 {
  font-size: 3em;
  margin-bottom: 20px;
  color: #5ac8fa;
  text-shadow: 0 0 20px rgba(90, 200, 250, 0.5);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.cinematic-description p {
  font-size: 1.3em;
  line-height: 1.8;
  color: #e0e0e0;
  max-width: 90%;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.cinematic-nav {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100000;
}

.cinematic-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.cinematic-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.cinematic-counter {
  color: #fff;
  font-size: 1.2em;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  .update-slide-container {
    height: 300px;
  }
  
  .update-slide-text {
    font-size: 1.4em;
  }
  
  .cinematic-content {
    flex-direction: column;
  }
  
  .cinematic-image {
    width: 100%;
    height: 50vh;
    transform: none;
  }
  
  .cinematic-description {
    width: 100%;
    height: 50vh;
    transform: none;
    padding: 30px;
  }
  
  .cinematic-description h3 {
    font-size: 2em;
  }
  
  .cinematic-description p {
    font-size: 1em;
  }
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(145deg, #0e1014, #171a21);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.carousel-slide {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  transition: opacity 0.5s ease;
}

.carousel-slide.active {
  display: grid;
  opacity: 1;
}

.carousel-link {
  text-decoration: none;
  color: inherit;
}

.carousel-image-container {
  background: #15171c;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: pointer;
  will-change: transform;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.carousel-image-container:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(90, 200, 250, 0.2);
}

.carousel-image-container img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.carousel-image-container:hover img {
  filter: brightness(1);
}

.carousel-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.7rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #f8f8f8;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: bold;
}

@media (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }
  header {
    padding: 40px 15px;
  }
}

@media (max-width: 768px) {
  header {
    gap: 12px;
    padding: 30px 10px;
  }

  header .logo-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  header .logo-container > div:first-child {
    grid-column: 1;
    justify-self: center;
  }
  
  header .logo-container #clock-container {
    grid-column: 1;
    justify-self: center;
    margin: 0;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 90%;
  }

  body {
    text-align: center;
    word-wrap: break-word;
  }

  header {
    padding: 25px 10px;
    gap: 8px;
  }

  .logo {
    width: 60px;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  button, a {
    touch-action: manipulation;
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 85%;
  }

  .logo {
    width: 50px;
  }
}

body.mobile-mode header {
  flex-direction: column;
  padding: 30px 10px;
}

body.mobile-mode nav {
  flex-direction: column;
  gap: 15px;
}

#mobile-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  transition: opacity 0.4s ease;
}

#mobile-popup .popup-content {
  background: #1a1c22;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  color: #e0e0e0;
  max-width: 85%;
}

#mobile-popup h2 {
  color: #5ac8fa;
  margin-bottom: 10px;
}

#mobile-popup button {
  margin-top: 15px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: #5ac8fa;
  color: #0c0d11;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s;
}

#mobile-popup button:hover {
  transform: scale(1.05);
  background: #49b7d6;
}
