@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/open-sans-500.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/open-sans-700.woff2') format('woff2');
}

[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #f2f2f2;
  --subtext: #bbbbbb;
  --avatar-border: #555;
  --link-bg: #4ea4ff;
  --link-hover: #78c0ff;
  --link-icon-filter: invert(1);
  --theme-content: "🌘";
}

[data-theme="light"] {
  --bg: #f9f9f9;
  --text: #1a1a1a;
  --subtext: #555;
  --avatar-border: #ddd;
  --link-bg: #0077b5;
  --link-hover: #005582;
  --link-icon-filter: invert(0);
  --theme-content: "🌔";
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: background 0.5s, color 0.5s;
}

.card {
  text-align: center;
  width: 90%;
}

.avatar {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  border: 1px solid var(--avatar-border);
}

.links {
  list-style: none;
  padding: 0;
  margin: 4em 0;
  display: flex;
  justify-content: center;
}

.links li {
  display: inline;
  margin: 0 0 0 0.8em;
}

.links li:not(:first-child)::before {
  content: "|";
  vertical-align: top;
  color: var(--subtext);
  opacity: 0.5;
  margin-right: 0.8em;
}

h1 {
  margin: 0;
  font-size: 2em;
  font-weight: 700;
  letter-spacing: 0.1em;
}

p {
  margin: 8px 0 24px;
  color: var(--subtext);
  font-size: 1.3em;
  letter-spacing: 0.1em;
}

a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  transition: color 0.5s ease, opacity 0.5s ease;
  font-size: 1em;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.link-icon {
  width: 1.5em;
  height: 1.5em;
  display: inline-block;
  filter: var(--link-icon-filter);
}

.theme-btn {
  position: absolute;
  top: 1em;
  right: 1em;
  background: none;
  border: none;
  font-size: 2.5em;
  cursor: pointer;
}

.theme-btn .indicator::after {
    content: var(--theme-content);
}

.theme-btn .indicator.animate::after {
  animation: moon-animation 0.6s linear reverse;
  animation-direction: reverse;
}
[data-theme="dark"] .theme-btn .indicator.animate::after {
  animation: moon-animation 0.6s linear forwards;
}

@keyframes moon-animation {
  0% { content: '🌔'; }
  25% { content: '🌓'; }
  50% { content: '🌒'; }
  75% { content: '🌑 '; }
  100% { content: '🌘'; }
}

@media (max-width: 480px) {
  .card {
    padding: 36px 20px;
  }

  h1 {
    font-size: 1.5em;
  }

  .avatar {
    width: 250px;
    height: 250px;
  }

  .color-scheme-btn {
    font-size: 1.4em;
  }
}
