/* ============================================================
   Red Inmobiliaria — tarjeta de presentación digital (ISAI)

   Diseño construido desde cero: la foto se presenta como un sello
   tipo "domo" que emerge del encabezado (gafete), el puesto vive en
   una píldora de marca y los datos de contacto se agrupan en
   tarjetas elevadas. Paleta fija (rojo/grafito del isotipo RI): esta
   tarjeta es una identidad de marca, no una superficie que deba
   responder al tema del sistema operativo del visitante.
   ============================================================ */

:root {
  --red: #e11820;
  --red-dark: #a81219;
  --red-light: #ff5b56;
  --red-soft: rgba(225, 24, 32, 0.12);
  --gold: #f0b545;

  --graphite-950: #131316;
  --graphite-900: #1b1a1d;
  --graphite-800: #242327;
  --graphite-700: #34323690;

  --gray-400: #98959c;
  --gray-300: #c3c1c6;

  --surface: #ffffff;
  --surface-2: #f6f5f4;
  --surface-3: #efedec;
  --ink: #1c1b1e;
  --ink-muted: #6b6970;
  --line: #eae8e7;

  --radius-pill: 999px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--graphite-950);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  fill: currentColor;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------------------------------------------------------
   Scene: ambient backdrop. Full-bleed on mobile, a floating
   card on desktop so the same markup reads as an "app" on
   both a phone and a monitor.
   --------------------------------------------------------- */

.scene {
  position: relative;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  padding: 0;
}

.scene__ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(55% 42% at 50% 0%, rgba(225, 24, 32, 0.2), transparent 70%),
    radial-gradient(70% 50% at 90% 100%, rgba(240, 181, 69, 0.08), transparent 60%),
    radial-gradient(60% 50% at 5% 90%, rgba(255, 255, 255, 0.05), transparent 60%);
  pointer-events: none;
}

@media (min-width: 640px) {
  .scene {
    align-items: center;
    padding: 56px 24px;
  }
}

/* ---------------------------------------------------------
   Card shell
   --------------------------------------------------------- */

.profile-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  overflow: hidden;
}

@media (min-width: 640px) {
  .profile-card {
    border-radius: 30px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.06) inset,
      0 40px 80px -24px rgba(0, 0, 0, 0.65),
      0 12px 32px -12px rgba(0, 0, 0, 0.5);
  }
}

/* ---------------------------------------------------------
   Flip stage — the whole card turns over to reveal the
   offices/contact side on its back, like a physical card.
   The front face sits in normal flow (it sets the height);
   the back face is absolutely stacked on top of it, pre-
   rotated 180deg, so both faces share the exact same box.
   --------------------------------------------------------- */

.profile-card__stage {
  position: relative;
  perspective: 1800px;
  -webkit-perspective: 1800px;
}

.profile-card__flipper {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}

.profile-card__stage.is-flipped .profile-card__flipper {
  transform: rotateY(180deg);
}

.profile-card__face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.profile-card__face--front {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .profile-card__face--front {
    min-height: 0;
  }
}

.profile-card__face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--graphite-900) 0%, var(--graphite-950) 75%);
}

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

/* ---------------------------------------------------------
   Hero — logo + textured backdrop. No shape cut at the
   bottom: the arch below does the transition into the photo.
   --------------------------------------------------------- */

.profile-card__hero {
  position: relative;
  padding: calc(30px + var(--safe-top)) 28px 206px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(225, 24, 32, 0.28), transparent 55%),
    linear-gradient(165deg, var(--graphite-900) 0%, var(--graphite-950) 72%);
  text-align: center;
  overflow: hidden;
}

.profile-card__hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 15px 15px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
}

.profile-card__hero-glow {
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 24, 32, 0.45), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

.profile-card__watermark {
  position: absolute;
  right: -14%;
  bottom: -14%;
  width: 58%;
  height: auto;
  opacity: 0.06;
  transform: rotate(-8deg);
  pointer-events: none;
}

.profile-card__logo {
  position: relative;
  height: 34px;
  width: auto;
  margin: 0 auto;
  opacity: 0.98;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}

/* ---------------------------------------------------------
   Arch — the photo "seal". Pulled up over the hero with a
   negative margin so it reads as a badge emerging from the
   dark header, echoing an ID-card photo dome but rebuilt in
   the RI palette with a conic ring and a brand-mark rivet.
   --------------------------------------------------------- */

.profile-card__arch {
  position: relative;
  z-index: 2;
  width: 232px;
  margin: -175px auto 0;
  padding-top: 26px;
  background: var(--surface);
  border-radius: 116px 116px 0 0;
  display: flex;
  justify-content: center;
}

.profile-card__avatar {
  position: relative;
  width: 180px;
  height: 180px;
}

.profile-card__avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 5px;
  background: conic-gradient(
    from 220deg,
    var(--red) 0%,
    var(--red-dark) 32%,
    var(--graphite-900) 50%,
    var(--red-dark) 68%,
    var(--gold) 88%,
    var(--red) 100%
  );
  box-shadow: 0 18px 34px -14px rgba(225, 24, 32, 0.55);
}

.profile-card__avatar-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--surface);
  object-fit: cover;
  background: var(--graphite-800);
}

.profile-card__avatar-seal {
  position: absolute;
  right: -2px;
  bottom: 6px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.4);
}

.profile-card__avatar-seal img {
  width: 20px;
  height: 20px;
}

/* ---------------------------------------------------------
   Identity — name, role pill, brand chip
   --------------------------------------------------------- */

.profile-card__identity {
  padding: 16px 28px 0;
  text-align: center;
  background: var(--surface);
}

.profile-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 8vw, 37px);
  letter-spacing: 0.01em;
  color: var(--ink);
}

.profile-card__role {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.profile-card__role svg {
  flex-shrink: 0;
}

.profile-card__divider {
  display: block;
  width: 40px;
  height: 3px;
  margin: 20px auto 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.profile-card__brand {
  margin: 16px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-card__brand-mark {
  flex-shrink: 0;
}

.profile-card__brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}

.profile-card__brand-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.04em;
  color: var(--red);
}

.profile-card__brand-text small {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------
   Body
   --------------------------------------------------------- */

.profile-card__body {
  padding: 6px 24px 8px;
  flex: 1;
}

/* Primary action */

.actions {
  padding-top: 22px;
}

.actions__save {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--red-light) 0%, var(--red) 45%, var(--red-dark) 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 15.5px;
  box-shadow: 0 14px 24px -10px rgba(225, 24, 32, 0.55);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.actions__save:hover {
  box-shadow: 0 18px 30px -10px rgba(225, 24, 32, 0.6);
}

.actions__save:active {
  transform: scale(0.98) translateY(1px);
}

.quick-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  border-radius: var(--radius-lg);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.quick-grid__item:hover {
  background: var(--surface-2);
}

.quick-grid__item:active {
  transform: scale(0.96);
}

.quick-grid__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(155deg, var(--graphite-800), var(--graphite-950));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transition: transform 0.18s var(--ease);
}

.quick-grid__item:hover .quick-grid__icon {
  transform: translateY(-2px);
}

.quick-grid__icon--wa {
  background: linear-gradient(155deg, #34e075, #1da851);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 18px -10px rgba(29, 168, 81, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.quick-grid__icon--call {
  background: linear-gradient(155deg, var(--red-light), var(--red-dark));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 18px -10px rgba(225, 24, 32, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Contact list */

.contact-list {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.contact-list__title {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.contact-list__item {
  display: flex;
  gap: 14px;
  padding: 13px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  transition: background-color 0.18s var(--ease);
}

.contact-list__item + .contact-list__item {
  margin-top: 8px;
}

.contact-list__item:hover {
  background: var(--surface-3);
}

.contact-list__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  margin-top: 2px;
}

.contact-list__text {
  min-width: 0;
}

.contact-list__label {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.contact-list__value {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

a.contact-list__value.contact-list__link {
  display: inline-block;
  color: var(--ink-muted);
  transition: color 0.15s var(--ease);
}

a.contact-list__value.contact-list__link:hover {
  color: var(--red);
}

.contact-list__map {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}

.contact-list__map:hover {
  color: var(--red-dark);
}

/* ---------------------------------------------------------
   Card back — offices/contact side, animated particle
   network behind frosted-glass cards.
   --------------------------------------------------------- */

.profile-card__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.card-back__content {
  position: relative;
  z-index: 1;
  padding: calc(24px + var(--safe-top)) 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-back__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.card-back__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 9px 14px 9px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.card-back__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.card-back__close:active {
  transform: scale(0.96);
}

.card-back__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: #ffffff;
}

.profile-card__face--back .contact-list {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.profile-card__face--back .contact-list__item {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-card__face--back .contact-list__item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.profile-card__face--back .contact-list__icon {
  background: rgba(225, 24, 32, 0.25);
  color: #ff8b85;
}

.profile-card__face--back .contact-list__label {
  color: #ffffff;
}

.profile-card__face--back .contact-list__value {
  color: rgba(255, 255, 255, 0.68);
}

.profile-card__face--back a.contact-list__value.contact-list__link {
  color: rgba(255, 255, 255, 0.68);
}

.profile-card__face--back a.contact-list__value.contact-list__link:hover {
  color: #ffffff;
}

.profile-card__face--back .contact-list__map {
  color: #ff8b85;
}

.profile-card__face--back .contact-list__map:hover {
  color: #ffffff;
}

/* Social */

.social-row {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-row__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.social-row__btn:hover {
  background: var(--surface-2);
  border-color: var(--gray-300);
}

.social-row__btn:active {
  transform: scale(0.97);
}

.social-row__icon {
  flex-shrink: 0;
}

.social-row__icon--facebook {
  fill: #1877f2;
}

.social-row__icon--instagram {
  fill: #e4405f;
}

.social-row__icon--youtube {
  fill: #ff0000;
}

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

.profile-card__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 24px 24px calc(20px + var(--safe-bottom));
}

.footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}

.footer-btn:hover {
  background: var(--surface-2);
}

.footer-btn:active {
  transform: scale(0.97);
}

.footer-btn--fill {
  background: var(--graphite-950);
  border-color: var(--graphite-950);
  color: #ffffff;
}

.footer-btn--fill:hover {
  background: var(--graphite-900);
}

.profile-card__accent-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--graphite-950), var(--red) 45%, var(--gold) 75%, var(--graphite-950));
}

/* Contact cards stagger in once the back face is revealed */

.profile-card__face--back .contact-list__item {
  opacity: 0;
  transform: translateY(8px);
}

.profile-card__stage.is-flipped .profile-card__face--back .contact-list__item {
  animation: rise 0.5s var(--ease) both;
}

.profile-card__stage.is-flipped .profile-card__face--back .contact-list__item:nth-child(1) { animation-delay: 0.15s; }
.profile-card__stage.is-flipped .profile-card__face--back .contact-list__item:nth-child(2) { animation-delay: 0.22s; }
.profile-card__stage.is-flipped .profile-card__face--back .contact-list__item:nth-child(3) { animation-delay: 0.29s; }
.profile-card__stage.is-flipped .profile-card__face--back .contact-list__item:nth-child(4) { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  .profile-card__face--back .contact-list__item {
    opacity: 1;
    transform: none;
  }

  .profile-card__stage.is-flipped .profile-card__face--back .contact-list__item {
    animation: none;
  }
}

/* ---------------------------------------------------------
   Toast
   --------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translate(-50%, 12px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: var(--graphite-950);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast svg {
  color: var(--red);
  flex-shrink: 0;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------
   Entrance motion (progressive reveal on load)
   --------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .profile-card__logo,
  .profile-card__avatar,
  .profile-card__name,
  .profile-card__role,
  .profile-card__brand,
  .actions,
  .profile-card__face--front .social-row,
  .profile-card__footer {
    animation: rise 0.6s var(--ease) both;
  }

  .profile-card__logo { animation-delay: 0.02s; }
  .profile-card__avatar { animation-delay: 0.08s; }
  .profile-card__name { animation-delay: 0.14s; }
  .profile-card__role { animation-delay: 0.18s; }
  .profile-card__brand { animation-delay: 0.22s; }
  .actions { animation-delay: 0.28s; }
  .profile-card__face--front .social-row { animation-delay: 0.34s; }
  .profile-card__footer { animation-delay: 0.4s; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

