@import url('https://fonts.googleapis.com/css2?family=Alegreya&family=Montserrat&family=UnifrakturCook&display=swap');

:root {
  --bg-gradient-start: #dfd4ff;
  --bg-gradient-end: #b28eff;
  --text-color: #311d65;
  --accent-color: #9c6bff;
  --accent-color-light: #c8aaff;
  --button-bg: #d9c9f8;
  --button-color: #4a3387;
  --button-bg-active: #9c6bff;
  --button-color-active: #fff;
  --shadow-color: #9c6bff33;
  --border-color: #9c6bff;
}

body {
  background: radial-gradient(ellipse at top, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-color);
  font-family: 'Alegreya', serif;
  font-size: 1.15rem;
  line-height: 1.65;
  margin: 0;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  position: relative;
}

#theme-switcher {
  position: fixed;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  width: 160px;
  font-family: 'Montserrat', sans-serif;
  user-select: none;
  z-index: 1000;
}

#theme-switcher button,
#theme-switcher button[data-back-button] {
  padding: 0.5em 1em;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid var(--accent-color);
  background: var(--button-bg);
  color: var(--accent-color);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

#theme-switcher button.active,
#theme-switcher button:hover,
#theme-switcher button:focus-visible,
#theme-switcher button[data-back-button]:hover,
#theme-switcher button[data-back-button]:focus-visible {
  background-color: var(--button-bg-active);
  color: var(--button-color-active);
  outline: none;
}

body.theme-dark {
  --button-bg: #3a2c68;
  --accent-color: #67d1ff;
  --button-bg-active: #67d1ff;
  --button-color-active: #1e1f2f;
  background: radial-gradient(ellipse at top, #241a49 0%, #312159 100%);
  color: #c9dcff;
}

body.theme-contrast {
  --button-bg: #fff;
  --accent-color: #000;
  --button-bg-active: #000;
  --button-color-active: #fff;
  background: #fff;
  color: #000;
}

header {
  background: var(--button-bg);
  padding-left: 180px;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-color);
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-family: 'UnifrakturCook', serif;
  color: var(--accent-color);
}

main {
  max-width: 900px;
  margin: auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Секции с отступами */
section {
  margin-bottom: 2.5rem;
}

.lfd-intro p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.lfd-timeline ul {
  list-style: none;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-color);
}

.lfd-timeline li {
  padding-left: 0.7rem;
  margin-bottom: 0.7rem;
  font-weight: 600;
  cursor: default;
  transition: color 0.3s ease;
}

.lfd-timeline li:hover {
  color: var(--button-bg-active);
}

.lfd-projects .project-list {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.project-item {
  background-color: var(--button-bg);
  border-radius: 12px;
  padding: 1rem 1.3rem;
  box-shadow: 0 0 10px var(--shadow-color);
  border: 2px solid var(--accent-color-light);
  transition: background-color 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
  user-select: none;
}

.project-item:hover,
.project-item:focus-within {
  background-color: var(--accent-color);
  border-color: var(--button-bg-active);
  color: var(--button-color-active);
  outline: none;
}

.project-item h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-family: 'UnifrakturCook', serif;
}

.project-item p {
  margin: 0;
  font-style: italic;
}

/* Адаптив */
@media (max-width: 600px) {
  header {
    padding-left: 0;
  }

  #theme-switcher {
    position: static;
    flex-direction: row;
    width: auto;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .lfd-projects .project-list {
    flex-direction: column;
  }
}

/* Декоративный "пузырьковый" фон справа снизу */
#floating-layers {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 0;
}

#floating-layers::before,
#floating-layers::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--accent-color-light);
  opacity: 0.2;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

#floating-layers::before {
  width: 80px;
  height: 80px;
  bottom: 10px;
  right: 20px;
  animation-name: floatUpDown1;
  animation-duration: 4.5s;
  animation-direction: alternate;
  filter: drop-shadow(0 0 5px var(--accent-color));
}

#floating-layers::after {
  width: 120px;
  height: 120px;
  bottom: 20px;
  right: 100px;
  animation-name: floatUpDown2;
  animation-duration: 6s;
  animation-direction: alternate;
  filter: drop-shadow(0 0 8px var(--accent-color));
}

@keyframes floatUpDown1 {
  0% { transform: translateY(0); }
  100% { transform: translateY(-15px); }
}

@keyframes floatUpDown2 {
  0% { transform: translateY(0); }
  100% { transform: translateY(-25px); }
}
