/*
  Katalyst Groups invite page.
  Built to the Figma frames "Invite Link [Desktop] Dark" (1440) and "Invite Link [Mobile] Dark" (402).
  html[data-view] is set before first paint in index.html: "desktop" (QR code) or "mobile" (app buttons).

  Stacking note: several texts use mix-blend-mode: plus-lighter (Figma "Plus lighter") so they pick up
  the red glow behind them. For that to work the cards must NOT form stacking contexts, so each glass
  material is its own absolutely positioned layer and the content after it is position: relative.
  Don't add z-index, opacity, filter or backdrop-filter to .invite, .gcard, .stat, .offer or .learn.
*/

:root {
  --bg: #141414;
  --red: #ff2323;
  --link-red: #e1251b;
  --muted: #999999;
  --secondary: rgba(235, 235, 245, 0.6);
  --hairline: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-button: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

h1, h2, p { margin: 0; font-weight: inherit; font-size: inherit; }
a { color: inherit; }
svg { display: block; fill: currentColor; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

/* ---------- Header ---------- */

.nav {
  flex: none;
  height: 48px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.nav__inner { width: 100%; max-width: 1200px; display: flex; align-items: center; gap: 20px; }
.brand { flex: 1; display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand__logo { flex: none; width: 142px; height: 16px; color: #fff; }
.brand__groups {
  display: flex; align-items: center; gap: 4px;
  font-size: 17px; line-height: 22px; letter-spacing: -0.43px;
  color: rgba(255, 255, 255, 0.94);
}
.brand__icon { width: 21px; height: 22px; display: grid; place-items: center; color: var(--red); }
.brand__icon svg { width: 18px; height: 17px; }
.nav__link {
  flex: none; display: flex; align-items: center; gap: 3px;
  font-weight: 500; font-size: 13px; line-height: 16px; letter-spacing: -0.003em;
  color: var(--muted); text-decoration: none;
  mix-blend-mode: plus-lighter;
}
.nav__link:hover { color: #c8c8c8; }
.nav__link-icon { width: 13px; height: 16px; display: grid; place-items: center; }
.nav__link-icon svg { width: 10px; height: 10px; }

/* ---------- Hero layout (desktop) ---------- */

.hero {
  flex: 1 0 auto;
  position: relative;
  overflow: hidden;
  padding: 64px 40px 96px;
}
.hero__inner {
  max-width: 1136px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 80px;
}

.invite {
  position: relative;
  flex: none;
  width: 460px;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Red glow behind the card. Figma: 589 ellipse, #FF2323 at 24%, layer blur 400, plus lighter. */
.glow {
  position: absolute;
  left: -65px;
  top: -58px;
  width: 589px;
  height: 589px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.24;
  filter: blur(200px);
  mix-blend-mode: plus-lighter;
  pointer-events: none;
}

.rail { position: relative; flex: 1; min-width: 0; }
.rail--mobile, .actions { display: none; }

/* ---------- Group card ---------- */

.gcard {
  position: relative;
  width: 100%;
  padding: 14px 21px 27px;
  border-radius: 34px;
  overflow: hidden;
}
.gcard::after,
.gavatar::after,
.qr__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--hairline);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.gavatar::after, .qr__logo::after { padding: 1.5px; }

.gcard__material {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}
.gcard__cover {
  position: absolute; left: 0; right: 0; top: 0; height: 128px;
  opacity: 0.6;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.84) 15%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.84) 15%, rgba(0, 0, 0, 0) 100%);
}
.gcard__cover-img {
  position: absolute; left: 0; top: -60px; width: 100%; aspect-ratio: 1;
  background-size: cover; background-position: center;
}
.gcard__content {
  position: relative;
  padding-top: 30px; /* empty 20px header row + 10px gap in Figma */
  display: flex; flex-direction: column; gap: 10px;
}
.gcard__identity { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.gcard__who { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }

.gavatar {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(235, 235, 245, 0.3);
  display: grid; place-items: center;
}
.gavatar img { width: 100%; height: 100%; object-fit: cover; }
.gavatar__fallback { font-weight: 600; font-size: 28px; line-height: 34px; letter-spacing: -0.38px; color: #fff; }

.inviter { display: flex; align-items: center; gap: 7px; min-height: 28px; }
.inviter__badge {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background:
    conic-gradient(from 215deg at 50% 50%, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, 0.16) 180deg, rgba(255, 255, 255, 0) 270deg),
    radial-gradient(circle at 42% 50%, #2ee6d6 0%, #14827d 40%, #033f42 77%);
  font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: #e6e6e6;
}
.inviter__text {
  font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: var(--muted);
  mix-blend-mode: plus-lighter;
}

.gname__title {
  font-weight: 600; font-size: 28px; line-height: 34px; letter-spacing: -0.38px;
  color: #fff;
  overflow-wrap: anywhere;
}
.gname__meta { font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--secondary); }

.gcard__stats { display: flex; flex-direction: column; gap: 10px; }

.stat { position: relative; border-radius: 14px; overflow: hidden; padding: 14px 0; }
.stat__material {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(rgba(118, 118, 128, 0.24), rgba(118, 118, 128, 0.24)), rgba(0, 0, 0, 0.02);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}
.stat__row { position: relative; display: flex; }
.stat__cell {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.stat__cell + .stat__cell { border-left: 1px solid rgba(255, 255, 255, 0.17); }
.stat__value { font-weight: 500; font-size: 20px; line-height: 25px; letter-spacing: -0.45px; color: #fff; }
.stat__label { font-size: 12px; line-height: 16px; color: var(--secondary); mix-blend-mode: plus-lighter; }

.gfoot { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.gfoot__text {
  min-width: 0;
  font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: var(--muted);
  mix-blend-mode: plus-lighter;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.badge {
  flex: none;
  display: inline-flex; align-items: center; gap: 3px;
  height: 20px; padding: 0 5px 1px;
  border-radius: 6px;
  background: #3a1414;
}
.badge__icon { width: 13px; height: 14px; padding-top: 1px; display: grid; place-items: center; color: #ff4d4d; }
.badge__icon svg { width: 10px; height: 11px; }
.offer__badge .badge__icon svg { width: 11px; height: 12px; }
.badge__text { font-weight: 500; font-size: 11px; line-height: 13px; letter-spacing: 0.06px; color: #fff; white-space: nowrap; }
.badge__text--upper { text-transform: uppercase; }

.footnote {
  position: relative;
  width: 100%;
  display: flex; justify-content: center; align-items: center; gap: 4px;
  font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: var(--muted);
  text-align: center;
  mix-blend-mode: plus-lighter;
}
.footnote__icon { flex: none; width: 11px; height: 15px; margin: 0 2.5px; }

/* ---------- Desktop rail ---------- */

.rail--desktop { display: flex; flex-direction: column; gap: 20px; }
.rail__head { display: flex; flex-direction: column; gap: 10px; }
.eyebrow {
  font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: var(--red);
  mix-blend-mode: plus-lighter;
}
.headline {
  font-weight: 700; font-size: 48px; line-height: 52px; letter-spacing: -0.8px;
  color: #fff;
  overflow-wrap: anywhere;
}
.headline > span { display: block; }
.rail__body { display: flex; flex-direction: column; gap: 40px; }

.scan { display: flex; align-items: center; gap: 20px; }
.qr {
  position: relative; flex: none;
  width: 236px; height: 236px;
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(48, 38, 32, 0.05), 0 4px 12px rgba(48, 38, 32, 0.05);
}
.qr__code { position: absolute; inset: 22px; }
.qr__code svg { width: 100%; height: 100%; }
.qr__logo {
  position: absolute; left: 96px; top: 96px;
  width: 44px; height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(235, 235, 245, 0.3);
}
.qr__logo img { width: 100%; height: 100%; object-fit: cover; }

.scan__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.scan__body {
  font-size: 17px; line-height: 22px; letter-spacing: -0.43px;
  color: var(--secondary);
  mix-blend-mode: plus-lighter;
}
.scan__links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.copy {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  font-family: inherit; font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: #fff;
}
.copy__icon { width: 16px; height: 16px; display: grid; place-items: center; transition: transform 0.15s ease; }
.copy__icon svg { width: 12px; height: 10px; }
.copy:hover .copy__icon { transform: translateX(2px); }
.scan__url {
  font-weight: 500; font-size: 13px; line-height: 16px; letter-spacing: -0.003em;
  color: var(--link-red);
  mix-blend-mode: plus-lighter;
  overflow-wrap: anywhere;
}

.separator { height: 1px; background: #38383a; }

/* Referral card */
.offer {
  position: relative;
  padding: 17px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 44px 96px rgba(48, 38, 32, 0.2);
}
.offer__material {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), rgba(118, 118, 128, 0.24);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}
/* Figma: 233x242 ellipse, #FF2323 at 80%, layer blur 220, plus lighter. */
.offer__glow {
  position: absolute; left: 375px; top: -27px;
  width: 233px; height: 242px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.8;
  filter: blur(96px);
  mix-blend-mode: plus-lighter;
  pointer-events: none;
}
.offer__row { position: relative; display: flex; gap: 40px; min-height: 211px; }
.offer__copy { flex: 1; min-width: 0; padding-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.offer__text { display: flex; flex-direction: column; gap: 10px; }
.offer__title { font-weight: 600; font-size: 22px; line-height: 28px; letter-spacing: -0.26px; color: #fff; }
.offer__title > span { display: block; }
.offer__body { font-size: 15px; line-height: 20px; letter-spacing: -0.23px; color: var(--secondary); }
.offer__img { flex: none; width: 150px; height: 211px; object-fit: contain; }
.offer__badge { position: absolute; left: 17px; top: 17px; }

/* Pill buttons with the trailing arrow circle */
.pill {
  position: relative; flex: none;
  display: inline-flex; align-items: center;
  height: 50px; padding: 12px 36px;
  border-radius: 50px;
  box-shadow: inset 0 0 0 1px rgba(120, 120, 128, 0.36);
  text-decoration: none;
  color: #fff;
  transition: filter 0.15s ease;
}
.pill:hover { filter: brightness(1.08); }
.pill__label {
  padding-right: 20px;
  font-family: var(--font-button); font-weight: 600; font-size: 16px; line-height: 24px; letter-spacing: -0.02em;
  white-space: nowrap;
}
.pill__circle {
  position: absolute; right: 5px; top: 5px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
}
.pill__circle svg { width: 34px; height: 34px; }
.pill--red { background: var(--red); }
.pill--red .pill__circle { background: #ce0000; } /* #787880 at 36%, linear burn, over the red */
.pill--grey { background: rgba(118, 118, 128, 0.24); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.pill--grey .pill__circle { background: #050505; }

.footnote--privacy { margin-top: 0; }

/* ---------- Footer ---------- */

.foot { flex: none; height: 48px; padding: 0 40px; display: flex; align-items: center; justify-content: center; }
.foot__inner { display: flex; align-items: center; gap: 20px; }
.foot a {
  font-weight: 500; font-size: 13px; line-height: 16px; letter-spacing: -0.003em;
  color: var(--muted); text-decoration: none;
}
.foot a:hover { color: #c8c8c8; }

/* ---------- Desktop view in a narrow window ---------- */

@media (max-width: 1215px) {
  html[data-view="desktop"] .hero__inner { flex-direction: column; align-items: center; gap: 56px; }
  html[data-view="desktop"] .invite { padding-top: 0; width: 100%; max-width: 460px; }
  html[data-view="desktop"] .glow { left: 50%; margin-left: -294.5px; top: -98px; }
  html[data-view="desktop"] .rail--desktop { flex: none; width: 100%; max-width: 596px; }
}
@media (max-width: 680px) {
  html[data-view="desktop"] .nav { padding: 0 16px; }
  html[data-view="desktop"] .hero { padding: 32px 16px 64px; }
  html[data-view="desktop"] .headline { font-size: 36px; line-height: 40px; }
  html[data-view="desktop"] .scan { flex-direction: column; align-items: flex-start; }
  html[data-view="desktop"] .offer__img { width: 96px; height: 135px; align-self: center; }
  html[data-view="desktop"] .offer__row { gap: 12px; }
  html[data-view="desktop"] .offer__glow { left: auto; right: -40px; }
  html[data-view="desktop"] .footnote--privacy { align-items: flex-start; text-align: left; }
}

/* ---------- Mobile view (iPhone / iPad) ---------- */

html[data-view="mobile"] .nav { height: 64px; padding: 0 16px; border-bottom: 1px solid rgba(22, 19, 15, 0.1); }
html[data-view="mobile"] .nav__inner { justify-content: center; }
html[data-view="mobile"] .brand { flex: none; }
html[data-view="mobile"] .nav__link { display: none; }

html[data-view="mobile"] .hero { padding: 32px 16px 96px; }
html[data-view="mobile"] .hero__inner { max-width: 370px; flex-direction: column; align-items: stretch; gap: 32px; }
html[data-view="mobile"] .invite { width: 100%; padding-top: 0; }
html[data-view="mobile"] .glow { left: -110px; top: -164px; }
html[data-view="mobile"] .invite > .footnote { mix-blend-mode: normal; }

html[data-view="mobile"] .rail--desktop { display: none; }
html[data-view="mobile"] .rail--mobile { display: block; flex: none; }

html[data-view="mobile"] .gcard { padding: 14px 17px 17px; border-radius: 22px; }
html[data-view="mobile"] .gcard__material { background: rgba(28, 28, 28, 0.9); }
html[data-view="mobile"] .gcard__cover { height: 88px; }
html[data-view="mobile"] .gcard__cover-img { filter: blur(2px); }
html[data-view="mobile"] .gcard__who { gap: 12px; }
html[data-view="mobile"] .gavatar { width: 84px; height: 84px; border-radius: 21px; }

html[data-view="mobile"] .actions {
  position: relative;
  width: 100%;
  padding: 20px 6px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.action {
  height: 54px; padding: 0 14px;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-weight: 600; font-size: 15px; line-height: 20px; letter-spacing: -0.23px;
  text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.action:active { transform: scale(0.985); opacity: 0.9; }
.action--primary { background: #fff; color: #262626; }
.action--secondary { background: rgba(235, 235, 245, 0.16); color: #fff; }
.action__icon { flex: none; width: 12px; height: 15px; margin: 0 1px 2px; }

.learn { position: relative; border-radius: 22px; overflow: hidden; padding: 21px 17px; }
.learn__material {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(28, 28, 28, 0.9);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}
.learn__content { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.learn__text { align-self: stretch; display: flex; flex-direction: column; gap: 10px; }
.learn__title {
  display: flex; align-items: center; gap: 3px;
  font-weight: 600; font-size: 15px; line-height: 20px; letter-spacing: -0.23px; color: #fff;
}
.learn__arrow { width: 16px; height: 16px; display: grid; place-items: center; }
.learn__arrow svg { width: 12px; height: 10px; }
.learn__body { font-size: 15px; line-height: 20px; letter-spacing: -0.23px; color: var(--secondary); }

@media (max-width: 360px) {
  html[data-view="mobile"] .pill--grey { padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
