/* ── Persona transporter-effekt ── */
:root {
  --persona-w: clamp(170px, 17vw, 260px);
  --persona-h: clamp(218px, 22vw, 333px);
  --persona-left: 50vw;
}
.persona-stage {
  position: fixed;
  left: var(--persona-left);
  bottom: 0;
  width: var(--persona-w);
  height: var(--persona-h);
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.persona-stage.visible { opacity: 1; }

@media (max-width: 900px) { .persona-stage { display: none; } }

.persona-frame {
  position: absolute;
  inset: 0;
}

.persona-canvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.persona-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom right;
  opacity: 0;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  -webkit-mask-image: linear-gradient(180deg,
    #000 0%,
    #000 calc(var(--reveal, 0%) - 6%),
    rgba(0,0,0,0.7) calc(var(--reveal, 0%) - 2%),
    rgba(0,0,0,0.3) var(--reveal, 0%),
    rgba(0,0,0,0.05) calc(var(--reveal, 0%) + 3%),
    transparent calc(var(--reveal, 0%) + 6%),
    transparent 100%);
          mask-image: linear-gradient(180deg,
    #000 0%,
    #000 calc(var(--reveal, 0%) - 6%),
    rgba(0,0,0,0.7) calc(var(--reveal, 0%) - 2%),
    rgba(0,0,0,0.3) var(--reveal, 0%),
    rgba(0,0,0,0.05) calc(var(--reveal, 0%) + 3%),
    transparent calc(var(--reveal, 0%) + 6%),
    transparent 100%);
  transition: opacity 0.5s ease;
}
.persona-image.materialized {
  opacity: 1;
}
.persona-image.simple-fade {
  -webkit-mask-image: none;
  mask-image: none;
  transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.persona-beam {
  display: none;
}

.persona-glow {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  width: 78%;
  height: 92%;
  background: radial-gradient(ellipse at center 60%,
    rgba(180, 240, 255, 0.22) 0%,
    rgba(180, 240, 255, 0.10) 25%,
    rgba(120, 200, 255, 0.03) 45%,
    transparent 65%);
  opacity: 0;
  filter: blur(34px);
  pointer-events: none;
  transition: opacity 0.8s ease;
  -webkit-mask-image: radial-gradient(ellipse at 50% 60%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 60%, #000 30%, transparent 75%);
}
.persona-glow.active { opacity: 1; }

/* ── Citatboble — står over personen ── */
.persona-quote {
  position: fixed;
  left: var(--persona-left);
  bottom: calc(var(--persona-h) - 4px);
  width: clamp(280px, 26vw, 400px);
  max-width: 90vw;
  margin-left: calc((var(--persona-w) - clamp(280px, 26vw, 400px)) / 2);
  transform: translateY(18px);
  z-index: 61;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: 'Georgia', 'Cambria', 'Times New Roman', serif;
  color: #ffffff;
  text-align: center;
  padding: 18px 22px 16px;
  background: linear-gradient(180deg,
    rgba(8, 16, 32, 0.78) 0%,
    rgba(10, 22, 40, 0.72) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(180, 240, 255, 0.22);
  border-radius: 14px;
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(120, 200, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.persona-quote.visible { opacity: 1; transform: translateY(0); }
.persona-quote::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: rgba(10, 22, 40, 0.78);
  border-right: 1px solid rgba(180, 240, 255, 0.22);
  border-bottom: 1px solid rgba(180, 240, 255, 0.22);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}

.persona-quote-text {
  font-size: clamp(0.95rem, 1.05vw, 1.25rem);
  line-height: 1.42;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.003em;
  padding: 0 6px;
  pointer-events: auto;
  cursor: default;
}

.persona-quote-text .qm {
  font-style: normal;
  font-weight: 700;
  font-size: 1.6em;
  line-height: 0;
  vertical-align: -0.18em;
  color: rgba(180, 240, 255, 0.95);
  text-shadow: 0 0 14px rgba(120, 200, 255, 0.7);
  margin: 0 0.05em;
}
.persona-quote-text .qm.open  { margin-right: 0.1em; }
.persona-quote-text .qm.close { margin-left: 0.1em; }

.persona-quote-prof {
  margin-top: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(180, 240, 255, 0.85);
  font-weight: 600;
}

.persona-quote-cta {
  position: relative;
  display: inline-block;
  margin-top: 16px;
  padding: 4px 2px 4px 4px;
  font-family: 'Georgia', 'Cambria', serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 240, 200, 0.96);
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.persona-quote-cta:hover { color: #fff8d8; transform: translateY(-1px); }
.persona-quote-cta .cta-text {
  border-bottom: 1px solid rgba(252, 211, 77, 0.5);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}
.persona-quote-cta:hover .cta-text { border-bottom-color: #fde68a; }


/* ── Tease-bobble: "JA, login og kig selv..." over talebobblen ── */
.persona-tease {
  position: absolute;
  left: 50%;
  top: -54px;
  transform: translate(-50%, 12px) scale(0.96);
  white-space: nowrap;
  padding: 9px 18px 8px;
  font-family: 'Georgia', 'Cambria', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: 0.012em;
  color: rgba(255, 244, 210, 0.97);
  background: linear-gradient(180deg,
    rgba(28, 42, 62, 0.62) 0%,
    rgba(18, 30, 48, 0.52) 100%);
  border: 1px solid rgba(252, 211, 77, 0.32);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px) saturate(130%);
          backdrop-filter: blur(8px) saturate(130%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  isolation: isolate;
  z-index: 2;
}

.persona-tease.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  animation: teaseGlow 3.4s ease-in-out infinite;
}

/* Lille pil ned mod talebobblen */
.persona-tease::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  background: rgba(18, 30, 48, 0.62);
  border-right: 1px solid rgba(252, 211, 77, 0.32);
  border-bottom: 1px solid rgba(252, 211, 77, 0.32);
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}

/* Levende SVG-grain (film-noise) — drives med steps() for klassisk støj-flicker */
.persona-tease::before {
  content: '';
  position: absolute;
  inset: -25%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 0.92  0 0 0 0 0.62  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: 0.42;
  pointer-events: none;
  animation: teaseGrain 0.42s steps(3) infinite;
  z-index: -1;
}

@keyframes teaseGrain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-7%, 4%); }
  50%  { transform: translate(6%, -3%); }
  75%  { transform: translate(-4%, -5%); }
  100% { transform: translate(3%, 6%); }
}

@keyframes teaseGlow {
  0%, 100% {
    box-shadow:
      0 4px 18px rgba(0, 0, 0, 0.5),
      0 0 14px rgba(252, 211, 77, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.55),
      0 0 26px rgba(252, 211, 77, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

/* Selve teksten — let levende blink på sidste tegn */
.persona-tease .tease-text {
  position: relative;
  display: inline-block;
}

/* ── Play-knap nederst i højre hjørne ── */
.persona-play {
  position: fixed;
  bottom: 22px;
  right: 32px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(180, 240, 255, 0.28);
  background: linear-gradient(180deg,
    rgba(28, 42, 62, 0.62) 0%,
    rgba(18, 30, 48, 0.55) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  color: rgba(255, 244, 210, 0.95);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(120, 200, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 70;
}

.persona-play.ready {
  opacity: 0.7;
  pointer-events: auto;
}

.persona-play:hover {
  opacity: 1;
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(252, 211, 77, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.persona-play:active { transform: scale(0.96); }

.persona-play.playing {
  opacity: 0.95;
  border-color: rgba(252, 211, 77, 0.45);
  animation: playPulse 2.4s ease-in-out infinite;
}

.persona-play svg { width: 16px; height: 16px; pointer-events: none; }
.persona-play .ico-play  { margin-left: 2px; }
.persona-play .ico-pause { display: none; }
.persona-play.playing .ico-play  { display: none; }
.persona-play.playing .ico-pause { display: inline-block; }

@keyframes playPulse {
  0%, 100% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.45),
      0 0 14px rgba(252, 211, 77, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow:
      0 4px 18px rgba(0, 0, 0, 0.5),
      0 0 24px rgba(252, 211, 77, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 900px) {
  .persona-quote { display: none; }
  .persona-play  { display: none; }
}
