/* Fluento opening frames 2058:20608 and 2058:20614, using Learn Britain assets.
   The device supplies its own status bar and home indicator. */
#studyApp {
  display: contents;
}

#appOpening {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light dark;
  overscroll-behavior: contain;
}

.opening-screen {
  min-height: 100%;
  min-height: 100dvh;
  padding: max(24px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) max(16px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))
    max(24px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))) max(16px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
}

.opening-splash {
  display: grid;
  place-items: center;
  background: var(--paper);
  color: #0ba5ec;
  position: relative;
}

.opening-wordmark {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2rem, 8.2vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.2;
}

.opening-splash .opening-wordmark {
  position: absolute;
  bottom: calc(40px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  left: 16px;
  right: 16px;
  text-align: center;
  font-size: clamp(2.25rem, 9.5vw, 3rem);
}

.opening-splash-mascot {
  width: clamp(180px, 34dvh, 280px);
  height: clamp(180px, 34dvh, 280px);
  animation: opening-hello .6s var(--ease) both;
}

/* In the iOS app the launch screen covers the splash until it has painted
   (app.html). The corgi's hello waits, then plays as the cover dissolves. */
[data-launch="covered"] .opening-splash-mascot {
  animation-play-state: paused;
}

.opening-welcome {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.opening-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0 64px;
  text-align: center;
}

.opening-mascot {
  width: clamp(160px, 28dvh, 240px);
  height: clamp(160px, 28dvh, 240px);
  object-fit: contain;
  margin-bottom: 24px;
  animation: opening-hello .6s var(--ease) both;
}


.opening-welcome .opening-wordmark {
  color: #0ba5ec;
  outline: none;
}

.opening-intro p {
  max-width: 350px;
  margin: 14px 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
}

.opening-actions {
  display: grid;
  flex-shrink: 0;
  gap: 12px;
  padding-bottom: 4px;
}

.opening-button {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 4px 0 var(--brand-lip);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
  touch-action: manipulation;
}

.opening-button.secondary {
  background: var(--paper);
  color: var(--brand-ink);
  border: 1.5px solid var(--brand-soft);
  box-shadow: 0 4px 0 var(--brand-soft);
}

.opening-button:active {
  transform: translateY(4px);
  box-shadow: none;
}

.opening-button:focus-visible {
  outline: 3px solid var(--brand-ink);
  outline-offset: 5px;
}

.opening-recovery {
  position: absolute;
  bottom: calc(110px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  left: 16px;
  right: 16px;
  text-align: center;
  color: var(--ink);
}

.opening-recovery a {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  border-radius: var(--r);
  background: var(--paper);
  color: var(--brand-ink);
  font-weight: 800;
}

@keyframes opening-hello {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}


@media (max-height: 600px) {
  .opening-intro { padding: 16px 0 28px; }
  .opening-mascot { width: 140px; height: 140px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .opening-mascot,
  .opening-splash-mascot { animation: none; }
  .opening-button { transition: none; }
}
