/* Landing hero. The machine fills the first viewport; a gradient on the left
   carries the copy and CTAs, and the IDE panel floats in the lower-right corner. The stage's poster crops like
   object-fit: cover inside .cine-frame so static chips stay on their anchors, and the live canvas fades in over
   it. */

.cine {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(640px, 100svh, 980px);
  padding: 116px var(--gutter) 96px;
  background: #07090d;
  color: var(--text-on-dark);
  overflow: hidden;
  isolation: isolate;
}

.cine-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  container-type: size;
}

/* Darkens only where the copy sits, under the navigation and into the next section; the machine stays clear. */
.cine-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgb(7 9 13 / 94%) 0%, rgb(7 9 13 / 84%) 28%, rgb(7 9 13 / 40%) 46%, rgb(7 9 13 / 0%) 60%),
    linear-gradient(180deg, rgb(7 9 13 / 70%) 0%, rgb(7 9 13 / 0%) 18%, rgb(7 9 13 / 0%) 82%, rgb(7 9 13 / 85%) 100%);
  pointer-events: none;
}

.cine-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 100cqh * 16 / 10);
  aspect-ratio: 16 / 10;
  translate: -50% -50%;
}

.cine-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cine-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}

.cine.is-live .cine-canvas {
  opacity: 1;
}

.cine-inner {
  width: 100%;
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
}

.cine-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding-left: clamp(0px, 3vw, 48px);
  animation: site-enter 0.9s var(--ease-out) both;
}

.cine h1 {
  font-size: clamp(2.6rem, 4.4vw, 4.1rem);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-shadow: 0 2px 30px rgb(7 9 13 / 60%);
}

.cine h1 span {
  color: #a9b9d4;
}

.cine-lede {
  max-width: 29em;
  margin-top: 22px;
  color: #b3bccb;
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.6;
}

.cine-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* IDE panel: the workspace's own Ladder view and simulation panel, rendered in a shadow root (cinematic-ide.css). */

.cine-ide {
  position: absolute;
  right: var(--gutter);
  bottom: 56px;
  z-index: 2;
  width: clamp(280px, 23vw, 340px);
  animation: site-enter 1s 0.2s var(--ease-out) both;
}

/* Tag chips: anchored to the photoeye and the diverter actuator. Static positions match the posters. */

.cine-chips {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.cine-chip {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(9 12 18 / 78%);
  color: #cdd5e2;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  translate: -50% calc(-100% - 22px);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s;
}

.cine-chip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 22px;
  background: linear-gradient(rgb(205 213 226 / 45%), rgb(205 213 226 / 10%));
}

.cine-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d6879;
  transition: background-color 0.12s;
}

.cine-chip b {
  color: #8d98ab;
  font-weight: 600;
}

.cine-chip.is-on i {
  background: var(--signal);
}

.cine-chip.is-on b {
  color: var(--signal);
}

.cine-chip.is-hidden {
  opacity: 0;
}

/* chip-positions:start (generated by npm run hero:media) */
.cine-chip--eye {
  top: 44.2%;
  left: 58.3%;
}

.cine-chip--gate {
  top: 33.7%;
  left: 65.3%;
}

@media (max-width: 860px) {
  .cine-chip--eye {
    top: 49.3%;
    left: 29.1%;
  }

  .cine-chip--gate {
    top: 35.7%;
    left: 44.9%;
  }
}
/* chip-positions:end */

.cine.is-live .cine-chip {
  top: 0;
  left: 0;
}

/* Small screens: copy first, then the stage and the routine. */
@media (max-width: 860px) {
  .cine {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 108px var(--gutter) 40px;
  }

  .cine-inner {
    order: 1;
  }

  .cine-copy {
    padding-left: 0;
  }

  .cine-stage {
    position: relative;
    inset: auto;
    order: 2;
    aspect-ratio: 4 / 3;
    margin: 36px calc(var(--gutter) * -1) 0;
    container-type: normal;
  }

  .cine-stage::after {
    background: linear-gradient(180deg, #07090d 0%, rgb(7 9 13 / 0%) 16%, rgb(7 9 13 / 0%) 80%, #07090d 100%);
  }

  .cine-frame {
    inset: 0;
    width: 100%;
    aspect-ratio: 4 / 3;
    translate: none;
  }

  .cine-ide {
    position: relative;
    right: auto;
    bottom: auto;
    order: 3;
    width: 100%;
    max-width: 560px;
    margin: -28px auto 0;
  }
}

@media (max-width: 560px) {
  .cine-cta .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
