/* ---------- Pipeline reel ----------
   Adapted from the BestTrip case in the founder's portfolio. main.js adds .rl--live and turns
   the drum; without JS it is a plain list with HTML5 campaigns open. Monochrome sketches:
   ink, warm greys and white; blue only on the open card, the pulse and the layout guides. */
.section--reel .head { align-items: start; }
.head__sub { margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.rl {
  --rl-h: 440px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --line-soft: color-mix(in srgb, var(--text) 7%, transparent);
  --line-k: color-mix(in srgb, var(--text) 13%, transparent);
  margin: 0; padding: 32px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--sub);
}
.rl__defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.rl__grid { display: grid; grid-template-columns: minmax(0, .82fr) 56px minmax(0, 1.38fr); align-items: center; }

.rl__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rl__item { position: relative; background: var(--paper); border: 1px solid var(--line-k); border-radius: 12px; box-shadow: 0 1px 2px color-mix(in srgb, var(--shade) 5%, transparent), 0 2px 8px color-mix(in srgb, var(--shade) 4%, transparent); }
.rl__item.is-on { border-color: color-mix(in srgb, var(--accent) 35%, transparent); border-left: 2px solid var(--accent); box-shadow: 0 2px 4px color-mix(in srgb, var(--shade) 5%, transparent), 0 12px 32px color-mix(in srgb, var(--shade) 8%, transparent); }
.rl__btn {
  display: block; width: 100%; margin: 0; padding: 11px 16px; border: 0; background: none; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--text); text-align: center; cursor: pointer;
}
.rl__item.is-on .rl__btn { font-size: 17px; }
.rl__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rl__in { list-style: none; margin: 0; padding: 0 16px 14px; display: none; box-sizing: border-box; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.rl__item.is-on .rl__in { display: grid; }
.rl__in li { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.rl__in svg { flex: none; width: 17px; height: 13px; color: var(--text); }

.rl--live .rl__drum { position: relative; height: var(--rl-h); overflow: hidden; cursor: grab; touch-action: pan-y; }
.rl--live .rl__drum::before, .rl--live .rl__drum::after { content: ""; position: absolute; left: 0; right: 0; height: 16%; z-index: 20; pointer-events: none; }
.rl--live .rl__drum::before { top: 0; background: linear-gradient(var(--sub), transparent); }
.rl--live .rl__drum::after { bottom: 0; background: linear-gradient(transparent, var(--sub)); }
.rl--live .rl__drum.is-drag { cursor: grabbing; }
.rl--live .rl__list { display: block; position: relative; height: 100%; }
.rl--live .rl__item {
  position: absolute; left: 5%; right: 5%; top: 50%;
  transform: translateY(calc(var(--y, 0px) - 50%)) scale(var(--sc, 1)); opacity: var(--o, 1);
  transition: transform .55s var(--ease), opacity .55s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  will-change: transform;
}
.rl--live .rl__item.no-tr { transition: none; }
.rl--live .rl__in { display: grid; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .45s var(--ease), opacity .3s var(--ease); }
.rl--live .rl__item:not(.is-on) .rl__in { padding-bottom: 0; }
.rl--live .rl__item.is-on .rl__in { max-height: 200px; opacity: 1; transition: max-height .45s var(--ease), opacity .35s var(--ease) .15s; }

.rl__arrow { position: relative; align-self: stretch; }
.rl__arrow::before { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; margin-top: -1px; background: radial-gradient(circle, color-mix(in srgb, var(--text) 28%, transparent) .9px, transparent 1.3px) 0 50% / 6px 2px repeat-x; }
.rl__arrow i { position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); opacity: 0; }
.rl.is-run .rl__arrow i { animation: rl-dot .6s var(--ease) .35s both; }
@keyframes rl-dot { 0% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(34px); } }

.rl__stage { display: grid; grid-template-rows: auto auto; overflow: hidden; background: var(--base); border: 1px solid var(--line-k); border-radius: 16px; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--paper) 70%, transparent), 0 1px 2px color-mix(in srgb, var(--shade) 4%, transparent); }
.rl__canvas { display: grid; place-items: center; aspect-ratio: 16 / 10.5; padding: 3% 4%; box-sizing: border-box; background: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px) 8px 8px / 16px 16px; }
.rl__sk { grid-area: 1 / 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; }
.rl__sk.is-on { display: flex; }
.rl__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 28px; padding: 10px 14px; border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--paper) 55%, transparent); }
.rl__file { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; }
.rl__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rl__chip { display: none; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--text); color: var(--paper); font-size: 11px; line-height: 18px; letter-spacing: .04em; }
.rl__chip.is-on { display: inline-flex; }
.rl--live .rl__chip.is-on { animation: rl-in .35s var(--ease) both; animation-delay: calc(2.3s + var(--i, 0) * 90ms); }

.sk-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sk-line rect { fill: none; stroke: var(--text); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-dasharray: 1 1; opacity: 0; }
.rl--live .rl__sk.is-on .sk-line rect { animation: rl-draw .9s var(--ease) .45s both; }
.rl--live .rl__sk.is-on .rl__page:not(.rl__page--board) { animation: rl-fill .45s var(--ease) 1.05s both; }
.rl--live .rl__sk.is-on .s, .rl--live .rl__sk.is-on .sk-bar, .rl--live .rl__sk.is-on .sk-crop { animation: rl-in .4s var(--ease) both; animation-delay: calc(1.3s + var(--d, 0) * 100ms); }
.rl--live .rl__sk.is-on .rl__page--board .s { animation-delay: calc(.6s + var(--d, 0) * 110ms); }
@keyframes rl-draw { 0% { stroke-dashoffset: 1; opacity: 1; } 70% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes rl-fill { from { background-color: transparent; box-shadow: 0 0 0 color-mix(in srgb, var(--shade) 0%, transparent); } }
@keyframes rl-in { from { opacity: 0; transform: translateY(5px); } }

/* carriers: every piece is placed by --x/--y/--w/--h (% of its page) */
.rl__page { position: relative; box-sizing: border-box; flex: none; overflow: hidden; background: var(--paper); border-radius: 6px; box-shadow: 0 1px 2px color-mix(in srgb, var(--shade) 6%, transparent), 0 8px 22px color-mix(in srgb, var(--shade) 10%, transparent); }
.rl__page--site { width: 94%; aspect-ratio: 16 / 10; border-radius: 10px; }
.rl__page--a4 { height: 92%; aspect-ratio: 1 / 1.414; }
.rl__page--print { height: 78%; aspect-ratio: 1 / 1.414; overflow: visible; border-radius: 0; margin: 12px 0 18px; outline: 1px solid var(--line-k); }
.rl__page--board { width: 96%; aspect-ratio: 16 / 10; overflow: visible; background: none; box-shadow: none; border-radius: 0; }

.s { display: block; }
.s.a { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 999px; }
.k-ink { background: var(--text); }
.k-ink2 { background: var(--ink-2); }
.k-mid { background: var(--mid); }
.k-sub { background: var(--sub-2); }
.k-sub2 { background: var(--sub); }
.k-w { background: var(--paper); }
.k-line { background: var(--line-k); }
.k-cmyk { background: linear-gradient(90deg, #00A3E0 0 25%, #E6007E 25% 50%, #FFE600 50% 75%, #1A1A1A 75%); border-radius: 0; }
.k-reg { aspect-ratio: 1; height: auto !important; border: 1px solid var(--text); border-radius: 50%; background: linear-gradient(var(--text), var(--text)) center / 140% 1px no-repeat, linear-gradient(var(--text), var(--text)) center / 1px 140% no-repeat; }
.k-qr { background: repeating-conic-gradient(var(--text) 0 25%, var(--paper) 0 50%) 0 0 / 34% 34%; border: 2px solid var(--text); box-sizing: border-box; border-radius: 2px !important; }
.o-ring { aspect-ratio: 1; height: auto !important; border-radius: 50% !important; background: none; border: 1.5px solid var(--mid); box-sizing: border-box; }
.o-ring--ink { border-color: var(--text); }
.o-line { background: none; border: 1.2px solid var(--text); box-sizing: border-box; }
.o-dash { background: none; border: 1px dashed color-mix(in srgb, var(--text) 40%, transparent); border-radius: 0; }
.r-circle { aspect-ratio: 1; height: auto !important; border-radius: 50% !important; }
.sq { aspect-ratio: 1; height: auto !important; }
.r-0 { border-radius: 0 !important; }
.r-8 { border-radius: 8px !important; }
.r-6 { border-radius: 6px !important; }
.r-4 { border-radius: 4px !important; }
.r-bar { border-radius: 3px 3px 1px 1px !important; }
.sh { box-shadow: 0 1px 2px color-mix(in srgb, var(--shade) 6%, transparent), 0 6px 16px color-mix(in srgb, var(--shade) 12%, transparent); }
.o50 { opacity: .5; } .o60 { opacity: .6; }
.t-lbl { font-family: var(--mono); width: auto !important; height: auto !important; border-radius: 0 !important; font-size: 10px; line-height: 1; letter-spacing: .04em; color: var(--muted); font-style: normal; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sk-bar { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 1.2%; width: 100%; height: 8%; padding: 0 2.5%; box-sizing: border-box; background: var(--base); border-bottom: 1px solid var(--line-soft); }
.sk-bar i { width: 1.4%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--text) 16%, transparent); }
.sk-bar b { margin-left: 3%; width: 34%; height: 36%; border-radius: 999px; background: var(--sub); }
.sk-crop {
  position: absolute; inset: -9px; pointer-events: none; --c: var(--muted); background:
    linear-gradient(var(--c), var(--c)) 0 9px / 6px 1px no-repeat, linear-gradient(var(--c), var(--c)) 9px 0 / 1px 6px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 9px / 6px 1px no-repeat, linear-gradient(var(--c), var(--c)) calc(100% - 9px) 0 / 1px 6px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 calc(100% - 9px) / 6px 1px no-repeat, linear-gradient(var(--c), var(--c)) 9px 100% / 1px 6px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% calc(100% - 9px) / 6px 1px no-repeat, linear-gradient(var(--c), var(--c)) calc(100% - 9px) 100% / 1px 6px no-repeat;
}

/* the rules made visible: layout guides flash while the carrier builds */
.sk-guides { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.rl--live.is-run .rl__sk.is-on .sk-guides { animation: rl-guide 2s var(--ease) 1.1s both; }
.g { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); box-sizing: border-box; }
.g-box { border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.g-cols { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 6.6%, transparent 6.6% 8.333%); }
.g-h { height: 0 !important; border-top: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.g-v { width: 0 !important; border-left: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.g-v--c { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
@keyframes rl-guide { 0% { opacity: 0; } 18% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }

/* auto-turn progress line on the open card */
.rl--live .rl__item.is-on::after, .rl--live .rl__item.is-on::before { content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; border-radius: 2px; }
.rl--live .rl__item.is-on::after { background: var(--line-soft); }
.rl--live .rl__item.is-on::before { z-index: 1; background: var(--accent); transform: scaleX(0); transform-origin: left; will-change: transform; }
.rl--live.is-tick .rl__item.is-on::before { animation: rl-prog var(--rl-t, 5200ms) linear both; }
@keyframes rl-prog { to { transform: scaleX(1); } }

@media (max-width: 760px) {
  .rl { padding: 24px 16px 16px; --rl-h: 330px; }
  .rl__canvas { aspect-ratio: 4 / 3.6; }
  .rl__grid { grid-template-columns: minmax(0, 1fr); }
  .rl__arrow { height: 44px; }
  .rl__arrow::before { left: 50%; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; margin: 0 0 0 -1px; background: radial-gradient(circle, color-mix(in srgb, var(--text) 28%, transparent) .9px, transparent 1.3px) 50% 0 / 2px 6px repeat-y; }
  .rl__arrow i { left: 50%; top: 6px; margin: 0 0 0 -3px; }
  .rl.is-run .rl__arrow i { animation-name: rl-dot-y; }
  .rl__btn { font-size: 14px; padding: 10px 12px; }
  .rl__item.is-on .rl__btn { font-size: 15px; }
  .rl__in { padding: 0 12px 12px; gap: 6px 10px; }
  .rl__in li { font-size: 12px; }
  .t-lbl { font-size: 8px; }
}
@keyframes rl-dot-y { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px); } }
@media (prefers-reduced-motion: reduce) {
  .rl .s, .rl .rl__page, .rl .rl__chip, .rl .rl__arrow i, .rl .sk-line rect, .rl .sk-bar, .rl .sk-crop, .rl .sk-guides { animation: none !important; }
  .rl--live .rl__item, .rl--live .rl__in, .rl--live .rl__item.is-on .rl__in { transition: none; }
  .rl--live .rl__item.is-on::before, .rl--live .rl__item.is-on::after { display: none; }
}
