/* Come Look At This V0 — cinematic door. Does not restyle the Pit underneath. */

html.come-look-on,
html.come-look-on body {
  overflow: hidden;
  overscroll-behavior: none;
  background: #050304;
}

html.come-look-on .void,
html.come-look-on .top-stamp,
html.come-look-on .stage,
html.come-look-on .inhabitant,
html.come-look-on .inspect,
html.come-look-on .exhibit {
  visibility: hidden !important;
  pointer-events: none !important;
}

.come-look {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050304;
  color: #f3ead6;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

html.come-look-on .come-look {
  display: block;
}

.cl-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050304;
}

.cl-stage img,
.cl-stage picture,
.cl-stage .cl-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cl-stage.ken img {
  animation: cl-ken 7s ease-out forwards;
  transform-origin: 50% 40%;
}

.cl-stage.still img,
.cl-stage.black {
  animation: none;
}

.cl-stage.photo-copy {
  filter: grayscale(1) contrast(1.7) brightness(1.05);
  background: #cfc6b4;
}
.cl-stage.photo-copy img {
  mix-blend-mode: multiply;
  opacity: 0.92;
}

.cl-stage.halftone::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#1a140e 0.7px, transparent 0.8px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.cl-stage.scan::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.22) 2px 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.cl-stage.chrome {
  background: #000;
}
.cl-stage.chrome img {
  object-fit: cover;
  filter: contrast(1.2) saturate(0.7);
}

.cl-stage.comic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  background: #111;
  padding: 4px;
}
.cl-stage.comic img {
  height: 100%;
  min-height: 0;
  border: 2px solid #0b0907;
}
.cl-stage.comic img:first-child {
  grid-column: 1 / -1;
}

.cl-grain,
.cl-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.cl-grain {
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
  background-size: 180px 180px;
}
.cl-veil {
  background: linear-gradient(180deg, rgba(5, 3, 4, 0.18), transparent 30%, transparent 62%, rgba(5, 3, 4, 0.55));
}

.cl-copy {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  max-width: 42rem;
  pointer-events: none;
  text-shadow: 0 2px 18px #050304;
}
.cl-kicker {
  display: block;
  font: 700 0.68rem/1 "Avenir Next", "Helvetica Neue", sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d9783a;
  margin-bottom: 0.35rem;
}
.cl-line {
  margin: 0;
  font-size: clamp(1.35rem, 5.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
}
.cl-line.small {
  font-size: clamp(1.05rem, 3.6vw, 1.6rem);
  max-width: 28rem;
}
.cl-line.hand {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-weight: 700;
  transform: rotate(-1.5deg);
}

.come-look [hidden] {
  display: none !important;
}

.cl-truth {
  position: absolute;
  top: calc(0.7rem + env(safe-area-inset-top, 0px));
  left: max(1rem, env(safe-area-inset-left));
  z-index: 5;
  font: 800 0.68rem/1 "Avenir Next", sans-serif;
  letter-spacing: 0.18em;
  border: 1px solid #d9783a;
  color: #d9783a;
  padding: 0.35rem 0.5rem;
  background: rgba(5, 3, 4, 0.55);
}

.cl-reject {
  position: absolute;
  inset: 18% 6%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 900 clamp(3rem, 18vw, 9rem)/0.8 "Avenir Next", sans-serif;
  letter-spacing: 0.02em;
  color: #8a2a22;
  transform: rotate(-12deg);
  text-shadow: 2px 3px 0 #1a140e;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.cl-wtf {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  top: 42%;
  z-index: 6;
  font: 800 clamp(1.4rem, 5vw, 2.4rem)/1.1 "Avenir Next", sans-serif;
  color: #f3ead6;
}

.cl-title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 max(1.1rem, env(safe-area-inset-right)) calc(5.4rem + env(safe-area-inset-bottom, 0px))
    max(1.1rem, env(safe-area-inset-left));
  z-index: 4;
}
.cl-title .markish {
  font: 800 clamp(0.8rem, 3vw, 1rem)/1 "Avenir Next", sans-serif;
  letter-spacing: 0.34em;
  margin: 0 0 0.7rem;
  color: #d8c9a4;
}
.cl-title h1 {
  margin: 0;
  font-size: clamp(2.2rem, 10vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 11ch;
}

.cl-black {
  position: absolute;
  inset: 0;
  background: #050304;
}
.cl-signal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #92c2ff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px #92c2ff;
  animation: cl-blip 1.4s ease-in-out infinite;
}

.cl-greet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 max(1.2rem, env(safe-area-inset-left));
  z-index: 4;
}
.cl-greet p {
  margin: 0 0 0.55rem;
  font-size: clamp(1.7rem, 6vw, 3rem);
  line-height: 1.15;
}

.cl-meter {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right));
  top: calc(3.2rem + env(safe-area-inset-top, 0px));
  z-index: 5;
  font: 700 0.85rem/1 ui-monospace, Menlo, monospace;
  color: #d9783a;
  background: rgba(5, 3, 4, 0.6);
  padding: 0.3rem 0.45rem;
  border: 1px solid #d9783a;
}

.cl-card {
  position: absolute;
  right: 8%;
  top: 22%;
  z-index: 5;
  width: min(14rem, 46vw);
  padding: 0.8rem;
  background: #f3efe8;
  color: #1e1a16;
  font: 700 0.78rem/1.2 "Avenir Next", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: cl-eaten 2.8s ease-in forwards;
}

.cl-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem max(0.7rem, env(safe-area-inset-right)) calc(0.55rem + env(safe-area-inset-bottom, 0px))
    max(0.7rem, env(safe-area-inset-left));
  background: linear-gradient(180deg, transparent, rgba(5, 3, 4, 0.86) 40%);
}

.cl-hud button {
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid color-mix(in srgb, #d8c9a4 55%, transparent);
  background: rgba(8, 6, 4, 0.72);
  color: #d8c9a4;
  font: 750 0.72rem/1 "Avenir Next", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.cl-hud button:focus-visible {
  outline: 2px solid #d9783a;
  outline-offset: 2px;
}
.cl-clock {
  font: 700 0.78rem/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
  color: #9a8f7a;
}
.cl-clock.lie {
  color: #d9783a;
}

.look-doors .door.film {
  border-style: solid;
  color: #d9783a;
  letter-spacing: 0.08em;
}

@keyframes cl-ken {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes cl-blip {
  0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.7); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes cl-eaten {
  0% { transform: translate(0, 0) rotate(-4deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-18vw, 28vh) rotate(25deg) scale(0.2); opacity: 0; }
}
@keyframes cl-glitch {
  0%, 80%, 100% { transform: none; filter: none; }
  84% { transform: translate(-6px, 1px); filter: hue-rotate(40deg); }
  88% { transform: translate(5px, -2px); }
}

.cl-stage.glitch img {
  animation: cl-glitch 0.9s steps(2, end) infinite;
}

@media (max-width: 720px) {
  .cl-copy {
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
  }
  .cl-line {
    font-size: clamp(1.25rem, 7.4vw, 2.1rem);
  }
  .cl-stage.comic {
    grid-template-columns: 1fr;
    grid-template-rows: 1.4fr 1fr 1fr;
  }
  .cl-stage.comic img:first-child {
    grid-column: auto;
  }
  .cl-card {
    width: min(11rem, 58vw);
    top: 18%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cl-stage.ken img,
  .cl-stage.glitch img,
  .cl-card,
  .cl-signal {
    animation: none !important;
    transform: none !important;
  }
}
