@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Playfair+Display:wght@600&display=swap');

:root {
  --bg-color: #FAFAFA;
  --text-color: #2C3E50;
  --card-bg: linear-gradient(to bottom, #f9fafa, #eef2f3);
  --link-color: #2980B9;
  --link-hover: #1c598f;
  --shadow: rgba(0, 0, 0, 0.04);
  --toggle-bg: #e0e0e0;
  --toggle-thumb: #ffffff;
  --toggle-shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --card-bg: linear-gradient(to bottom, #2a2a2a, #333333);
  --link-color: #64b5f6;
  --link-hover: #90caf9;
  --shadow: rgba(0, 0, 0, 0.3);
  --toggle-bg: #404040;
  --toggle-thumb: #666666;
  --toggle-shadow: rgba(255, 255, 255, 0.1);
}

body {
  z-index: 500;
  max-width: 960px;
  font-family: 'Inter', sans-serif;
  margin: 0 auto;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 1em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  user-select: none;
}

.toggle-track {
  width: 72px;
  height: 24px;
  background: var(--toggle-bg);
  border-radius: 12px;
  position: relative;
  display: flex;
  transition: background 0.3s ease;
  box-shadow: inset 0 1px 2px var(--toggle-shadow);
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.toggle-option:not(.active) {
  opacity: 0.5;
}

.toggle-option.active {
  opacity: 1;
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  background: var(--toggle-thumb);
  border-radius: 10px;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px var(--toggle-shadow);
}

.toggle-track[data-theme="system"] .toggle-thumb {
  transform: translateX(24px);
}

.toggle-track[data-theme="dark"] .toggle-thumb {
  transform: translateX(48px);
}

h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3em, 2.5vw, 1.6em);
  color: var(--text-color);
  margin-bottom: 0.5em;
}

main section {
  padding-top: 4em;
  display: flex;
  flex-flow: column wrap;
  justify-content: space-around;
  align-items: center;
}

main section div {
  background: var(--card-bg);
  color: var(--text-color);
  margin: 1em;
  padding: 1.5em;
  border-radius: 12px;
  box-shadow: 0 4px 10px var(--shadow);
  width: 90%;
  max-width: 280px;
  transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}

main section div:hover {
  transform: scale(1.05);
}

.profile-pic {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

#author {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
}

#author h3 {
  font-size: clamp(1.8em, 3vw, 2.2em);
  margin: 0.2em 0;
  letter-spacing: 1px;
}

#contact-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#contact-details ul li {
  padding: 0.5em 0 0.5em 32px;
  background-size: 20px;
  background-repeat: no-repeat;
  background-position: 0 4px;
  color: var(--text-color);
}

main a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

main a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

aside {
  display: none;
}

@media only screen and (min-width: 960px) {
  main section {
    flex-flow: row nowrap;
  }

  main section div {
    width: 28%;
    padding: 2em;
  }

  header h1 {
    text-align: center;
  }

  aside {
    display: block;
    font-family: monospace;
    position: absolute;
    bottom: 0;
    right: 0;
  }

  aside a {
    color: var(--link-color);
  }
}

@media only screen and (max-width: 959px) {
  main section {
    flex-direction: column;
    align-items: center;
  }

  main section div {
    width: 95%;
  }

  .theme-toggle {
    top: 15px;
    right: 15px;
  }

  .toggle-track {
    width: 60px;
    height: 20px;
  }

  .toggle-thumb {
    width: 16px;
    height: 16px;
  }

  .toggle-option {
    font-size: 10px;
  }

  .toggle-track[data-theme="system"] .toggle-thumb {
    transform: translateX(20px);
  }

  .toggle-track[data-theme="dark"] .toggle-thumb {
    transform: translateX(40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}