/* =========================================================
   Moments — immersive story viewer
   (uses variables, fonts and buttons from styles.css)
   ========================================================= */
.moments-page { min-height: 100vh; }
.moments-page.viewing { overflow: hidden; }

.m-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--pad); background: linear-gradient(var(--earth), rgba(30, 21, 16, 0)); }
.m-back { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; opacity: 0.8; transition: opacity 0.2s, transform 0.3s var(--ease); }
.m-back:hover { opacity: 1; transform: translateX(-4px); }
.m-logo { height: 64px; width: auto; }

.m-intro { position: relative; max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--pad) 2.5rem; }
.m-intro .mega { font-size: clamp(5rem, 16vw, 15rem); line-height: 0.82; }
.m-script { display: block; font-size: clamp(3rem, 7vw, 6rem); transform: rotate(-7deg); margin-bottom: -1.2rem; position: relative; z-index: 2; }
.m-intro p { max-width: 36rem; margin: 1.6rem 0 2rem; color: var(--muted-l); font-size: 1.05rem; }
.m-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 1rem; }
.m-count { font-size: 0.85rem; color: var(--muted-l); }

/* Grid of moments */
.m-grid { max-width: var(--max); margin: 0 auto; padding: 1rem var(--pad) clamp(6rem, 10vw, 8rem); columns: 4 240px; column-gap: 1rem; }
.m-tile {
  position: relative; display: block; width: 100%; margin: 0 0 1rem; break-inside: avoid; overflow: hidden; border-radius: 6px;
  background: var(--earth-2); text-align: left; cursor: pointer;
  opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.m-tile.in { opacity: 1; transform: none; }
.m-tile img, .m-tile video { display: block; width: 100%; height: auto; transition: transform 0.8s var(--ease), filter 0.5s; filter: sepia(0.12); }
.m-tile video { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.m-tile.previewing video { opacity: 1; }
.m-tile:hover img { transform: scale(1.04); filter: none; }
.m-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 14, 10, 0.85), transparent 55%); pointer-events: none; }
.m-meta { position: absolute; z-index: 2; left: 1rem; right: 1rem; bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.1rem; }
.m-meta b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.35rem; line-height: 1.05; }
.m-meta small { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ochre); }
.m-badge { position: absolute; z-index: 2; top: 0.8rem; right: 0.8rem; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(20, 14, 10, 0.65); backdrop-filter: blur(6px); font-size: 0.72rem; font-weight: 600; }
.m-badge::before { content: ""; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.m-badge.photo::before { display: none; }

.m-outro { padding: clamp(6rem, 10vw, 8rem) var(--pad); text-align: center; }
.m-outro .script { display: block; font-size: clamp(3rem, 6vw, 5rem); transform: rotate(-6deg); margin-bottom: -0.6rem; }
.m-outro .mega { font-size: clamp(2.8rem, 7vw, 6.4rem); max-width: 16ch; margin: 0 auto 2rem; }
.m-outro .m-actions { justify-content: center; }

/* ---------- Reels ---------- */
.reels { position: fixed; inset: 0; z-index: 500; background: #0b0806; color: #fff; overflow: hidden; }
.reels[hidden] { display: none; }
.reels.opening { animation: rIn 0.45s var(--ease); }
@keyframes rIn { from { opacity: 0; transform: scale(0.97); } }
.r-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(50px) brightness(0.4) saturate(1.3); transition: background-image 0.6s; }

.r-feed { position: absolute; inset: 0; overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.r-feed::-webkit-scrollbar { display: none; }
.r-slide { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }

/* The video frame: sized from the clip's own aspect ratio */
.r-frame {
  position: relative; aspect-ratio: var(--ar);
  width: min(calc(100vw - 220px), calc((100dvh - 2.5rem) * var(--ar)));
  border-radius: 14px; background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.94); opacity: 0.55; transition: transform 0.6s var(--ease), opacity 0.6s;
}
.r-slide.active .r-frame { transform: none; opacity: 1; }
.r-clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.r-clip .r-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.r-clip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.r-clip::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent 38%), linear-gradient(rgba(0, 0, 0, 0.35), transparent 18%); }

/* tap target + feedback */
.r-tap { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.r-state { position: absolute; z-index: 3; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); display: grid; place-items: center; font-size: 2rem; opacity: 0; transform: scale(0.7); transition: opacity 0.25s, transform 0.25s var(--ease); pointer-events: none; }
.r-slide.paused .r-state { opacity: 1; transform: none; }
.r-burst { position: absolute; z-index: 4; font-size: 6rem; pointer-events: none; transform: translate(-50%, -50%) scale(0); animation: burst 0.9s var(--ease) forwards; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.4)); }
@keyframes burst { 20% { transform: translate(-50%, -50%) scale(1.25) rotate(-8deg); opacity: 1; } 60% { transform: translate(-50%, -60%) scale(1) rotate(4deg); } 100% { transform: translate(-50%, -120%) scale(0.8); opacity: 0; } }

/* caption */
.r-info { position: absolute; z-index: 3; left: 1.2rem; right: 5.5rem; bottom: 1.6rem; pointer-events: none; }
.r-info .script { display: block; font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--ochre); transform: rotate(-5deg); transform-origin: left; }
.r-info h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.7rem, 3.2vw, 2.8rem); line-height: 1; margin-top: 0.15rem; }
.r-info p { font-size: 0.85rem; opacity: 0.85; margin-top: 0.3rem; }
.r-slide.active .r-info > * { animation: capIn 0.7s var(--ease) both; }
.r-slide.active .r-info > :nth-child(2) { animation-delay: 0.08s; }
.r-slide.active .r-info > :nth-child(3) { animation-delay: 0.16s; }
@keyframes capIn { from { opacity: 0; transform: translateY(14px); } }

/* progress / scrubber */
.r-progress { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 18px; display: flex; align-items: flex-end; cursor: pointer; touch-action: none; }
.r-progress span { position: relative; display: block; width: 100%; height: 3px; background: rgba(255, 255, 255, 0.25); transition: height 0.2s; }
.r-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--ochre); transform-origin: left; transform: scaleX(0); }
.r-progress:hover span, .r-progress.dragging span { height: 6px; }

/* action rail */
.r-rail { position: absolute; z-index: 6; bottom: 1.4rem; right: -4.6rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.r-act { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; font-size: 0.7rem; font-weight: 600; color: #fff; }
.r-act b { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; font-weight: 400; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); transition: transform 0.25s var(--ease), background 0.25s; }
.r-act:hover b { transform: scale(1.1); background: rgba(255, 255, 255, 0.22); }
.r-act.loved b { background: var(--rust); animation: pop 0.45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.3); } }
.r-act.book b { background: var(--ochre); color: var(--ink); }

/* end slide */
.r-end { text-align: center; padding: var(--pad); display: grid; justify-items: center; gap: 1rem; }
.r-end .script { font-size: clamp(3rem, 7vw, 5rem); transform: rotate(-6deg); }
.r-end .mega { font-size: clamp(2.6rem, 7vw, 5.6rem); max-width: 14ch; }
.r-end .m-actions { justify-content: center; margin-top: 1rem; }

/* chrome */
.r-top { position: absolute; z-index: 10; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 1rem; padding: max(0.9rem, env(safe-area-inset-top)) 1.2rem 0.9rem; pointer-events: none; }
.r-top > * { pointer-events: auto; }
.r-title { flex: 1; display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); text-transform: uppercase; font-size: 1.3rem; letter-spacing: 0.02em; }
.r-title img { width: 32px; height: 32px; border-radius: 50%; background: var(--rust); padding: 4px; }
.r-title em { font-family: var(--sans); font-style: normal; font-size: 0.78rem; font-weight: 600; opacity: 0.7; letter-spacing: 0.08em; }
.r-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); color: #fff; transition: background 0.2s, transform 0.2s var(--ease); }
.r-btn:hover { background: rgba(255, 255, 255, 0.25); }
.r-btn:disabled { opacity: 0.3; cursor: default; }
.r-auto { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); cursor: pointer; }
.r-auto input { accent-color: var(--ochre); }
.r-arrows { position: absolute; z-index: 10; right: 1.4rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0.7rem; }
.r-arrows .r-btn:hover:not(:disabled) { transform: scale(1.08); }

.r-hint { position: absolute; z-index: 12; left: 50%; top: 5.2rem; transform: translateX(-50%); padding: 0.75rem 1.3rem; border-radius: 999px; background: var(--ochre); color: var(--ink); font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: pulse 1.6s infinite; }
.r-hint[hidden] { display: none; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.06); } }
.r-toast { position: absolute; z-index: 12; left: 50%; bottom: 2rem; transform: translate(-50%, 20px); padding: 0.7rem 1.2rem; border-radius: 999px; background: rgba(20, 14, 10, 0.9); font-size: 0.88rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s var(--ease); }
.r-toast.show { opacity: 1; transform: translate(-50%, 0); }
.r-swipe { position: absolute; z-index: 4; left: 50%; bottom: 5.5rem; transform: translateX(-50%); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; animation: nudge 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes nudge { 50% { transform: translate(-50%, -8px); } }

/* phones: full-bleed frame, rail inside */
@media (max-width: 760px) {
  .r-frame { width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; transform: none; opacity: 1; }
  .r-rail { right: 0.8rem; bottom: 5.5rem; }
  .r-info { right: 4.8rem; bottom: 1.8rem; }
  .r-arrows { display: none; }
  .r-auto span { display: none; }
  .r-progress { bottom: max(0px, env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .m-grid { columns: 2 150px; column-gap: 0.6rem; }
  .m-tile { margin-bottom: 0.6rem; }
  .m-meta b { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .m-tile { opacity: 1; transform: none; }
  .v-stage .kb { animation: none; }
}


/* arrows on the left so they never sit over the Love/Share rail */
.r-arrows { right: auto; left: 1.4rem; }

/* =========================================================
   Phone experience
   ========================================================= */
.r-act, .r-act b { line-height: 1; }
/* .book is also the booking block on the home page (styles.css): undo its margin, padding and border here */
.r-act.book { display: flex; max-width: none; margin: 0; padding: 0; border: 0; gap: 0.25rem; }

@media (max-width: 760px) {
  /* let the blurred poster fill the black bars around landscape clips */
  .r-frame, .r-clip video { background: transparent; }
  .r-frame { box-shadow: none; }
  .r-info { bottom: calc(1.8rem + env(safe-area-inset-bottom)); }
  .r-rail { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .r-swipe { bottom: calc(11rem + env(safe-area-inset-bottom)); }
  .r-toast { bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .m-top { padding-top: max(1rem, env(safe-area-inset-top)); background: linear-gradient(var(--earth) 55%, rgba(30, 21, 16, 0)); }
  .m-logo { height: 46px; }
  .m-intro { padding-top: 2rem; }
  .m-intro p { font-size: 1rem; }

  /* uniform portrait tiles so titles never collide with the duration badge */
  .m-grid { columns: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .m-tile { margin: 0; aspect-ratio: 4 / 5; }
  .m-tile img { height: 100%; object-fit: cover; }
  .m-badge { top: 0.5rem; right: 0.5rem; font-size: 0.66rem; padding: 0.25rem 0.55rem; }
  .m-meta { left: 0.7rem; right: 0.7rem; bottom: 0.7rem; }
  .m-meta small { font-size: 0.62rem; letter-spacing: 0.08em; }
}
