/* Cardly landing page (cardly.php only).
 * One memorable moment, the scan-to-save stage in the hero; everything else
 * stays quiet: real card images, plain type, hairlines instead of boxes. */

body.is-cardly .lp-hero,
body.is-cardly .lp-section,
body.is-cardly .lp-close { --lp-display: 'Clash Display', var(--font-display); }

/* ---------- Hero ---------- */
body.is-cardly .cardly-hero.lp-hero { text-align: left; padding: 64px 0 24px; background: none; }
.lp-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
body.is-cardly .lp-hero h1 {
  font-family: var(--lp-display); font-weight: 700;
  font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -.02em;
  max-width: 11ch; margin: 0; color: var(--text);
}
.lp-hero__sub { margin: 22px 0 0; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--text-2); max-width: 34em; }
.lp-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
body.is-cardly .lp-btn-lg { font-size: 17px; padding: 14px 26px; min-height: 52px; }
.lp-hero__note { margin: 18px 0 0; font-size: 14.5px; color: var(--text-2); }
body.is-cardly .lp-hero__acct { margin-top: 6px; font-size: 14.5px; }

/* The stage: a real card in 3D, and a phone that scans it and saves the contact. */
.lp-stage { position: relative; padding: 24px 0 96px; perspective: 1600px; }
.lp-stage__glow {
  position: absolute; inset: 0 8% 18% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--trust-3, #38bdf8) 28%, transparent), transparent);
  filter: blur(20px); opacity: .7;
}
.lp-stage__cardwrap { width: 70%; transform-style: preserve-3d; }
.lp-stage__card {
  position: relative; border-radius: 22px; transform-style: preserve-3d;
  transform: rotateX(9deg) rotateY(-16deg) rotateZ(-2deg);
  box-shadow: 0 50px 90px -40px rgba(15, 23, 42, .7), 0 18px 30px -18px rgba(15, 23, 42, .45);
}
.lp-stage__card img { display: block; width: 100%; height: auto; border-radius: 22px; }
.lp-stage__glare {
  position: absolute; inset: 0; border-radius: 22px; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .28), transparent 45%);
  mix-blend-mode: soft-light; transition: opacity .4s ease;
}
.lp-stage__phonewrap { position: absolute; right: 0; top: 10%; width: 196px; }
.lp-phone {
  width: 100%; aspect-ratio: 196 / 400;
  padding: 9px; border-radius: 38px; background: #0b1220;
  box-shadow: 0 40px 70px -24px rgba(15, 23, 42, .65), inset 0 0 0 1.5px rgba(255, 255, 255, .14);
}
.lp-phone__screen { position: relative; height: 100%; border-radius: 30px; overflow: hidden; background: #111827; }
.lp-phone__screen::before { /* dynamic island */
  content: ""; position: absolute; z-index: 3; top: 8px; left: 50%; width: 30%; height: 16px;
  transform: translateX(-50%); border-radius: 999px; background: #000;
}
/* Camera view: a close-up of the card's QR code. */
.lp-phone__cam { position: absolute; inset: 0; overflow: hidden; background: #0b1220; }
.lp-phone__cam::before { /* the card, zoomed so its QR code sits inside the scan frame */
  content: ""; position: absolute; left: 50%; top: 27%; width: 330%; aspect-ratio: 840 / 525;
  background: url('../images/cardly-templates/tpl-executive.webp') center / 100% 100% no-repeat;
  transform: translate(-81.5%, -35%); filter: saturate(.9) brightness(.85);
}
.lp-phone__frame {
  position: absolute; left: 50%; top: 27%; width: 64%; aspect-ratio: 1; margin: -32% 0 0 -32%;
  border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38);
  background:
    linear-gradient(#fff, #fff) top left / 22px 3px, linear-gradient(#fff, #fff) top left / 3px 22px,
    linear-gradient(#fff, #fff) top right / 22px 3px, linear-gradient(#fff, #fff) top right / 3px 22px,
    linear-gradient(#fff, #fff) bottom left / 22px 3px, linear-gradient(#fff, #fff) bottom left / 3px 22px,
    linear-gradient(#fff, #fff) bottom right / 22px 3px, linear-gradient(#fff, #fff) bottom right / 3px 22px;
  background-repeat: no-repeat;
}
.lp-phone__beam {
  position: absolute; left: 22%; right: 22%; top: 13%; height: 2px; opacity: 0;
  background: #38bdf8; box-shadow: 0 0 12px 2px rgba(56, 189, 248, .8);
}
/* Saved-contact sheet. Its resting state is "saved", so it shows with no motion. */
.lp-phone__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 34%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 14px 14px; border-radius: 22px 22px 0 0;
  background: #fff; color: #0b1220; text-align: center;
  box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, .35);
}
.lp-phone__av {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; font-weight: 700; font-size: 20px;
}
.lp-phone__name { font-size: 14.5px; line-height: 1.25; }
.lp-phone__role { font-size: 10.5px; line-height: 1.35; color: #475569; margin-bottom: 6px; }
.lp-phone__row {
  align-self: stretch; display: flex; flex-direction: column; text-align: left; gap: 2px;
  padding: 6px 2px; border-top: 1px solid #e2e8f0; font-size: 10.5px; line-height: 1.35; color: #0b1220;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-phone__row i { font-style: normal; font-size: 9.5px; color: #64748b; }
.lp-phone__saved {
  margin-top: auto; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px; border-radius: 12px; background: #dcfce7; color: #166534; font-size: 11.5px; font-weight: 700;
}
.lp-phone__saved svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lp-phone__saved path { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* Without the motion script, a simple CSS version of the same sequence runs. */
@keyframes lp-beam { 0% { opacity: 0; top: 13%; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; top: 41%; } }
@keyframes lp-sheet { from { transform: translateY(105%); } to { transform: none; } }
html:not(.lp-motion) .lp-phone__beam { animation: lp-beam 1.3s ease-in-out .7s 1 both; }
html:not(.lp-motion) .lp-phone__sheet { animation: lp-sheet .55s cubic-bezier(.22, 1, .36, 1) 2.1s 1 both; }

/* With the motion script, pieces start hidden and are animated in by it. */
.lp-motion .lp-stage__card,
.lp-motion .lp-phone,
.lp-motion .lp-phone__av,
.lp-motion .lp-phone__name,
.lp-motion .lp-phone__role,
.lp-motion .lp-phone__row,
.lp-motion .lp-phone__saved,
.lp-motion .lp-head,
.lp-motion .lp-tpl,
.lp-motion .lp-steps li,
.lp-motion .lp-features > div,
.lp-motion .lp-plan,
.lp-motion .lp-close__inner,
.lp-motion .lp-stats > div,
.lp-motion .lp-people li,
.lp-motion .lp-quote { opacity: 0; }
.lp-motion .lp-phone__sheet { transform: translateY(105%); }
.lp-motion .lp-phone__saved path { stroke-dashoffset: 1; }
.lp-motion .lp-steps__rule { transform: scaleX(0); }
.lp-motion-on .lp-tpl img { transition: box-shadow .3s; }
.lp-motion-on .lp-tpl:hover img { transform: none; }

/* Real social proof. */
.lp-proof {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 8px;
  font-size: 14.5px; color: var(--text-2); text-decoration: none;
}
.lp-proof:hover span:last-child { color: var(--text); text-decoration: underline; }
.lp-proof__avatars { display: inline-flex; }
.lp-proof__avatars img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); margin-left: -8px; }
.lp-proof__avatars img:first-child { margin-left: 0; }

/* ---------- Sections ---------- */
.lp-section { padding-top: 104px; }
.lp-head { max-width: 640px; margin-bottom: 36px; }
body.is-cardly .lp-head h2,
body.is-cardly .lp-close h2 {
  font-family: var(--lp-display); font-weight: 600; letter-spacing: -.015em;
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; margin: 0; color: var(--text);
}
.lp-head p { margin: 14px 0 0; font-size: 17px; line-height: 1.6; color: var(--text-2); }

/* Templates: real cards, an even 3 × 4 grid. */
.lp-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.lp-tpl { display: block; text-decoration: none; color: var(--text); perspective: 900px; }
.lp-tpl img {
  display: block; width: 100%; height: auto; border-radius: 14px;
  box-shadow: 0 18px 36px -22px rgba(15, 23, 42, .5);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s;
}
.lp-tpl:hover img { transform: translateY(-4px); box-shadow: 0 26px 44px -22px rgba(15, 23, 42, .55); }
.lp-tpl__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.lp-tpl__name { font-weight: 700; font-size: 16px; }
.lp-tpl:hover .lp-tpl__name { text-decoration: underline; text-underline-offset: 3px; }
.lp-tag {
  font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2);
}
.lp-tag--pro { border-color: transparent; background: var(--ink, #0f172a); color: #fff; }
[data-theme="dark"] .lp-tag--pro { background: #e2e8f0; color: #0b1220; }

/* Real proof: live numbers, real cards from Discover, real quotes. */
.lp-stats { display: flex; flex-wrap: wrap; gap: 20px 56px; margin: 0 0 36px; }
.lp-stats > div { display: flex; flex-direction: column; gap: 6px; max-width: 16em; }
.lp-stats dd { order: -1; }
.lp-stats dd { margin: 0; font-family: var(--lp-display); font-weight: 600; font-size: clamp(34px, 4vw, 48px); line-height: 1; color: var(--text); }
.lp-stats dt { font-size: 15px; line-height: 1.45; color: var(--text-2); }
.lp-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lp-person {
  display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.lp-person:hover { border-color: var(--border-strong, #cbd5e1); box-shadow: 0 12px 28px -18px rgba(15, 23, 42, .45); }
.lp-person__photo { flex: none; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2, #f1f3f7); }
.lp-person__photo--initial { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; background: linear-gradient(135deg, #1e40af, #3b82f6); }
.lp-person__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.lp-person__name { font-weight: 700; font-size: 15.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-person:hover .lp-person__name { text-decoration: underline; text-underline-offset: 3px; }
.lp-person__tag {
  font-size: 13.5px; line-height: 1.4; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lp-people__more { margin: 20px 0 0; font-size: 15.5px; }
.lp-people__more a { color: var(--accent); font-weight: 600; }
.lp-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; margin-top: 56px; }
.lp-quote { margin: 0; border-top: 1px solid var(--border); padding-top: 20px; }
.lp-quote blockquote { margin: 0; }
.lp-quote p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--text); }
.lp-quote figcaption { margin-top: 14px; font-weight: 700; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.lp-quote figcaption a { color: var(--text); }
.lp-quote figcaption span { font-weight: 500; color: var(--text-2); }

/* Steps: a real sequence, so numbered. */
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.lp-steps li { position: relative; padding-top: 20px; }
.lp-steps__rule { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--text); transform-origin: left center; }
.lp-steps__n { font-family: var(--lp-display); font-weight: 600; font-size: 40px; line-height: 1; color: var(--text); }
.lp-steps h3 { margin: 14px 0 6px; font-size: 20px; }
.lp-steps p { margin: 0; color: var(--text-2); line-height: 1.6; font-size: 16px; }

/* Benefits: plain columns with hairlines, no boxes. */
.lp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 32px; }
.lp-features > div { border-top: 1px solid var(--border); padding-top: 18px; }
.lp-features h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.lp-features p { margin: 0; color: var(--text-2); line-height: 1.6; font-size: 15.5px; }

/* Pricing: Pro carries the weight. */
.lp-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 820px; }
.lp-plan {
  display: flex; flex-direction: column; padding: 30px; border-radius: 22px;
  border: 1px solid var(--border); background: var(--surface);
}
body.is-cardly .lp-plans .lp-plan h3 { margin: 0; font-size: 18px; color: inherit; }
.lp-plan__price { margin: 14px 0 0; font-family: var(--lp-display); font-weight: 600; font-size: 44px; line-height: 1; }
.lp-plan__price small { font-family: var(--font-sans); font-size: 16px; font-weight: 500; }
.lp-plan__alt { margin: 10px 0 0; font-size: 15px; color: var(--text-2); }
.lp-plan ul { list-style: none; margin: 22px 0 26px; padding: 0; flex: 1; }
.lp-plan li { padding: 9px 0; border-top: 1px solid var(--border); font-size: 15.5px; }
.lp-plan .btn { justify-content: center; min-height: 50px; }
.lp-plan--pro { background: #0f172a; border-color: #0f172a; color: #f8fafc; box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .7); }
.lp-plan--pro .lp-plan__alt { color: #cbd5e1; }
.lp-plan--pro .lp-plan__alt strong { color: #86efac; }
.lp-plan--pro li { border-color: rgba(255, 255, 255, .14); }
body.is-cardly .lp-plan--pro .btn--primary { background: #fff; color: #0f172a; box-shadow: none; }
[data-theme="dark"] .lp-plan--pro { background: #1e293b; border-color: #334155; }

/* Closing call to action. */
.lp-close { padding: 120px 0 96px; }
.lp-close__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; }
body.is-cardly .lp-close h2 { max-width: 22ch; text-wrap: balance; }
.lp-close__ph .cardly-ph__img { width: 200px; height: 43px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .lp-hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .lp-stage { max-width: 600px; }
  .lp-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.is-cardly .cardly-hero.lp-hero { padding-top: 36px; }
  .lp-stage { padding: 8px 0 40px; }
  .lp-stage__cardwrap { width: 78%; }
  .lp-stage__phonewrap { width: 132px; top: 18%; }
  .lp-phone { border-radius: 28px; padding: 7px; }
  .lp-phone__screen::before { height: 11px; top: 6px; }
  .lp-phone__screen { border-radius: 22px; }
  .lp-phone__sheet { padding: 12px 10px 10px; gap: 2px; }
  .lp-phone__av { width: 36px; height: 36px; font-size: 16px; margin-bottom: 2px; }
  .lp-phone__name { font-size: 12px; }
  .lp-phone__role { font-size: 8.5px; margin-bottom: 4px; }
  .lp-phone__row { display: none; }
  .lp-phone__saved { font-size: 9.5px; padding: 6px; border-radius: 9px; }
  .lp-section { padding-top: 72px; }
  /* Designs become a swipeable row so the page stays short on phones. */
  .lp-gallery {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -20px; padding: 4px 20px 18px; scroll-padding: 0 20px; -webkit-overflow-scrolling: touch;
  }
  .lp-tpl { flex: 0 0 80%; scroll-snap-align: start; }
  .lp-steps, .lp-features, .lp-plans { grid-template-columns: 1fr; }
  .lp-people { grid-template-columns: 1fr; }
  .lp-people li:nth-child(n+5) { display: none; }
  .lp-stats { gap: 20px 32px; }
  .lp-hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .lp-close { padding: 88px 0 72px; }
}
