/* ============================================
   @chagogil — Linkpage
   Hereda sistema visual de santiagogil.com.mx
   ============================================ */

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

:root {
  --dark: #0d121e;
  --dark-2: #141a28;
  --light: #f5f0eb;
  --accent: #ff4a39;
  --accent-soft: rgba(255, 74, 57, 0.12);
  --accent-glow: rgba(255, 74, 57, 0.4);
  --white: #ffffff;
  --gray: #8a8f98;
  --gray-2: rgba(255, 255, 255, 0.08);
  --gray-3: rgba(255, 255, 255, 0.04);
  --radius: 16px;
  --radius-lg: 22px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--white);
  background: var(--dark);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}

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

/* ============================================
   BACKGROUND — sutil pero con personalidad
   ============================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: glowFloat 18s ease-in-out infinite;
}

.bg__glow--1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -120px;
  left: -120px;
  opacity: 0.3;
}

.bg__glow--2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -200px;
  right: -200px;
  opacity: 0.2;
  animation-delay: -9s;
  animation-direction: reverse;
}

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.1); }
}

/* Fine grain noise overlay (CSS only) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.6;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (min-width: 768px) {
  .page {
    padding: 96px 24px 56px;
  }
}

/* ============================================
   REVEAL ANIMATION
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero__logo {
  color: var(--accent);
  display: inline-flex;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.hero__handle {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
}

.hero__at {
  color: var(--accent);
  font-weight: 900;
}

.hero__tagline {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.005em;
}

.hero__sep {
  color: var(--accent);
  margin: 0 6px;
  font-weight: 700;
}

.hero__loc {
  color: var(--white);
}

.hero__sub {
  font-size: 0.9rem;
  color: var(--gray);
  font-weight: 400;
  max-width: 320px;
}

/* ============================================
   LINKS
   ============================================ */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--gray-3);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  color: var(--white);
  transition:
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    transform 0.4s var(--ease-expo);
  overflow: hidden;
  isolation: isolate;
}

/* Hover glow effect */
.link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: -1;
}

.link:hover {
  background: var(--dark-2);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.link:hover::before {
  opacity: 1;
}

.link:active {
  transform: translateY(0);
}

/* Icon */
.link__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  background: var(--gray-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.link:hover .link__icon {
  background: var(--accent);
  color: var(--white);
}

/* Label */
.link__label {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
}

.link__url {
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow */
.link__arrow {
  flex: 0 0 auto;
  color: var(--gray);
  transition: transform 0.4s var(--ease-expo), color 0.4s var(--ease);
  display: inline-flex;
}

.link:hover .link__arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ============================================
   FOOTER
   ============================================ */
.foot {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.foot__sep {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-2), transparent);
  margin-bottom: 8px;
}

.foot__text {
  font-size: 0.85rem;
  color: var(--gray);
}

.foot__text strong {
  color: var(--white);
  font-weight: 600;
}

.foot__sep-dot {
  margin: 0 8px;
  color: var(--accent);
}

.foot__text a {
  color: var(--gray);
  transition: color 0.3s var(--ease);
  border-bottom: 1px dashed var(--gray-2);
  padding-bottom: 1px;
}

.foot__text a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.foot__year {
  font-size: 0.75rem;
  color: var(--gray);
  opacity: 0.6;
}

/* ============================================
   CUSTOM CURSOR (desktop only)
   ============================================ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}

.cursor__dot {
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: -3px;
  transition: transform 0.1s linear;
}

.cursor__ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  position: absolute;
  top: -18px;
  left: -18px;
  transition:
    width 0.4s var(--ease-expo),
    height 0.4s var(--ease-expo),
    top 0.4s var(--ease-expo),
    left 0.4s var(--ease-expo),
    border-color 0.3s,
    background 0.3s;
}

.cursor.hover .cursor__ring {
  width: 64px;
  height: 64px;
  top: -32px;
  left: -32px;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cursor.hover .cursor__dot {
  transform: scale(0);
}

/* ============================================
   FOCUS STATES (accesibilidad)
   ============================================ */
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
