/* Hiffi 500 share card — brand typography (Archivo Black / Inter / JetBrains Mono) */

:root {
  --sc-hiffi-red: #e31e24;
  --sc-ink: #0a0a0c;
  --sc-paper: #f4f1ec;
  --sc-steel: #8a8782;
  --sc-mono-accent: #e31e24;
  --sc-display: "Archivo Black", "Arial Black", sans-serif;
  --sc-body: Inter, Arial, sans-serif;
  --sc-mono: "JetBrains Mono", "Courier New", monospace;
}

.share-card-host {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1080px;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

.share-card {
  container-type: inline-size;
  position: relative;
  width: 1080px;
  height: 1080px;
  background:
    radial-gradient(58% 52% at 50% 42%, rgba(227, 30, 36, 0.34) 0%, transparent 62%),
    radial-gradient(42% 36% at 18% 12%, rgba(227, 30, 36, 0.1) 0%, transparent 55%),
    radial-gradient(40% 34% at 88% 78%, rgba(227, 30, 36, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #0e0e12 0%, var(--sc-ink) 42%, #070708 100%);
  overflow: hidden;
  font-family: var(--sc-display);
  display: none;
  color: var(--sc-paper);
}

.share-card.is-active {
  display: block;
}

.share-card.format-story {
  height: 1920px;
}

.share-card__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 38%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, transparent 18%, transparent 78%, rgba(0, 0, 0, 0.45) 100%);
}

.share-card__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.share-card__frame {
  position: absolute;
  inset: 28px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(244, 241, 236, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(227, 30, 36, 0.18),
    inset 0 0 80px rgba(0, 0, 0, 0.35);
}

.share-card__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--sc-hiffi-red);
  border-style: solid;
  opacity: 0.9;
}

.share-card__corner--tl {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.share-card__corner--tr {
  top: -1px;
  right: -1px;
  border-width: 2px 2px 0 0;
}

.share-card__corner--bl {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 2px 2px;
}

.share-card__corner--br {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.share-card__glow {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 980px;
  height: 980px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(227, 30, 36, 0.5) 0%,
    rgba(227, 30, 36, 0.22) 28%,
    rgba(227, 30, 36, 0.06) 52%,
    transparent 70%
  );
  pointer-events: none;
  filter: blur(2px);
  z-index: 0;
}

.share-card__mark {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 1;
  width: min(70%, 760px);
  transform: translate(-50%, -50%);
  opacity: 0.09;
  pointer-events: none;
}

.share-card__mark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.share-card.format-story .share-card__mark {
  top: 44%;
  width: min(78%, 860px);
  opacity: 0.08;
}

/* Top bar */
.share-card .wordmark {
  position: absolute;
  top: 52px;
  left: 56px;
  z-index: 6;
  display: flex;
  align-items: center;
  height: 40px;
}

.share-card .wordmark img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

/* Masthead */
.share-card__masthead {
  position: absolute;
  top: 108px;
  left: 72px;
  right: 72px;
  z-index: 6;
  display: grid;
  gap: 14px;
  justify-items: stretch;
  text-align: center;
}

.share-card .kicker__eyebrow {
  position: relative;
  justify-self: center;
  padding: 0 22px;
  font: 700 14px / 1 var(--sc-mono);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.58);
}

.share-card .kicker__eyebrow::before,
.share-card .kicker__eyebrow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, rgba(227, 30, 36, 0.7), transparent);
}

.share-card .kicker__eyebrow::before {
  right: 100%;
  margin-right: 14px;
  transform: scaleX(-1);
}

.share-card .kicker__eyebrow::after {
  left: 100%;
  margin-left: 14px;
}

.share-card .kicker__title {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  font: 400 56px / 0.9 var(--sc-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sc-hiffi-red);
  text-shadow:
    0 0 28px rgba(227, 30, 36, 0.55),
    0 0 64px rgba(227, 30, 36, 0.28);
  white-space: nowrap;
  overflow: hidden;
}

.share-card .kicker__brand {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 100%;
}

.share-card .kicker__title.is-brand .kicker__brand {
  display: inline-flex;
}

.share-card .kicker__title.is-brand .kicker__title-text {
  display: none !important;
}

.share-card .kicker__brand[hidden] {
  display: none !important;
}

.share-card .kicker__brand img {
  display: block;
  height: 52px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(227, 30, 36, 0.35));
}

.share-card .kicker__500 {
  font: 400 56px / 0.9 var(--sc-display);
  letter-spacing: 0.04em;
  color: var(--sc-hiffi-red);
  text-shadow:
    0 0 28px rgba(227, 30, 36, 0.55),
    0 0 64px rgba(227, 30, 36, 0.28);
}

.share-card .kicker__title-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

.share-card .kicker__sub {
  font: 400 20px / 1 var(--sc-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.92);
}

/* Centered hero: artist first, rank below */
.share-card__hero {
  position: absolute;
  left: 64px;
  right: 64px;
  top: 250px;
  bottom: 130px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  min-width: 0;
}

.share-card .identity {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  max-width: 920px;
  min-width: 0;
  height: auto;
}

.share-card .share-card__avatar,
.share-card .monogram {
  --avatar-accent: color-mix(
    in srgb,
    var(--mono-accent, var(--sc-hiffi-red)) 28%,
    var(--sc-hiffi-red)
  );
  width: 240px;
  height: 240px;
  border-radius: 0;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  font: 400 72px / 1 var(--sc-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.82);
  background:
    radial-gradient(
      120% 90% at 30% 18%,
      color-mix(in srgb, var(--avatar-accent) 42%, #2a1014) 0%,
      transparent 58%
    ),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--avatar-accent) 32%, #161014) 0%,
      color-mix(in srgb, var(--avatar-accent) 18%, #0c0a0c) 48%,
      #080708 100%
    );
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--avatar-accent) 35%, transparent),
    0 0 48px color-mix(in srgb, var(--avatar-accent) 22%, transparent),
    0 22px 56px rgba(0, 0, 0, 0.55);
}

/* Soft edge blend into the card */
.share-card .share-card__avatar::after,
.share-card .monogram::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 4;
  pointer-events: none;
  box-shadow:
    inset 0 0 28px rgba(8, 7, 8, 0.55),
    inset 0 0 1px rgba(244, 241, 236, 0.08);
  background: linear-gradient(
    180deg,
    rgba(10, 10, 12, 0.12) 0%,
    transparent 28%,
    transparent 62%,
    rgba(10, 10, 12, 0.35) 100%
  );
}

.share-card .share-card__avatar .photo-initials,
.share-card .monogram .photo-initials {
  position: relative;
  z-index: 1;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: color-mix(in srgb, var(--sc-paper) 88%, var(--avatar-accent));
}

.share-card .share-card__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  filter: saturate(0.82) brightness(0.86) contrast(1.04);
}

.share-card .share-card__avatar.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(10, 10, 12, 0.2) 0%,
      color-mix(in srgb, var(--avatar-accent) 18%, transparent) 45%,
      rgba(10, 10, 12, 0.48) 100%
    );
}

.share-card .share-card__avatar.has-image .photo-initials {
  opacity: 0;
}

.share-card .identity__text {
  min-width: 0;
  width: 100%;
  flex: none;
}

.share-card .artist-name {
  max-width: 100% !important;
  width: 100%;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  font-family: var(--sc-display);
  font-weight: 400;
  font-size: 108px;
  line-height: 0.88;
  letter-spacing: -0.02em;
  color: var(--sc-paper);
  text-transform: uppercase;
  text-align: center;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.25),
    0 16px 48px rgba(0, 0, 0, 0.45);
}

.share-card .artist-name.is-long {
  font-size: 84px;
}

.share-card .artist-name.is-xl {
  font-size: 64px;
}

.share-card .artist-name.is-wrapped {
  white-space: normal !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 0.92;
}

.share-card .subline {
  margin-top: 14px;
  font: 700 26px / 1.2 var(--sc-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.55);
  text-align: center;
}

.share-card__rank {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  transform: none;
  box-sizing: border-box;
  margin: 4px 0 0;
  font: 400 220px / 0.8 var(--sc-display);
  letter-spacing: -0.06em;
  white-space: nowrap;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  z-index: auto;
  color: rgba(227, 30, 36, 0.88);
  text-shadow:
    0 0 24px rgba(227, 30, 36, 0.45),
    0 0 80px rgba(227, 30, 36, 0.5),
    0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.share-card__rank.is-2digit {
  font-size: 190px;
}

.share-card__rank.is-3digit {
  font-size: 150px;
}

.share-card__meta-stack {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  z-index: auto;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  margin-top: 4px;
  width: 100%;
}

.share-card .citation,
.share-card .movement-tag {
  max-width: none;
  width: max-content;
  font: 700 28px / 1.3 var(--sc-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.72);
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.share-card .movement-tag {
  display: none !important;
}

.share-card__divider {
  display: none;
}

/* Footer */
.share-card .footer {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 52px;
  z-index: 6;
  display: grid;
  gap: 14px;
  border: 0;
  padding: 0;
}

.share-card .footer__rule {
  height: 1px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(244, 241, 236, 0.16) 10%,
    rgba(244, 241, 236, 0.22) 50%,
    rgba(244, 241, 236, 0.16) 90%,
    transparent
  );
}

.share-card .footer__row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 24px;
}

.share-card .footer__left,
.share-card .footer__right {
  font: 600 30px / 1.4 var(--sc-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc-steel);
}

.share-card .footer__left {
  display: none;
}

.share-card .footer__claim {
  color: rgba(227, 30, 36, 0.92);
}

.share-card .footer__claim[hidden] {
  display: none !important;
}

.share-card .footer__right {
  flex-shrink: 0;
  text-align: center;
  color: rgba(244, 241, 236, 0.62);
}

/* Story */
.share-card.format-story .share-card__masthead {
  top: 140px;
}

.share-card.format-story .kicker__title,
.share-card.format-story .kicker__500 {
  font-size: 68px;
}

.share-card.format-story .kicker__brand img {
  height: 62px;
  max-width: 280px;
}

.share-card.format-story .footer__right {
  font-size: 34px;
}

.share-card.format-story .citation {
  font-size: 32px;
}

.share-card.format-story .subline {
  font-size: 30px;
}

.share-card.format-story .share-card__hero {
  top: 320px;
  bottom: 160px;
  gap: 24px;
}

.share-card.format-story .identity {
  gap: 44px;
}

.share-card.format-story .share-card__rank {
  font-size: 250px;
}

.share-card.format-story .share-card__rank.is-2digit {
  font-size: 220px;
}

.share-card.format-story .share-card__rank.is-3digit {
  font-size: 170px;
}

.share-card.format-story .share-card__glow {
  top: 52%;
  width: 1200px;
  height: 1200px;
}

.share-card.format-story .share-card__avatar,
.share-card.format-story .monogram {
  width: 280px;
  height: 280px;
  font-size: 84px;
}

.share-card.format-story .artist-name {
  font-size: 124px;
}

.share-card.format-story .artist-name.is-long {
  font-size: 96px;
}

.share-card.format-story .artist-name.is-xl {
  font-size: 72px;
}

.share-card.format-story .footer {
  bottom: 78px;
}

.share-card.format-story .share-card__frame {
  inset: 36px;
}


/* Drawer preview chrome */
.drawer-share-card-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.drawer-share-card-preview {
  border: 1px solid var(--rule);
  background: #0d0d10;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  padding: 10px 8px;
}

.drawer-share-card-scaler {
  transform-origin: top left;
  width: 1080px;
  height: 1080px;
  flex-shrink: 0;
  max-width: none;
  position: relative;
}

#drawerSharePanel.drawer-share-popup {
  max-width: min(360px, calc(100vw - 24px));
  width: min(360px, calc(100vw - 24px));
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  #drawerSharePanel.drawer-share-popup {
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    z-index: 120;
  }

  .drawer-share-card-preview {
    padding: 8px 6px;
  }
}

.drawer-share-format {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-share-chip {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: #aaa8a4;
  padding: 6px 10px;
  font: 700 8px / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.drawer-share-chip.is-active,
.drawer-share-chip:hover {
  border-color: var(--red);
  background: rgba(255, 43, 43, 0.12);
  color: white;
}

.drawer-share-chip[hidden] {
  display: none !important;
}

.drawer-share-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
}

.drawer-share-card-actions button {
  min-height: 40px;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
  font: 700 9px / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.drawer-share-card-actions button:hover:not(:disabled) {
  background: var(--red);
  color: white;
}

.drawer-share-card-actions button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.drawer-share-card-actions .is-primary {
  background: var(--red);
  color: white;
}

.drawer-share-card-actions .is-primary:hover:not(:disabled) {
  background: white;
  border-color: white;
  color: var(--black);
}

.drawer-share-card-actions .is-primary[aria-expanded="true"] {
  background: white;
  border-color: white;
  color: var(--black);
}

.drawer-share-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  animation: fadeIn 0.16s both;
}

.drawer-share-sheet-overlay[hidden] {
  display: none !important;
}

.drawer-share-sheet-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.drawer-share-sheet {
  position: relative;
  z-index: 1;
  width: min(340px, calc(100vw - 32px));
  max-height: min(78vh, 520px);
  border: 1px solid var(--rule);
  background: rgba(28, 28, 30, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  border-radius: 16px;
  padding: 12px 10px 10px;
  display: grid;
  gap: 6px;
  animation: drawerIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.drawer-share-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--rule);
}

.drawer-share-sheet-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: #111113 center / cover no-repeat;
  flex: 0 0 auto;
  overflow: hidden;
}

.drawer-share-sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-share-sheet-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.drawer-share-sheet-meta b {
  font: 700 11px / 1.2 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-share-sheet-meta span {
  font: 500 9px / 1.3 var(--mono);
  color: var(--gray);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drawer-share-sheet-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--white);
  font: 300 24px / 1 Arial;
  cursor: pointer;
}

.drawer-share-sheet-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.drawer-share-sheet-list {
  display: grid;
  gap: 2px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
  padding: 6px 0 2px;
}

.drawer-share-sheet-list .drawer-share-app {
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  font: 600 14px / 1.2 Inter, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.drawer-share-sheet-list .drawer-share-app svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: currentColor;
}

.drawer-share-sheet-list .drawer-share-app:hover {
  background: rgba(255, 43, 43, 0.14);
  border-color: transparent;
  color: white;
}
