:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #132533;
  color: #f3f2ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.welcome {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: start center;
  min-height: 100svh;
  overflow: hidden;
  background: url("assets/bg.png") center / cover no-repeat;
}

.welcome::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 50%, #07111a55 100%);
  pointer-events: none;
}

.flag {
  position: absolute;
  z-index: -2;
  top: 4%;
  left: -9%;
  width: min(85vw, 1300px);
  height: auto;
  opacity: 0.17;
  transform-origin: left center;
  transform: rotate(-12deg);
  animation: wave 9s ease-in-out infinite alternate;
  pointer-events: none;
}

.welcome-content {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(40px, env(safe-area-inset-top)) 20px 12vh;
  gap: 0;
}

.emblem {
  display: block;
  width: min(64vw, 112vh);
  height: auto;
  filter: drop-shadow(0 12px 12px #0009);
}

h1 {
  margin: 4vh 0 0;
  font-size: clamp(28px, 5.2vw, 96px);
  line-height: 1.12;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  color: #fff4db;
  background: linear-gradient(
    180deg,
    #fff 10%,
    #fff4da 36%,
    #d6e2ee 48%,
    #7f96af 51%,
    #f7e3b6 73%,
    #dc9c45 100%
  );
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.5px #fff1d888;
  filter: drop-shadow(0 2px 0 #26364b)
    drop-shadow(0 5px 0 #101c2b)
    drop-shadow(0 8px 6px #000c)
    drop-shadow(0 0 18px #edb15a55);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(560px, 42vw);
  margin-top: 12px;
  color: #f1f1ed;
}

.divider svg {
  flex: 0 0 42px;
  width: 42px;
  height: 48px;
  filter: drop-shadow(0 2px 4px #0008);
}

.divider span {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, transparent, #d7a45c 70%, #fff3d8);
  box-shadow: 0 3px 9px #dba45a55;
}

.divider span:last-child {
  transform: rotate(180deg);
}

@keyframes wave {
  from { transform: rotate(-12deg) skewY(-2deg) scaleY(0.97); }
  to { transform: rotate(-9deg) skewY(2deg) scaleY(1.03); }
}

@media (max-width: 768px) {
  .welcome {
    background-position: 76% center;
  }

  .welcome-content {
    padding: max(40px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(48px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
  }

  .emblem {
    width: min(120vw, 90svh);
    flex-shrink: 0;
  }

  h1 {
    width: 100%;
    max-width: 560px;
    margin-top: clamp(18px, 3svh, 28px);
    font-size: clamp(28px, 8.2vw, 52px);
    line-height: 1.18;
  }

  .flag {
    top: 15%;
    left: -45%;
    width: 160vw;
  }

  .divider {
    width: min(72vw, 400px);
    margin-top: 20px;
    gap: 12px;
  }

  .divider svg {
    flex-basis: 32px;
    width: 32px;
    height: 38px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .welcome-content {
    padding: max(40px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
  }

  .emblem {
    width: min(64vw, 94svh);
  }

  h1 {
    max-width: none;
    margin-top: 3svh;
    font-size: clamp(24px, 7svh, 40px);
  }

  .divider {
    margin-top: 8px;
  }

  .divider svg {
    flex-basis: 28px;
    width: 28px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flag {
    animation: none;
  }
}
