:root {
  --red:        #B21017;
  --red-dark:   #8e0d12;
  --red-glow:   rgba(178,16,23,.15);
  --gray-700:   #374151;
  --gray-600:   #4b5563;
  --gray-500:   #6b7280;
  --gray-400:   #9ca3af;
  --gray-200:   #e5e7eb;
  --bg:         #0d1117;
  --footer-bg:  #111827;
  --radius-sm:  8px;
  --radius-md:  10px;
  --radius-xl:  16px;

  /* ── Escala fluida: ligada a la altura visible (dvh) para que TODO
     el contenido quepa en una sola pantalla, sin scroll, en cualquier
     celular (desde iPhone SE hasta los más altos). ── */
  --sp-1: clamp(2px, 0.5dvh, 4px);
  --sp-2: clamp(4px, 0.8dvh, 8px);
  --sp-3: clamp(6px, 1.4dvh, 13px);
  --sp-4: clamp(9px, 2.1dvh, 17px);

  /* Logo MEIDEI: +180% del tamaño original (x2.8) */
  --logo-h:      clamp(78px, 15.4dvh, 129px);
  --profile-size: clamp(52px, 9.5dvh, 84px);
  --name-fs:     clamp(1rem, 3dvh, 1.4rem);
  --role-fs:     clamp(0.7rem, 1.7dvh, 0.86rem);
  --btn-fs:      clamp(0.72rem, 1.6dvh, 0.92rem);
  --btn-pad-y:   clamp(0.42rem, 1.1dvh, 0.7rem);
  --btn-icon:    clamp(16px, 2.3dvh, 20px);
  --social-size: clamp(28px, 4.4dvh, 36px);
  --social-icon: clamp(14px, 2dvh, 18px);
  /* Distintivos del footer: -20% del tamaño original (x0.8) */
  --badge-h:     clamp(27px, 5dvh, 40px);
  --badge-fs:    clamp(0.56rem, 1.2dvh, 0.66rem);
  --footer-fs:   clamp(0.58rem, 1.2dvh, 0.7rem);
  --footer-pad:  clamp(0.45rem, 1.2dvh, 0.85rem);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

picture {
  display: inline-block;
  line-height: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--gray-200);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

header {
  flex-shrink: 0;
  text-align: center;
  padding: 0 1rem var(--sp-3);
}

header img.logo {
  height: var(--logo-h);
  width: auto;
}

.logo-placeholder {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: 2px;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sp-2) + env(safe-area-inset-top)) 1.25rem var(--sp-2);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.profile-img {
  width: var(--profile-size);
  height: var(--profile-size);
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--sp-3);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.profile-placeholder {
  width: var(--profile-size);
  height: var(--profile-size);
  border-radius: 50%;
  border: 4px solid var(--red);
  background-color: var(--gray-700);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--gray-500);
}

.name {
  font-size: var(--name-fs);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--sp-1);
  text-align: center;
}

.role {
  font-size: var(--role-fs);
  color: var(--gray-400);
  text-align: center;
  margin-bottom: var(--sp-4);
  line-height: 1.35;
}

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--btn-pad-y) 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--btn-fs);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px var(--red-glow);
}

.btn-primary:hover, .btn-primary:active {
  background-color: var(--red-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--gray-700);
  color: #fff;
}

.btn-secondary:hover, .btn-secondary:active {
  background-color: var(--gray-600);
  transform: translateY(-2px);
}

.btn-icon {
  margin-right: 0.45rem;
  width: var(--btn-icon);
  height: var(--btn-icon);
  flex-shrink: 0;
  fill: currentColor;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--social-size);
  height: var(--social-size);
  border-radius: 50%;
  background-color: var(--gray-700);
  color: #fff;
  transition: all 0.2s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.social-btn:hover {
  background-color: var(--red);
  transform: translateY(-2px);
}

.social-btn svg {
  width: var(--social-icon);
  height: var(--social-icon);
  fill: currentColor;
}

.badges {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.25rem;
  margin-top: var(--sp-4);
  width: 100%;
}

.badge-item {
  font-size: var(--badge-fs);
  color: var(--gray-400);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  max-width: 100px;
  line-height: 1.25;
}

.badge-item img {
  height: var(--badge-h);
  width: auto;
  max-width: 100px;
  object-fit: contain;
}

/* FOOTER CANONICO MEIDEI */
.site-footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  border-top: 3px solid var(--red);
  padding: var(--footer-pad) 1.25rem calc(var(--footer-pad) + env(safe-area-inset-bottom));
  text-align: center;
}

.ftr-brand {
  font-size: var(--footer-fs);
  color: var(--gray-400);
  line-height: 1.4;
}

.ftr-brand span {
  color: var(--red);
  font-weight: 700;
}

/* Pantallas muy angostas: recorta el padding lateral, no el vertical
   (el vertical ya lo controla la escala fluida basada en dvh) */
@media (max-width: 340px) {
  main { padding-left: 1rem; padding-right: 1rem; }
}

/* Fallback: si un dispositivo es más alto que ancho de forma extrema
   (o el usuario fuerza zoom de texto grande), permite scroll en vez
   de recortar contenido inalcanzable. */
@media (max-height: 480px) {
  body { overflow-y: auto; }
}
