:root {
  --splash-ease: cubic-bezier(.22, 1, .36, 1);
}

html,
body {
  background-color: var(--bg, #f7f9f8);
}

/* Keep the permanent brand optically centered. It is not animated. */
.tutor-brand-icons {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
}

.tutor-brand-icons .tutor-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.tutor-brand-title,
.tutor-title-only {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  align-items: center !important;
  overflow: visible !important;
  letter-spacing: 0;
  line-height: 1 !important;
  white-space: nowrap;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.tutor-title-only {
  padding-top: 2px;
  color: #15352c;
}

.topbar .site-brand .school-brand-icons {
  width: 42px;
  min-width: 42px;
  height: 42px;
  flex: 0 0 42px;
  aspect-ratio: 1;
}

.topbar .site-brand .school-brand-icons .school-logo {
  width: 42px;
  min-width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  aspect-ratio: 1;
}

.topbar .site-brand:hover {
  background: #edf7f3;
}

@media (max-width: 760px) {
  .topbar .site-brand .school-brand-icons,
  .topbar .site-brand .school-brand-icons .school-logo {
    width: 40px;
    min-width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    flex-basis: 40px;
  }
}

.auth-brand {
  justify-content: center;
  gap: 10px;
}

.auth-brand .tutor-brand-icons,
.auth-brand .tutor-logo {
  width: 52px;
  height: 52px;
}

.auth-brand .tutor-title-only {
  font-size: clamp(22px, 5vw, 28px);
}

/* The only motion left in the product: school mark, then site mark. */
.wt-boot-splash {
  /* This sentinel covers every visible mark. JS reads the same value for its
     animationend fallback; it must not use an unrelated short splash delay. */
  --splash-sequence-duration: 2350ms;
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #143129;
  background: #fbfdfc;
  opacity: 1;
  transition: opacity 180ms ease-out, visibility 180ms step-end;
}

.wt-boot-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.wt-splash-school,
.wt-splash-festival,
.wt-splash-tutor {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 12px;
  opacity: 0;
}

/* Show the school mark from the first paint, before scripts or images finish. */
.wt-splash-school {
  opacity: 1;
}

.wt-splash-slow {
  position: absolute;
  right: 20px;
  bottom: calc(56px + env(safe-area-inset-bottom));
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #36574a;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.wt-splash-slow button {
  min-height: 36px;
  padding: 5px 13px;
  border: 1px solid #b9d4c4;
  border-radius: 10px;
  background: #fff;
  color: #075f47;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.wt-splash-slow button:focus-visible {
  outline: 3px solid #68bc98;
  outline-offset: 2px;
}

.wt-splash-skip-hint {
  position: absolute;
  right: 20px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 20px;
  margin: 0;
  color: #607b6f;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.wt-boot-splash.is-running {
  animation: wt-splash-sequence var(--splash-sequence-duration) linear both;
}

.wt-boot-splash.is-sequence-complete .wt-splash-school,
.wt-boot-splash.is-sequence-complete .wt-splash-festival,
.wt-boot-splash.is-sequence-complete .wt-splash-leaves {
  display: none !important;
}

.wt-boot-splash.is-sequence-complete,
.wt-boot-splash.is-sequence-complete *,
.wt-boot-splash.is-sequence-complete *::after {
  animation: none !important;
}

.wt-boot-splash.is-sequence-complete .wt-splash-tutor {
  opacity: 1;
  transform: none;
}

.wt-boot-splash.is-festival.is-sequence-complete {
  background: #fff9e8;
}

.wt-splash-festival {
  display: none;
  width: min(560px, calc(100vw - 48px));
  isolation: isolate;
}

.wt-splash-festival img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(124, 82, 0, .14));
}

.wt-splash-festival::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .78) 49%, transparent 64%);
  -webkit-mask: url("/assets/banners/wooshin-bank-festival-logo-transparent.png?v=2") center / contain no-repeat;
  mask: url("/assets/banners/wooshin-bank-festival-logo-transparent.png?v=2") center / contain no-repeat;
  opacity: 0;
  transform: translateX(-82%);
}

.wt-splash-leaves {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.wt-splash-leaves span {
  position: absolute;
  top: -12vh;
  left: var(--leaf-x);
  width: 34px;
  aspect-ratio: 1;
  opacity: 0;
  filter: blur(var(--leaf-blur)) drop-shadow(0 4px 5px rgba(113, 78, 0, .13));
  transform: translate3d(0, -12vh, 0) rotate(0) scale(var(--leaf-scale));
  transform-origin: 50% 8%;
  will-change: transform, opacity;
}

.wt-splash-leaves span::before {
  position: absolute;
  inset: 0;
  content: "";
  background: url("/assets/icons/ginkgo-leaf.svg?v=1") center / contain no-repeat;
  transform: scaleX(var(--leaf-flip));
}

.wt-splash-school img {
  display: block;
  object-fit: contain;
}

.wt-splash-school strong {
  color: #087454;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
}

.wt-splash-tutor-lockup {
  display: block;
  width: 176px;
  height: 176px;
  object-fit: contain;
}

.wt-boot-splash.is-running .wt-splash-school {
  animation: wt-splash-school 1800ms var(--splash-ease) both 100ms;
}

.wt-boot-splash.is-running .wt-splash-tutor {
  animation: wt-splash-tutor 600ms var(--splash-ease) both 1750ms;
}

/* Every LIVE Eunhaengje gets the same one-shot gold handoff. */
.wt-boot-splash.is-festival {
  /* The last falling leaf ends at 720 + 3180 = 3900ms. */
  --splash-sequence-duration: 3900ms;
}

.wt-boot-splash.is-festival.is-running {
  animation: wt-splash-festival-canvas 3000ms ease-out both,
    wt-splash-sequence var(--splash-sequence-duration) linear both;
}

.wt-boot-splash.is-festival.is-running .wt-splash-school strong {
  animation: wt-splash-school-gold 1300ms ease-out both;
}

.wt-boot-splash.is-festival.is-running .wt-splash-school img {
  animation: wt-splash-school-mark-gold 1300ms ease-out both;
}

.wt-boot-splash.is-festival .wt-splash-festival {
  z-index: 3;
  display: grid;
}

.wt-boot-splash.is-festival .wt-splash-leaves {
  display: block;
}

.wt-boot-splash.is-festival.is-running .wt-splash-school {
  animation: wt-splash-school-festival 1450ms var(--splash-ease) both 80ms;
}

.wt-boot-splash.is-festival.is-running .wt-splash-festival {
  animation: wt-splash-festival-mark 1500ms var(--splash-ease) both 1250ms;
}

.wt-boot-splash.is-festival.is-running .wt-splash-festival::after {
  animation: wt-splash-festival-glint 900ms ease-out both 1650ms;
}

.wt-boot-splash.is-festival.is-running .wt-splash-tutor {
  z-index: 4;
  animation: wt-splash-tutor-festival 700ms var(--splash-ease) both 2750ms;
}

.wt-boot-splash.is-festival.is-running .wt-splash-leaves span {
  animation: wt-splash-leaf-fall var(--leaf-duration) cubic-bezier(.24, .64, .42, 1) both var(--leaf-delay);
}

@keyframes wt-splash-school {
  0%, 70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* An invisible root animation emits one completion event for the sequence. */
@keyframes wt-splash-sequence {
  from { outline-color: transparent; }
  to { outline-color: transparent; }
}

@keyframes wt-splash-tutor {
  0% { opacity: 0; transform: translateY(8px) scale(.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wt-splash-festival-canvas {
  0%, 22% { background-color: #fbfdfc; }
  58%, 100% { background-color: #fff9e8; }
}

@keyframes wt-splash-school-gold {
  0%, 46% { color: #087454; }
  100% { color: #a86d00; }
}

@keyframes wt-splash-school-mark-gold {
  0%, 46% { filter: none; }
  100% { filter: sepia(1) saturate(2.35) hue-rotate(347deg) brightness(1.03); }
}

@keyframes wt-splash-school-festival {
  0%, 68% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px) scale(.98); }
}

@keyframes wt-splash-festival-mark {
  0% { opacity: 0; transform: translateY(12px) scale(.97); }
  22%, 72% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-5px) scale(.99); }
}

@keyframes wt-splash-festival-glint {
  0%, 12% { opacity: 0; transform: translateX(-82%); }
  38% { opacity: .54; }
  100% { opacity: 0; transform: translateX(82%); }
}

@keyframes wt-splash-tutor-festival {
  0% { opacity: 0; transform: translateY(9px) scale(.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wt-splash-leaf-fall {
  0% { opacity: 0; transform: translate3d(0, -12vh, 0) rotate(0) scale(var(--leaf-scale)); }
  12% { opacity: var(--leaf-alpha); }
  82% { opacity: var(--leaf-alpha-out); }
  100% { opacity: 0; transform: translate3d(var(--leaf-drift), 116vh, 0) rotate(var(--leaf-rotate)) scale(var(--leaf-scale)); }
}

:root.festival-season-active {
  --ui-brand: #b77a00;
  --ui-brand-strong: #785000;
  --ui-brand-soft: #fff2bd;
  --ui-mint: #176b49;
  --ui-mint-soft: #edf7f2;
  --ui-amber: #e7a512;
  --ui-canvas: #fffaf0;
  --ui-canvas-blue: #fff5d5;
  --ui-surface-soft: #fffcf4;
  --campus-green: #b77a00;
  --campus-green-deep: #785000;
  --campus-green-soft: #fff2bd;
  --campus-blue: #b77a00;
  --campus-blue-deep: #785000;
  --campus-blue-soft: #fff2bd;
  --campus-bg: #fffaf0;
  --workspace-blue: #b77a00;
  --workspace-blue-dark: #785000;
  --workspace-blue-soft: #fff2bd;
  --blue: #b77a00;
  --blue-dark: #785000;
  --blue-soft: #fff2bd;
}

html.festival-season-active,
body.festival-season-active {
  background-color: #fffaf0;
}

body.festival-season-active {
  background-image: none;
}

.festival-season-active .topbar {
  border-bottom-color: #ead9a3;
  background: rgba(255, 252, 241, .94);
}

.festival-season-active .topbar::before {
  background: #d7a11d;
}

.festival-season-active .topbar .site-brand:hover {
  background: #fff2bd;
}

.festival-season-active .mobile-tabbar {
  border-color: #ead9a3;
  background: rgba(255, 252, 241, .96);
}

@media (max-width: 760px) {
  .wt-splash-tutor-lockup {
    width: 164px;
    height: 164px;
  }

  .wt-splash-festival {
    width: min(390px, calc(100vw - 38px));
  }

  .wt-splash-leaves span {
    width: 28px;
  }

  .wt-splash-leaves span:nth-child(n + 11) {
    display: none;
  }

  .topbar .brand .tutor-brand-title {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    overflow: visible !important;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wt-boot-splash {
    transition-duration: 80ms;
  }

  .wt-boot-splash,
  .wt-boot-splash *,
  .wt-boot-splash *::after {
    animation: none !important;
  }

  .wt-boot-splash.is-festival {
    background: #fff9e8;
  }

  .wt-boot-splash .wt-splash-school,
  .wt-boot-splash .wt-splash-festival,
  .wt-boot-splash .wt-splash-leaves {
    display: none !important;
  }

  .wt-boot-splash .wt-splash-tutor {
    opacity: 1;
    transform: none;
  }

  .wt-boot-splash.is-festival .wt-splash-festival {
    display: grid !important;
    opacity: 1;
    transform: none;
  }

  .wt-boot-splash.is-festival .wt-splash-tutor {
    display: none !important;
  }
}
