/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */

/* Light Theme (Default) */
:root,
[data-theme="light"] {
  /* Colors */
  --color-primary: #0540F2;
  --color-dark: #052159;
  --color-medium: #0F41A6;
  --color-accent: #1D64F2;
  --color-light: #F2F2F2;

  /* Theme-specific colors */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-tertiary: #F5F5F5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #6a6a6a;
  --border-color: #E0E0E0;
  --logo-bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --card-hover-bg: #F8F9FA;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 8px 32px rgba(5, 64, 242, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  --gradient-bg: linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
}

/* Dark Theme */
[data-theme="dark"] {
  /* Theme-specific colors */
  --bg-primary: #0a1628;
  --bg-secondary: #0d1b2e;
  --bg-tertiary: rgba(242, 242, 242, 0.05);
  --text-primary: #F2F2F2;
  --text-secondary: rgba(242, 242, 242, 0.8);
  --text-tertiary: rgba(242, 242, 242, 0.6);
  --border-color: rgba(242, 242, 242, 0.1);
  --logo-bg: #FFFFFF;
  --card-bg: rgba(242, 242, 242, 0.05);
  --card-hover-bg: rgba(242, 242, 242, 0.08);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(5, 64, 242, 0.1);
  --shadow-md: 0 4px 16px rgba(5, 64, 242, 0.15);
  --shadow-lg: 0 8px 32px rgba(5, 64, 242, 0.2);
  --shadow-hover: 0 0 40px rgba(29, 100, 242, 0.4);

  /* Gradients */
  --gradient-bg: linear-gradient(135deg, #0a1628 0%, var(--color-dark) 50%, var(--color-medium) 100%);
}

/* Common Variables */
:root {
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background var(--transition-base), color var(--transition-base);
}

/* Animated Background Elements (Dark Theme Only) */
[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

[data-theme="dark"] body::before {
  width: 500px;
  height: 500px;
  background: var(--color-primary);
  top: -250px;
  right: -250px;
  animation-delay: 0s;
}

[data-theme="dark"] body::after {
  width: 400px;
  height: 400px;
  background: var(--color-accent);
  bottom: -200px;
  left: -200px;
  animation-delay: 10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
  transition: transform var(--transition-base);
}

.theme-toggle:hover .theme-icon {
  transform: rotate(15deg);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   HEADER SECTION
   ============================================ */
header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.profile-container {
  position: relative;
  display: inline-block;
  margin-bottom: var(--spacing-md);
}

.profile-image-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  padding: 4px;
  background: var(--gradient-primary);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(29, 100, 242, 0.7);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 10px rgba(29, 100, 242, 0);
  }
}

.profile-image-wrapper figure {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-secondary);
}

.profile-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-info p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: 400;
}

/* ============================================
   MAIN CONTENT & NAVIGATION
   ============================================ */
main {
  animation: fadeIn 0.8s ease-out 0.4s backwards;
}

nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Link Cards */
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-base);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .link-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hover gradient effect (dark theme only) */
[data-theme="dark"] .link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

[data-theme="dark"] .link-card:hover::before {
  opacity: 0.1;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-hover);
  background: var(--card-hover-bg);
}

.link-card:active {
  transform: translateY(-2px);
}

/* Link Card Image - RECTANGULAR DESIGN */
.link-card figure {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--logo-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
  border: 1px solid var(--border-color);
}

.link-card:hover figure {
  transform: scale(1.05);
}

.link-card figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 12px;
}

/* Link Card Content */
.link-card-content {
  flex: 1;
  min-width: 0;
}

.link-card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.link-card-description {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Arrow Icon */
.link-card-arrow {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  opacity: 0.5;
  transition: all var(--transition-base);
  color: var(--text-secondary);
}

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

/* ============================================
   FOOTER
   ============================================ */
footer {
  text-align: center;
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  animation: fadeIn 0.8s ease-out 0.6s backwards;
}

footer a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  :root {
    --font-size-2xl: 1.75rem;
    --font-size-xl: 1.25rem;
    --spacing-xl: 2rem;
  }

  .container {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .profile-image-wrapper {
    width: 100px;
    height: 100px;
  }

  .link-card {
    padding: var(--spacing-sm);
  }

  .link-card figure {
    width: 100px;
    height: 66px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
  }

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

  [data-theme="dark"] body::before,
  [data-theme="dark"] body::after {
    filter: blur(80px);
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-2xl: 1.5rem;
    --font-size-xl: 1.125rem;
    --font-size-lg: 1rem;
  }

  .link-card figure {
    width: 80px;
    height: 53px;
  }

  .link-card-description {
    display: none;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .link-card {
    border-width: 2px;
  }

  .theme-toggle {
    border-width: 3px;
  }
}