:root {
  --color-bg: #111216;
  --color-header: #1d1f22;
  --color-text: #eaeaea;
  --color-accent: #66b2ff;
  --color-button-bg: #007bff;
  --color-button-hover: #0056b3;
  --color-footer: #aaa;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background 0.3s, color 0.3s;
}

header {
  background-color: var(--color-header);
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  transition: background 0.3s;
}

.theme-toggle {
  position: absolute;
  top: 1.2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--color-accent);
  padding: 0.2em 0.4em;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  z-index: 10;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: var(--color-accent);
  color: var(--color-header);
  box-shadow: 0 2px 8px #0002;
}

.theme-toggle:active {
  animation: rotateTheme 0.4s;
}

@keyframes rotateTheme {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

h1 {
  margin: 0;
  font-size: 2rem;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h2 {
  color: var(--color-accent);
  border-left: 4px solid var(--color-accent);
  padding-left: 0.5rem;
}

ul {
  margin-left: 1.5rem;
  list-style-type: disc;
}

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

a:hover {
  text-decoration: underline;
}

a.button {
  display: inline-block;
  margin-top: 1rem;
  background-color: var(--color-button-bg);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}

a.button:hover {
  background-color: var(--color-button-hover);
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--color-footer);
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in:nth-of-type(2) {
  animation-delay: 0.1s;
}

.fade-in:nth-of-type(3) {
  animation-delay: 0.2s;
}

.fade-in:nth-of-type(4) {
  animation-delay: 0.3s;
}

.fade-in:nth-of-type(5) {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}

body.light {
  --color-bg: #f5f7fa;
  --color-header: #e2e6ed;
  --color-text: #222;
  --color-accent: #007bff;
  --color-button-bg: #007bff;
  --color-button-hover: #0056b3;
  --color-footer: #555;
}

.card {
  background: #181a1f;
  border-radius: 14px;
  box-shadow: 0 2px 16px #0002;
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  transition: background 0.3s, box-shadow 0.3s;
}

body.light .card {
  background: #fff;
  box-shadow: 0 2px 16px #0001;
}

.icon {
  margin-right: 0.5em;
  font-size: 1.2em;
  vertical-align: middle;
}

.card h2 {
  /* убрать цветную черту */
  border-left: none;
  padding-left: 0;
  display: flex;
  align-items: center;
}

@media (max-width: 600px) {
  .theme-toggle {
    top: 0.7rem;
    right: 0.7rem;
    font-size: 1.5rem;
    padding: 0.1em 0.2em;
  }

  .card {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 400px) {
  .theme-toggle {
    top: 0.3rem;
    right: 0.3rem;
  }
}

html {
  scroll-behavior: smooth;
}