/* 
 * CSS VARIABLES & THEME SETUP
 */
:root {
  /* Dark Theme (Default) */
  --bg-color: #0f0c14;
  --text-main: #f3eefc;
  --text-muted: #a09aaf;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(255, 255, 255, 0.1);

  /* Warm Purple Accent */
  --accent-color: #b088f9;
  --accent-glow: rgba(176, 136, 249, 0.3);

  /* Layout */
  --max-width: 480px;
  --border-radius: 16px;
  --transition-speed: 0.3s;

  /* External sans font */
  --font-sans:
    "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

/* Light Theme Overrides */
body.light-mode {
  --bg-color: #f3f2f9;
  --text-main: #2a2235;
  --text-muted: #655d70;

  /* Glass Card Style for Light Mode */
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.4);
  --card-hover: rgba(255, 255, 255, 0.85);

  /* Stronger Accent for Light Mode Contrast */
  --accent-color: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.25); /* More visible glow */
}

/* 
 * RESET & BASE STYLES
 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

  /* Set sans font & text anti-aliasing (hopefully, at least some ) */
  font-family: var(--font-sans);
  font-smooth: always;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -o-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
  position: relative;
  overflow-x: hidden;
  padding: 20px;
}

/* 
 * BACKGROUND EFFECTS (Grain & Gradients)
 */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07; /* Dark Mode default opacity */
  /* Inline SVG for noise to avoid external requests */
  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");
  transition: opacity var(--transition-speed) ease;
}

/* Enhance grain significantly in light mode to prevent "flat" look */
body.light-mode .noise-overlay {
  opacity: 0.15;
}

.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 120%; /* Taller to cover more */
  z-index: -1;
  background: radial-gradient(
    circle at 50% 20%,
    var(--accent-glow) 0%,
    transparent 65%
  );
  opacity: 0.6;
  pointer-events: none;
  transition:
    background var(--transition-speed) ease,
    opacity var(--transition-speed) ease;
}

/* Make the glow feel more "atmospheric" in light mode */
body.light-mode .ambient-glow {
  opacity: 0.8;
}

/* 
 * LAYOUT CONTAINER
 */
main {
  width: 100%;
  max-width: var(--max-width);
  z-index: 1; /* Sit above noise */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* 
 * HEADER SECTION
 */
header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: -10px;
  right: -10px;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.theme-toggle:hover {
  background-color: var(--card-hover);
  transform: rotate(15deg);
}

/* Hide the appropriate icon based on theme */
body:not(.light-mode) .icon-sun {
  display: none;
}
body.light-mode .icon-moon {
  display: none;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
  box-shadow: 0 4px 20px var(--accent-glow);
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

p.bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 80%;
}

/* 
 * DIVIDER STYLES
 */
.section-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 1rem 0 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--card-border);
}

.section-divider span {
  padding: 0 1rem;
  opacity: 0.8;
}

/* 
 * LINKS SECTION
 */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px); /* Glassmorphism */
  -webkit-backdrop-filter: blur(10px);
}

/* Light mode specific shadows for depth */
body.light-mode .link-card {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.02),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

/* Interaction States */
.link-card:hover {
  transform: translateY(-2px);
  background-color: var(--card-hover);
  border-color: var(--accent-color);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.link-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

/* TABLER ICONS STYLING */
.icon::before {
  font-family: "tabler-icons-300" !important;
  font-size: 28px;
  color: var(--text-main);
  transition: color 0.2s;
}

.link-card:hover .icon::before {
  color: var(--accent-color);
}

/* Special styling for Mastodon (Primary) */
.link-card.primary {
  border: 1px solid var(--accent-color);
  background: linear-gradient(
    135deg,
    rgba(176, 136, 249, 0.15),
    rgba(255, 255, 255, 0.05)
  );
}

/* Adjust primary card for light mode */
body.light-mode .link-card.primary {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.08),
    rgba(255, 255, 255, 0.4)
  );
}

.link-card.primary span {
  color: var(--accent-color);
  font-weight: 600;
}

/* Arrow Icon */
.arrow-icon::before {
  font-size: 24px;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.2s ease;
}

.link-card:hover .arrow-icon::before {
  opacity: 1;
  transform: translateX(0);
}

/* 
 * FOOTER
 */
footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition:
    border-color 0.2s,
    color 0.2s;
}

footer a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Accessibility: Focus States */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
}

/* Do confetti */
.confetti-btn {
  position: fixed;
  bottom: 10px;
  right: 5px;
  cursor: pointer;
  color: var(--accent-color);
  padding: 5px 15px 5px 15px;
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid transparent;
  z-index: 88888;
}
@media all and (max-width: 725px) {
  footer {
    margin-bottom: 50px;
  }
}
/* Do confetti */
