/* Modern Design System Tokens */
:root {
  /* Common Tokens */
  --font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --transition-speed: 0.3s;
  --transition-cubic: cubic-bezier(0.4, 0, 0.2, 1);

  /* Light Theme Palette */
  --bg-color: #f6f6f9;
  --text-primary: #18181b;
  --text-secondary: #4b5563;
  --text-muted: #8b5cf6; /* A refined purple accent color for highlights */
  --text-body-muted: #9ca3af;
  
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.6);
  --card-shadow: rgba(31, 38, 135, 0.04);
  
  --pic-border: #ffffff;
  --pic-shadow: rgba(0, 0, 0, 0.06);

  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-border: rgba(0, 0, 0, 0.04);
  --btn-text: #1f2937;
  --btn-hover-bg: #ffffff;
  --btn-hover-border: rgba(139, 92, 246, 0.3); /* Subtle purple glow on hover */
  --btn-hover-shadow: rgba(139, 92, 246, 0.08);
  --btn-icon-color: #6b7280;
  --btn-icon-hover: #8b5cf6;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Theme Palette */
    --bg-color: #0b0b0d;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #a78bfa; /* Soft purple accent for dark mode */
    --text-body-muted: #52525b;

    --card-bg: rgba(18, 18, 22, 0.65);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-shadow: rgba(0, 0, 0, 0.4);

    --pic-border: rgba(255, 255, 255, 0.08);
    --pic-shadow: rgba(0, 0, 0, 0.3);

    --btn-bg: rgba(30, 30, 35, 0.5);
    --btn-border: rgba(255, 255, 255, 0.03);
    --btn-text: #e4e4e7;
    --btn-hover-bg: rgba(40, 40, 48, 0.8);
    --btn-hover-border: rgba(167, 139, 250, 0.3);
    --btn-hover-shadow: rgba(167, 139, 250, 0.1);
    --btn-icon-color: #9ea3ae;
    --btn-icon-hover: #a78bfa;
  }
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("nnnoise.svg");
  opacity: 0.015;
  pointer-events: none;
  z-index: 9999;
}

/* Page container (handles full responsiveness and scroll) */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  position: relative;
  width: 100%;
}

/* Dynamic background glows */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  mix-blend-mode: multiply;
}

/* Light mode backgrounds */
.bg-glow::before {
  background: radial-gradient(circle, rgba(224, 231, 255, 0.9) 0%, rgba(224, 231, 255, 0) 70%);
  top: -10%;
  right: -5%;
}

.bg-glow::after {
  background: radial-gradient(circle, rgba(254, 226, 226, 0.7) 0%, rgba(254, 226, 226, 0) 70%);
  bottom: -10%;
  left: -5%;
}

/* Dark mode overrides for background glows */
@media (prefers-color-scheme: dark) {
  body::after {
    opacity: 0.025; /* Slightly higher contrast for noise in dark mode */
  }
  
  .bg-glow::before {
    background: radial-gradient(circle, rgba(67, 56, 202, 0.18) 0%, rgba(67, 56, 202, 0) 70%);
    mix-blend-mode: screen;
  }
  
  .bg-glow::after {
    background: radial-gradient(circle, rgba(127, 29, 29, 0.15) 0%, rgba(127, 29, 29, 0) 70%);
    mix-blend-mode: screen;
  }
}

/* Profile Card */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px var(--card-shadow);
  padding: 48px 36px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 10;
  transition: box-shadow var(--transition-speed) ease;
}

/* Profile Picture */
.profile-pic {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 4px solid var(--pic-border);
  box-shadow: 0 10px 25px var(--pic-shadow);
  overflow: hidden;
  margin-bottom: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1); /* Slight zoom for centering portrait */
  object-position: center 2px;
}

/* Profile Header Typography */
.profile-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.profile-header .role {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.profile-header .institution {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Links Container */
.links-container {
  width: 100%;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Interactive Link Button */
.link-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 16px;
  color: var(--btn-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-speed) var(--transition-cubic);
  position: relative;
}

/* Button Icon Styling */
.link-btn .icon {
  width: 20px;
  height: 20px;
  color: var(--btn-icon-color);
  margin-right: 14px;
  flex-shrink: 0;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) var(--transition-cubic);
}

/* Button Text */
.link-btn .btn-text {
  flex-grow: 1;
  text-align: left;
  line-height: 1.4;
}

/* Button Right Chevron Chevron */
.link-btn .arrow {
  width: 16px;
  height: 16px;
  color: var(--text-body-muted);
  opacity: 0.5;
  flex-shrink: 0;
  transition: all var(--transition-speed) var(--transition-cubic);
  transform: translateX(0);
}

/* Button Interactions */
.link-btn:hover {
  background-color: var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--btn-hover-shadow);
}

.link-btn:hover .icon {
  color: var(--btn-icon-hover);
  transform: scale(1.1);
}

.link-btn:hover .arrow {
  opacity: 1;
  color: var(--btn-icon-hover);
  transform: translateX(4px);
}

.link-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px var(--btn-hover-shadow);
}

/* Footer Styles */
.page-footer {
  margin-top: 48px;
  z-index: 10;
}

.page-footer p {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-body-muted);
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* Responsive Breakpoints & Viewport Fallbacks */
@media (max-width: 480px) {
  .page-container {
    padding: 40px 16px;
  }
  
  .profile-card {
    padding: 36px 24px;
    border-radius: 24px;
  }
  
  .profile-header h1 {
    font-size: 22px;
  }
  
  .profile-header .role {
    font-size: 14px;
  }
  
  .link-btn {
    padding: 14px 16px;
    font-size: 13.5px;
  }
}

/* Handle landscape viewports on tiny heights */
@media (max-height: 580px) and (orientation: landscape) {
  .page-container {
    padding: 24px 16px;
  }
  .profile-card {
    flex-direction: row;
    max-width: 700px;
    text-align: left;
    align-items: flex-start;
    padding: 28px;
  }
  .profile-pic {
    margin-bottom: 0;
    margin-right: 28px;
    width: 100px;
    height: 100px;
  }
  .profile-header {
    text-align: left;
  }
  .links-container {
    margin-top: 0;
  }
}
