@property --glare-opacity {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

:root {
  --accent-color: #38bdf8;
  --glow-color: #a855f7;
  --text-color: #ffffff;
  --card-blur: 6px;
  --card-opacity: 0.06;
  --bg-overlay-opacity: 0.24;
  --bg-blur: 0px;
  --glare-x: 28%;
  --glare-y: 16%;
  --glare-opacity: 0;
  --in-oklab: ;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

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

html, body {
  min-height: 100%;
  font-family: var(--font-family);
  background: #05060a;
  color: var(--text-color);
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  user-select: none;
}

/* Splash / Intro Screen (#intro) */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05060a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

#intro.hidden {
  animation: introFadeOut 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

#intro.hidden .intro-content {
  animation: none;
}

@keyframes introFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(8px);
    visibility: hidden;
  }
}

.intro-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.intro-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  padding-left: 2px;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 28px rgba(56, 189, 248, 0.4);
  margin-bottom: 10px;
}

.intro-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #38bdf8;
  letter-spacing: 4px;
  padding-left: 4px;
  text-align: center;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  text-transform: uppercase;
}

/* Background Layers */
.bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.bg-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(106, 92, 255, 0.32), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(255, 61, 154, 0.25), transparent 55%),
    radial-gradient(circle at 50% 85%, rgba(0, 212, 255, 0.22), transparent 60%),
    linear-gradient(135deg, #05060a 0%, #0d1020 50%, #070812 100%);
  z-index: 0;
}

.bg-video, .bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
  pointer-events: none;
  z-index: 0;
}

.bg-video {
  will-change: transform;
  backface-visibility: hidden;
}

.bg-video.has-blur, .bg-image.has-blur {
  filter: blur(var(--bg-blur));
}

.bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--bg-overlay-opacity));
  z-index: 1;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Main Apple Liquid Glass Card (.card) */
.card {
  position: relative;
  z-index: 1;
  width: 360px;
  max-width: 92vw;
  margin: auto 0;
  overflow: hidden;
  padding: 22px 22px 16px;
  text-align: center;
  isolation: isolate;
  background: linear-gradient(
    155deg var(--in-oklab),
    rgba(255, 255, 255, calc(var(--card-opacity) + 0.07)) 0%,
    rgba(255, 255, 255, calc(var(--card-opacity) * 0.35)) 40%,
    rgba(12, 15, 24, calc(var(--card-opacity) + 0.05)) 78%,
    rgba(255, 255, 255, calc(var(--card-opacity) * 0.6)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 30px;
  backdrop-filter: blur(var(--card-blur)) saturate(175%) brightness(1.05);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(175%) brightness(1.05);
  box-shadow:
    0 28px 68px rgba(0, 0, 0, 0.48),
    0 6px 20px rgba(0, 0, 0, 0.24),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22),
    inset 1px 0 0 rgba(255, 255, 255, 0.26),
    inset -1px 0 0 rgba(255, 255, 255, 0.14),
    inset 0 0 28px rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.9s ease, --glare-opacity 0.2s ease;
  contain: layout style;
}

@media (hover: hover) and (pointer: fine) {
  .card {
    will-change: transform;
  }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    145deg var(--in-oklab),
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.14) 36%,
    rgba(255, 255, 255, 0.06) 64%,
    rgba(255, 255, 255, 0.42) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      280px circle at var(--glare-x) var(--glare-y),
      rgba(255, 255, 255, calc(0.20 * var(--glare-opacity))) 0%,
      rgba(255, 255, 255, calc(0.06 * var(--glare-opacity))) 42%,
      transparent 72%
    ),
    linear-gradient(
      180deg var(--in-oklab),
      rgba(255, 255, 255, 0.10) 0%,
      rgba(255, 255, 255, 0.02) 26%,
      transparent 52%
    );
  pointer-events: none;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card.visible {
  opacity: 1;
}

/* Avatar Ring (static light-blue border) */
.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  border-radius: 50%;
  padding: 3px;
  background: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0f1119;
}

/* Username & Optional Effects */
.name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-color);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
  display: inline-block;
}

.name-effect-glow {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42), 0 0 18px rgba(255, 255, 255, 0.25);
}

.name-effect-gradient {
  background: linear-gradient(90deg, var(--accent-color), #ff3d9a, #00d4ff, var(--accent-color));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientFlow 4s linear infinite;
}

.name-effect-gold {
  background: linear-gradient(120deg, #fde047, #f59e0b, #fef08a, #d97706, #fde047);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientFlow 3.5s linear infinite;
}

.name-effect-glitch {
  color: #fff;
  text-shadow: -1.5px 0 #00d4ff, 1.5px 0 #ff3d9a;
}

@keyframes gradientFlow {
  to { background-position: 200% center; }
}

/* Optional Badges */
.badges-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Bio & Typewriter Block Cursor */
.bio {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  font-family: 'JetBrains Mono', monospace;
  min-height: 20px;
  margin-bottom: 12px;
  line-height: 1.45;
  white-space: pre-line;
}

.bio:not(.done)::after {
  content: "▌";
  color: #00ff88;
  margin-left: 2px;
  animation: blinkCursor 1s steps(1) infinite;
}

@keyframes blinkCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Discord / Spotify Activity Card */
#discord-activity {
  margin-bottom: 12px;
}

.dc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dc-card.dc-idle {
  background: rgba(12, 15, 24, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.dc-card.dc-spotify {
  background: rgba(30, 215, 96, 0.12);
  border: 1px solid rgba(30, 215, 96, 0.3);
}

.dc-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.dc-avatar-box {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.dc-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #141724;
}

.dc-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dc-avatar-box .dc-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 13px;
  height: 13px;
  border: 2.5px solid #10131e;
}

.dc-status-online {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.dc-status-idle {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}

.dc-status-dnd {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

.dc-status-offline {
  background: #6b7280;
}

.dc-info {
  flex: 1;
  min-width: 0;
}

.dc-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #5865F2;
  margin-bottom: 2px;
}

.dc-card.dc-idle .dc-label {
  color: #8f96ab;
}

.dc-card.dc-spotify .dc-label {
  color: #1DB954;
}

.dc-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-sub {
  font-size: 12px;
  color: #b0b6c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Social Link Buttons */
.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 44px;
  border-radius: 16px;
  background: rgba(12, 15, 24, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 14px rgba(0, 0, 0, 0.16);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn .icon {
  position: absolute;
  left: 14px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.btn .icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.btn .icon .icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  filter: grayscale(100%) contrast(1.15) brightness(1.06);
}

.btn .label {
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--btn-color, rgba(255, 255, 255, 0.45));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 24px var(--btn-glow, rgba(255, 255, 255, 0.32));
}

.btn:active {
  transform: scale(0.975);
  transition: transform 100ms ease-out;
}

.btn:hover .icon {
  transform: scale(1.15);
}

/* Bottom Bar (Music Toggle + View Counter) */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.volume-control {
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 4px 12px rgba(0, 0, 0, 0.16);
  padding-right: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, padding-right 0.22s ease;
}

.volume-control:hover,
.volume-control:has(:focus-visible),
.volume-control.open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  padding-right: 12px;
}

.music-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.music-btn.muted svg {
  opacity: 0.35;
}

.volume-slider-wrap {
  width: 0;
  opacity: 0;
  margin-left: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.22s ease, opacity 0.18s ease, margin-left 0.22s ease;
}

.volume-control:hover .volume-slider-wrap,
.volume-control:has(:focus-visible) .volume-slider-wrap,
.volume-control.open .volume-slider-wrap {
  width: 88px;
  opacity: 1;
  margin-left: 6px;
  overflow: visible;
}

.volume-slider {
  --slider-track-size: 4px;
  --slider-thumb-size: 12px;
  --slider-track-radius: 999px;
  --slider-thumb-radius: 50%;
  --slider-track-color: rgba(255, 255, 255, 0.24);
  --slider-fill-color: #38bdf8;
  --slider-thumb-color: #ffffff;
  --slider-direction: to right;
  --attr-min: 0;
  --attr-max: 100;
  --control-value: 100;
  --slider-progress: calc(
    progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%
  );

  -webkit-appearance: none;
  appearance: none;
  inline-size: 100%;
  block-size: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

@supports not (opacity: progress(1, 0, 100)) {
  .volume-slider {
    --slider-progress: calc(
      (var(--control-value) - var(--attr-min)) /
      (var(--attr-max) - var(--attr-min)) * 100%
    );
  }
}

.volume-slider:focus-visible {
  outline: 2px solid var(--slider-fill-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* WebKit / Blink */
.volume-slider::-webkit-slider-runnable-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: linear-gradient(
    var(--slider-direction),
    var(--slider-fill-color) var(--slider-progress),
    var(--slider-track-color) var(--slider-progress)
  );
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  margin-block-start: calc(
    (var(--slider-track-size) - var(--slider-thumb-size)) / 2
  );
  border: 0;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}

/* Firefox */
.volume-slider::-moz-range-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: var(--slider-track-color);
}

.volume-slider::-moz-range-progress {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-fill-color);
}

.volume-slider::-moz-range-thumb {
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  border: 0;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
}

@media (hover: none), (pointer: coarse) {
  .volume-control {
    padding-right: 12px;
  }
  .volume-control .volume-slider-wrap {
    width: 84px;
    opacity: 1;
    margin-left: 6px;
    overflow: visible;
  }
}

.visits {
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.visits svg {
  opacity: 0.85;
}

/* Footer */
.footer {
  margin-top: 10px;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Click Ripple Effect */
.ripple {
  position: fixed;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(
    circle,
    rgba(0, 255, 136, 0.55) 0%,
    rgba(106, 92, 255, 0.35) 45%,
    transparent 70%
  );
  animation: rippleOut 0.7s ease-out forwards;
  z-index: 9999;
}

@keyframes rippleOut {
  from {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

@media (max-width: 420px) {
  .intro-title {
    font-size: 24px;
  }
  .card {
    padding: 18px 16px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-content,
  .name-effect-gradient,
  .name-effect-gold {
    animation: none;
  }
  .card {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .card {
    background: rgba(16, 18, 28, 0.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .btn,
  .dc-card.dc-idle,
  .volume-control {
    background: rgba(28, 32, 48, 0.95);
  }
}

@media (prefers-contrast: more) {
  .card {
    background: rgba(12, 14, 22, 0.92);
    border-color: rgba(255, 255, 255, 0.65);
  }
  .card,
  .dc-card,
  .btn,
  .volume-control {
    border-color: rgba(255, 255, 255, 0.55);
  }
}

.is-hidden {
  display: none;
}

.cf-turnstile-slot {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.cf-turnstile-slot:empty {
  display: none;
  margin-top: 0;
}
