/* bkleczek.com – vivid blob background, cursor trail, magnetic links */

:root {
  --color-bg: #050508;
  --color-text: #e0e0e8;
  --color-text-muted: #6a6a80;
  --color-accent: #a78bfa;
  --color-accent-2: #38bdf8;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --space-unit: 1rem;
  --space-lg: 2rem;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  cursor: none;
  width: 100vw;
  min-height: 100vh;
}

/* Canvas: 3D mesh background (wireframe cubes) */
#mesh-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
}

/* Canvas: cursor trail */
#trail-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
}

/* Blob layer */
.blob-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  will-change: transform;
  transform: translate(-50%, -50%);
}

.blob--1 {
  width: 40vmax;
  height: 40vmax;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.7), rgba(167, 139, 250, 0) 70%);
  left: var(--bx, 50%);
  top: var(--by, 50%);
  animation: morph-1 10s ease-in-out infinite;
}

.blob--2 {
  width: 35vmax;
  height: 35vmax;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5), rgba(56, 189, 248, 0) 70%);
  left: var(--bx2, 40%);
  top: var(--by2, 60%);
  animation: morph-2 14s ease-in-out infinite;
}

.blob--3 {
  width: 25vmax;
  height: 25vmax;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.35), rgba(251, 113, 133, 0) 70%);
  left: var(--bx3, 60%);
  top: var(--by3, 40%);
  animation: morph-3 18s ease-in-out infinite;
}

@keyframes morph-1 {
  0%, 100% { border-radius: 40% 60% 70% 30% / 50% 50% 60% 40%; transform: translate(-50%, -50%) scale(1); }
  33% { border-radius: 60% 40% 30% 70% / 60% 40% 50% 50%; transform: translate(-50%, -50%) scale(1.05); }
  66% { border-radius: 30% 70% 50% 50% / 40% 60% 40% 60%; transform: translate(-50%, -50%) scale(0.95); }
}

@keyframes morph-2 {
  0%, 100% { border-radius: 50% 50% 50% 50%; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  50% { border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%; transform: translate(-50%, -50%) scale(1.1) rotate(180deg); }
}

@keyframes morph-3 {
  0%, 100% { border-radius: 70% 30% 50% 50% / 50% 60% 30% 70%; transform: translate(-50%, -50%) scale(1); }
  50% { border-radius: 30% 70% 70% 30% / 60% 40% 50% 50%; transform: translate(-50%, -50%) scale(1.08); }
}

/* Header */
.site-header {
  position: relative;
  z-index: 10;
  padding: 3rem var(--space-unit) 0.25rem;
  text-align: center;
}

.site-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  user-select: none;
  transition: filter 0.3s ease;
  text-shadow: 0 0 2rem rgba(5, 5, 8, 0.7);
}

.site-name:hover {
  filter: brightness(1.3);
}

.site-name.scrambling {
  -webkit-text-fill-color: var(--color-accent);
  background: none;
}

/* Main */
.site-main {
  flex: 1;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 18vh var(--space-unit) var(--space-unit);
}

/* Subtle content zone: calm center so mesh does not overpower text */
.site-header::before,
.site-main::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90vmax;
  height: 70vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(5, 5, 8, 0.25) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.site-header::before {
  top: 30%;
}
.site-main::before {
  top: 55%;
}

.intro {
  text-align: center;
}

.intro__tagline {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "mail linkedin"
    "bytebased bytebased";
  gap: 0.75rem;
  align-items: center;
  justify-items: stretch;
  width: min(22rem, 100%);
}

.links__item--mail { grid-area: mail; justify-self: start; }
.links__item--linkedin { grid-area: linkedin; justify-self: end; }
.links__item--bytebased { grid-area: bytebased; }

.links__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease;
  will-change: transform;
}

.links__item--bytebased {
  width: 100%;
  justify-content: center;
  justify-self: stretch;
}

.links__item:hover {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.06);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.15);
}

.links__label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.links__arrow {
  font-size: 1.125rem;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.links__item:hover .links__arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 10;
  padding: var(--space-unit);
  text-align: center;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

@media (max-width: 26rem) {
  .links {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mail"
      "linkedin"
      "bytebased";
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none;
  }
  body:not(.effects-forced) #mesh-canvas {
    display: none;
  }
  body:not(.effects-forced) #trail-canvas {
    display: none;
  }
  body:not(.effects-forced) {
    cursor: auto;
  }
}
