/* ═══════════════════════════════════════
   EDIER PEÑA — Link in Bio
   Estilo: Brutalismo Editorial
   Approach: Mobile-first
   UI/UX Pro Max: Priority 1→5 aplicado
═══════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --c-wine:       #631e33;
  --c-cream:      #f9f3f3;
  --c-wa:         #128c7e;
  --c-linkedin:   #0a66c2;
  --c-instagram:  #c13584;

  --f-display: 'Space Grotesk', sans-serif;
  --f-mono:    'IBM Plex Mono', monospace;

  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;

  --border: 1.5px solid var(--c-wine);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ── */
*, *::before, *::after {
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* ── BODY ── Mobile-first
   FIX PRINCIPAL: justify-content era center → cortaba
   el contenido en pantallas pequeñas sin scroll.
   Ahora usa flex-start y solo centra cuando hay espacio.
── */
body {
  background-color: var(--c-cream);
  color: var(--c-wine);
  font-family: var(--f-display);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow-x: hidden;
}

/* ── NOISE ── */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── GRID LINES — solo desktop ── */
.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.grid-lines span {
  display: block;
  width: 2px;
  height: 100%;
  background: var(--c-wine);
  opacity: 0.06;
}

@media (min-width: 600px) {
  .grid-lines {
    display: flex;
    justify-content: space-between;
    padding: 0 var(--sp-3);
  }
}

/* ── CONTAINER ── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
.header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--sp-3);
  border: var(--border);
  background: var(--c-wine);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: 'EP';
  position: absolute;
  right: -6px;
  bottom: -14px;
  font-family: var(--f-display);
  font-size: clamp(80px, 22vw, 120px);
  font-weight: 900;
  color: rgba(249, 243, 243, 0.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -4px;
}

/* Logo */
.logo-wrap { margin-bottom: var(--sp-2); }

.logo-svg {
  width: 100px;
  height: auto;
  display: block;
}

/* Nombre */
.name {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  margin-bottom: var(--sp-2);
}

.name-first,
.name-last {
  /* clamp: funciona desde 320px hasta desktop */
  font-size: clamp(40px, 14vw, 68px);
  font-weight: 900;
  letter-spacing: clamp(-1px, -0.25vw, -2.5px);
  /* Previene overflow horizontal */
  max-width: 100%;
}

.name-first { color: var(--c-cream); }
.name-last  { color: rgba(207, 206, 206, 0.4); }

/* Role */
.role {
  font-family: var(--f-mono);
  font-size: clamp(10px, 2.8vw, 12px);
  color: rgba(249, 243, 243, 1);
  letter-spacing: 0.3px;
  margin-bottom: var(--sp-2);
  line-height: 1.5;
  word-break: break-word;
  /* Transición suave para la rotación de texto */
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Tags */
.tag-row {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.tag {
  font-family: var(--f-display);
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(249, 243, 243, 0.1);
  color: var(--c-cream);
  padding: 4px 10px;
  border: 1px solid rgba(249, 243, 243, 0.18);
  min-height: 26px;
  display: flex;
  align-items: center;
}

.tag-outline {
  background: transparent;
  color: rgba(249, 243, 243, 0.5);
  border-color: rgba(249, 243, 243, 0.4);
}

/* ══════════════════════════════
   SEPARATOR
══════════════════════════════ */
.sep {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-3);
  border-left: var(--border);
  border-right: var(--border);
  background: var(--c-cream);
}

.sep-line {
  flex: 1;
  height: 1px;
  background: var(--c-wine);
  opacity: 0.8;
}

.sep-label {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--c-wine);
  opacity: 0.35;
  white-space: nowrap;
}

/* ══════════════════════════════
   LINKS
   Touch targets: min-height 64px (> 44px mínimo WCAG) ✓
══════════════════════════════ */
.links {
  display: flex;
  flex-direction: column;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: var(--border);
  border-top: none;
  background: var(--c-cream);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 64px;
  /* Feedback táctil inmediato iOS */
  -webkit-tap-highlight-color: rgba(99, 30, 51, 0.07);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

/* Acento izquierdo */
.link-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 100%;
  background: var(--c-wine);
  transition: width 0.18s var(--ease);
  z-index: 0;
}

/* Feedback táctil activo — mobile */
.link-btn:active {
  opacity: 0.82;
}

/* ── Hover solo en pointer fino (desktop/trackpad) ── */
@media (hover: hover) and (pointer: fine) {
  .link-btn:hover::before { width: 5px; }
  .link-btn:hover .link-arrow {
    opacity: 0.75;
    transform: translate(3px, -3px);
  }

  /* Portafolio */
  .link-primary:hover {
    background: var(--c-wine);
  }
  .link-primary:hover .link-title,
  .link-primary:hover .link-num,
  .link-primary:hover .link-arrow { color: var(--c-cream); }
  .link-primary:hover .link-sub   { color: var(--c-cream); opacity: 0.6; }

  /* WhatsApp */
  .link-whatsapp:hover { background: var(--c-wa); border-color: var(--c-wa); }

  /* LinkedIn */
  .link-linkedin:hover  { background: var(--c-linkedin); border-color: var(--c-linkedin); }

  /* Instagram */
  .link-instagram:hover { background: var(--c-instagram); border-color: var(--c-instagram); }

  .link-whatsapp:hover .link-title,
  .link-whatsapp:hover .link-num,
  .link-whatsapp:hover .link-arrow,
  .link-linkedin:hover .link-title,
  .link-linkedin:hover .link-num,
  .link-linkedin:hover .link-arrow,
  .link-instagram:hover .link-title,
  .link-instagram:hover .link-num,
  .link-instagram:hover .link-arrow { color: #fff; }

  .link-whatsapp:hover .link-sub,
  .link-linkedin:hover .link-sub,
  .link-instagram:hover .link-sub  { color: rgba(255,255,255,0.65); opacity: 1; }
}

/* Número — ocultar en 360px */
.link-num {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--c-wine);
  opacity: 0.28;
  letter-spacing: 1px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 360px) {
  .link-num { display: none; }
}

/* Contenido */
.link-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.link-title {
  font-family: var(--f-display);
  font-size: clamp(14px, 4.2vw, 17px);
  font-weight: 700;
  color: var(--c-wine);
  letter-spacing: -0.2px;
  transition: color 0.18s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-sub {
  font-family: var(--f-mono);
  font-size: clamp(10px, 2.5vw, 11px);
  color: var(--c-wine);
  opacity: 0.6;
  line-height: 1.4;
  transition: opacity 0.18s var(--ease), color 0.18s var(--ease);
}

/* Flecha */
.link-arrow {
  font-size: 18px;
  color: var(--c-wine);
  opacity: 0.2;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), color 0.18s var(--ease);
}

/* Focus visible — accesibilidad teclado */
.link-btn:focus-visible {
  outline: 3px solid var(--c-wine);
  outline-offset: -3px;
  z-index: 2;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-2) var(--sp-3);
  border: var(--border);
  border-top: none;
  background: var(--c-wine);
}

.footer-copy {
  font-family: var(--f-mono);
  font-size: clamp(9px, 2.5vw, 11px);
  color: rgba(249, 243, 243, 0.4);
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(249, 243, 243, 0.22);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.footer-meta {
  font-family: var(--f-mono);
  font-size: clamp(9px, 2.5vw, 11px);
  color: rgba(249, 243, 243, 0.2);
  letter-spacing: 0.3px;
  word-break: break-all;
  text-align: center;
}

/* ══════════════════════════════
   ANIMACIONES DE ENTRADA
   150–300ms por elemento (UX Pro Max ✓)
══════════════════════════════ */
.header,
.sep,
.link-btn,
.footer {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.38s var(--ease) forwards;
}

.header                { animation-delay: 0.04s; }
.sep                   { animation-delay: 0.11s; }
.link-btn:nth-child(1) { animation-delay: 0.17s; }
.link-btn:nth-child(2) { animation-delay: 0.23s; }
.link-btn:nth-child(3) { animation-delay: 0.29s; }
.link-btn:nth-child(4) { animation-delay: 0.35s; }
.footer                { animation-delay: 0.41s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════
   TABLET Y DESKTOP
══════════════════════════════ */
@media (min-width: 600px) {
  body { padding: var(--sp-5) var(--sp-3); justify-content: center; }
  .container { max-width: 520px; }
  .header { padding: var(--sp-4); }
  .link-btn { padding: var(--sp-3) var(--sp-4); min-height: 80px; gap: var(--sp-3); }
  .sep, .footer { padding: var(--sp-2) var(--sp-4); }
}


/* ══════════════════════════════
   REDUCED MOTION ✓
══════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .header, .sep, .link-btn, .footer {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .link-btn, .link-btn::before,
  .link-title, .link-sub, .link-arrow, .link-num,
  .footer-dot { transition: none; }
  .link-btn:active { opacity: 1; }
}
