*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }

#app { position: relative; min-height: 100%; max-width: var(--content-max); margin: 0 auto; overflow: hidden; }

/* Screens */
.screen {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 16px) var(--gutter) calc(var(--safe-bottom) + 24px);
  animation: screen-in .25s ease-out;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen, .slide { animation: none !important; transition: none !important; } }

/* Background used on splash, language and welcome screens */
.bg-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--white); }
.bg-art__glow { position: absolute; left: 50%; top: -325px; width: 797px; height: 1461px; transform: translateX(calc(-50% + 7px)); }
.bg-art__glow img { position: absolute; inset: -8.21% -15.06% -6.1%; width: 130.12%; height: 114.31%; max-width: none; }
.bg-art__pattern {
  position: absolute; inset: 0;
  background: url("../assets/img/bg-pattern.png") center top / 390px auto repeat;
  opacity: .1; mix-blend-mode: luminosity;
}
.bg-art__fade { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.88) 47%, rgba(255,255,255,.88) 53%, rgba(255,255,255,0) 100%); }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 40px; padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-body); line-height: 16px; font-weight: 700;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--turquoise); color: var(--white); }
.btn--primary:hover { background: var(--turquoise-dark); }
.btn--primary[disabled] { opacity: .5; pointer-events: none; }
.btn--link { color: var(--turquoise); font-weight: 600; min-height: 40px; }
.btn--text { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }
.btn:focus-visible, .lang-card:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

/* Splash */
.splash { justify-content: center; align-items: center; }
.splash__logo { width: 300px; height: 300px; max-width: 80vw; max-height: 80vw; }

/* Language */
.language__logo { width: 240px; height: 240px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.language__logo img { width: 102px; height: auto; }
.language__body { margin-top: auto; margin-bottom: auto; display: flex; flex-direction: column; gap: 32px; }
.language__head { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
.language__head h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; }
.language__options { display: flex; gap: 8px; }
.lang-card {
  flex: 1; padding: 4px; border-radius: var(--radius-md);
  background: var(--white); border: 1px solid var(--gray-light);
  display: flex; flex-direction: column; align-items: center;
  transition: background-color .15s, border-color .15s;
}
.lang-card__hello { width: 100%; padding: 10px; border-radius: var(--radius-sm); background: var(--gray-light);
  font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; text-align: center; }
.lang-card__name { padding: 8px 0; font-weight: 600; }
.lang-card[aria-checked="true"] { background: var(--turquoise); border-color: var(--turquoise); }
.lang-card[aria-checked="true"] .lang-card__hello { background: var(--white); }
.lang-card[aria-checked="true"] .lang-card__name { color: var(--white); }

/* Intro carousel */
.intro { padding: 0 0 calc(var(--safe-bottom) + 24px); }
.intro__track { flex: 1; display: flex; transition: transform .35s ease; }
.slide { flex: 0 0 100%; display: flex; flex-direction: column; }
.slide__art {
  height: min(56vh, 452px); padding-top: calc(var(--safe-top) + 24px);
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, var(--ice) 0%, var(--white) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.slide__art img { width: min(100%, 375px); height: 100%; object-fit: contain; object-position: center bottom; }
.slide__text { padding: 20px var(--gutter) 0; text-align: center; }
.slide__text h2 { font-size: 22px; line-height: 30px; font-weight: 600; margin-bottom: 12px; }
.slide__text p { color: var(--gray-text); }
.intro__dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 24px; }
.intro__dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-light); transition: background-color .2s, transform .2s; }
.intro__dots span.is-active { background: var(--turquoise); transform: scale(1.2); }
.intro__actions { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 8px; }

/* Welcome */
.welcome { justify-content: space-between; }
.welcome__brand { display: flex; justify-content: center; padding-top: 48px; }
.welcome__brand img { width: 120px; height: auto; }
.welcome__card {
  background: var(--white); border-radius: var(--radius-lg); padding: 24px 16px;
  box-shadow: 0 8px 32px rgba(31,31,31,.08); text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center; margin-bottom: 40px;
}
.welcome__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--ice); display: grid; place-items: center; color: var(--turquoise); }
.welcome__card h1 { font-size: 22px; line-height: 30px; font-weight: 600; }
.welcome__card p { color: var(--gray-text); max-width: 260px; }
.divider-or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--gray-text); }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }

/* Home (temporary, until the Home design is implemented) */
.home__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.home__header h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; }
.home__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.home__tile { padding: 16px; border-radius: var(--radius-md); background: var(--ice); text-align: start; font-weight: 600; min-height: 88px; }
.home__note { margin-top: 24px; color: var(--gray-text); font-size: var(--fs-small); line-height: var(--lh-small); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%);
  background: var(--charcoal); color: var(--white); padding: 10px 16px; border-radius: var(--radius-sm);
  max-width: calc(100% - 32px); z-index: 100; animation: screen-in .2s ease-out; }
