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

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Alice", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #ffffff;
  color: #020202;
}

/* --- MAIN PAGE (centered, responsive) --- */

#page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 5vw;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#page.page-show {
  opacity: 1;
  transform: translateY(0);
}

.page-inner {
  text-align: center;
  max-width: min(720px, 90vw);
}

.page-inner h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 0.75rem;
}

.page-inner p {
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  line-height: 1.5;
}

/* --- PRELOADER --- */

#preloader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  opacity: 1;
  transform: scale(1);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

#preloader.preloader-hide {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2vh, 1.5rem);
}

/* Bigger, smoother logo zoom */
.preloader-logo {
  width: clamp(140px, 28vw, 220px);  /* larger than before */
  height: auto;
  animation: logoZoomIn 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logoZoomIn {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  40% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Type line */
.preloader-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 0.8vw, 0.7rem);
  font-family: "Alice", serif;
  font-weight: 700;              /* mimic Alice Bold */
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  letter-spacing: -0.05em;       /* scalable negative spacing instead of -62px */
  text-shadow: 0.02em 0 0 currentColor;
  white-space: nowrap;
}

/* Each word starts empty; text filled via JS */
.word {
  display: inline-block;
}

/* Shaping, Minds: #020202 */
.word-1,
.word-3 {
  color: #020202;
}

/* Young: #55a80a */
.word-2 {
  color: #55a80a;
}

/* Blinking caret */
.caret {
  width: 2px;
  height: 1.1em;
  margin-left: 0.2em;
  background: #020202;
  animation: caretBlink 0.8s steps(1) infinite;
}

@keyframes caretBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Tiny screens safety */
@media (max-width: 360px) {
  .preloader-title {
    font-size: 1.3rem;
    letter-spacing: -0.03em;
  }
}
