/*
 * Manic Millionaire - the "ultra premium domain" sale pages
 * (public/ultra-premium-domains/*.html).
 *
 * These pages are built from the site's own design: styles.css, site.css and
 * site-footer.css give them the header, sections, cards, buttons, form and
 * footer. This file holds only what a sale page adds:
 *
 *   1. Video hero, and the header over it
 *   2. Language boxes
 *   3. Comparable-sales bars
 *   4. The hat while the video plays, reduced motion
 */

/* ------------------------------------------------------------------ *
 * 1. Video hero
 *    Sized and dressed like the video hero on domainmanage.com: it fills
 *    exactly one screen, on a phone as on a desktop, and the header lies
 *    clear over the top of it (section 1b).
 *    premium-domain.js puts the Vimeo player in .pd-hero__media and shows it
 *    as soon as it is ready, paused on its first frame. The photo behind is
 *    what shows while it loads, or if Vimeo cannot be reached.
 *    Without JavaScript the header stays the yellow bar above the hero, and
 *    --pd-header (its height) keeps the two together at one screen.
 * ------------------------------------------------------------------ */
.pd-hero {
  --pd-header: 66px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--pd-header));
  height: calc(100dvh - var(--pd-header));
  min-height: 480px;
  overflow: hidden;
  color: #fff;
  background: #0a0a0f center 30% / cover no-repeat;
}

@media (min-width: 768px) {
  .pd-hero {
    --pd-header: 82px;
  }
}

.js .pd-hero {
  height: 100vh;
  height: 100dvh;
}

.pd-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(6, 8, 14, 0.86) 0%, rgba(6, 8, 14, 0.18) 48%, rgba(6, 8, 14, 0.62) 100%);
  pointer-events: none;
  transition: opacity 0.6s;
}

.pd-hero.is-playing {
  cursor: pointer;
}

.pd-hero.is-playing::before {
  opacity: 0;
}

.pd-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
}

/* Fill the hero at 16:9 whatever its shape, cropping the overflow. */
.pd-hero__media iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
  border: 0;
  opacity: 0;
  transition: opacity 0.6s;
}

.pd-hero.has-video .pd-hero__media iframe {
  opacity: 1;
}

.pd-hero__title {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  margin-top: auto;
  padding: 0 16px clamp(28px, 4vw, 48px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}

.pd-hero.is-playing .pd-hero__title {
  opacity: 0;
  transform: translateY(12px);
}

.pd-sticker {
  display: block;
  width: min(460px, 72vw);
  height: auto;
  animation: pd-pop 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes pd-pop {
  from {
    transform: scale(0.6) rotate(-8deg);
    opacity: 0;
  }
}

.pd-play {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}

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

/* While the video plays with sound the button fades out. It stays reachable
   by keyboard (as "Pause video") and reappears when focused. */
.pd-play.is-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
}

.pd-play.is-hidden:has(:focus-visible) {
  opacity: 1;
}

.pd-play__caption {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.pd-play__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(76px, 11vw, 104px);
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(10, 10, 20, 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.pd-play__orb:hover {
  background: rgba(30, 30, 52, 0.62);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.06);
}

.pd-play__orb:focus-visible,
.pd-play__restart:focus-visible {
  outline: 3px solid #ffd701;
  outline-offset: 4px;
}

.pd-play__orb::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: pd-ring 2.6s ease-out infinite;
}

@keyframes pd-ring {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* The triangle; two bars once the video is playing with sound. */
.pd-play__orb i {
  display: block;
  margin-left: 6px;
  border-left: 22px solid currentColor;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
}

.pd-play.is-hidden .pd-play__orb i {
  margin-left: 0;
  width: 22px;
  height: 26px;
  border: solid currentColor;
  border-width: 0 7px;
}

.pd-play.is-hidden .pd-play__orb::before {
  animation: none;
  opacity: 0;
}

.pd-play__restart {
  position: absolute;
  top: calc(100% + 48px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: rgba(10, 10, 20, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.75);
  font: 600 12px Inter, system-ui, sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.pd-play__restart.is-shown {
  display: inline-flex;
}

.pd-play__restart:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(20, 20, 36, 0.62);
}

.pd-play__restart svg {
  display: block;
  width: 13px;
  height: 13px;
}

/* ------------------------------------------------------------------ *
 * 1b. The header over the video
 *    Clear, with yellow links and a yellow button, while the hero is under
 *    it; premium-domain.js adds .is-solid once the hero has scrolled away,
 *    and the header is the site's yellow bar again.
 * ------------------------------------------------------------------ */
.js .pd-header {
  position: fixed;
  left: 0;
  right: 0;
  transition: background-color 0.25s, border-color 0.25s;
}

/* A soft shade behind the links, as on domainmanage.com. */
.js .pd-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -24px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  pointer-events: none;
  transition: opacity 0.25s;
}

.js .pd-header.is-solid::before {
  opacity: 0;
}

.js .pd-header:not(.is-solid) {
  border-color: transparent;
  background-color: transparent;
}

.js .pd-header:not(.is-solid) > div:first-child nav a {
  color: #ffd701;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.js .pd-header:not(.is-solid) > div:first-child a[href="#enquire"] {
  border-color: #ffd701;
  background-color: #ffd701;
  color: #222222;
}

.js .pd-header:not(.is-solid) > div:first-child a[href="#enquire"]:hover {
  border-color: #fff;
  background-color: #fff;
}

/* ------------------------------------------------------------------ *
 * 2. Language boxes
 *    A row of the site's bordered cells that wraps; the boxes on the last
 *    line stretch, so there is never an empty slot.
 * ------------------------------------------------------------------ */
.pd-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  border: 2px solid #222222;
  background: #222222;
}

.pd-langs li {
  flex: 1 1 240px;
  padding: 24px;
  background: #ffd701;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.375;
}

/* ------------------------------------------------------------------ *
 * 3. Comparable-sales bars
 *    The track is the site's progress bar; the bars grow from the left when
 *    scrolled into view (premium-domain.js adds .is-armed, then .is-in).
 * ------------------------------------------------------------------ */
.pd-rows {
  display: grid;
  gap: 16px;
}

.pd-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 140px;
  align-items: center;
  gap: 20px;
}

.pd-row__name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.pd-row__year {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(34, 34, 34, 0.7);
}

.pd-row__bar {
  height: 40px;
  padding: 2px;
  border: 2px solid #222222;
  background: #fff7da;
}

.pd-row__bar i {
  display: block;
  width: var(--w);
  height: 100%;
  background: #222222;
  transform-origin: left;
}

.pd-rows.is-armed .pd-row__bar i {
  transform: scaleX(0);
}

.pd-rows.is-armed.is-in .pd-row__bar i {
  transform: none;
  transition: transform 1.2s cubic-bezier(0, 0, 0.58, 1);
}

/* ia.com's own row: an open yellow track, no bar. */
.pd-row--ours .pd-row__bar {
  background: #ffd701;
}

.pd-row__value {
  font-family: Knewave, Impact, sans-serif;
  font-size: 30px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .pd-langs li {
    padding: 20px;
  }
  .pd-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }
  .pd-row__bar {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 28px;
  }
  .pd-row__value {
    font-size: 24px;
  }
}

/* ------------------------------------------------------------------ *
 * 4. The hat steps aside while the video plays; reduced motion
 * ------------------------------------------------------------------ */
#mm-hat {
  transition: opacity 0.35s;
}

body:has(.pd-hero.is-playing) #mm-hat {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pd-sticker,
  .pd-play__orb::before {
    animation: none;
  }
  .pd-rows.is-armed .pd-row__bar i {
    transform: none;
  }
}
