:root {
  --ink: #120e0a;
  --ivory: #f4ebdd;
  --ivory-dim: #b9ad9b;
  --muted: #8a7f70;
  --blue: #3ba0da;
  --red: #e74415;
  --yellow: #fbb900;
  --green: #84b727;
  --display: "Pally", ui-rounded, system-ui, sans-serif;
  --text: "Switzer", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--ivory); overflow: hidden; }
body { font-family: var(--text); -webkit-font-smoothing: antialiased; }

/* The stage is always composed at 1920x1080 and scaled to fit (LED walls, laptops, phones alike). */
.viewport { position: fixed; inset: 0; }
.stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: center;
  overflow: hidden; background: var(--ink);
}

.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: filter 1.2s ease; }
.stage[data-state="asleep"] .bg { filter: brightness(.55) saturate(.8); }
.grain {
  position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.brand { position: absolute; left: 96px; top: 64px; display: flex; align-items: center; gap: 22px; }
.logo { height: 52px; width: auto; }
.event { font-size: 22px; font-weight: 500; color: var(--ivory-dim); letter-spacing: .01em; padding-left: 22px; border-left: 1px solid rgb(244 235 221 / .22); line-height: 30px; }

.pagi { position: absolute; left: 226px; top: 72px; width: 948px; height: 1008px; }

/* Kaan's side of the stage */
.guest { position: absolute; right: 120px; top: 70px; width: 420px; text-align: right; }
.guest-name { margin: 0; font: 600 34px/1.1 var(--text); color: var(--ivory-dim); transition: color .4s ease; }
.guest-role { margin: 6px 0 0; font: 400 20px/1.2 var(--text); color: var(--muted); }
.stage[data-state="listening"] .guest-name { color: var(--ivory); }
.cam { margin: 0 0 22px auto; width: 420px; height: 500px; background: #1c1610;
  clip-path: polygon(0 0, calc(100% - 46px) 0, 100% 46px, 100% 100%, 46px 100%, 0 calc(100% - 46px)); }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

/* The conversation between them */
.talk {
  position: absolute; left: 1150px; right: 120px; top: 250px; bottom: 150px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 34px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 120px);
}
.stage.cam-on .talk { top: 690px; gap: 22px; }
.turn { animation: rise .45s cubic-bezier(.2, .8, .2, 1); transition: opacity .6s ease; }
.turn:not(:nth-last-child(-n + 2)) { opacity: .34; }
.who { display: block; font: 600 17px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.turn.pagi-line .who { color: var(--blue); }
.turn.guest-line { text-align: right; }
.turn.guest-line .who { color: var(--muted); }
.turn p { margin: 0; text-wrap: pretty; }
.turn.pagi-line p { font: 500 42px/1.24 var(--display); color: var(--ivory); }
.turn.guest-line p { font: 400 30px/1.32 var(--text); color: var(--ivory-dim); }
.turn.guest-line p:empty::before { content: "…"; }
.turn.pagi-line.long p, .stage.cam-on .turn.pagi-line p { font-size: 34px; }
@keyframes rise { from { transform: translateY(18px); opacity: .5; } to { transform: none; opacity: 1; } }

.cue { position: absolute; left: 1150px; right: 120px; bottom: 150px; margin: 0; font: 400 28px/1.4 var(--text); color: var(--muted); }
.cue kbd { font: 600 22px var(--text); color: var(--ivory); border: 1px solid rgb(244 235 221 / .3); border-radius: 8px; padding: 2px 10px; }
.stage:not([data-state="asleep"]) .cue { display: none; }

.theme { position: absolute; right: 120px; bottom: 64px; margin: 0; font: 400 19px/1 var(--text); color: var(--muted); letter-spacing: .02em; }

.typer { position: absolute; left: 1150px; right: 120px; bottom: 60px; }
.typer input { width: 100%; font: 400 24px var(--text); color: var(--ivory); background: rgb(18 14 10 / .82); border: 1px solid rgb(244 235 221 / .25); border-radius: 12px; padding: 14px 18px; outline: none; }
.typer input:focus { border-color: var(--blue); }

.debug { position: absolute; left: 24px; bottom: 16px; margin: 0; font: 14px/1.4 ui-monospace, monospace; color: #cfc4b3; background: rgb(0 0 0 / .6); padding: 10px 12px; border-radius: 8px; white-space: pre; }

@media (prefers-reduced-motion: reduce) { .turn { animation: none; } }
