/* ECHIVO — #listen · "The city speaks" — monument audio guide scene. OWNED BY: web agent 2. */

#listen {
  --l-phone: clamp(220px, min(30vh, 22vw), 300px);
  padding: 0;
  background: var(--night);
  isolation: isolate;
}

#listen .listen__stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px var(--gutter) 40px;
}

/* ---------- Background: darkened Moon Church, slow Ken Burns ---------- */
#listen .listen__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
#listen .listen__bg-move { position: absolute; inset: -8% 0; }
#listen .listen__bg-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
  max-width: none;
  filter: saturate(1.15) brightness(0.85) contrast(1.05);
  transform: scale(1.12);
  animation: listen-kenburns 38s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes listen-kenburns {
  0%   { transform: scale(1.12) translate3d(-1.5%, 1%, 0); }
  100% { transform: scale(1.3) translate3d(2%, -2.5%, 0); }
}
#listen .listen__bg-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 55% at 50% 40%, rgba(245, 200, 130, 0.10), transparent 70%),
    linear-gradient(90deg, rgba(5, 7, 13, 0.82) 0%, rgba(5, 7, 13, 0.45) 30%, rgba(5, 7, 13, 0.4) 55%, rgba(5, 7, 13, 0.82) 78%, rgba(5, 7, 13, 0.9) 100%),
    linear-gradient(180deg, var(--night) 0%, rgba(5, 7, 13, 0.35) 22%, rgba(5, 7, 13, 0.45) 70%, var(--night) 100%);
}

/* ---------- Grid ---------- */
#listen .listen__grid {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas:
    ".     device voice"
    "copy  device voice"
    "stats device voice"
    ".     device voice";
  column-gap: clamp(24px, 3vw, 56px);
  align-items: center;
}

/* ---------- Copy ---------- */
#listen .listen__copy { grid-area: copy; align-self: end; padding-bottom: clamp(28px, 5vh, 56px); }
#listen .listen__eyebrow { display: inline-flex; align-items: center; gap: 0.6em; margin: 0 0 18px; }
#listen .listen__eyebrow svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#listen .listen__title {
  margin: 0;
  font-size: clamp(2.4rem, 4.4vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
}
#listen .listen__title-gold {
  display: block;
  background: linear-gradient(100deg, var(--gold) 0%, #fff3dc 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
/* After SplitText: each gold word carries its own gradient clip (transformed children break a parent clip) */
#listen .listen__title.is-split .listen__title-gold { background: none; color: inherit; }
#listen .listen__title.is-split .listen__title-gold .listen__word {
  background: linear-gradient(100deg, var(--gold) 0%, #fff3dc 60%, var(--gold) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#listen .listen__lede { margin: 20px 0 0; max-width: 26ch; font-size: clamp(1rem, 1.2vw, 1.15rem); }

/* ---------- Stats ---------- */
#listen .listen__stats {
  grid-area: stats; align-self: start;
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(20px, 2.4vw, 36px);
}
#listen .listen__stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding-left: clamp(14px, 1.4vw, 20px);
  border-left: 1px solid rgba(245, 200, 130, 0.25);
}
#listen .listen__stat:first-child { padding-left: 0; border-left: 0; }
#listen .listen__stat-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: rgba(245, 200, 130, 0.12);
  color: var(--gold);
}
#listen .listen__stat-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#listen .listen__stat-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); font-weight: 650; white-space: nowrap; }
#listen .listen__num { color: #fff; font-size: clamp(1.8rem, 2.4vw, 2.4rem); line-height: 1; letter-spacing: -0.02em; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Device + orbit ---------- */
#listen .listen__device {
  grid-area: device;
  position: relative;
  width: calc(var(--l-phone) * 1.95);
  height: 100%;
  display: grid; place-items: center;
}
#listen .listen__phone-wrap { position: relative; z-index: 2; perspective: 1400px; }
#listen .listen__tilt { transform-style: preserve-3d; will-change: transform; }
#listen .listen__phone { --phone-w: var(--l-phone); }
#listen .listen__screen--playing {
  position: absolute;
  top: calc(var(--phone-w) * 0.032); left: calc(var(--phone-w) * 0.032);
  width: calc(100% - var(--phone-w) * 0.064);
  height: calc(100% - var(--phone-w) * 0.064);
  opacity: 0;
}

#listen .listen__orbit { position: absolute; inset: 0; pointer-events: none; }
#listen .listen__orbit-line {
  position: absolute; z-index: 1;
  left: 50%; top: calc(50% + var(--l-phone) * 0.3);
  width: calc(var(--l-phone) * 1.84); height: calc(var(--l-phone) * 0.48);
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
#listen .listen__orbit-line ellipse { fill: none; stroke: rgba(245, 200, 130, 0.28); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }

#listen .listen__chip {
  position: absolute; left: 50%; top: calc(50% + var(--l-phone) * 0.3);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px 6px 6px;
  border-radius: 999px;
  background: rgba(14, 17, 28, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.74rem; font-weight: 750; letter-spacing: 0.1em;
  color: var(--text);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: border-color .4s, color .4s, box-shadow .4s, background .4s;
  will-change: transform, opacity;
}
#listen .listen__chip.is-active {
  border-color: rgba(245, 200, 130, 0.9);
  color: var(--gold);
  background: rgba(30, 24, 14, 0.9);
  box-shadow: 0 0 0 4px rgba(245, 200, 130, 0.12), 0 12px 40px rgba(245, 200, 130, 0.35);
}

/* Flags: round, drawn with CSS stripes (UK as inline SVG) */
#listen .listen__flag {
  display: inline-block; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  background-position: center; background-size: cover;
}
#listen .listen__flag--ro { background: linear-gradient(90deg, #002b7f 0 33.4%, #fcd116 0 66.6%, #ce1126 0); }
#listen .listen__flag--hu { background: linear-gradient(180deg, #cd2a3e 0 33.4%, #fff 0 66.6%, #436f4d 0); }
#listen .listen__flag--de { background: linear-gradient(180deg, #111 0 33.4%, #dd0000 0 66.6%, #ffce00 0); }
#listen .listen__flag--fr { background: linear-gradient(90deg, #0055a4 0 33.4%, #fff 0 66.6%, #ef4135 0); }
#listen .listen__flag--it { background: linear-gradient(90deg, #009246 0 33.4%, #fff 0 66.6%, #ce2b37 0); }
#listen .listen__flag--es { background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 0 75%, #aa151b 0); }
#listen .listen__flag--en {
  background: #012169 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='15 0 30 30'><clipPath id='t'><path d='M30,15h30v15zv15h-30zh-30v-15zv-15h30z'/></clipPath><path d='M0,0v30h60v-30z' fill='%23012169'/><path d='M0,0L60,30M60,0L0,30' stroke='%23fff' stroke-width='6'/><path d='M0,0L60,30M60,0L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/><path d='M30,0v30M0,15h60' stroke='%23fff' stroke-width='10'/><path d='M30,0v30M0,15h60' stroke='%23C8102E' stroke-width='6'/></svg>") center / cover no-repeat;
}

/* Sound rings emanating from the phone */
#listen .listen__rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 0; }
#listen .listen__rings i {
  position: absolute; left: 0; top: 0;
  width: calc(var(--l-phone) * 1.6); height: calc(var(--l-phone) * 1.6);
  margin: calc(var(--l-phone) * -0.8) 0 0 calc(var(--l-phone) * -0.8);
  border-radius: 50%;
  border: 1px solid rgba(245, 200, 130, 0.45);
  opacity: 0;
  animation: listen-ring 3.6s cubic-bezier(.2,.6,.3,1) infinite;
  animation-play-state: paused;
}
#listen .listen__rings i:nth-child(2) { animation-delay: 1.2s; }
#listen .listen__rings i:nth-child(3) { animation-delay: 2.4s; }
#listen.is-playing .listen__rings i { animation-play-state: running; }
@keyframes listen-ring {
  0%   { transform: scale(0.55); opacity: 0; }
  15%  { opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Voice column ---------- */
#listen .listen__voice { grid-area: voice; align-self: center; display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 28px); }
#listen .listen__now {
  margin: 0; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--hairline);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-2);
}
#listen .listen__now-sep { color: var(--gold); }
#listen .listen__live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
#listen .listen__live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--gold);
  animation: listen-live 1.6s ease-out infinite;
}
@keyframes listen-live { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

#listen .listen__wave {
  height: clamp(56px, 9vh, 88px);
  display: flex; align-items: center; gap: 4px;
  max-width: 460px;
}
#listen .listen__bar {
  flex: 1 1 0; max-width: 6px; height: 100%;
  border-radius: 99px;
  background: linear-gradient(180deg, #fff1d6 0%, var(--gold) 35%, var(--amber) 100%);
  transform: scaleY(0.12);
  transform-origin: 50% 50%;
  will-change: transform;
}

#listen .listen__caption {
  margin: 0;
  font-size: clamp(1.5rem, 2.25vw, 2.3rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.012em;
  max-width: 19ch;
  color: rgba(255, 255, 255, 0.86);
}
#listen .listen__w { color: rgba(255, 255, 255, 0.2); transition: color .35s ease, text-shadow .35s ease; }
#listen .listen__w.is-past { color: rgba(255, 255, 255, 0.9); }
#listen .listen__w.is-now { color: var(--gold); text-shadow: 0 0 28px rgba(245, 200, 130, 0.65); }
#listen .listen__w.is-key.is-past, #listen .listen__w.is-key.is-now { color: var(--gold); }
#listen .listen__key { white-space: nowrap; }

#listen .listen__greet {
  margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
  height: 2.2em; overflow: hidden;
  font-size: clamp(1.1rem, 1.45vw, 1.4rem); font-weight: 650; color: rgba(255, 255, 255, 0.92); letter-spacing: -0.01em;
}
#listen .listen__greet-flag { width: 28px; height: 28px; }
#listen .listen__greet-text { display: inline-block; will-change: transform, opacity; }
#listen .listen__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; }

/* ---------- Tablet / mid ---------- */
@media (max-width: 1100px) and (min-width: 760px) {
  #listen { --l-phone: clamp(200px, min(28vh, 24vw), 260px); }
  #listen .listen__caption { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
}

/* ---------- Mobile: stacked, compact pinned stage ---------- */
@media (max-width: 759px) {
  #listen { --l-phone: clamp(124px, min(42vw, 20svh), 186px); }
  #listen .listen__stage { min-height: 600px; padding: 72px 16px 20px; align-items: stretch; }
  #listen .listen__bg-img { filter: none; } /* the phone-size backdrop (picture source, same breakpoint) has this grade baked in */
  #listen .listen__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "copy" "device" "voice" "stats";
    row-gap: 10px;
    align-items: stretch;
  }
  #listen .listen__copy { align-self: start; padding: 0; text-align: center; }
  #listen .listen__eyebrow { margin-bottom: 10px; }
  #listen .listen__title { font-size: clamp(2rem, 9.6vw, 2.6rem); }
  #listen .listen__lede { display: none; }
  #listen .listen__device { width: 100%; height: auto; min-height: calc(var(--l-phone) * 2.25); }
  #listen .listen__chip { font-size: 0.64rem; padding: 4px 8px 4px 4px; gap: 5px; }
  #listen .listen__chip .listen__flag { width: 15px; height: 15px; }
  #listen .listen__voice { align-items: center; text-align: center; gap: 8px; }
  #listen .listen__now { display: none; }
  #listen .listen__wave { height: 34px; width: 100%; max-width: 300px; justify-content: center; gap: 3px; }
  #listen .listen__bar { max-width: 4px; }
  #listen .listen__caption { font-size: clamp(1.02rem, 4.5vw, 1.2rem); max-width: 26ch; line-height: 1.3; }
  #listen .listen__greet { font-size: 0.9rem; gap: 8px; height: 1.8em; }
  #listen .listen__greet-flag { width: 18px; height: 18px; }
  #listen .listen__stats { justify-content: center; gap: 0; flex-wrap: nowrap; }
  #listen .listen__stat { flex: 1 1 0; align-items: center; text-align: center; gap: 6px; padding: 0 6px; }
  #listen .listen__stat:first-child { padding-left: 6px; }
  #listen .listen__stat-icon { width: 26px; height: 26px; }
  #listen .listen__stat-icon svg { width: 14px; height: 14px; }
  #listen .listen__stat-text { font-size: 0.6rem; letter-spacing: 0.12em; gap: 3px; align-items: center; }
  #listen .listen__num { font-size: 1.4rem; }
}

/* ---------- Low power (html.lp): fewer promoted layers; bars/tilt repaint cheaply in place ---------- */
.lp #listen .listen__bar,
.lp #listen .listen__tilt { will-change: auto; }

/* ---------- Reduced motion: final state, still ---------- */
.reduced-motion #listen .listen__bg-img { animation: none; transform: scale(1.12); }
.reduced-motion #listen .listen__screen--playing { opacity: 1; }
.reduced-motion #listen .listen__w { color: rgba(255, 255, 255, 0.9); }
.reduced-motion #listen .listen__w.is-key { color: var(--gold); }
.reduced-motion #listen .listen__live::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #listen .listen__bg-img, #listen .listen__rings i, #listen .listen__live::after { animation: none; }
}
