/* Seen, Believed, Measured, Round again: one trip around the loop, in four frames.
   Used by the home page (via __LOOP__). Resting state is complete; script only adds .is-before
   when the section starts below the fold, then lifts it as it scrolls in. */
.loop { margin-top: 36px; }
.loop-frames { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.loop-frame { display: grid; gap: 12px; align-content: start; min-width: 0; transition: opacity .6s ease, transform .6s ease; transition-delay: calc(var(--i, 0) * 180ms); }
.loop-frame .label { color: var(--ink); }
.loop-frame h3 { font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.loop.is-before .loop-frame { opacity: 0; transform: translateY(14px); }

.loop-shotwrap { position: relative; margin-bottom: 4px; }
.loop-frame:not(:last-child) .loop-shotwrap::after { content: ""; position: absolute; top: 50%; right: -15px; width: 9px; height: 9px; margin-top: -5px; border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: rotate(45deg); }
.loop-shot { position: relative; aspect-ratio: 3 / 4; max-width: 100%; overflow: hidden; background: var(--starlight); }
.loop-shot > img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 01: the reel on a phone */
.loop-phone { position: absolute; inset: 8% 20%; background: var(--ink); border: 1px solid var(--hair-2); overflow: hidden; }
.loop-phone img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 02: a guest's words over the table */
.loop-quote { position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; background: rgba(255,255,255,.95); padding: 10px 12px; box-shadow: 0 6px 18px rgba(7,11,26,.22); }
.loop-quote p { font-size: 14px; line-height: 1.4; }
.loop-quote .fig { display: block; margin-top: 4px; font-size: 11px; }

/* 03: the profile header they already check */
.loop-profile { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 16px; text-align: center; }
.loop-av { width: 68px; height: 68px; border-radius: 50%; background: #3B4A2A; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--hair-2); display: grid; place-items: center; overflow: hidden; }
.loop-av img { width: 74%; height: auto; display: block; }
.loop-handle { font-weight: 600; font-size: 15px; }
.loop-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 22px; justify-content: center; }
.loop-stats div { display: grid; }
.loop-stats b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.loop-stats small { font-size: 12px; color: var(--ink-2); }
.loop-stats .hit b { color: var(--nebula); }
.loop-lift { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }

/* 04: the next post */
.loop-tag { position: absolute; top: 10px; left: 10px; background: var(--paper); color: var(--ink); font: 700 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; }

/* the line from 04 back to 01 */
.loop-back { display: grid; justify-items: center; gap: 12px; margin-top: 18px; }
.loop-line { position: relative; justify-self: start; margin-left: calc(12.5% - 7.5px); width: calc(75% + 15px); height: 30px; border: 1.5px solid var(--ink); border-top: 0; clip-path: inset(-12px -12px -12px -12px); transition: clip-path 1.1s cubic-bezier(.45,0,.2,1); transition-delay: 900ms; }
.loop-line::before { content: ""; position: absolute; left: -7px; top: -3px; width: 11px; height: 11px; border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink); transform: rotate(45deg); }
.loop.is-before .loop-line { clip-path: inset(-12px -12px -12px 100%); }
.loop-back .label { transition: opacity .5s; transition-delay: 1700ms; }
.loop.is-before .loop-back .label { opacity: 0; }
.loop-source { margin-top: 22px; max-width: 90ch; }

@media (max-width: 900px) {
  .loop-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .loop-frame:not(:last-child) .loop-shotwrap::after { display: none; }
  .loop-line { display: none; }
  .loop-back { justify-items: start; margin-top: 26px; padding-top: 14px; border-top: 1.5px solid var(--ink); }
}
@media (max-width: 560px) {
  .loop-frames { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .loop-shot { aspect-ratio: 4 / 5; }
  .loop-phone { inset: 8% 23%; }
}
@media (prefers-reduced-motion: reduce) {
  .loop *, .loop *::before { transition: none !important; }
}
