* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  background: var(--bg, #12080a);
}

.ad {
  position: relative;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  background: var(--bg, #12080a);
  color: #f6f1ea;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12080a;
  transition: opacity 0.35s ease;
}

.loader span {
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(201, 164, 92, 0.28);
  border-top-color: #e7c98a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ad.is-ready .loader { opacity: 0; pointer-events: none; }

.stage {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  overflow: hidden;
  background: #1a0c0e;
}

.ad--portrait .stage { width: 100%; height: var(--stage, 355px); }
.ad--banner .stage { width: 100%; height: 100%; }

.panel {
  position: relative;
  height: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: linear-gradient(180deg, #3a1820 0%, #14080c 100%);
  color: inherit;
  cursor: pointer;
  flex: none;
}

.ad.is-live .panel {
  transition: width 1s cubic-bezier(0.7, 0.02, 0.25, 1);
}

.panel + .panel { box-shadow: inset 1px 0 0 rgba(231, 201, 138, 0.92); }

.panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 40%);
  display: block;
  opacity: 1;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.ad.is-live .panel:not(.is-open) img { opacity: 0; }
.ad.is-live .stage.is-split .panel img { opacity: 1; }

.stage.is-split .panel::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(to top, #12080a 8%, rgba(18, 8, 10, 0));
  pointer-events: none;
}

.vlabel {
  position: absolute;
  z-index: 2;
  top: 16px;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #e7c98a;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ad.is-live .panel:not(.is-open) .vlabel { opacity: 1; }
.ad.is-live .stage.is-split .vlabel { opacity: 0; }
.ad--banner .vlabel { top: 8px; bottom: 48px; font-size: 7px; letter-spacing: 0.12em; }

.panel:focus-visible { outline: 1px solid #fff; outline-offset: -2px; }

.rail {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    radial-gradient(90px 48px at 100% 0%, rgba(200, 16, 46, 0.32), transparent 70%),
    linear-gradient(180deg, #2a1218 0%, #12080a 70%);
}

.ad--portrait .rail {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--rail, 125px);
  gap: 12px;
  padding: 0 16px 0 18px;
}

.ad--portrait .rail::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 201, 138, 0.9), transparent);
}

.ad--banner .rail {
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  justify-content: flex-end;
  padding: 0 8px 6px 12px;
  background: linear-gradient(to top, rgba(12, 6, 8, 0.72), rgba(12, 6, 8, 0));
}

.ad--banner .copy { display: none; }

.ad--banner .rail::before { content: none; }

.copy { min-width: 0; }

.rule {
  display: block;
  width: 28px;
  height: 1px;
  margin-bottom: 6px;
  background: #e7c98a;
  transform: scaleX(0);
  transform-origin: left center;
}

.rule.is-in { animation: draw 0.8s ease forwards; }
.ad--banner .rule { display: none; }

.word {
  color: #e7c98a;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: normal;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.word.is-in { animation: rise 0.7s ease both; }
.ad--portrait .word { font-size: 30px; }
.ad--banner .word { font-size: 18px; }

.line {
  margin-top: 5px;
  max-width: 180px;
  color: rgba(246, 241, 234, 0.86);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ad--banner .line { display: none; }

.cta {
  position: relative;
  flex: none;
  height: 32px;
  padding: 0 14px;
  overflow: hidden;
  border: 0;
  background: var(--cta-bg, #c8102e);
  color: var(--cta-text, #fff);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.ad--banner .cta {
  height: 26px;
  padding: 0 10px;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.cta::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-180%);
  animation: shimmer 2.8s ease-in-out infinite;
}

.cta:focus-visible { outline: 1px solid #fff; outline-offset: 1px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes draw { to { transform: scaleX(1); } }

@keyframes shimmer {
  0%, 42% { transform: translateX(-180%); }
  78%, 100% { transform: translateX(320%); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ad.is-live .panel,
  .word.is-in,
  .rule.is-in,
  .cta::after,
  .loader span { animation: none; transition: none; }
  .rule.is-in { transform: scaleX(1); }
  .word.is-in { opacity: 1; }
}
