/* A shared Moment's landing page (/m/…, backend/moment-page.mjs): the
   scene's picture blurred edge to edge behind a sharp 16:9 frame with its
   start time, the scene's name, and the two ways into StreamUp. The share
   row's styles live in styles.css, beside sUP's. */

.moment-page {
  position: relative;
  min-block-size: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: clip;
  background: var(--background);
}

.moment-backdrop {
  position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 30% 20%, #1d3a46 0%, #101b22 42%, var(--background) 78%);
}
.moment-backdrop img {
  inline-size: 100%; block-size: 100%; object-fit: cover;
  filter: blur(56px) saturate(1.4) brightness(.62);
  transform: scale(1.25);
}
.moment-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, transparent 0%, #09090b80 70%, #09090bd9 100%),
    linear-gradient(180deg, #09090b8c 0%, #09090b26 30%, #09090b99 75%, var(--background) 100%);
}

.moment-header, .moment, .moment-footer > * {
  position: relative; z-index: 1;
  inline-size: min(calc(100% - 32px), 1240px); margin-inline: auto;
}
.moment-header {
  z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 16px;
}
.moment-header .brand img { box-shadow: 0 6px 18px #0008; }
.moment-header-get { min-block-size: 38px; background: #0000004d; }
@supports (backdrop-filter: blur(12px)) {
  .moment-header-get { backdrop-filter: blur(14px) saturate(140%); }
}

.moment {
  display: grid; align-items: center; align-content: center;
  gap: clamp(26px, 4vw, 60px);
  padding-block: clamp(12px, 4vw, 48px) clamp(44px, 7vw, 96px);
}
@media (min-width: 960px) {
  .moment { grid-template-columns: minmax(0, 1.45fr) minmax(330px, 1fr); }
}

/* The scene, Apple Wide as the apps draw every Moment: 3:2, the title's
   logo centred at its foot, the badge and start time at the top. */
.moment-frame {
  position: relative; container-type: inline-size;
  aspect-ratio: 3 / 2; margin: 0; overflow: hidden;
  border-radius: clamp(14px, 2vw, 26px);
  background: radial-gradient(120% 90% at 30% 35%, #2b4f5a 0%, #12262e 50%, #070c0f 100%);
  box-shadow: 0 40px 110px #000000c7, 0 10px 30px #00000080;
  animation: moment-rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.moment-frame > img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.moment-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px #ffffff2e;
  background: linear-gradient(180deg, #00000059 0%, transparent 30%, transparent 50%, #000000a8 100%);
}
.moment-logo {
  position: absolute; z-index: 1; inset: auto 5cqi 5cqi;
  display: flex; align-items: flex-end; justify-content: center; block-size: 24%;
}
.moment-logo-art {
  inline-size: auto; block-size: auto; max-inline-size: 50cqi; max-block-size: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 12px #0009);
}
.moment-logo-type {
  margin-inline-end: auto; color: #fff; font-size: clamp(1.1rem, 6.6cqi, 2.6rem); font-weight: 800; line-height: 1.05;
  letter-spacing: -.02em; text-shadow: 0 4px 20px #000b;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.moment-frame-empty::before {
  content: ""; position: absolute; inset: 22% auto auto 50%; inline-size: 18%; aspect-ratio: 1;
  transform: translateX(-50%); background: #ffffff14;
  -webkit-mask: url(/assets/sup-bubble.svg) center / contain no-repeat; mask: url(/assets/sup-bubble.svg) center / contain no-repeat;
}
.moment-stamp {
  position: absolute; z-index: 1; inset: clamp(12px, 3cqi, 28px) auto auto clamp(14px, 3.2cqi, 30px);
  display: grid; justify-items: start; gap: clamp(4px, 1cqi, 10px);
}
.moment-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: #000000a6; color: var(--catalog);
  font-size: .74rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase;
}
@supports (backdrop-filter: blur(12px)) {
  .moment-badge { background: #0000006b; backdrop-filter: blur(16px) saturate(150%); }
}
.moment-badge .sup-glyph { inline-size: 1.35em; block-size: 1.35em; }
.moment-start {
  color: #fff; font-size: clamp(2rem, 7vw, 4.6rem); font-size: clamp(1.8rem, 11cqi, 5.4rem);
  font-weight: 760; line-height: .86; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 40px #000000b3;
}

/* The words: the scene's name, the title, the span, the ways in. */
.moment-copy { display: grid; align-content: center; gap: 14px; min-inline-size: 0; }
.moment-copy > * { animation: moment-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.moment-copy > :nth-child(1) { animation-delay: .08s; }
.moment-copy > :nth-child(2) { animation-delay: .14s; }
.moment-copy > :nth-child(3) { animation-delay: .2s; }
.moment-copy > :nth-child(n + 4) { animation-delay: .26s; }
.moment-copy h1 {
  margin: 0; font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: .98; letter-spacing: -.05em;
  overflow-wrap: anywhere; text-wrap: balance;
}
.moment-work { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; color: #c4c8cf; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.moment-work b { color: var(--text); font-weight: 680; }
.moment-work > * + *::before { content: "·"; content: "·" / ""; margin-inline: 9px; color: #ffffff59; }
.moment-span {
  display: inline-flex; align-items: center; gap: 9px; justify-self: start;
  padding: 7px 14px 7px 11px; border: 1px solid #ffffff21; border-radius: 999px;
  background: #ffffff0f; color: #eceef1;
  font-size: .92rem; font-weight: 620; font-variant-numeric: tabular-nums;
}
.moment-span-dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--catalog); box-shadow: 0 0 0 4px var(--catalog-soft); }
.moment-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 10px; }
.moment-actions .button { min-block-size: 52px; padding-inline: 22px; font-size: 1rem; }
.moment-actions .button-outline { background: #ffffff14; }
.moment-actions .button:focus-visible, .moment-header-get:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.moment-open { box-shadow: 0 12px 36px #00000073; }
.moment-open .sup-glyph { inline-size: 1.3em; block-size: 1.3em; }
.moment-platforms { color: var(--muted); font-size: .86rem; }
.moment-copy .share-row { margin-block-start: 12px; padding-block-start: 20px; border-block-start: 1px solid #ffffff1a; }

/* StreamUp itself, under every Moment. */
.moment-footer {
  position: relative; z-index: 1; display: grid; gap: 16px;
  padding-block: 28px max(24px, env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--line); background: #0b0b0dd9;
}
@supports (backdrop-filter: blur(12px)) {
  .moment-footer { background: #0b0b0d99; backdrop-filter: blur(26px) saturate(130%); }
}
.moment-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.moment-promo p { color: var(--muted); font-size: .92rem; }
.moment-devices { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.moment-devices li { display: inline-flex; align-items: center; gap: 7px; color: #dedee2; font-size: .86rem; font-weight: 600; }
.moment-devices svg { width: 18px; height: 18px; }
.moment-footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .85rem; font-weight: 600; }
.moment-footer-nav a { color: #d1d4da; text-decoration: none; }
.moment-footer-nav a:hover { color: #fff; }
.moment-legal { color: #8b9098; font-size: .76rem; }

/* The 404. */
.moment-missing { position: relative; z-index: 1; background: none; min-block-size: 0; }
.moment-missing .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--catalog); }
.moment-missing .sup-glyph { inline-size: 1.4em; block-size: 1.4em; }

@keyframes moment-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  .moment-frame, .moment-copy > * { animation: none; }
}

@media (max-width: 600px) {
  .moment-header .brand { font-size: 1.05rem; }
  .moment-actions .button { flex: 1 1 100%; }
  .moment-devices { margin-inline-start: 0; }
}
