/* Loop — the /get/ bridge page.
 *
 * Its own small stylesheet, not the landing page's: this loads in an in-app browser
 * on a phone and is on screen for well under a second in the good case. It shares
 * only the palette with the rest of the site.
 *
 * `data-state` on <html> picks which block is visible — set to `loading` by an
 * inline script before first paint, then `fallback` or `android` by main.js. With
 * JavaScript off the attribute is never set, and the rule below shows the fallback,
 * so the download button is there for everyone.
 */

:root {
  --bg: #F6F5FB;
  --card: #FFFFFF;
  --ink: #15141F;
  --ink-2: #5A596E;
  --ink-3: #8E8DA3;
  --line: #E4E2EF;
  --accent: #5B4BFF;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-feature-settings: "palt" 1;
  text-align: center;
  -webkit-text-size-adjust: 100%;
}

.bridge { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 400px; }

.mark {
  width: 88px; height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(91, 75, 255, .22);
}
.name {
  margin: -6px 0 0;
  font-size: 1.5rem; font-weight: 800; letter-spacing: .01em;
  display: flex; flex-direction: column; gap: 2px;
}
.name span { font-size: .85rem; font-weight: 500; color: var(--ink-2); letter-spacing: .04em; }

/* ---- States -------------------------------------------------------------- */

.state { display: none; flex-direction: column; align-items: center; gap: 20px; width: 100%; }

/* No attribute at all means JavaScript never ran. Show the button, not a spinner. */
html:not([data-state]) .state--fallback { display: flex; }
html[data-state="loading"]  .state--loading  { display: flex; }
html[data-state="fallback"] .state--fallback { display: flex; }
html[data-state="android"]  .state--android  { display: flex; }

/* ---- Loading ------------------------------------------------------------- */

.status { margin: 8px 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.7; }

.spinner { display: flex; gap: 7px; }
.spinner span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}
.spinner span:nth-child(2) { animation-delay: .15s; }
.spinner span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .spinner span { animation: none; opacity: .5; }
}

/* ---- Fallback ------------------------------------------------------------ */

.cta { display: inline-block; line-height: 0; margin-top: 6px; border-radius: 12px; }
.cta img { height: 56px; width: auto; }        /* Apple's floor for web is 40px */

.hint { margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.8; }
.hint strong { color: var(--ink); font-weight: 700; }
.dots { letter-spacing: .06em; }

.copy { width: 100%; margin-top: 4px; }
.copy__row { display: flex; gap: 8px; }
.copy__field {
  flex: 1 1 auto; min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: .84rem;
  text-overflow: ellipsis;
}
.copy__btn {
  flex: none;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.copy__btn:active { opacity: .8; }
.copy__status { margin: 10px 0 0; min-height: 1.4em; color: var(--ink-2); font-size: .84rem; line-height: 1.6; }

/* ---- Android ------------------------------------------------------------- */

.android-note { margin: 8px 0 0; color: var(--ink); font-size: 1.05rem; font-weight: 700; line-height: 1.85; }
.android-sub { margin: -8px 0 0; color: var(--ink-2); font-size: .9rem; line-height: 1.7; }

/* ---- Footer -------------------------------------------------------------- */

.home { margin-top: 10px; color: var(--ink-3); font-size: .86rem; text-underline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
