/* Call the Draugr: fake incoming-call experience.
   Dark gradient fallback sits behind img/atmos/call-bg.jpg so the stage
   looks right even before the background art exists. */

.call-stage {
  position: relative;
  min-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #0a0908;
  background-image:
    radial-gradient(ellipse 90% 65% at 50% 30%, rgba(122, 12, 20, 0.16), transparent 70%),
    linear-gradient(rgba(10, 9, 8, 0.72), rgba(10, 9, 8, 0.94)),
    url('../img/atmos/call-bg.jpg');
  background-size: cover;
  background-position: center;
  border-top: 1px solid #1c1916;
  border-bottom: 1px solid #1c1916;
}

.call-inner {
  text-align: center;
  padding: 3rem 0 3.5rem;
  position: relative;
  z-index: 1;
}

.call-state[hidden] { display: none; }

.call-state {
  animation: call-in 0.45s ease-out;
}

@keyframes call-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Caller ID */
.caller-id {
  font-family: var(--font-display);
  font-size: clamp(3rem, 13vw, 5.5rem);
  line-height: 1;
  color: var(--bone);
  margin: 0 0 1.6rem;
  text-shadow: 0 0 34px rgba(193, 18, 31, 0.45), 0 3px 10px rgba(0, 0, 0, 0.8);
}

.caller-id.small {
  font-size: clamp(2rem, 8vw, 3rem);
  margin-bottom: 0.6rem;
}

/* Avatar with pulsing blood ring */
.avatar-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 1.4rem;
}

.avatar {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blood-deep);
  box-shadow: 0 0 0 6px rgba(10, 9, 8, 0.9), 0 0 44px rgba(193, 18, 31, 0.5);
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--blood);
  animation: ring-pulse 2.2s ease-out infinite;
  pointer-events: none;
}

@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

.call-status {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin: 0 0 2rem;
}

.call-actions {
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-answer {
  background: linear-gradient(180deg, var(--blood), var(--blood-deep));
  border: 1px solid var(--blood-bright);
  color: #fff;
  min-width: 11rem;
  box-shadow: 0 0 26px var(--blood-glow);
}

.btn-answer:hover, .btn-answer:focus {
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 40px rgba(255, 42, 54, 0.55);
}

.btn-decline {
  background: transparent;
  border: 1px solid var(--bone-dim);
  color: var(--bone-dim);
  min-width: 11rem;
}

.btn-decline:hover, .btn-decline:focus {
  border-color: var(--bone);
  color: var(--bone);
  text-decoration: none;
}

.declined-line {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  color: var(--bone);
  margin: 0 0 2rem;
  text-shadow: 0 0 26px rgba(193, 18, 31, 0.4);
}

/* Active call */
.call-timer {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  letter-spacing: 0.32em;
  color: var(--bone-dim);
  margin: 0 0 1.8rem;
  font-variant-numeric: tabular-nums;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  max-width: 460px;
  margin: 0 auto 2rem;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 104px;
  padding: 0.9rem 0.4rem;
  background: rgba(28, 25, 22, 0.72);
  border: 1px solid #2c2521;
  border-radius: var(--radius);
  color: var(--bone);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
  backdrop-filter: blur(2px);
}

.key:hover, .key:focus-visible {
  border-color: var(--blood);
  box-shadow: 0 0 22px var(--blood-glow);
  outline: none;
}

.key:active { transform: scale(0.96); }

.key-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--blood-bright);
}

.key-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  text-align: center;
}

.btn-end {
  background: transparent;
  border: 1px solid var(--blood-deep);
  color: var(--blood-bright);
  min-width: 11rem;
}

.btn-end:hover, .btn-end:focus {
  background: rgba(193, 18, 31, 0.14);
  color: #ff4d5e;
  text-decoration: none;
}

/* Voicemail recorder */
.rec-btn {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid var(--blood-deep);
  background: radial-gradient(circle at 50% 35%, #241312, #120b0a 75%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rec-btn:hover, .rec-btn:focus-visible {
  border-color: var(--blood);
  outline: none;
}

.rec-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blood);
  box-shadow: 0 0 18px var(--blood-glow);
}

.rec-btn.recording {
  border-color: var(--blood-bright);
  animation: rec-pulse 1.4s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 54, 0.5); }
  50% { box-shadow: 0 0 0 18px rgba(255, 42, 54, 0); }
}

.rec-timer {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  letter-spacing: 0.22em;
  color: var(--bone);
  margin: 0 0 0.7rem;
  font-variant-numeric: tabular-nums;
}

.rec-progress {
  height: 4px;
  max-width: 320px;
  margin: 0 auto 0.9rem;
  background: #2c2521;
  border-radius: 2px;
  overflow: hidden;
}

.rec-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blood-deep), var(--blood-bright));
  transition: width 0.2s linear;
}

.rec-hint {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin: 0 0 1.6rem;
}

.rec-error {
  color: #ff8a94;
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 1.4rem;
}

.rec-error a { color: var(--blood-bright); }

#vm-form {
  max-width: 560px;
  margin: 0 auto 1.8rem;
  text-align: left;
}

.vm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

/* Received state */
.received-line {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  color: var(--bone);
  margin: 0 0 0.8rem;
  text-shadow: 0 0 26px rgba(193, 18, 31, 0.4);
}

.received-sub {
  max-width: 520px;
  margin: 0 auto 2rem;
  color: var(--bone-dim);
  font-style: italic;
}

/* Caption line: what the Draugr is saying */
.call-caption {
  min-height: 3.4em;
  max-width: 620px;
  margin: 2.4rem auto 0;
  padding: 0 1rem;
  font-style: italic;
  color: var(--bone-dim);
  font-size: 1.02rem;
  line-height: 1.6;
}

.call-caption:empty::before {
  content: "The line is quiet. For now.";
  opacity: 0.55;
}

/* Reduced motion: kill the pulse and glow loops */
@media (prefers-reduced-motion: reduce) {
  .call-state { animation: none; }
  .avatar-ring { animation: none; opacity: 0.35; }
  .rec-btn.recording { animation: none; box-shadow: 0 0 18px var(--blood-glow); }
  .key, .rec-btn { transition: none; }
  html { scroll-behavior: auto; }
}

/* Small screens */
@media (max-width: 420px) {
  .keypad { gap: 0.6rem; }
  .key { min-height: 92px; }
  .key-label { font-size: 0.6rem; }
  .call-actions .btn, .btn-end { min-width: 9rem; }
}
