:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #061116;
  --panel: rgba(7, 23, 30, .84);
  --paper: #f4f8f7;
  --muted: #a8bdc1;
  --cyan: #49e7ed;
  --blue: #1988ff;
  --copper: #ff8b4c;
  --line: rgba(101, 223, 226, .26);
}

* { box-sizing: border-box; }

html,
body {
  width: 340px;
  height: 400px;
  min-width: 340px;
  min-height: 400px;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body { position: relative; }

.ad {
  position: relative;
  display: block;
  width: 340px;
  height: 400px;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
  text-decoration: none;
  background:
    radial-gradient(circle at 78% 18%, rgba(20, 128, 164, .22), transparent 38%),
    linear-gradient(145deg, #071921 0%, #04090d 72%);
  border: 1px solid rgba(79, 216, 221, .3);
  box-shadow: inset 0 0 42px rgba(55, 224, 229, .06);
  cursor: pointer;
}

.ad:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

.ad__webgl,
.ad__aurora,
.ad__grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ad__webgl { z-index: -4; opacity: 1; transition: opacity .7s ease; }
.ad[data-kind="reference"] .ad__webgl { opacity: .24; }
.ad[data-kind="message"] .ad__webgl { opacity: .64; }

.ad__aurora {
  z-index: -3;
  background:
    radial-gradient(circle at 84% 82%, rgba(255, 112, 54, .16), transparent 28%),
    linear-gradient(135deg, transparent 45%, rgba(21, 173, 190, .07) 70%, transparent 85%);
  animation: aurora 7s ease-in-out infinite alternate;
}

.ad__grain {
  z-index: -2;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.brand {
  position: absolute;
  z-index: 20;
  top: 15px;
  left: 13px;
  right: 13px;
  display: flex;
  align-items: center;
  height: 24px;
  letter-spacing: .075em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.brand__mark {
  position: relative;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border: 1px solid rgba(76, 228, 234, .7);
  border-radius: 7px;
  transform: rotate(45deg);
  overflow: hidden;
  box-shadow: 0 0 18px rgba(65, 229, 234, .22);
}

.brand__mark i {
  position: absolute;
  left: -4px;
  width: 29px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.brand__mark i:nth-child(1) { top: 6px; }
.brand__mark i:nth-child(2) { top: 11px; }
.brand__mark i:nth-child(3) { top: 16px; }

.brand__name { font-size: 11px; font-weight: 900; }
.brand__line { flex: 1; height: 1px; margin: 0 9px; background: linear-gradient(90deg, var(--line), transparent); }
.brand__unit { color: var(--cyan); font-size: 7px; font-weight: 800; letter-spacing: .16em; }

.scenes { position: absolute; inset: 0; z-index: 4; }

.scene {
  position: absolute;
  inset: 0;
  padding: 54px 13px 35px;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(17px, 0, 0) scale(.985);
  filter: blur(4px);
  transition: opacity .62s ease, transform .72s cubic-bezier(.2, .8, .2, 1), filter .62s ease, visibility 0s linear .72s;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  filter: none;
  transition-delay: 0s;
}

.scene.is-leaving {
  opacity: 0;
  visibility: visible;
  transform: translate3d(-20px, 0, 0) scale(.985);
  filter: blur(3px);
}

.kicker {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.scene--intro { padding-top: 81px; }
.scene--intro h1 {
  position: relative;
  z-index: 2;
  max-width: 302px;
  margin: 0;
  color: #f6fbfa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 37px;
  line-height: .91;
  font-weight: 700;
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 3px 20px rgba(0, 0, 0, .72);
}

.scene--intro h1 em {
  display: inline-block;
  color: #fff;
  font-weight: 400;
  font-style: italic;
  background: linear-gradient(94deg, var(--cyan), #b8fbff 47%, #ffbc83 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro__copy {
  margin: 16px 0 0;
  color: #d7e5e5;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: .01em;
}

.intro__action {
  position: absolute;
  left: 13px;
  bottom: 39px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(80, 231, 236, .54);
  border-radius: 999px;
  background: rgba(7, 27, 34, .62);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 0 25px rgba(67, 223, 229, .13);
}
.intro__action b { color: var(--copper); font-size: 14px; }

.intro__signal {
  position: absolute;
  top: 70px;
  right: -40px;
  width: 205px;
  height: 205px;
  border: 1px solid rgba(71, 231, 236, .22);
  border-radius: 50%;
  animation: signal-spin 10s linear infinite;
}
.intro__signal::before,
.intro__signal::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 135, 72, .22);
  border-radius: 50%;
}
.intro__signal::before { inset: 25px; }
.intro__signal::after { inset: 58px; border-color: rgba(88, 232, 237, .35); }
.intro__signal i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}
.intro__signal i:nth-child(1) { top: 13px; left: 63px; }
.intro__signal i:nth-child(2) { top: 103px; left: -4px; background: var(--copper); box-shadow: 0 0 14px var(--copper); }
.intro__signal i:nth-child(3) { right: 13px; bottom: 44px; }
.intro__signal i:nth-child(4) { left: 90px; bottom: 54px; width: 4px; height: 4px; }

.scene--reference { padding: 49px 15px 35px; }
.device-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 69px;
  gap: 8px;
  align-items: center;
  height: 180px;
  padding: 11px 8px;
  overflow: hidden;
  border: 1px solid rgba(77, 216, 221, .27);
  border-radius: 17px;
  background:
    radial-gradient(circle at 80% 14%, rgba(59, 213, 220, .13), transparent 31%),
    rgba(5, 18, 24, .88);
  box-shadow: inset 0 0 30px rgba(38, 189, 196, .05), 0 16px 38px rgba(0, 0, 0, .3);
}

.device-stage::before {
  content: "";
  position: absolute;
  inset: auto 15px 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 229, 234, .54), transparent);
}

.browser,
.phone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #020608;
  border: 1px solid rgba(185, 225, 226, .35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .48);
}

.browser {
  height: 139px;
  padding: 12px 4px 4px;
  border-radius: 7px;
}
.browser::before {
  content: "•••";
  position: absolute;
  top: -1px;
  left: 7px;
  color: var(--copper);
  font-size: 9px;
  letter-spacing: 1px;
}

.phone {
  width: 69px;
  height: 148px;
  padding: 7px 4px 6px;
  border: 3px solid #17282d;
  border-radius: 14px;
  outline: 1px solid rgba(132, 224, 226, .26);
}
.phone::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 50%;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #31464b;
  transform: translateX(-50%);
}

.browser img,
.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.reference-copy { padding: 11px 5px 0; }
.reference-copy .kicker { margin-bottom: 4px; font-size: 7.5px; }
.reference-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -.025em;
}
.reference-copy p:last-child {
  max-width: 298px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 550;
}

.scene--message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 17px 43px;
}
.scene--message .message__number {
  position: absolute;
  top: 54px;
  right: 19px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(93, 230, 234, .2);
  font-family: Georgia, serif;
  font-size: 76px;
  line-height: 1;
  font-style: italic;
}
.scene--message h2,
.scene--outro h2 {
  position: relative;
  z-index: 2;
  max-width: 315px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 35px;
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.scene--message h2 em,
.scene--outro h2 em { color: var(--copper); font-weight: 400; }
.message__copy {
  max-width: 294px;
  margin: 15px 0 0;
  color: #c1d1d2;
  font-size: 12px;
  line-height: 1.45;
}
.message__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}
.message__tags span {
  padding: 5px 8px;
  border: 1px solid rgba(70, 223, 229, .28);
  border-radius: 999px;
  color: #e8f6f5;
  background: rgba(10, 33, 40, .55);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scene--outro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 61px 17px 47px;
  background: radial-gradient(circle at 88% 27%, rgba(79, 232, 237, .12), transparent 34%);
}
.scene--outro h2 { font-size: 38px; }
.outro__copy { margin: 15px 0 0; color: #c9d8d9; font-size: 12px; line-height: 1.4; }
.outro__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 22px;
  padding: 13px 15px;
  border-radius: 11px;
  color: #021014;
  background: linear-gradient(96deg, var(--cyan), #b6fbfd);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 0 30px rgba(72, 232, 237, .22);
}
.outro__button b { font-size: 18px; }
.outro__micro { margin-top: 10px; color: #89a8ab; font-size: 8px; letter-spacing: .04em; }

.ad__footer {
  position: absolute;
  z-index: 22;
  right: 13px;
  bottom: 13px;
  left: 13px;
  display: grid;
  grid-template-columns: 18px 1fr 18px;
  gap: 8px;
  align-items: center;
  color: #75979b;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .1em;
}
.ad__total { text-align: right; }
.ad__progress { height: 1px; overflow: hidden; background: rgba(116, 196, 199, .18); }
.ad__progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--copper));
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

@keyframes aurora { to { transform: translate3d(-9px, 7px, 0) scale(1.04); } }
@keyframes signal-spin { to { transform: rotate(405deg); } }

.ad.is-paused .ad__aurora,
.ad.is-paused .intro__signal {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .ad__aurora,
  .intro__signal { animation: none; }
  .scene { transition: none; }
}
