/*
 * The moment feed and the pieces every moment wears — the freshness stamp, the
 * Whimzi mark, Go and the store buttons — shared by the home page and the
 * shared-moment page, so a moment looks and behaves the same wherever it is
 * opened (2026-10-29). Each page keeps its own layout in its own stylesheet
 * (site.css, share.css); this file is only what they have in common.
 *
 * The feed frames video, so it is dark whatever the page around it is doing
 * (CLAUDE.md, "Design"): its colours are set on the feed itself rather than
 * read from the page, which on the home page may be light.
 */

.s-feed {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #17171a;
  --surface-high: #222227;
  --ink: #f7f7f8;
  --ink-muted: #9a9aa3;
  --hairline: #2a2a2f;
  --accent: #c6f432;
  --on-accent: #111114;
  --display: 'Space Grotesk', Futura, 'Trebuchet MS', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
}

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

.s-feed a {
  color: inherit;
}

/*
 * Whimzi's mark on the playing clip (functions/m/[clipId].js, MARK), so a
 * screenshot or a screen recording says where it came from: the app icon as
 * a small tile, then the address. Low on the left, where no player puts a
 * control: iOS Safari keeps full screen and picture in picture top left,
 * sound top right and the scrubber along the bottom; Chrome keeps play in the
 * middle and a bar two rows deep along the bottom, about 60px, which `bottom`
 * clears with room to spare. No scrim (CLAUDE.md): a shadow on the mark
 * itself keeps it legible on sky and on night alike.
 */
.s-mark {
  position: absolute;
  left: 12px;
  bottom: 84px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  font: 700 0.9rem/1 var(--display);
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* The icon's own tile, rounded as the app's is, with a hairline so it holds its edge on dark footage. */
.s-mark img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 4px rgba(0, 0, 0, 0.45);
}

/*
 * A moment still current: the tile breathes a soft lime glow every few seconds —
 * the city happening now. Quiet most of the cycle, so it never pulls the eye
 * from the footage; still on anything older, and for reduced motion (below).
 */
.s-mark.live img {
  animation: mark-breathe 4s ease-in-out infinite;
}

@keyframes mark-breathe {
  0%,
  60%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 4px rgba(0, 0, 0, 0.45);
  }
  80% {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(198, 244, 50, 0.9), 0 0 18px 5px rgba(198, 244, 50, 0.6), 0 1px 4px rgba(0, 0, 0, 0.45);
  }
}

/* In the feed it heads the words under the clip, clear of the stamp, the sound and Go. */
.s-slide-words .s-mark {
  position: static;
  justify-self: start;
  margin-bottom: 0.35rem;
}

/* The freshness stamp, top left, as the app puts it: lime while current. */
.s-stamp {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.78);
  color: var(--ink);
  font: 700 0.8rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.s-stamp.current {
  background: var(--accent);
  color: var(--on-accent);
}

.s-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.s-stamp.current .s-dot {
  animation: s-pulse 1.6s ease-in-out infinite;
}

@keyframes s-pulse {
  50% {
    opacity: 0.3;
  }
}

.s-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: none;
  min-height: 48px;
  padding: 0 1.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 1.1rem/1 var(--display);
  text-decoration: none;
  box-shadow: 0 0 32px rgba(198, 244, 50, 0.28);
}

.s-go svg {
  width: 1.1rem;
  height: 1.1rem;
}

.s-app-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--hairline), 0 0 28px rgba(198, 244, 50, 0.18);
}

.s-app-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.s-btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 1.2rem;
  border-radius: 999px;
  background: var(--surface-high);
  font: 600 0.95rem/1 var(--body);
  text-decoration: none;
}

.s-btn svg {
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.45rem;
}

.s-btn.primary {
  background: var(--ink);
  color: var(--bg);
}

.s-btn.small {
  min-height: 40px;
  padding: 0 1rem;
  font-size: 0.9rem;
}

/* ---- The feed: the shared moment and the next ones, full screen ---------- */

/* What the script adds to the page's own clip: it opens the feed. */
.s-frame-opens {
  cursor: pointer;
}

.s-watch {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0 1rem 0 0.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.78);
  color: var(--ink);
  font: 700 0.85rem/1 var(--display);
  cursor: pointer;
}

.s-watch svg {
  width: 1.1rem;
  height: 1.1rem;
}

html.s-feed-open,
html.s-feed-open body {
  overflow: hidden;
}

.s-feed {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
}

.s-feed[hidden] {
  display: none;
}

/* One moment per screen, and a swipe never stops between two. */
.s-feed-track {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.s-feed-track::-webkit-scrollbar {
  display: none;
}

.s-slide {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* The clip fills a phone; on a wide screen it is a phone-shaped column in the middle. */
.s-stage {
  position: relative;
  width: 100%;
  max-width: calc(100dvh * 9 / 16);
  height: 100%;
  overflow: hidden;
  background: var(--surface);
}

.s-slide-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}

/*
 * What sits on the footage: the stamp top left, the place and Go at the foot,
 * small and with nothing behind them (CLAUDE.md, "No scrim, ever") — a
 * shadow under the letters, never a block over the clip.
 */
.s-stage .s-stamp {
  top: max(14px, env(safe-area-inset-top, 0px));
  left: 14px;
}

.s-slide-foot {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  pointer-events: none;
}

.s-slide-words {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.s-slide-words p {
  margin: 0;
}

.s-slide-place {
  font: 700 1.15rem/1.15 var(--display);
}

.s-slide-area {
  font-size: 0.8rem;
  color: rgba(247, 247, 248, 0.86);
}

.s-slide-foot .s-go-menu {
  pointer-events: auto;
}

/* The first moment from past the reach says so, as the app's feed does. */
.s-slide-beyond {
  font: 700 0.7rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 247, 248, 0.86);
}

.s-go.s-go-small {
  min-height: 42px;
  padding: 0 1.05rem;
  font-size: 1rem;
}

/*
 * Go and every way there (goMenu in functions/_feed.js): a native <details>,
 * so it opens with no script. On a clip the list rises from Go, over the
 * footage; on the page, where Go sits under the clip, it drops below it.
 */
.s-go-menu {
  position: relative;
  flex: none;
}

.s-go-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.s-go-menu > summary::-webkit-details-marker {
  display: none;
}

.s-go-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 5;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: rgba(23, 23, 26, 0.97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.s-head .s-go-list {
  top: calc(100% + 0.5rem);
  bottom: auto;
}

.s-go-list a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  color: var(--ink);
  font: 600 1rem/1.2 var(--body);
  text-decoration: none;
}

.s-go-list a:hover,
.s-go-list a:focus-visible {
  background: var(--surface-high);
}

/* Bolt and inDrive: the place was copied, and their app is opening. */
.s-go-copied {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 6;
  max-width: 15rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.9rem/1.3 var(--body);
}

.s-head .s-go-copied {
  top: calc(100% + 0.5rem);
  bottom: auto;
}

.s-feed-buttons {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  display: flex;
  gap: 0.4rem;
}

.s-feed-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.6);
  color: var(--ink);
  cursor: pointer;
}

.s-feed-button[hidden] {
  display: none;
}

.s-feed-button svg {
  width: 22px;
  height: 22px;
}

.s-feed :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The last screen: the app, free, in one breath. */
.s-slide-end {
  align-items: center;
  padding: 1.5rem max(16px, env(safe-area-inset-right, 0px)) 1.5rem max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg);
}

.s-end {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  max-width: 22rem;
  text-align: center;
}

.s-end h2 {
  margin: 0;
  font: 700 clamp(1.8rem, 8vw, 2.3rem) / 1.05 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.s-end p {
  margin: 0;
  color: var(--ink-muted);
}

.s-end .s-app-mark {
  border-radius: 16px;
}

.s-end .s-app-actions {
  margin-top: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .s-mark.live img,
  .s-stamp.current .s-dot,
  .life-fill {
    animation: none;
  }

  .s-feed-track {
    scroll-behavior: auto;
  }
}

/*
 * Share, beside Go, on the page and on every clip in the feed (founder,
 * 2026-11-03): a round button of its own, never the accent — that is Go's.
 * Drawn by the page hidden and shown by feed.js, which is what can share.
 */
.s-head-actions,
.s-slide-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.s-slide-actions {
  pointer-events: auto;
}

.s-share-holder,
.s-slide-actions {
  position: relative;
}

.s-share {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.s-share[hidden] {
  display: none;
}

.s-share svg {
  width: 22px;
  height: 22px;
}

.s-share.s-share-small {
  width: 42px;
  height: 42px;
  background: rgba(11, 11, 13, 0.6);
}
