.personality-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3/4;
  border: 1px solid #d8c5a45c;
  border-radius: 16px;
  background: #181421;
  color: #fff7ec;
  box-shadow: 0 18px 45px #09071145;
  text-align: left;
}
.personality-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.personality-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #100d1e80 0%,
    transparent 18%,
    transparent 34%,
    #14111d80 49%,
    #14111df5 72%,
    #14111d 100%
  );
}
.portrait-top {
  position: absolute;
  inset: 18px 20px auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 650;
  text-transform: uppercase;
  text-shadow: 0 1px 5px #000;
}
.portrait-copy {
  position: absolute;
  inset: auto 24px 20px;
}
.portrait-code {
  display: block;
  color: var(--card-tint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}
.personality-card .portrait-copy h1,
.personality-card .portrait-copy h2,
.personality-card .portrait-copy h3 {
  font:
    600 clamp(24px, 2.7vw, 36px)/1.13 Georgia,
    "Yu Mincho",
    serif;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
  color: #fff7ec;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.personality-card .portrait-copy p {
  font-size: clamp(13px, 1.1vw, 15px);
  line-height: 1.55;
  color: #f0e8ef;
  margin: 0;
  max-width: 100%;
  text-wrap: pretty;
}
.portrait-signature {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ddc5a44a;
  margin-top: 20px;
  padding-top: 12px;
  font-size: 10px;
  color: var(--card-tint);
  letter-spacing: 0.05em;
}
.cosmic-stage.personality-stage {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 4px 0 0;
  overflow: hidden;
}
.deck-kicker,
.deck-hint {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.07em;
  color: #e3d8eb;
  margin: 0 0 16px;
}
.deck-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #c7bbd5;
}
.portrait-rail {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px max(18px, calc((100% - 326px) / 2)) 26px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline-offset: -2px;
}
.portrait-rail::-webkit-scrollbar {
  display: none;
}
.portrait-slide {
  display: block;
  flex: 0 0 326px;
  max-width: calc(100vw - 96px);
  scroll-snap-align: center;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.35s,
    opacity 0.35s;
  transform: scale(0.95);
  opacity: 0.7;
}
.portrait-slide.is-current,
.portrait-slide:focus-visible {
  transform: scale(1);
  opacity: 1;
}
.portrait-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding: 0 6px;
  font-size: 13px;
  color: #f1e6f7;
}
.portrait-start > span {
  color: #d6ef78;
  font-size: 21px;
}
.deck-controls:not([hidden]) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.deck-controls button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid #756583;
  background: #1b152be0;
  color: #f4eafc;
  border-radius: 50%;
  cursor: pointer;
}
.deck-dots {
  display: flex;
  gap: 0;
}
.deck-dots button {
  border: 0;
  background: none;
  min-width: 28px;
}
.deck-dots span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9d8fac;
  margin: auto;
}
.deck-dots [aria-pressed="true"] span {
  background: #e5ce9f;
  width: 18px;
  border-radius: 4px;
}
.result-card.portrait-result {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  background: transparent;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--ink);
  border-radius: 0;
}
.result-card.portrait-result:after {
  display: none;
}
.portrait-result .personality-card {
  max-width: 340px;
}
.portrait-result .result-keepsake h3 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 12px 0 20px;
}
.result-keepsake p {
  color: var(--muted);
  line-height: 1.6;
}
.result-keepsake .result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.result-keepsake .result-actions .button {
  white-space: normal;
  text-align: center;
}
.test-card.illustrated-test {
  overflow: hidden;
  background: #1b1728;
  color: #fff7ec;
  border-color: #685778;
  min-height: 380px;
  padding-top: 190px;
}
.illustrated-test .test-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: center 36%;
  mask-image: linear-gradient(#000 58%, transparent);
}
.test-card.illustrated-test:after {
  display: none;
}
.illustrated-test .card-number {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 1;
  color: #fff7ec;
  background: #191322d9;
  border-radius: 99px;
  padding: 6px 10px;
  font-size: 10px;
}
.illustrated-test h3,
.illustrated-test p,
.illustrated-test .card-link {
  position: relative;
  color: inherit;
}
.test-card.illustrated-test p {
  color: #e1d7e8;
}
.test-card.illustrated-test .card-link {
  color: #e8d4ac;
}
.share-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.share-styles button {
  padding: 10px 14px;
  border: 1px solid #80708f;
  border-radius: 99px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.share-styles [aria-pressed="true"] {
  background: #edd7af;
  color: #211729;
  border-color: #edd7af;
}
.share-link-field {
  display: block;
  width: 100%;
  margin-top: 12px;
}
.shared-page > .personality-card {
  max-width: 400px;
  justify-self: center;
}
@media (min-width: 1100px) {
  .cosmic-hero {
    grid-template-columns: 1fr 1fr;
  }
  .cosmic-copy {
    padding-right: 20px;
  }
}
@media (max-width: 700px) {
  .cosmic-hero {
    padding-bottom: 24px;
  }
  .cosmic-stage.personality-stage {
    margin: 20px -14px 0;
    width: calc(100% + 28px);
  }
  .portrait-rail {
    gap: 16px;
    padding-left: max(24px, calc((100% - 286px) / 2));
    padding-right: max(24px, calc((100% - 286px) / 2));
  }
  .portrait-slide {
    flex-basis: 286px;
  }
  .portrait-copy {
    inset: auto 20px 16px;
  }
  .portrait-signature {
    margin-top: 14px;
    padding-top: 10px;
  }
  .result-card.portrait-result {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .portrait-result .personality-card {
    width: min(100%, 340px);
    justify-self: center;
  }
  .personality-card .portrait-copy h1,
  .personality-card .portrait-copy h2,
  .personality-card .portrait-copy h3 {
    font-size: 28px;
  }
  .personality-card .portrait-copy p {
    font-size: 13px;
  }
  .result-keepsake {
    text-align: center;
  }
  .result-keepsake .result-actions {
    justify-content: center;
  }
  .test-card.illustrated-test {
    padding-top: 145px;
    min-height: 340px;
  }
  .illustrated-test .test-art {
    height: 185px;
  }
  .illustrated-test .card-number {
    left: 10px;
    top: 10px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-slide {
    transition: none;
  }
  .portrait-rail {
    scroll-behavior: auto;
  }
}
@media (max-width: 700px) {
  .cosmic-hero {
    display: flex;
    flex-direction: column;
    padding: 22px 20px 26px;
  }
  .cosmic-copy {
    display: contents;
  }
  .cosmic-copy .eyebrow {
    order: 0;
  }
  .cosmic-copy h1 {
    order: 1;
    font-size: clamp(36px, 10vw, 46px);
    margin: 12px 0 8px;
  }
  .cosmic-copy > p:not(.hero-fine) {
    order: 5;
    font-size: 13px;
    margin-top: 14px;
    color: #d2c7dd;
  }
  .cosmic-stage.personality-stage {
    order: 2;
    margin: 4px -20px 0;
    width: calc(100% + 40px);
  }
  .cosmic-copy .cosmic-cta {
    order: 3;
    margin-top: 16px;
  }
  .cosmic-copy .hero-fine {
    order: 4;
    margin-top: 8px;
  }
  .deck-kicker {
    display: none;
  }
  .portrait-rail {
    padding-top: 8px;
    padding-bottom: 12px;
  }
  .deck-hint {
    margin-top: 6px;
  }
  .portrait-start {
    margin-top: 9px;
  }
}
