:root {
  --bg: #060609;
  --bg-2: #0d0d14;
  --surface: #13131c;
  --surface-2: #1a1a26;
  --border: rgba(255, 255, 255, 0.06);
  --border-h: rgba(139, 92, 246, 0.35);

  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-g: rgba(139, 92, 246, 0.22);
  --accent-d: rgba(139, 92, 246, 0.10);

  --cyan: #22d3ee;

  --text: #f0f0f8;
  --text-2: #9090aa;
  --text-3: #44445a;

  --font: 'Space Grotesk', sans-serif;
  --mono: 'Space Mono', monospace;

  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  cursor: none;
}

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

/* ── Canvas BG ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── Cursors ── */
#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #9fdcff;
  box-shadow:
    0 0 12px rgba(124, 217, 255, 0.9),
    0 0 30px rgba(76, 168, 255, 0.6),
    0 0 60px rgba(76, 168, 255, 0.3);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, background 0.2s ease;
  will-change: transform;
}

#cursor-dot.hover {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background: #ffffff;
}

@media (hover: none) {
  html, body { cursor: auto; }
  #cursor-dot { display: none; }
}

/* ── HERO ── */
#hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.ey-line {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.ey-line:last-child {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hero-title {
  font-size: clamp(4.5rem, 14vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
}

.t-black {
  color: var(--text);
}

.t-ten {
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 50px rgba(139, 92, 246, .45));
}

.t-dot {
  color: var(--text-3);
}

.t-dev {
  color: var(--text-2);
  font-weight: 300;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sh-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: sh 1.8s ease-in-out infinite;
}

@keyframes sh {

  0%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }

  50% {
    transform: scaleY(.5);
    opacity: .4;
  }
}

/* ── ZNAJOMI ── */
#znajomi {
  position: relative;
  z-index: 2;
  padding: 7rem 2rem;
}

.section-inner {
  max-width: 820px;
  margin: 0 auto;
}

.sec-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}

.sec-num {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--accent);
  letter-spacing: .1em;
}

.sec-name {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-3);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sec-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 2.5rem;
  color: var(--text);
}

/* Grid */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* Card */
.friend-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: none;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
  position: relative;
  overflow: hidden;
}

.friend-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-d), transparent 60%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.friend-card:not(.empty):hover {
  transform: translateY(-4px);
  border-color: var(--border-h);
  box-shadow: 0 16px 60px rgba(0, 0, 0, .55), 0 0 40px var(--accent-g);
}

.friend-card:not(.empty):hover::before {
  opacity: 1;
}

.friend-card.clickable {
  cursor: none;
}

.friend-card.clickable .friend-avatar {
  --clr: #ec4899;
}

/* Avatar */
.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--clr, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--clr, var(--accent)) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--clr, var(--accent));
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: box-shadow .3s;
}

.friend-card:not(.empty):hover .friend-avatar {
  box-shadow: 0 0 20px color-mix(in srgb, var(--clr, var(--accent)) 50%, transparent);
}

.empty-avatar {
  --clr: #44445a;
  border-style: dashed;
}

.img-avatar {
  background: transparent;
  border: none;
  padding: 0;
}

.img-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

/* Info */
.friend-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  position: relative;
  z-index: 1;
}

.friend-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.friend-url {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-3);
}

.empty-name {
  color: var(--text-3);
  font-style: italic;
}

.empty {
  opacity: .45;
  cursor: not-allowed;
}

/* Arrow */
.friend-arrow {
  color: var(--text-3);
  transition: color .3s, transform .3s var(--ease);
  position: relative;
  z-index: 1;
}

.friend-arrow svg {
  width: 18px;
  height: 18px;
}

.friend-card:not(.empty):hover .friend-arrow {
  color: var(--accent-2);
  transform: translate(3px, -3px);
}

/* ── FOOTER ── */
#footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

.footer-copy {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-3);
}

.f-bracket {
  color: var(--accent);
}

/* ── Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}

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

/* ── Himari Modal ── */
.hm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}

.hm-overlay.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.hm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 6, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hm-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  transform: scale(0.6) translateY(30px);
  filter: blur(8px);
  transition: transform .5s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter .4s var(--ease);
}

.hm-overlay.active .hm-content {
  transform: scale(1) translateY(0);
  filter: blur(0);
}

.hm-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.30) 0%, rgba(244, 114, 182, 0.10) 40%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  animation: hm-pulse 3s ease-in-out infinite;
}

@keyframes hm-pulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  50% { opacity: .6; transform: translate(-50%, -55%) scale(1.12); }
}

.hm-frame {
  width: 260px;
  height: 260px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(236, 72, 153, 0.35);
  box-shadow:
    0 0 40px rgba(236, 72, 153, 0.20),
    0 0 80px rgba(236, 72, 153, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
  background: var(--surface);
  transition: border-color .3s, box-shadow .3s;
}

.hm-overlay.active .hm-frame {
  animation: hm-border-shimmer 3s ease-in-out infinite;
}

@keyframes hm-border-shimmer {
  0%, 100% { border-color: rgba(236, 72, 153, 0.35); box-shadow: 0 0 40px rgba(236, 72, 153, 0.20), 0 0 80px rgba(236, 72, 153, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5); }
  50% { border-color: rgba(244, 114, 182, 0.55); box-shadow: 0 0 50px rgba(236, 72, 153, 0.30), 0 0 100px rgba(236, 72, 153, 0.12), 0 20px 60px rgba(0, 0, 0, 0.5); }
}

.hm-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.hm-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

.hm-label {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(244, 114, 182, 0.7);
  position: relative;
  z-index: 1;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .friends-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(3.5rem, 18vw, 6rem);
  }

  .hm-frame {
    width: 200px;
    height: 200px;
  }

  .hm-glow {
    width: 260px;
    height: 260px;
  }
}