:root {
  color-scheme: light;
  --paper: #f5f7fa;
  --ink: #192332;
  --quiet: #53606f;
  --accent: #1654C8;
  --line: #d5dce6;
  --stage: #15171a;
  --control: #2e333b;
  --stage-ink: #f5f7fa;
  font-family: "Helvetica Neue", Helvetica, sans-serif;
  font-size: 100%;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.125rem, 5vw, 3.75rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

p {
  margin: 0;
  overflow-wrap: anywhere;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.04em;
}

.brand img {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
}

.landing-page {
  min-height: 100dvh;
  background-image: radial-gradient(ellipse at 90% 12%, #1654c80a, transparent 65%);
}

.landing {
  display: flex;
  flex-direction: column;
  width: min(100%, 72rem);
  min-height: 100dvh;
  margin-inline: auto;
  padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
}

.landing-header {
  padding-block: max(1.75rem, env(safe-area-inset-top)) 1.75rem;
  border-bottom: 1px solid var(--line);
}

.landing-content {
  width: min(100%, 42rem);
  margin-block: auto;
  padding-block: clamp(2.5rem, 10vh, 7rem);
}

.eyebrow {
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .06em;
}

.landing-detail,
#detail {
  max-width: 32rem;
  color: var(--quiet);
  font-size: 1.125rem;
  line-height: 1.65;
}

.invitation-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2.5rem;
  color: var(--quiet);
  font-size: .875rem;
}

.note-rule {
  width: 28px;
  height: 2px;
  flex: none;
  background: var(--accent);
}

.viewer {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: var(--stage);
  touch-action: none;
  user-select: none;
}

#frame {
  position: absolute;
  overflow: hidden;
}

#photo {
  position: absolute;
  max-width: none;
  max-height: none;
}

#pointer {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ff343b;
  border: 2px solid #fff;
  box-shadow: 0 0 16px 5px #ff343baa;
  pointer-events: none;
}

#welcome {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 80% 12%, #1654c808, transparent 65%);
  text-align: center;
}

.welcome-content {
  width: min(100%, 40rem);
  flex: none;
  margin: auto;
}

#welcome .brand {
  justify-content: center;
  margin-bottom: 2.5rem;
}

#detail {
  margin-inline: auto;
}

.stage-footer {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  pointer-events: none;
  color: var(--stage-ink);
  font-size: .8125rem;
}

.wordmark,
#count {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--stage);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.wordmark img {
  display: block;
  flex: none;
}

#count:empty {
  display: none;
}

#status {
  position: fixed;
  z-index: 2;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 48px);
  padding: 12px 18px;
  border: 1px solid #6b737e;
  border-radius: 8px;
  background: var(--control);
  color: var(--stage-ink);
  font-size: .875rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.viewer:has(#welcome:not([hidden])) .stage-footer {
  display: none;
}

.viewer:has(#welcome:not([hidden])) #status {
  position: relative;
  order: -1;
  top: auto;
  left: auto;
  transform: none;
  flex: none;
  margin: max(20px, env(safe-area-inset-top)) auto 0;
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.viewer:has(#welcome[hidden]) {
  color-scheme: dark;
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.125rem);
  }

  .landing-header {
    padding-block: max(1.25rem, env(safe-area-inset-top)) 1.25rem;
  }

  .stage-footer {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .landing-content,
  .welcome-content {
    animation: arrive .25s ease-out;
  }

  @keyframes arrive {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}
