/* CLOUDE enter screen: a tilted mosaic of CLOUDE film frames and product
   imagery behind a cinematic glass card. Markup: #cloude-intro in
   home-template.html; shown by the inline head script (html.show-intro) and
   dismissed by cloude-intro.js. */

.cloude-intro {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  transition: opacity .9s ease, visibility .9s ease;
}

html.show-intro .cloude-intro {
  display: block;
}

html.show-intro,
html.show-intro body {
  overflow: hidden;
}

.cloude-intro.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.cloude-intro-skip {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 24px;
  padding: 9px 18px;
  border: 1px solid rgba(255, 236, 205, .35);
  border-radius: 999px;
  background: rgba(33, 20, 12, .45);
  color: #f4e2bd;
  font: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cloude-intro-skip:hover { background: rgba(33, 20, 12, .7); }

.hero-mosaic-slide {
  --mx: 0;
  --my: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 38%, #4a2f1e 0%, #24150d 55%, #120a06 100%);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---- Mosaic backdrop ---- */
.hero-mosaic-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  perspective: 1400px;
  pointer-events: none;
}

.hero-mosaic-grid {
  position: absolute;
  inset: -34% -18%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  transform: rotateX(18deg) rotateZ(-11deg) scale(1.08);
  transform-origin: 50% 50%;
}

.hero-mosaic-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: hero-mosaic-drift 46s linear infinite;
}

.hero-mosaic-col-2,
.hero-mosaic-col-4 {
  animation-direction: reverse;
  margin-top: -120px;
}

.hero-mosaic-col-3 { animation-duration: 58s; }
.hero-mosaic-col-5 { animation-duration: 52s; margin-top: -60px; }

.hero-mosaic-tile {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 26px;
  background-size: cover;
  background-position: center;
  filter: saturate(.92) brightness(.58) contrast(1.04);
  box-shadow:
    0 0 0 1px rgba(255, 232, 196, .14),
    0 24px 60px rgba(0, 0, 0, .45);
}

/* A few tiles catch the light, echoing the pearl-and-gold brand palette. */
.hero-mosaic-col-2 .hero-mosaic-tile:nth-child(2),
.hero-mosaic-col-4 .hero-mosaic-tile:nth-child(3) {
  filter: saturate(1) brightness(.78);
  box-shadow:
    0 0 0 1px rgba(216, 177, 106, .55),
    0 0 42px rgba(216, 177, 106, .28),
    0 24px 60px rgba(0, 0, 0, .45);
}

.hero-mosaic-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 50%, rgba(216, 177, 106, .20), transparent 70%),
    radial-gradient(120% 100% at 50% 50%, transparent 45%, rgba(10, 5, 2, .82) 100%),
    linear-gradient(180deg, rgba(18, 10, 6, .35), rgba(18, 10, 6, .55));
}

@keyframes hero-mosaic-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -50%, 0); }
}

/* ---- Cinematic card ---- */
.hero-mosaic-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(1180px, calc(100% - 140px));
  height: min(680px, calc(100% - 140px));
  border-radius: 30px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 236, 205, .34);
  box-shadow:
    0 0 0 6px rgba(255, 236, 205, .05),
    0 50px 120px rgba(5, 2, 1, .65),
    0 0 90px rgba(216, 177, 106, .18);
  transform:
    translate(-50%, -50%)
    perspective(1600px)
    rotateX(calc(4deg + var(--my) * -3deg))
    rotateY(calc(var(--mx) * 4deg))
    rotateZ(-2.2deg);
  transition:
    transform .9s cubic-bezier(.22, 1, .36, 1),
    opacity .9s ease;
}

.cloude-intro .hero-mosaic-card {
  animation: cloude-intro-rise 1.1s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes cloude-intro-rise {
  from {
    opacity: 0;
    transform: translate(-50%, -42%) perspective(1600px) rotateX(16deg) rotateZ(-6deg) scale(.96);
  }
}

/* Entering: the card lifts towards the viewer as the screen fades out. */
.cloude-intro.is-leaving .hero-mosaic-card {
  opacity: 0;
  transform: translate(-50%, -50%) perspective(1600px) rotateX(0) rotateZ(0) scale(1.12);
}

.hero-mosaic-card-media {
  position: absolute;
  inset: 0;
  background: url("/assets/hero-mosaic/cloud-float-hero.webp") center 42% / cover no-repeat;
  transform: scale(1.08);
}

.hero-mosaic-slide .hero-mosaic-card-media {
  animation: hero-mosaic-kenburns 14s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes hero-mosaic-kenburns {
  from { transform: scale(1.14) translate3d(1.5%, 1%, 0); }
  to { transform: scale(1.02) translate3d(0, 0, 0); }
}

.hero-mosaic-card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 12, 7, .52) 0%, rgba(20, 12, 7, .08) 30%, rgba(20, 12, 7, .12) 55%, rgba(20, 12, 7, .78) 100%),
    radial-gradient(62% 52% at 50% 54%, rgba(20, 12, 7, .58), transparent 78%);
}

/* A thin iridescent streak along the card edge, a nod to the reference's
   prism light but in CLOUDE gold. */
.hero-mosaic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 226, 170, .16) 48%, rgba(255, 255, 255, .06) 52%, transparent 62%);
  mix-blend-mode: screen;
}

.hero-mosaic-card-top {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-mosaic-badge,
.hero-mosaic-features li,
.hero-mosaic-trust {
  background: rgba(33, 20, 12, .42);
  border: 1px solid rgba(255, 236, 205, .28);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.hero-mosaic-badge {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f4e2bd;
  white-space: nowrap;
}

.hero-mosaic-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-mosaic-features li {
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff7ea;
}

.hero-mosaic-features li::before {
  content: "\2726";
  margin-right: 7px;
  color: #d8b16a;
}

.hero-mosaic-content {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(820px, calc(100% - 64px));
  transform: translate(-50%, -46%);
  text-align: center;
}

.hero-mosaic-title {
  margin: 0;
  font-family: inherit;
  font-weight: 300;
  margin: 0 0 30px;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 1;
  letter-spacing: -.03em;
  text-shadow: 0 6px 40px rgba(15, 8, 4, .55);
}

.hero-mosaic-nowrap {
  white-space: nowrap;
}

.hero-mosaic-title em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: #f0d29b;
  background: linear-gradient(100deg, #f7e3b8 0%, #d8b16a 45%, #fff1d2 70%, #c99a4b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: .06em;
}


.hero-mosaic-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-mosaic-cta,
.hero-mosaic-ghost {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.hero-mosaic-cta {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 6px 6px 26px;
  background: #fffaf0;
  color: #2b1a10;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}

.hero-mosaic-cta i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-style: normal;
  font-size: 18px;
  color: #2b1a10;
  background: linear-gradient(135deg, #f0d29b, #c99a4b);
  transition: transform .25s ease;
}

.hero-mosaic-ghost {
  padding: 0 24px;
  color: #fff;
  border: 1px solid rgba(255, 236, 205, .5);
  background: rgba(33, 20, 12, .28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-mosaic-cta:hover,
.hero-mosaic-ghost:hover {
  transform: translateY(-2px);
}

.hero-mosaic-cta:hover i {
  transform: translateX(3px);
}

.hero-mosaic-cta:focus-visible,
.hero-mosaic-ghost:focus-visible {
  outline: 2px solid #f0d29b;
  outline-offset: 3px;
}

.hero-mosaic-trust {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  color: rgba(255, 248, 234, .86);
}

.hero-mosaic-trust span {
  padding: 0 16px;
}

.hero-mosaic-trust span + span {
  border-left: 1px solid rgba(255, 236, 205, .28);
}

.hero-mosaic-trust strong {
  color: #f0d29b;
  font-weight: 700;
}


@media (max-width: 1100px) {
  .hero-mosaic-features li:nth-child(3) { display: none; }
}

@media (max-width: 900px) {
  .hero-mosaic-card {
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    max-height: none;
    border-radius: 24px;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 16px 24px;
    box-sizing: border-box;
  }


  .hero-mosaic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    inset: -30% -40%;
  }

  .hero-mosaic-col-4,
  .hero-mosaic-col-5 { display: none; }

  .hero-mosaic-card-top,
  .hero-mosaic-content,
  .hero-mosaic-trust {
    position: relative;
    inset: auto;
    transform: none;
  }

  .hero-mosaic-card-media { background-position: 30% 45%; }

  .hero-mosaic-card-top { justify-content: center; }

  .cloude-intro-skip {
    top: 14px;
    right: 14px;
    z-index: 4;
    padding: 7px 14px;
  }
  .hero-mosaic-features { display: none; }

  .hero-mosaic-badge {
    font-size: 9.5px;
    padding: 7px 12px;
  }

  .hero-mosaic-content { width: 100%; }

  .hero-mosaic-title { font-size: clamp(32px, 9.4vw, 46px); }


  .hero-mosaic-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hero-mosaic-cta {
    width: min(320px, 100%);
    justify-content: space-between;
    min-height: 48px;
    box-sizing: border-box;
  }

  .hero-mosaic-cta i { width: 36px; height: 36px; }

  .hero-mosaic-ghost {
    min-height: 0;
    padding: 4px 8px;
    border: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-decoration: underline;
    text-underline-offset: 4px;
    font-size: 14px;
  }

  .hero-mosaic-trust {
    font-size: 11px;
    padding: 7px 2px;
  }

  .hero-mosaic-trust span { padding: 0 9px; }
}

@media (max-width: 400px) {
  .hero-mosaic-trust span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mosaic-col,
  .hero-mosaic-slide .hero-mosaic-card-media {
    animation: none !important;
  }

  .hero-mosaic-card,
  .cloude-intro {
    animation: none !important;
    transition: none !important;
  }
}
