/* Developer digital business card — flip front/back */
.dev-card-wrap {
  --dev-card-ink: #0f172a;
  --dev-card-muted: #64748b;
  --dev-card-line: #e2e8f0;
  --dev-card-accent: #0ea5e9;
  --dev-card-radius: 18px;
  margin: 0 0 2.25rem;
}

.dev-card-intro {
  margin: 0 0 1.1rem;
  color: var(--text-muted, #94a3b8);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.dev-card-stage {
  perspective: 1600px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 1.15rem;
}

.dev-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.85 / 1;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: var(--dev-card-radius);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dev-card.is-flipped {
  transform: rotateY(180deg);
}

.dev-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--dev-card-radius);
  overflow: hidden;
  background: #fff;
  color: var(--dev-card-ink);
  border: 1px solid var(--dev-card-line);
}

.dev-card-face--back {
  transform: rotateY(180deg);
}

/* —— Front (same layout on all screens: info | photo) —— */
.dev-card-front-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  height: 100%;
  min-height: 0;
}

.dev-card-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.75rem, 2.4vw, 1.35rem) clamp(0.75rem, 2.2vw, 1.45rem);
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
}

.dev-card-brand {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.4vw, 0.65rem);
}

.dev-card-brand img {
  width: clamp(28px, 5.5vw, 42px);
  height: clamp(28px, 5.5vw, 42px);
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.dev-card-brand-text strong {
  display: block;
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dev-card-ink);
  line-height: 1.1;
}

.dev-card-brand-text span {
  display: block;
  font-size: clamp(0.52rem, 1.5vw, 0.62rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dev-card-muted);
  margin-top: 0.12rem;
}

.dev-card-who {
  margin: clamp(0.45rem, 1.8vw, 1.05rem) 0 clamp(0.4rem, 1.4vw, 0.8rem);
}

.dev-card-who h2,
.dev-card-who h3 {
  margin: 0 0 0.2rem;
  font-size: clamp(0.95rem, 3.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--dev-card-ink);
  line-height: 1.15;
}

.dev-card-who p {
  margin: 0;
  font-size: clamp(0.68rem, 2vw, 0.92rem);
  font-weight: 600;
  color: #475569;
}

.dev-card-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(0.28rem, 1vw, 0.45rem);
}

.dev-card-contacts li {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1.2vw, 0.55rem);
  margin: 0;
  font-size: clamp(0.62rem, 1.85vw, 0.82rem);
  color: var(--dev-card-muted);
  font-weight: 500;
  min-width: 0;
}

.dev-card-contacts a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dev-card-contacts a:hover {
  color: var(--dev-card-accent);
}

.dev-card-ico {
  width: clamp(0.85rem, 2.2vw, 1.05rem);
  height: clamp(0.85rem, 2.2vw, 1.05rem);
  flex-shrink: 0;
  color: var(--dev-card-ink);
}

.dev-card-photo {
  position: relative;
  height: 100%;
  min-height: 0;
  background: #0f172a;
  overflow: hidden;
}

.dev-card-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.12), transparent 28%);
}

.dev-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* —— Back —— */
.dev-card-back-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: clamp(0.85rem, 2.5vw, 1.5rem) clamp(0.85rem, 2.4vw, 1.6rem);
  gap: clamp(0.55rem, 1.8vw, 1rem);
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(14, 165, 233, 0.08), transparent 55%),
    #fff;
}

.dev-card-back-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.3rem, 1vw, 0.55rem);
  min-width: 0;
}

.dev-card-back-brand img {
  width: clamp(36px, 7vw, 52px);
  height: clamp(36px, 7vw, 52px);
  object-fit: contain;
}

.dev-card-back-brand strong {
  font-size: clamp(1.05rem, 3.4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--dev-card-ink);
  line-height: 1;
}

.dev-card-back-brand em {
  font-style: normal;
  font-size: clamp(0.55rem, 1.6vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dev-card-muted);
}

.dev-card-back-brand .dev-card-loc {
  margin-top: 0.2rem;
  font-size: clamp(0.68rem, 1.9vw, 0.85rem);
  color: #94a3b8;
  font-weight: 500;
}

.dev-card-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 1.2vw, 0.55rem);
}

.dev-card-qr {
  width: min(42%, 148px);
  min-width: 88px;
  aspect-ratio: 1;
  padding: clamp(0.3rem, 1vw, 0.45rem);
  border: 1px solid var(--dev-card-line);
  border-radius: 10px;
  background: #fff;
}

.dev-card-qr canvas,
.dev-card-qr img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.dev-card-qr-caption {
  margin: 0;
  font-size: clamp(0.62rem, 1.8vw, 0.78rem);
  color: var(--dev-card-muted);
  font-weight: 600;
  text-align: center;
}

.dev-card-flip-hint {
  position: absolute;
  right: clamp(0.45rem, 1.5vw, 0.75rem);
  bottom: clamp(0.4rem, 1.4vw, 0.65rem);
  width: clamp(1.7rem, 5vw, 2rem);
  height: clamp(1.7rem, 5vw, 2rem);
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--dev-card-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  touch-action: manipulation;
}

.dev-card-flip-hint:hover {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}

.dev-card-face--back .dev-card-flip-hint {
  transform: scaleX(-1);
}

/* —— Quick actions —— */
.dev-card-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto 1rem;
}

.dev-card-toolbar .btn {
  min-height: 46px;
  min-width: 46px;
  padding: 0;
}

.dev-card-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px !important;
  touch-action: manipulation;
}

.dev-card-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dev-card-ico--wa {
  color: #25d366;
}

.dev-card-btn--wa {
  border-color: rgba(37, 211, 102, 0.45) !important;
  color: #128c7e !important;
  background: rgba(37, 211, 102, 0.12) !important;
}

.dev-card-btn--wa:hover {
  background: rgba(37, 211, 102, 0.22) !important;
  border-color: #25d366 !important;
  color: #075e54 !important;
}

.dev-card-btn--wa svg {
  fill: currentColor;
  stroke: none;
}

/* —— Download panel —— */
.dev-card-downloads {
  max-width: 720px;
  margin: 0 auto 0.85rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(52, 211, 153, 0.08), transparent 50%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.72), rgba(8, 14, 26, 0.88));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.dev-card-downloads-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.dev-card-downloads-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.14);
  color: #7dd3fc;
}

.dev-card-downloads-mark svg {
  width: 1.2rem;
  height: 1.2rem;
}

.dev-card-downloads-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}

.dev-card-downloads-head p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #94a3b8;
}

.dev-card-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.dev-card-dl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 8, 20, 0.45);
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}

.dev-card-dl:hover {
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
  transform: translateY(-1px);
}

.dev-card-dl:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.dev-card-dl-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
}

.dev-card-dl-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.dev-card-dl--primary .dev-card-dl-icon {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(2, 132, 199, 0.25));
  color: #e0f2fe;
}

.dev-card-dl--vcf .dev-card-dl-icon {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.dev-card-dl strong {
  font-size: 0.86rem;
  font-weight: 750;
  color: #f8fafc;
}

.dev-card-dl span {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #94a3b8;
}

.dev-card-footer-links {
  margin-top: 1.5rem;
  color: var(--text-muted, #94a3b8);
  font-size: 0.92rem;
}

.dev-card-status {
  margin: 0.55rem auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted, #94a3b8);
  min-height: 1.2rem;
}

.dev-card-status.is-ok {
  color: #16a34a;
}

.dev-card-status.is-error {
  color: #dc2626;
}

/* Capture mode: hide flip control in exported PNG */
.dev-card.is-capturing .dev-card-flip-hint {
  display: none !important;
}

/* Mobile / small screens — keep laptop-style side-by-side card */
@media (max-width: 720px) {
  .dev-card-stage {
    max-width: 100%;
  }

  .dev-card {
    aspect-ratio: 1.85 / 1;
    /* Never stack: preserve business-card proportions */
    min-height: 0;
  }

  .dev-card-front-grid {
    grid-template-columns: 1.12fr 0.88fr;
  }

  .dev-card-photo {
    order: 0;
    height: 100%;
  }

  .dev-card-back-inner {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    justify-items: stretch;
    padding: 0.85rem 0.9rem 1.85rem;
  }

  .dev-card-back-brand {
    align-items: flex-start;
  }

  .dev-card-download-grid {
    grid-template-columns: 1fr;
  }

  .dev-card-downloads {
    padding: 1rem 0.95rem 1.1rem;
  }

  .dev-card-toolbar {
    gap: 0.45rem;
  }

  .dev-card-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .dev-card-contacts li:nth-child(3) {
    display: none; /* keep phone + email readable on very narrow cards */
  }

  .dev-card-who p {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dev-card {
    transition: none;
  }

  .dev-card-dl:hover {
    transform: none;
  }
}
