:root {
  color-scheme: light;
  --ink: #0e1b15;
  --muted: #5e6e66;
  --paper: #ffffff;
  --mist: #edf3ef;
  --green: #85d13d;
  --green-dark: #103b2c;
  --green-mid: #23684a;
  --line: #d9e4dd;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #e9efeb; }
body { margin: 0; color: var(--ink); background: #e9efeb; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }

.card-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #e9efeb;
  background-image: linear-gradient(rgba(18, 56, 44, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(18, 56, 44, .035) 1px, transparent 1px);
  background-size: 40px 40px;
}

.visiting-card {
  position: relative;
  width: min(438px, 100%);
  height: min(850px, calc(100svh - 48px));
  min-height: 700px;
  display: grid;
  grid-template-rows: 45% 55%;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(18, 56, 44, .1);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(16, 41, 31, .18);
}

.portrait-zone {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--green-dark);
}

.portrait-zone::before {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  top: -156px;
  right: -105px;
  border: 1px solid rgba(133, 209, 61, .35);
  border-radius: 50%;
}

.portrait-zone::after {
  content: "";
  position: absolute;
  left: -80px;
  bottom: -96px;
  width: 250px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.portrait-stage {
  position: absolute;
  inset: max(14px, env(safe-area-inset-top)) 24px 0;
  z-index: 2;
  overflow: hidden;
  background: #0a2b24;
  border: 2px solid rgba(133, 209, 61, .9);
  border-bottom: 0;
  border-radius: 56px 10px 58px 10px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, .24);
}

.portrait-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 67%, rgba(7, 28, 22, .26));
}

.portrait-stage::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-top: 2px solid var(--green);
  border-right: 2px solid var(--green);
}

.portrait-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 34%;
  transform: scale(1.005);
  filter: saturate(.94) contrast(1.04);
}

.corner-mark {
  position: absolute;
  left: 12px;
  bottom: 22px;
  width: 38px;
  height: 3px;
  z-index: 3;
  background: var(--green);
}

.profile-zone {
  position: relative;
  z-index: 5;
  min-height: 0;
  padding: 27px 26px max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto auto auto 44px;
  align-content: space-between;
  gap: 9px;
  background: var(--paper);
}

.profile-zone::before {
  content: "";
  position: absolute;
  left: -13%;
  right: -13%;
  top: -36px;
  height: 68px;
  z-index: -1;
  background: var(--paper);
  border-radius: 48% 52% 0 0 / 100% 100% 0 0;
  transform: rotate(-4deg);
  transform-origin: center;
}

.profile-zone::after {
  content: "";
  position: absolute;
  right: 27px;
  top: 0;
  width: 54px;
  height: 3px;
  background: var(--green);
}

.identity { text-align: center; }
.company-line { margin: 0 0 4px; color: var(--green-mid); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.identity h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.25rem, 10vw, 4.2rem); font-weight: 600; line-height: 1; letter-spacing: 0; }
.location { margin: 7px 0 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.location i { margin-right: 5px; color: var(--green-mid); }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-actions a { min-width: 0; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; }
.quick-actions span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 7px 16px rgba(16, 59, 44, .07);
  font-size: 1.15rem;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}
.quick-actions a:hover span { transform: translateY(-3px); color: #fff; background: var(--green-mid); }
.quick-actions small { color: var(--ink); font-size: .72rem; font-weight: 800; }

.contact-details { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.contact-details span { width: 4px; height: 4px; border-radius: 50%; background: var(--green); }

.social-links { display: flex; align-items: center; justify-content: center; gap: 14px; }
.social-links a {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(20, 45, 34, .12);
  font-size: 1rem;
  transition: transform 180ms ease, filter 180ms ease;
}
.social-links a:hover { transform: translateY(-3px); filter: brightness(.92); }
.instagram { background: #c13584; }
.facebook { background: #1877f2; }
.linkedin { background: #0a66c2; }
.whatsapp { background: #1fa855; }

.save-contact {
  width: min(250px, 100%);
  min-height: 51px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--green-mid);
  border: 1px solid var(--green-mid);
  border-radius: 26px;
  box-shadow: 0 12px 24px rgba(37, 104, 74, .2);
  font-size: .9rem;
  font-weight: 850;
  transition: transform 180ms ease, background 180ms ease;
}
.save-contact:hover { transform: translateY(-2px); background: var(--green-dark); }

.home-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--green-dark);
  border-top: 1px solid var(--line);
  font-size: .88rem;
  font-weight: 850;
}
.home-button i { color: var(--green-mid); font-size: .95rem; }

@media (max-width: 520px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .card-page { height: 100svh; min-height: 100svh; padding: 0; background: var(--paper); }
  .visiting-card { width: 100%; height: 100svh; min-height: 0; grid-template-rows: 44svh 56svh; border: 0; border-radius: 0; box-shadow: none; }
  .portrait-stage { inset: max(11px, env(safe-area-inset-top)) 15px 0; border-radius: 48px 9px 54px 9px; }
  .portrait-stage img { object-position: center 34%; }
  .profile-zone { padding: 22px 18px max(7px, env(safe-area-inset-bottom)); gap: clamp(5px, .85svh, 9px); }
  .profile-zone::before { top: -31px; height: 59px; }
  .profile-zone::after { right: 18px; }
  .company-line { font-size: .72rem; }
  .identity h1 { font-size: clamp(2.85rem, 13vw, 3.6rem); }
  .location { font-size: .82rem; }
  .quick-actions span { width: 47px; height: 47px; font-size: 1.08rem; }
  .quick-actions small { font-size: .68rem; }
  .contact-details { font-size: clamp(.68rem, 3vw, .76rem); }
  .social-links a { width: 39px; height: 39px; }
  .save-contact { min-height: 47px; font-size: .84rem; }
  .home-button { min-height: 40px; height: 40px; font-size: .82rem; }
}

@media (max-width: 520px) and (max-height: 720px) {
  .visiting-card { grid-template-rows: 39svh 61svh; }
  .portrait-stage { inset: max(8px, env(safe-area-inset-top)) 17px 0; }
  .profile-zone { padding-top: 15px; gap: 4px; }
  .profile-zone::before { top: -25px; height: 48px; }
  .company-line { font-size: .64rem; }
  .identity h1 { font-size: 2.55rem; }
  .location { margin-top: 3px; font-size: .72rem; }
  .quick-actions span { width: 40px; height: 40px; font-size: .95rem; }
  .quick-actions small { font-size: .62rem; }
  .contact-details { font-size: .65rem; }
  .social-links a { width: 34px; height: 34px; font-size: .84rem; }
  .save-contact { min-height: 41px; font-size: .78rem; }
  .home-button { min-height: 34px; height: 34px; font-size: .74rem; }
}

@media (max-width: 360px) {
  .profile-zone { padding-left: 12px; padding-right: 12px; }
  .quick-actions { gap: 4px; }
  .quick-actions span { width: 43px; height: 43px; }
  .contact-details { font-size: .62rem; }
}

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