:root {
  --bg-color: #09090b;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --glass-bg: #111113;
  --glass-border: rgba(39, 39, 42, 0.5);
  --glass-hover-bg: #18181b;

  /* Responsive Width Logic */
  --container-max-width: 440px;
  --container-padding-x: 1.5rem;

  --plus-size: 14px;
  --plus-thickness: 1px;
  --card-height: 46px;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Geist Sans", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem; /* Prevents card from touching screen edges */
  overflow-x: hidden;
}

/* Fading Grid Background */
.background-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      var(--glass-border) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--glass-border) 1px, transparent 1px);
  background-size: 50% 100%, 100% 40px;
  background-position: center center;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(
    circle at center,
    black 40%,
    transparent 90%
  );
  opacity: 0.4;
}

/* Grid Wrapper: Controls the + icons and container width */
.grid-wrapper {
  position: relative;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Plus Icon Components */
.plus-icon {
  position: absolute;
  width: var(--plus-size);
  height: var(--plus-size);
  z-index: 10;
  color: #52525b;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.plus-icon::before {
  width: 100%;
  height: var(--plus-thickness);
}
.plus-icon::after {
  width: var(--plus-thickness);
  height: 100%;
}

.top-left {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
}
.top-right {
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
}
.bottom-left {
  bottom: 0;
  left: 0;
  transform: translate(-50%, 50%);
}
.bottom-right {
  bottom: 0;
  right: 0;
  transform: translate(50%, 50%);
}

/* Main Card Container */
.container {
  width: 100%;
  padding: 2.25rem var(--container-padding-x);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border: 1px solid var(--glass-border);
  background-color: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
}

/* Full-width Divider Line */
.divider-line {
  height: 1px;
  background: var(--glass-border);
  width: calc(100% + (var(--container-padding-x) * 2));
  margin-left: calc(var(--container-padding-x) * -1);
}

/* Header & Links */
.logo-container {
  width: 42px;
  height: 42px;
  margin: 0 auto 1.25rem;
}

.profile-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.4;
}

.links-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.link-card {
  display: flex;
  align-items: center;
  height: var(--card-height);
  padding: 0 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.link-card:hover {
  background: var(--glass-hover-bg);
  border-color: #3f3f46;
}

/* Icon & Text Alignment */
.icon-wrapper {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
}

.link-text {
  flex-grow: 1;
  text-align: center;
  font-weight: 500;
  font-size: 0.85rem; /* Slightly smaller for mobile fit */
}

/* Animated Arrow indicator */
.arrow-icon {
  width: 14px;
  height: 14px;
  position: absolute;
  right: 1rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translate(-10px, 10px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.link-card:hover .arrow-icon {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--text-primary);
}

.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Mobile-Specific Refinements */
@media (max-width: 480px) {
  :root {
    --container-padding-x: 1rem; /* Slimmer padding for tiny screens */
    --card-height: 44px;
  }

  .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .link-text {
    font-size: 0.8rem;
  }
}

/* --- High-End Textured Background --- */
body {
  background-color: #050505; /* Deeper black for better contrast */
  position: relative;
  overflow-x: hidden;
}

/* Layer 1: Grainy Noise Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.03; /* Very subtle grain */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Layer 2: Shiny Radial Glow & Soft Scanlines */
.background-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;

  /* Primary Glow */
  background: 
    /* Subtle Indigo Glow in the center for "Shine" */ radial-gradient(
      circle at 50% 50%,
      rgba(99, 102, 241, 0.08) 0%,
      transparent 50%
    ),
    /* Secondary Deep Glow */
      radial-gradient(
        circle at 50% -10%,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 40%
      ),
    /* Dark Base Gradient */ linear-gradient(to bottom, #09090b, #050505);

  /* Horizontal Scanline Texture */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(255, 255, 255, 0.01) 1px,
    rgba(255, 255, 255, 0.01) 2px
  );
  background-size: 100% 3px;
}

/* Enhanced Glass Effect for the Main Card */
.container {
  width: 100%;
  padding: 2.25rem var(--container-padding-x);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  /* Semi-transparent border with a slight top-light highlight */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15); /* "Shine" on the top edge */

  background-color: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(20px); /* Heavier blur for frosted glass look */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.03); /* Extremely subtle indigo outer glow */
}
