/* Logus — reels 9:16 · 10s loop CSS */

.reels-stage {
  width: min(var(--max-w), 100%);
  margin: 0 auto;
  padding: 24px 20px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  justify-items: center;
}
@media (max-width: 800px) {
  .reels-stage { grid-template-columns: 1fr; }
}

.reel {
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reel__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-micro);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}
.reel__viewport {
  aspect-ratio: 9 / 16;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: var(--void);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 30px 60px rgba(7, 7, 8, 0.5),
    0 8px 20px rgba(7, 7, 8, 0.25);
  cursor: pointer;
}
.reel__viewport:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.reel__scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.reel__scene.is-on { opacity: 1; }

/* Shared type inside reel */
.reel-type {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  padding: 12%;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.reel-type--lg { font-size: clamp(1.6rem, 9cqi, 2.4rem); }
.reel-type--signal { color: var(--signal); }
.reel-label {
  position: absolute;
  top: 8%;
  left: 10%;
  font-family: var(--font-micro);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
}

/* ——— Reel 1 SISTEMA — 10s ——— */
.reel--sistema .reel__viewport { container-type: size; }
.reel--sistema.is-playing .r1-grain,
.reel--sistema.is-playing .r1-label,
.reel--sistema.is-playing .r1-line1,
.reel--sistema.is-playing .r1-line2,
.reel--sistema.is-playing .r1-phone,
.reel--sistema.is-playing .r1-end {
  animation-duration: 10s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.r1-grain {
  position: absolute; inset: 0;
  opacity: 0.085;
  background-image: url("../assets/grain.svg");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  z-index: 5;
  pointer-events: none;
}
.r1-label {
  animation-name: r1-label;
  z-index: 4;
}
@keyframes r1-label {
  0%, 12% { opacity: 1; }
  14%, 100% { opacity: 0.35; }
}

.r1-line1 {
  color: var(--bone);
  animation-name: r1-line1;
  z-index: 3;
}
@keyframes r1-line1 {
  0%, 14% { opacity: 0; transform: translateY(12px); }
  16%, 36% { opacity: 1; transform: translateY(0); }
  38%, 100% { opacity: 0; transform: translateY(-8px); }
}

.r1-line2 {
  animation-name: r1-line2;
  z-index: 3;
}
@keyframes r1-line2 {
  0%, 36% { opacity: 0; transform: scale(0.96); }
  38%, 60% { opacity: 1; transform: scale(1); }
  62%, 100% { opacity: 0; }
}

.r1-phone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation-name: r1-phone;
  z-index: 3;
}
.r1-phone .device-phone {
  width: 58%;
  transform: translateY(40%);
}
.r1-phone .pulse-num {
  font-family: var(--font-micro);
  color: var(--signal);
  animation: r1-pulse 1.2s ease-in-out infinite;
}
@keyframes r1-phone {
  0%, 60% { opacity: 0; }
  62% { opacity: 1; }
  62%, 84% { opacity: 1; }
  62% { }
  86%, 100% { opacity: 0; }
}
.reel--sistema.is-playing .r1-phone .device-phone {
  animation: r1-phone-rise 10s linear infinite;
}
@keyframes r1-phone-rise {
  0%, 60% { transform: translateY(48%); }
  68%, 84% { transform: translateY(0); }
  90%, 100% { transform: translateY(-10%); opacity: 0; }
}
@keyframes r1-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.r1-end {
  position: absolute;
  inset: 0;
  padding: 12%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background: var(--void);
  animation-name: r1-end;
  z-index: 4;
  color: var(--bone);
}
.r1-end strong {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 8cqi, 2.2rem);
  letter-spacing: -0.035em;
  font-weight: 700;
}
.r1-end span { color: var(--graphite); font-size: 0.9rem; }
@keyframes r1-end {
  0%, 84% { opacity: 0; }
  86%, 100% { opacity: 1; }
}

/* ——— Reel 2 CAMPO — 10s ——— */
.reel--campo .reel__viewport { background: var(--bone); container-type: size; }
.reel--campo.is-playing .r2-line,
.reel--campo.is-playing .r2-mods,
.reel--campo.is-playing .r2-glass,
.reel--campo.is-playing .r2-end {
  animation-duration: 10s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.r2-canvas {
  position: absolute;
  inset: 0;
  padding: 10%;
}
.r2-line {
  position: absolute;
  left: 12%; right: 12%;
  top: 42%;
  height: 1px;
  background: var(--ink);
  transform-origin: left center;
  animation-name: r2-line;
  z-index: 1;
}
.r2-line i {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
}
.r2-line i:nth-child(1) { left: 0%; }
.r2-line i:nth-child(2) { left: 25%; }
.r2-line i:nth-child(3) { left: 50%; }
.r2-line i:nth-child(4) { left: 75%; }
.r2-line i:nth-child(5) { left: 100%; background: var(--signal); }
@keyframes r2-line {
  0% { transform: scaleX(0); opacity: 1; }
  18% { transform: scaleX(1); opacity: 1; }
  22%, 100% { transform: scaleX(1); opacity: 0; }
}

.r2-mods {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14%;
  gap: 10px;
  animation-name: r2-mods-wrap;
  z-index: 2;
}
.r2-mods b {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 7cqi, 1.9rem);
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
}
.reel--campo.is-playing .r2-mods b:nth-child(1) { animation: r2-mod 10s linear infinite; }
.reel--campo.is-playing .r2-mods b:nth-child(2) { animation: r2-mod 10s linear infinite; animation-delay: 0s; }
/* Hard cuts via keyframe windows per module */
.reel--campo.is-playing .r2-mods b:nth-child(1) { animation-name: r2-m1; }
.reel--campo.is-playing .r2-mods b:nth-child(2) { animation-name: r2-m2; }
.reel--campo.is-playing .r2-mods b:nth-child(3) { animation-name: r2-m3; }
.reel--campo.is-playing .r2-mods b:nth-child(4) { animation-name: r2-m4; }
.reel--campo.is-playing .r2-mods b:nth-child(5) { animation-name: r2-m5; }
.reel--campo.is-playing .r2-mods b {
  animation-duration: 10s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  position: absolute;
  left: 14%; right: 14%;
  top: 40%;
}
@keyframes r2-mods-wrap {
  0%, 18% { opacity: 0; }
  20%, 58% { opacity: 1; }
  60%, 100% { opacity: 0; }
}
@keyframes r2-m1 {
  0%, 19% { opacity: 0; }
  20%, 27% { opacity: 1; }
  28%, 100% { opacity: 0; }
}
@keyframes r2-m2 {
  0%, 27% { opacity: 0; }
  28%, 35% { opacity: 1; }
  36%, 100% { opacity: 0; }
}
@keyframes r2-m3 {
  0%, 35% { opacity: 0; }
  36%, 43% { opacity: 1; }
  44%, 100% { opacity: 0; }
}
@keyframes r2-m4 {
  0%, 43% { opacity: 0; }
  44%, 51% { opacity: 1; }
  52%, 100% { opacity: 0; }
}
@keyframes r2-m5 {
  0%, 51% { opacity: 0; }
  52%, 58% { opacity: 1; }
  59%, 100% { opacity: 0; }
}

.r2-glass {
  position: absolute;
  left: 10%; right: 10%;
  top: 32%;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(243, 240, 232, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(18, 17, 15, 0.1);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 5.5cqi, 1.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  animation-name: r2-glass;
  z-index: 3;
}
@keyframes r2-glass {
  0%, 58% { opacity: 0; transform: translateY(10px); }
  60%, 80% { opacity: 1; transform: translateY(0); }
  82%, 100% { opacity: 0; }
}

.r2-end {
  position: absolute;
  inset: 0;
  background: var(--void);
  color: var(--bone);
  padding: 12%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  animation-name: r2-end;
  z-index: 4;
}
.r2-end svg { width: 36px; height: 36px; color: var(--bone); margin-bottom: auto; margin-top: 20%; }
.r2-end strong {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 7.5cqi, 2rem);
  letter-spacing: -0.035em;
}
@keyframes r2-end {
  0%, 80% { opacity: 0; }
  82%, 100% { opacity: 1; }
}

/* Reduced motion: show end card static */
@media (prefers-reduced-motion: reduce) {
  .reel--sistema.is-playing .r1-grain,
  .reel--sistema.is-playing .r1-label,
  .reel--sistema.is-playing .r1-line1,
  .reel--sistema.is-playing .r1-line2,
  .reel--sistema.is-playing .r1-phone,
  .reel--sistema.is-playing .r1-phone .device-phone,
  .reel--sistema.is-playing .r1-end,
  .reel--campo.is-playing .r2-line,
  .reel--campo.is-playing .r2-mods,
  .reel--campo.is-playing .r2-mods b,
  .reel--campo.is-playing .r2-glass,
  .reel--campo.is-playing .r2-end {
    animation: none !important;
  }
  .reel--sistema .r1-end,
  .reel--campo .r2-end { opacity: 1 !important; }
  .reel--sistema .r1-line1,
  .reel--sistema .r1-line2,
  .reel--sistema .r1-phone,
  .reel--campo .r2-line,
  .reel--campo .r2-mods,
  .reel--campo .r2-glass { opacity: 0 !important; }
  .reel--sistema .r1-label { opacity: 0.35 !important; }
}

.reel__hint {
  font-family: var(--font-micro);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  text-align: center;
}
