/* The /@handle invite page. Night palette and display type from the homepage;
   phone-first, because invite links are opened from Messages and WhatsApp. It
   loads no script but invite.js and no 3D: the map is a still render and the
   loop is SVG, so it opens instantly inside an in-app browser. */

@font-face {
  font-family: TLD;
  src: url('/assets/site/fonts/treadline-display.woff2') format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #0B0B0C;
  --ink-2: #151517;
  --text: #FFFFFF;
  --muted: #A9A9AE;
  --volt: #C5F52A;
  --display: TLD, 'Helvetica Neue Condensed', 'Arial Narrow', sans-serif;
  --expo: cubic-bezier(.16, 1, .3, 1);
  --back: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); overflow-x: clip; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1rem/1.5 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 4px; }
a:focus-visible, summary:focus-visible, .get-app:focus-visible { outline: 3px solid var(--volt); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; padding: 8px 12px; background: var(--volt); color: var(--ink); border-radius: 999px; z-index: 2; }

.page {
  width: min(100% - 40px, 460px);
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
/* The bar floats over the map, as on the homepage. */
header {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  padding: max(16px, env(safe-area-inset-top)) max(20px, calc((100% - 460px) / 2)) 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; border-radius: 8px; }
.brand span { font: 900 italic 22px/1 var(--display); padding-right: .1em; }

/* ---- The map and its loop ---------------------------------------------- */

/* Seamless, like the homepage hero: edge to edge from the very top, fading
   into the page instead of sitting in a card. The loop spans x 220–763 and
   y 270–745 of the 900×1000 render; the image and the SVG crop identically
   (cover / slice, both centred), so the loop stays on the streets. */
.map {
  position: relative; margin: 0 calc(50% - 50vw); width: 100vw;
  aspect-ratio: 4 / 5; max-height: 76svh; overflow: hidden; background: var(--ink);
}
.map img { display: block; width: 100%; height: 100%; object-fit: cover; }
.map::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(180deg, rgba(11, 11, 12, .75) 0%, rgba(11, 11, 12, 0) 20%),
    linear-gradient(0deg, var(--ink) 0%, rgba(11, 11, 12, .85) 12%, rgba(11, 11, 12, 0) 40%);
}
.loop { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.loop__line {
  fill: none; stroke: var(--volt); stroke-width: 7; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 7px rgba(197, 245, 42, .85));
  animation: draw 2.6s linear .5s forwards;
}
.loop__fill { fill: var(--volt); opacity: 0; animation: claim .8s var(--expo) 3.1s forwards; }
.loop__dot { fill: var(--ink); stroke: var(--volt); stroke-width: 5; }
.loop__pulse { fill: none; stroke: var(--volt); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-out infinite; }
.loop__initial { fill: #fff; font: 900 italic 30px var(--display); text-anchor: middle; text-transform: uppercase; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes claim { to { opacity: .3; } }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }

.loop__chip { opacity: 0; animation: chip .5s var(--expo) 3.3s forwards; }
.loop__chip rect { fill: var(--volt); }
.loop__chip text { fill: var(--ink); font: 900 italic 30px var(--display); text-anchor: middle; }
@keyframes chip { to { opacity: 1; } }
.map__credit {
  position: absolute; z-index: 2; right: max(16px, calc((100vw - 460px) / 2)); top: calc(max(16px, env(safe-area-inset-top)) + 40px);
  font-size: 10px; color: rgba(255, 255, 255, .6); text-decoration: underline; text-underline-offset: 2px;
}

/* ---- Words and the button ---------------------------------------------- */

/* Everything after the map rides above it: the words rise into its fade. */
main > :not(.map) { position: relative; z-index: 2; }

.sender {
  margin: -86px 0 10px; /* rises out of the map's fade */
  font: 700 12px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); overflow-wrap: anywhere;
}
.sender::before { content: ''; display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--volt); vertical-align: .3em; margin-right: 9px; }
.sender strong { color: var(--text); font-weight: 800; }
h1 {
  margin: 0 0 16px;
  font: 900 italic clamp(3.3rem, 17vw, 5.4rem)/.9 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
  overflow-wrap: anywhere;
}
h1 .ln { display: block; }
h1 .ln:empty { display: none; }
h1 mark {
  position: relative; z-index: 0; background: none; color: var(--ink);
  padding: 0 .08em 0 .04em; margin-left: -.03em;
}
h1 mark::before {
  content: ''; position: absolute; z-index: -1; inset: .05em -.05em 0 -.04em;
  background: var(--volt); transform: skewX(-11deg);
}
/* The handle stays on one line (the skewed box can't follow a wrap);
   invite.js shrinks it to fit instead. */
h1 mark { white-space: nowrap; display: block; width: fit-content; }
.lede { margin: 0 0 22px; color: var(--muted); font-size: 1.0625rem; }

.get-app {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  min-height: 58px; padding: 14px 22px;
  background: var(--volt); color: var(--ink); border-radius: 999px;
  font-size: 1.125rem; font-weight: 800; text-decoration: none;
  box-shadow: 0 16px 40px -16px rgba(197, 245, 42, .7);
  transition: transform .2s var(--back), box-shadow .2s;
}
.get-app:hover { transform: translateY(-1px); box-shadow: 0 20px 44px -14px rgba(197, 245, 42, .85); }
.get-app:active { transform: scale(.98); }
.get-app svg { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.availability { margin: 10px 0 6px; text-align: center; font-size: .8125rem; color: var(--muted); }
.existing { margin: 0; text-align: center; color: var(--muted); font-size: .9375rem; }
.existing a { display: inline-block; padding-block: 10px; color: var(--text); font-weight: 700; }

/* ---- What happens next, and why ---------------------------------------- */

.steps { list-style: none; margin: 26px 0 0; padding: 18px; display: grid; gap: 12px; background: var(--ink-2); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.steps b {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--volt); color: var(--ink); font: 900 italic 16px/1 var(--display); padding-right: .08em;
}
.why { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 18px; }
.why li { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9375rem; line-height: 1.4; }
.why img { flex: none; width: 58px; height: 58px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); }
.why strong { display: block; color: var(--text); font: 900 italic 1.35rem/1.05 var(--display); margin-bottom: 3px; padding-right: .1em; }

.help { margin: 26px 0 0; color: var(--muted); font-size: .875rem; }
.help summary { width: fit-content; margin-inline: auto; cursor: pointer; padding: 10px 4px; }
.help p, .script-help { margin: 8px 0 18px; padding: 16px; border-radius: 14px; background: var(--ink-2); line-height: 1.6; }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-top: auto; padding: 30px 0 max(18px, env(safe-area-inset-bottom)); font-size: .8125rem; color: var(--muted); }
footer a { padding-block: 10px; text-decoration: none; }
footer a:hover { color: var(--volt); }

/* Wider screens: the map fills the left of the window at full height and
   fades into the invitation on the right. */
@media (min-width: 900px) {
  .page { width: 100%; }
  header { padding: 28px 40px 0; }
  main { display: grid; grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); align-items: start; }
  .map {
    grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 0;
    width: auto; height: 100svh; max-height: none; aspect-ratio: auto; margin: 0;
  }
  .map::after {
    background:
      linear-gradient(180deg, rgba(11, 11, 12, .7) 0%, rgba(11, 11, 12, 0) 16%),
      linear-gradient(270deg, var(--ink) 0%, rgba(11, 11, 12, .6) 14%, rgba(11, 11, 12, 0) 38%),
      linear-gradient(0deg, rgba(11, 11, 12, .7) 0%, rgba(11, 11, 12, 0) 20%);
  }
  .map__credit { right: auto; left: 40px; top: auto; bottom: 18px; }
  main > :not(.map) { grid-column: 2; margin-inline: clamp(28px, 4vw, 64px); max-width: 500px; }
  .sender { margin-top: max(110px, 18svh); }
  h1 { font-size: clamp(4rem, 6vw, 5.6rem); }
  footer { margin-left: 54%; justify-content: flex-start; padding-inline: clamp(28px, 4vw, 64px); }
}

@media (prefers-reduced-motion: reduce) {
  .loop__line { animation: none; stroke-dashoffset: 0; }
  .loop__fill { animation: none; opacity: .3; }
  .loop__chip { animation: none; opacity: 1; }
  .loop__pin { display: none; }
  .get-app, .get-app:hover { transition: none; }
}
