/* ============================================
   RELAYVERSE.SITE — B4av0
   Dark Editorial Aesthetic
   ============================================ */

:root {
  --black: #0a0a0a;
  --off-black: #111111;
  --dark: #161616;
  --mid: #252525;
  --border: #2a2a2a;
  --muted: #4a4a4a;
  --dim: #787878;
  --light: #b8b8b8;
  --off-white: #e8e4de;
  --white: #f5f2ed;
  --accent: #c9b99a;
  --accent-dark: #8a7d68;

  --font-blackletter: 'UnifrakturMaguntia', cursive;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'Space Mono', monospace;

  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--black);
  color: var(--off-white);
  font-family: var(--font-serif);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- GRAIN ---- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  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)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
  animation: grainMove 0.5s steps(1) infinite;
}

@keyframes grainMove {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(2%, 1%); }
  30% { transform: translate(-1%, 2%); }
  40% { transform: translate(3%, -1%); }
  50% { transform: translate(-2%, 3%); }
  60% { transform: translate(1%, -2%); }
  70% { transform: translate(-3%, 1%); }
  80% { transform: translate(2%, -3%); }
  90% { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---- SCANLINES ---- */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ---- CURSOR ---- */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--off-white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.2s;
  mix-blend-mode: difference;
}

.cursor.hovering {
  width: 4px;
  height: 4px;
}

.cursor-follower {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(200, 185, 154, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-follower.hovering {
  width: 56px;
  height: 56px;
  border-color: rgba(200, 185, 154, 0.6);
}

/* ---- SITE WRAPPER ---- */
.site-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

/* Background huge text */
.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: clamp(5rem, 18vw, 18rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.03);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  animation: bgTextDrift 20s ease-in-out infinite alternate;
}

@keyframes bgTextDrift {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(-50%, -51%) scale(1.02); }
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* Avatar */
.avatar-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

.avatar-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  display: block;
  position: relative;
  z-index: 2;
  filter: grayscale(20%) contrast(1.05);
  transition: filter 0.5s ease;
}

.avatar-wrapper:hover .avatar-img {
  filter: grayscale(0%) contrast(1.1);
}

.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(201, 185, 154, 0.25);
  animation: ringPulse 3s ease-in-out infinite;
  z-index: 1;
}

.avatar-ring.ring-2 {
  inset: -20px;
  border-color: rgba(201, 185, 154, 0.1);
  animation: ringPulse 3s ease-in-out 0.8s infinite;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Glitch effect on avatar */
.avatar-glitch {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url('pfp.jpg') center top / cover no-repeat;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: hue-rotate(180deg) saturate(5);
}

.avatar-wrapper:hover .avatar-glitch {
  animation: glitchFlicker 0.3s steps(2) infinite;
  opacity: 0.08;
}

@keyframes glitchFlicker {
  0%   { clip-path: inset(10% 0 85% 0); transform: translateX(3px); }
  25%  { clip-path: inset(40% 0 50% 0); transform: translateX(-3px); }
  50%  { clip-path: inset(70% 0 10% 0); transform: translateX(2px); }
  75%  { clip-path: inset(20% 0 70% 0); transform: translateX(-2px); }
  100% { clip-path: inset(10% 0 85% 0); transform: translateX(3px); }
}

/* Hero text */
.hero-text {
  text-align: center;
}

.name-tag {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.6rem;
  animation: nameReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

@keyframes nameReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.mainline {
  font-family: var(--font-blackletter);
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
  animation: nameReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.4s;
  text-shadow: 0 0 40px rgba(201, 185, 154, 0.2);
}

.divider-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 1.2rem;
  animation: lineExpand 1s ease both;
  animation-delay: 0.6s;
}

@keyframes lineExpand {
  from { width: 0; opacity: 0; }
  to   { width: 60px; opacity: 1; }
}

.location-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  animation: nameReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.7s;
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 1.5s ease both;
  animation-delay: 1.2s;
  cursor: default;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scrollDrop 2s ease-in-out infinite;
}

@keyframes scrollDrop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  30% { opacity: 1; }
  60% { transform: scaleY(1); transform-origin: top; }
  61% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

.scroll-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================
   LINKS SECTION
   ============================================ */
.links-section {
  padding: 5rem 2rem 6rem;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  animation: fadeIn 0.8s ease both;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  padding-top: 0.1em;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  text-transform: uppercase;
}

.links-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Link Cards */
.link-card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: none;
  transition: border-color var(--transition-fast);
}

.link-card:hover {
  border-color: var(--accent-dark);
}

.link-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.6rem 2rem;
  transition: transform var(--transition);
}

.link-card:hover .link-card-inner {
  transform: translateX(4px);
}

.link-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,185,154,0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 0;
}

.link-card:hover .link-card-bg {
  opacity: 1;
}

/* Icon */
.link-icon-wrap {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.link-card:hover .link-icon-wrap {
  border-color: var(--accent-dark);
  background: rgba(201, 185, 154, 0.06);
}

.link-icon {
  width: 20px;
  height: 20px;
  color: var(--dim);
  transition: color var(--transition-fast);
}

.link-card:hover .link-icon {
  color: var(--accent);
}

/* Info */
.link-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.link-platform {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color var(--transition-fast);
}

.link-card:hover .link-platform {
  color: var(--accent-dark);
}

.link-handle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--light);
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
}

.link-card:hover .link-handle {
  color: var(--off-white);
}

/* Arrow */
.link-arrow {
  width: 24px;
  height: 24px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color var(--transition-fast), transform var(--transition);
}

.link-arrow svg {
  width: 100%;
  height: 100%;
}

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

/* Label floating on card */
.link-card::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  right: 5.5rem;
  transform: translateY(-50%) translateX(10px);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footer-sep {
  color: var(--border);
}

.footer-motto {
  font-family: var(--font-blackletter);
  font-size: 0.95rem;
  color: var(--accent-dark);
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* ============================================
   INTERSECTION OBSERVER ANIMATIONS
   ============================================ */
.link-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-color var(--transition-fast);
}

.link-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  .hero {
    padding: 5rem 1.5rem 3rem;
  }

  .avatar-wrapper {
    width: 140px;
    height: 140px;
  }

  .avatar-img {
    width: 140px;
    height: 140px;
  }

  .link-card-inner {
    padding: 1.3rem 1.4rem;
    gap: 1rem;
  }

  .link-handle {
    font-size: 1rem;
  }

  .links-section {
    padding: 3.5rem 1.5rem 4rem;
  }

  body, .link-card {
    cursor: auto;
  }

  .cursor, .cursor-follower {
    display: none;
  }
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background: rgba(201, 185, 154, 0.2);
  color: var(--white);
}
