/* ═══════════════════════════════════════════════════════════════
   RHYTHM.CSS — the page-rhythm system. Pages are built from five
   section types, used in this order of intensity so no texture runs
   long enough to feel like wallpaper:

     .r-bento   BENTO       dense grid of colour tiles. At most one or two
                            per page, never back to back.
     .r-break   BREAK       full-bleed photo (or motion) with one line of
                            type. Resets the eye after a dense section.
     .r-cards   BOLD CARDS  one row of equal, oversized colour cards.
                            Same size, same shape: order, not variety.
     .r-relief  RELIEF      plain type on black, generous space, no tiles.
     .r-flip    MOTION      GIF-style flipbook of real work. A creative
                            touch inside a bento tile or a break, never
                            its own section.
     .r-motion  MOTION      short muted looping video (assets/video/) used
                            behind a panel or beside relief type. Always
                            muted, looping, with a poster; paused off-screen
                            and for reduced-motion users (motion.js).
                            Panel and tile variants live in motion.css.

   Typical page:  bento → break → cards → small bento → relief → CTA.
   Relies on each page's tokens: --display, --mono, --ink, --cream and
   the four core colours (--orange, --red, --mag, --teal).
   ═══════════════════════════════════════════════════════════════ */

.r-kicker { display: inline-flex; align-items: baseline; gap: .6rem; font-family: var(--mono); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(243,236,223,.6); }
.r-kicker em { font-style: normal; color: var(--accent, var(--orange)); font-size: .95rem; }

/* ── BENTO ── */
.r-bento { padding: clamp(10px, 2vw, 20px); }

/* ── BREAK ── */
.r-break { position: relative; overflow: hidden; margin: clamp(10px, 2vw, 20px); border-radius: clamp(12px, 2vw, 20px); min-height: clamp(420px, 70vh, 760px); display: flex; align-items: flex-end; background: #0c0a08; }
.r-break > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.r-break::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,10,8,.78) 0%, rgba(12,10,8,.35) 55%, rgba(12,10,8,0) 100%); }
.r-break-copy { position: relative; z-index: 1; padding: clamp(1.6rem, 5vw, 4.5rem); display: flex; flex-direction: column; gap: 1rem; }
main .r-break-line { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.2rem, 8vw, 7.5rem); line-height: .88; color: var(--cream); overflow-wrap: anywhere; }

/* ── BOLD CARDS ── */
.r-cards { padding: clamp(4rem, 9vw, 8rem) clamp(10px, 2vw, 20px) clamp(3rem, 6vw, 5rem); }
.r-head { display: flex; flex-direction: column; gap: 1rem; padding: 0 clamp(.4rem, 2vw, 1.6rem); margin-bottom: clamp(1.8rem, 4vw, 3rem); }
main .r-head h2 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.6rem, 6.5vw, 5.6rem); line-height: .9; margin: 0; color: var(--cream); }
.r-cards-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 16px); }
.r-card { --c: var(--orange); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1rem; min-height: clamp(380px, 38vw, 520px); padding: clamp(1.6rem, 3vw, 2.6rem); border-radius: clamp(12px, 2vw, 20px); background: var(--c); color: var(--ink); text-decoration: none; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.r-card[data-color="red"]  { --c: var(--red); }
.r-card[data-color="mag"]  { --c: var(--mag); }
.r-card[data-color="teal"] { --c: var(--teal); }
.r-card-num { font-family: var(--display); font-weight: 900; font-size: clamp(5rem, 11vw, 9rem); line-height: .8; opacity: .9; }
main .r-card h3 { margin: auto 0 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2rem, 3.4vw, 3rem); line-height: .92; color: var(--ink); }
main .r-card p { margin: 0; color: var(--ink); opacity: .82; font-size: 1.02rem; line-height: 1.55; max-width: 34ch; }
.r-card-go { display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; font-family: var(--mono); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--ink); padding-bottom: .2rem; }
.r-card:hover, .r-card:focus-visible { transform: translateY(-8px); }

/* ── RELIEF ── */
.r-relief { padding: clamp(6rem, 14vw, 12rem) clamp(1.25rem, 6vw, 5rem); }
.r-relief-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.4rem clamp(2rem, 6vw, 5rem); align-items: start; }
.r-relief-inner .r-kicker { grid-column: 1 / -1; }
main .r-relief h2 { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: .92; color: var(--cream); }
.r-relief-body { display: flex; flex-direction: column; gap: 1.2rem; padding-top: .4rem; }
main .r-relief-body p { margin: 0; font-size: 1.12rem; line-height: 1.8; color: rgba(243,236,223,.66); }

/* ── MOTION: GIF-style flipbook ──
   Images stack and each one shows for one "frame", hard cuts (steps),
   so it reads like a GIF of real work rather than a smooth slideshow.
   Frame count is fixed at 6; add/remove images in sets of 6. */
.r-flip { position: absolute; inset: 0; }
.r-flip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: rFlip 3.6s steps(1, end) infinite; }
.r-flip img:nth-child(1) { animation-delay: 0s; }
.r-flip img:nth-child(2) { animation-delay: .6s; }
.r-flip img:nth-child(3) { animation-delay: 1.2s; }
.r-flip img:nth-child(4) { animation-delay: 1.8s; }
.r-flip img:nth-child(5) { animation-delay: 2.4s; }
.r-flip img:nth-child(6) { animation-delay: 3s; }
@keyframes rFlip { 0% { opacity: 1; } 16.667% { opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .r-flip img { animation: none; }
  .r-flip img:first-child { opacity: 1; }
}

/* ── MOTION: looping video ── */
.r-motion { pointer-events: none; }
/* Relief with motion: the clip fills the section, shaded under the type. */
.r-relief--motion { position: relative; overflow: hidden; }
.r-relief--motion { isolation: isolate; }
.r-relief-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.r-relief--motion::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, transparent 0%, rgba(8,10,11,.55) 45%, rgba(8,10,11,.85) 100%); }
.r-relief--motion .r-relief-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 0 0 auto; grid-template-columns: 1fr; }
.r-relief--motion .r-relief-body p { color: rgba(243,236,223,.85); }
@media (max-width: 900px) { .r-relief--motion::before { background: rgba(8,10,11,.62); } }

@media (max-width: 900px) {
  .r-cards-row { grid-template-columns: 1fr; }
  .r-card { min-height: 300px; }
  .r-relief-inner { grid-template-columns: 1fr; }
}
