.welcome {
  --paper: #f8faff;
  --rim: #fff;
  --accent: #3565d9;
  --shadow: rgb(28 51 90 / 18%);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}
.dark .welcome {
  --paper: #18212f;
  --rim: #37455a;
  --accent: #93b4ff;
  --shadow: rgb(0 0 0 / 36%);
}
.welcome :is(.welcome-bar,.welcome-footer,.welcome-main) {width:100%;max-width:1120px;margin-inline:auto}
.welcome-bar {
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding-block:max(16px,env(safe-area-inset-top)) 16px;
}
.welcome-brand {display:inline-flex;align-items:center;gap:10px;font-size:19px;letter-spacing:-.045em;line-height:1.2}
.welcome-brand strong {font-weight:700}
.welcome-brand img {width:30px;height:30px}
.dark .welcome-brand .auth-logo-light {display:none}
.dark .welcome-brand .auth-logo-dark {display:block}
.welcome .theme-switch {position:relative;top:auto;right:auto;width:44px;height:44px;flex:none;background:transparent}
.welcome-main {
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:clamp(18px,3svh,32px);padding-block:clamp(16px,4svh,40px) clamp(28px,6svh,60px);
}
.welcome-intro {width:100%;display:flex;flex-direction:column;align-items:center;gap:inherit;min-width:0}
.welcome-main.auth-page {min-height:0}
.welcome-signin.auth-main {display:none;min-width:0}
.welcome-form-route .welcome-intro {display:none}
.welcome-form-route .welcome-signin {display:flex;width:min(100%,420px);padding:0}
.welcome-signin .auth-card {width:100%;max-width:none;--caption-surface:var(--paper)}
.welcome-signin .auth-submit {font-weight:600}
.welcome-signin .auth-kicker {color:var(--accent)}
.welcome-gallery {width:min(100%,420px);min-width:0;position:relative;isolation:isolate}
.welcome-gallery::before {
  content:"";position:absolute;z-index:-1;inset:0 0 3%;
  background:radial-gradient(ellipse,rgb(72 127 255 / 13%),transparent 69%);
}
.welcome-deck {
  width:68%;aspect-ratio:6/7;margin-inline:auto;position:relative;
  touch-action:pan-y pinch-zoom;
  --radius:clamp(18px,4vw,32px);
}
.welcome-photo,.deck-next {
  position:absolute;inset:0;width:100%;height:100%;border-radius:var(--radius);
}
.welcome-photo {
  object-fit:cover;border:clamp(3px,.45vw,5px) solid var(--rim);background:var(--rim);
  box-shadow:0 8px 20px -12px var(--shadow);
  transition:transform .65s cubic-bezier(.22,.68,.18,1),opacity .55s ease;
}
.welcome-photo[data-place="left"],.welcome-photo[data-place="right"] {z-index:1;opacity:.48}
.welcome-photo[data-place="left"] {transform:translate(-22%,7%) rotate(-12deg) scale(.83)}
.welcome-photo[data-place="right"] {transform:translate(22%,7%) rotate(12deg) scale(.83)}
.welcome-photo[data-place="front"] {z-index:2;box-shadow:0 14px 28px -12px var(--shadow)}
.deck-next {z-index:3;background:transparent;border:0}
.gallery-controls {display:flex;align-items:center;justify-content:center;margin:clamp(12px,2.6svh,28px) auto 0}
.welcome [hidden] {display:none}
.photo-choice {display:grid;place-items:center;width:24px;height:44px;padding:0;border:0;border-radius:8px;background:transparent}
.photo-marker {width:5px;height:5px;border-radius:999px;background:var(--muted);opacity:.75}
.photo-choice[aria-current="true"] .photo-marker {width:20px;height:6px;background:var(--accent);opacity:1}
.welcome-enter svg {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.welcome-copy {width:min(100%,425px);min-width:0;text-align:center;overflow-wrap:anywhere}
.welcome-label {font-size:10px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;color:var(--accent)}
.welcome-copy h1 {font-size:clamp(34px,8.8vw,52px);line-height:1.04;font-weight:700;letter-spacing:-.048em;margin:10px 0 14px}
.welcome-copy h1 span {display:block;color:var(--accent)}
.welcome-summary {font-size:clamp(14px,3.55vw,17px);line-height:1.5;max-width:31ch;margin-inline:auto;text-wrap:pretty}
.welcome-enter {
  display:inline-flex;align-items:center;justify-content:center;gap:12px;
  width:min(100%,320px);min-height:54px;padding:12px 20px;margin-top:clamp(20px,3.8svh,36px);
  background:var(--primary);color:white;font-size:16px;font-weight:600;border-radius:15px;
}
.welcome-enter:hover {background:#2e58be}
.welcome-enter:active {background:#274ca6}
.welcome-footer {display:none}
@media (min-width:960px) {
  .welcome {padding-inline:clamp(36px,6vw,112px)}
  .welcome-bar {padding-block:27px;border-bottom:1px solid var(--border)}
  .welcome-brand {font-size:21px;gap:12px}
  .welcome-brand img {width:34px;height:34px}
  .welcome-main {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(42px,6vw,88px);padding-block:clamp(28px,5svh,54px)}
  .welcome-intro,.welcome-form-route .welcome-intro {display:flex;gap:12px;justify-self:center}
  .welcome-gallery {width:min(100%,clamp(300px,41svh,405px))}
  .gallery-controls {margin-top:10px}
  .welcome-copy {max-width:435px}
  .welcome-copy h1 {font-size:clamp(34px,3vw,46px);margin:9px 0 12px}
  .welcome-summary {font-size:16px}
  .welcome-enter {display:none}
  .welcome-signin.auth-main {display:block;justify-self:center;width:min(100%,450px);padding:clamp(28px,3.1vw,44px);background:var(--bg);border:1px solid var(--border);border-radius:22px}
  .welcome-signin .auth-card {--caption-surface:var(--bg)}
  .welcome-signin .auth-card :is(.auth-kicker,h2,p) {text-align:left}
  .welcome-signin .auth-card .auth-help {text-align:center}
  .welcome-signin .auth-submit {border-radius:12px;justify-content:center}
  .welcome-footer {display:block;padding-block:20px;border-top:1px solid var(--border);font-size:11px;color:var(--muted)}
}
@media (prefers-reduced-motion:reduce) {.welcome-photo {transition:none}}
@media (max-width:959px) and (max-height:730px) {
  .welcome-bar {padding-block:8px}
  .welcome-main {gap:10px;padding-block:10px 16px}
  .welcome-deck {width:min(68%,33svh)}
  .gallery-controls {margin-top:8px}
  .welcome-copy h1 {margin:8px 0 10px}
  .welcome-enter {margin-top:16px}
}

/* Keep normal document flow for enlarged text, the keyboard and form feedback. */
html.welcome-start { overscroll-behavior-y: none }
.welcome-start .welcome { min-height: 100dvh }

@media (min-width: 960px) and (max-height: 820px) {
  .welcome-start .welcome-bar { padding-block: max(env(safe-area-inset-top), clamp(4px, 8svh - 44px, 20px)) clamp(4px, 8svh - 44px, 20px) }
  .welcome-start .welcome-main { padding-block: clamp(6px, 12svh - 68px, 30px) }
  .welcome-start .welcome-gallery { width: min(100%, clamp(160px, 58svh - 123px, 337px)) }
  .welcome-start .welcome-footer { padding-block: 4px max(4px, env(safe-area-inset-bottom)) }
}

@media (min-width: 960px) and (max-height: 650px) {
  .welcome-start .welcome-intro { gap: 4px }
  .welcome-start .gallery-controls { margin-top: 4px }
  .welcome-start .welcome-copy h1 { font-size: clamp(28px, 5.5svh, 35px); margin-block: 4px 8px }
  .welcome-start .welcome-signin { padding-block: clamp(10px, 13svh - 52px, 30px) }
  .welcome-start .auth-card h2 { margin-block: 5px; font-size: clamp(24px, 4.7svh, 30px) }
  .welcome-start .auth-card form { margin-top: 12px }
  .welcome-start .auth-card .outlined-field ~ .outlined-field { margin-top: 10px }
  .welcome-start .auth-submit { margin-top: 14px; min-height: 44px; padding-block: 9px }
  .welcome-start .auth-help { margin-top: 12px !important }
}

@media (min-width: 960px) and (max-height: 520px) {
  .welcome-start .auth-card input { height: 44px }
  .welcome-start .password-field button { top: 1px }
}

@media (max-width: 959px) and (max-height: 960px) {
  .welcome-start .welcome-bar { padding-block: max(6px, env(safe-area-inset-top)) 6px }
  .welcome-start .welcome-main { gap: clamp(4px, 1.5svh, 14px); padding-block: clamp(5px, 1.5svh, 16px) }
  .welcome-start .welcome-deck { width: min(68%, clamp(90px, 65svh - 225px, 286px)) }
  .welcome-start .gallery-controls { margin-top: clamp(4px, 1.2svh, 12px) }
  .welcome-start .welcome-copy h1 { font-size: clamp(32px, min(8.8vw, 6svh), 52px); margin-block: 6px 8px }
  .welcome-start .welcome-enter { margin-top: clamp(10px, 2svh, 20px) }
}

@media (max-width: 959px) and (max-height: 540px) {
  .welcome-start .welcome-enter { min-height: 44px; padding-block: 8px }
}

@media (min-width: 500px) and (max-width: 959px) and (max-height: 540px) and (orientation: landscape) {
  .welcome-start .welcome-intro {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(12px, 3vw, 28px);
    max-width: 760px;
  }
  .welcome-start .welcome-gallery { justify-self: center; width: min(100%, 54svh) }
  .welcome-start .welcome-deck { width: 68% }
  .welcome-start .welcome-copy h1 { font-size: clamp(26px, 7svh, 36px) }
  .welcome-start .welcome-summary { font-size: 14px }
}
