/* =============== ROOT VARIABLES =============== */
:root {
  --bg-dark: #000;
  --bg-light: #fff;

  --text-dark: #fff;
  --text-light: #000;

  --btn-bg: #111;
  --btn-bg-hover: #222;
  --btn-text: #fff;

  --shadow-dark: rgba(0, 0, 0, 0.2);
  --shadow-light: rgba(255, 255, 255, 0.3);
  --shadow-light-hover: rgba(255, 255, 255, 0.5);

  --grid-dark: rgba(255, 255, 255, 0.05);
  --grid-light: rgba(0, 0, 0, 0.1);

  --scrollbar-thumb: #111;
}

/* =============== ACCESSIBILITY =============== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =============== STATIC GRID BACKGROUND =============== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(var(--grid-dark) 0.1em, transparent 0.1em), linear-gradient(90deg, var(--grid-dark) 0.1em, transparent 0.1em);
  background-size: 3em 3em;
}

body.light-mode::before {
  background-image: linear-gradient(var(--grid-light) 0.1em, transparent 0.1em), linear-gradient(90deg, var(--grid-light) 0.1em, transparent 0.1em);
}

/* =============== BASIC STYLES =============== */
body {
  font-family: "Nunito", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background: var(--bg-dark);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
  overflow-y: scroll;
  overflow-x: hidden;
}

body.light-mode {
  background: var(--bg-light);
  color: var(--text-light);
}

.main-container {
  width: 90%;
  max-width: 30rem;
  margin: 10rem auto;
  position: relative;
  z-index: 1;
}

:focus-visible {
  outline-offset: 4px;
}

/* =============== SCROLLBAR =============== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background-color: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
}

/* =============== TEXT STYLING =============== */
h1 {
  text-align: center;
  margin: 0.5rem 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.lead {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 400;
  margin: 1rem auto;
  line-height: 1.7;
  opacity: 0.9;
  max-width: 28rem;
}

small {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.8;
}

/* =============== ICON STYLES =============== */
.icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.icon-small {
  width: 20px;
  height: 20px;
}

.icon-large {
  width: 28px;
  height: 28px;
}

/* =============== BIO SECTION =============== */
.blob-center {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.head-section{
  overflow: hidden;
}

.blob-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 52% 48% 59% 41% / 53% 40% 60% 47%;
  overflow: hidden;
  animation: blobAnim 10s ease-in-out infinite alternate;
  box-shadow: 0 4px 20px var(--shadow-dark);
}

.blob-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  overflow: hidden;
}

@keyframes blobAnim {
  0%, 100% {
    border-radius: 52% 48% 59% 41% / 53% 40% 60% 47%;
  }
  25% {
    border-radius: 60% 40% 50% 50% / 40% 60% 40% 60%;
  }
  50% {
    border-radius: 40% 60% 60% 40% / 50% 50% 40% 60%;
  }
  75% {
    border-radius: 52% 48% 59% 41% / 53% 40% 60% 47%;
  }
}

/* =============== BUTTONS =============== */
.button-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.number-btn,
.mail-btn,
.share-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.number-btn:hover,
.mail-btn:hover,
.share-btn:hover {
  background: var(--btn-bg-hover);
  transform: scale(1.05);
}

/* =============== LINKS =============== */
.social-links ul {
  list-style: none;
  padding: 0;
}

.link-item {
  margin-bottom: 1rem;
  background: var(--btn-bg);
  border: 1px solid #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0 15px var(--shadow-light);
  transition: all 0.25s ease;
}

.link-item:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-5px);
  box-shadow: 0 0 25px var(--shadow-light-hover);
}

.link-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 1rem;
  gap: 1rem;
  color: var(--btn-text);
}

.link-wrapper a {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.link-wrapper .icon {
  margin-right: 1rem;
  transition: transform 0.3s ease;
}

.link-item:hover .icon {
  transform: scale(1.1);
}

.dots-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.link-item:hover .dots-btn {
  opacity: 1;
}

.dots-img {
  width: 24px;
  height: 24px;
}

/* =============== SHARE POPUP =============== */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.share-overlay.active {
  opacity: 1;
  visibility: visible;
}

.share-popup {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  padding: 32px;
  width: 90%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  transform: scale(0.8) translateY(40px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-overlay.active .share-popup {
  transform: scale(1) translateY(0);
}

.popup-header {
  margin-bottom: 24px;
}

.popup-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.9);
  margin-bottom: 8px;
}

.popup-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
}

.qr-container {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.qr-image {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.share-actions button {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-actions button:hover {
  transform: scale(1.1) translateY(-2px);
}

.share-actions button:active {
  transform: scale(0.95);
}

#shareBtn,
.share-btn {
  background: rgba(0, 149, 246, 0.9);
  color: white;
}

#shareBtn:hover,
.share-btn:hover {
  background: rgba(0, 149, 246, 1);
  box-shadow: 0 12px 40px rgba(0, 149, 246, 0.4);
}

#copyBtn,
#downloadBtn {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(0, 0, 0, 0.8);
}

#copyBtn:hover,
#downloadBtn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.hidden {
  display: none;
}

/* =============== DARK MODE TOGGLE =============== */
#dark-mode-toggle {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.1rem 0 1.5rem;
}

#theme-toggle {
  background: var(--bg-light);
  color: var(--text-light);
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.light-mode #theme-toggle {
  background: var(--bg-dark);
  color: var(--btn-text);
}

/* =============== RESPONSIVE TYPOGRAPHY =============== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.9rem;
  }

  .lead {
    font-size: 1rem;
  }

  h3 {
    font-size: 0.95rem;
  }

  small {
    font-size: 0.825rem;
  }

  .number-btn,
  .mail-btn,
  .share-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .share-popup {
    padding: 24px;
    margin: 20px;
  }

  .popup-title {
    font-size: 1.25rem;
  }
}
