/* Radhwa launch banner (top of chifaa.org/ai-game/) and poster-style buttons. */
:root {
  --rb-cream: #f5efe6;
  --rb-plum: #3b1f30;
  --rb-plum-hover: #55304a;
  --rb-rose: #b4475f;
  --rb-rose-line: #c98a99;
  --rb-ink: #2c2420;
  --rb-muted: #6b5d55;
  --rb-caps: 'Montserrat', 'DM Sans', Arial, sans-serif;
  --rb-serif: 'Cormorant Garamond', Georgia, serif;
  --rb-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
}

.radhwa-hero {
  background: var(--rb-cream);
  color: var(--rb-plum);
  padding: clamp(20px, 4vw, 56px) clamp(16px, 5vw, 96px) 0;
  overflow: hidden;
}

.rh-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* Top line: logo + "A narrative game" */
.rh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.rh-logo img {
  display: block;
  height: clamp(34px, 4.4vw, 58px);
  width: auto;
}

.rh-kicker {
  text-align: right;
  font-family: var(--rb-caps);
  font-weight: 600;
  font-size: clamp(10px, 1vw, 15px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--rb-muted);
}

.rh-kicker span {
  display: block;
  margin-top: 6px;
  font-family: var(--rb-arabic);
  font-size: 1.35em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* Two columns: text / portrait */
.rh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(16px, 3vw, 40px) 0 clamp(24px, 3vw, 40px);
}

.rh-text {
  text-align: center;
}

.rh-badge {
  display: inline-block;
  padding: 0.85em 2.1em;
  border-radius: 999px;
  background: var(--rb-rose);
  color: #fff;
  font-family: var(--rb-caps);
  font-weight: 700;
  font-size: clamp(10px, 1vw, 15px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.rh-title-ar {
  margin: 0.15em 0 0;
  font-family: var(--rb-arabic);
  font-weight: 700;
  font-size: clamp(72px, 10vw, 150px);
  line-height: 1.15;
}

.rh-title-en {
  margin: 0;
  font-family: var(--rb-serif);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 54px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-right: -0.42em; /* keep spaced letters optically centred */
  line-height: 1;
}

.rh-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 16px;
}

.rh-divider::before,
.rh-divider::after {
  content: "";
  width: clamp(48px, 6vw, 80px);
  height: 1px;
  background: var(--rb-rose-line);
}

.rh-divider span {
  width: 11px;
  height: 11px;
  background: var(--rb-rose);
  transform: rotate(45deg);
}

.rh-tagline {
  margin: 0;
  font-family: var(--rb-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 30px);
  color: var(--rb-ink);
}

.rh-call {
  margin: clamp(18px, 2.4vw, 36px) 0 0;
  font-family: var(--rb-serif);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: 1.35;
  color: var(--rb-ink);
}

.rh-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(20px, 2.6vw, 36px);
}

/* Poster buttons */
.rb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  min-height: 48px;
  padding: 1.05em 2.2em;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--rb-caps);
  font-weight: 700;
  font-size: clamp(12px, 1.15vw, 17px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.rb-btn:hover {
  transform: translateY(-2px);
}

.rb-btn:focus-visible {
  outline: 3px solid var(--rb-rose);
  outline-offset: 3px;
}

.rb-btn--plum {
  background: var(--rb-plum);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(59, 31, 48, 0.7);
}

.rb-btn--plum:hover {
  background: var(--rb-plum-hover);
}

.rb-url {
  display: inline-flex;
  gap: 0.9em;
}

.rb-btn--plum .rb-dot {
  opacity: 0.6;
}

.rb-btn--outline {
  background: transparent;
  border-color: var(--rb-plum);
  color: var(--rb-plum);
}

.rb-btn--outline:hover {
  background: var(--rb-plum);
  color: #fff;
}

.rh-feedback {
  margin: 16px 0 0;
  font-family: var(--rb-caps);
  font-weight: 600;
  font-size: clamp(10px, 0.95vw, 14px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rb-rose);
}

/* Arched portrait with a thin rose outline, as on the poster */
.rh-portrait {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  padding: 14px 14px 0;
}

.rh-portrait::before {
  content: "";
  position: absolute;
  inset: 0 0 -1px;
  border: 2px solid var(--rb-rose-line);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

.rh-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 760;
  object-fit: cover;
  border: 3px solid var(--rb-plum);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

/* Bottom notes */
.rh-notes {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--line, #dfd2c9);
  font-family: var(--rb-caps);
  font-size: clamp(11px, 0.9vw, 14px);
  color: var(--rb-muted);
}

.rh-notes [lang="ar"] {
  font-family: var(--rb-arabic);
  font-size: 1.1em;
}

/* Phones and small tablets: portrait above the text */
@media (max-width: 820px) {
  .rh-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rh-portrait {
    order: -1;
    width: min(52%, 220px);
    padding: 10px 10px 0;
  }

  /* On phones the button only says PLAY NOW */
  .rb-url {
    display: none;
  }

  .rh-notes {
    flex-direction: column;
    text-align: center;
  }

  .rh-kicker span {
    display: none;
  }

  .rb-btn {
    width: 100%;
    max-width: 360px;
    letter-spacing: 0.16em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-btn {
    transition: none;
  }

  .rb-btn:hover {
    transform: none;
  }
}

/* Game buttons take the poster style (light theme only) */
:root:not([data-theme=dark]) .continue-button {
  background: var(--rb-plum);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

:root:not([data-theme=dark]) .continue-button:hover {
  background: var(--rb-plum-hover);
}

:root:not([data-theme=dark]) .outlined {
  border-color: var(--rb-plum);
  color: var(--rb-plum);
  border-radius: 999px;
}

/* Dark theme: the banner keeps its light poster look */
[data-theme=dark] .radhwa-hero {
  color-scheme: light;
}

.rh-title {
  margin: 0;
  font: inherit;
}

.rh-title-ar,
.rh-title-en {
  display: block;
}

.rh-kicker,
.rh-tagline,
.rh-call,
.rh-feedback {
  font-variant-ligatures: common-ligatures;
}

.rh-top .rh-kicker {
  margin: 0;
}

.rh-portrait {
  margin: 0;
}

/* The poster replaces the home scene: show it whole (16:9) instead of the 3:1 crop */
#scene[src$="radhwa-poster.webp"] {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #f5efe6;
}

/* Clickable "PLAY NOW" pill drawn on the poster (position measured on the 1920x1080 image) */
.poster-play {
  position: absolute;
  left: 15.9%;
  top: 70.4%;
  width: 31.8%;
  height: 7.4%;
  border-radius: 999px;
  z-index: 2;
  cursor: pointer;
}

.poster-play:hover {
  box-shadow: 0 0 0 3px rgba(180, 71, 95, 0.55);
}

.poster-play:focus-visible {
  outline: 3px solid #b4475f;
  outline-offset: 3px;
}

.poster-play[hidden] {
  display: none;
}

/* Bigger touch area than the drawn pill, for phones */
.poster-play::before {
  content: "";
  position: absolute;
  inset: -14px -6px;
}

/* ── Living portrait on the poster ─────────────────────────────
   Positions are measured on the 1920x1080 poster: the arch interior is
   x 1140–1660, y 176–936; the cup's rim sits around x 1488, y 812. */
.poster-portrait {
  position: absolute;
  left: 59.375%;
  top: 16.3%;
  width: 27.083%;
  height: 70.37%;
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 34.2% 34.2% 0 0;
  pointer-events: none;
  z-index: 1;
}

.poster-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 40%;
  animation: rp-breathe 7s ease-in-out infinite;
}

/* Soft light passing over the drawing */
.poster-portrait::after {
  content: "";
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 248, 236, 0.35) 50%, transparent 60%);
  transform: translateX(-60%);
  animation: rp-light 9s ease-in-out 2s infinite;
}

/* Steam rising from the cup */
.poster-steam {
  position: absolute;
  left: 76.6%;
  top: 66.5%;
  width: 2.2%;
  height: 9%;
  pointer-events: none;
  z-index: 1;
}

.poster-steam span {
  position: absolute;
  bottom: 0;
  left: 35%;
  width: 34%;
  height: 55%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%);
  filter: blur(1.5px);
  opacity: 0;
  animation: rp-steam 4.5s ease-out infinite;
}

.poster-steam span:nth-child(2) {
  left: 10%;
  animation-delay: 1.5s;
}

.poster-steam span:nth-child(3) {
  left: 58%;
  animation-delay: 3s;
}

.poster-portrait[hidden],
.poster-steam[hidden] {
  display: none;
}

@keyframes rp-breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.025) translateY(-0.6%); }
}

@keyframes rp-light {
  0%, 15% { transform: translateX(-60%); }
  45%, 100% { transform: translateX(60%); }
}

@keyframes rp-steam {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(-30%, -150%) scale(1.4, 1.8); }
}

/* Respect "reduce motion" and the game's own pause button */
@media (prefers-reduced-motion: reduce) {
  .poster-portrait img,
  .poster-portrait::after,
  .poster-steam span {
    animation: none;
  }
  .poster-steam {
    display: none;
  }
}

/* The scene's pause button (Ⅱ) also pauses the portrait */
.scene-wrap:has(#motion[aria-pressed="true"]) .poster-portrait img,
.scene-wrap:has(#motion[aria-pressed="true"]) .poster-portrait::after,
.scene-wrap:has(#motion[aria-pressed="true"]) .poster-steam span {
  animation-play-state: paused;
}
