/* Прелоадер */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--darker-color) 0%, var(--dark-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  color: var(--light-color);
}

.logo-loader h1 {
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 30px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
  margin: 20px 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-text {
  font-size: 16px;
  color: var(--light-color);
  opacity: 0.8;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .logo-loader h1 {
    font-size: 32px;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
  }
  
  .loading-text {
    font-size: 14px;
  }
  
  header {
    flex-direction: column;
    padding: 15px 10px;
  }
  
  nav {
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  nav a {
    font-size: 14px;
    padding: 4px 8px;
  }
  
  .theme-switch {
    margin-top: 10px;
  }
  
  .banner, .post {
    margin: 20px auto;
    padding: 30px 15px;
  }
  
  .banner h1 {
    font-size: 28px;
  }
  
  .post h1 {
    font-size: 24px;
  }
  
  .post img {
    max-width: 95%;
  }
  
  footer {
    padding: 15px 0;
    margin-top: 20px;
  }
  
  .social-links {
    gap: 15px;
    padding: 15px 0;
  }
  
  .footer-links {
    gap: 15px;
    margin: 2.5px 0;
  }
  
  .footer-links a {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  footer p {
    font-size: 11px;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 20px 3%;
  }
  
  .banner, .post {
    padding: 20px 10px;
  }
  
  .banner h1 {
    font-size: 24px;
  }
  
  .post h1 {
    font-size: 20px;
  }
  
  nav a {
    font-size: 12px;
    padding: 3px 6px;
  }
  
  .theme-switch span {
    font-size: 12px;
  }
  
  .footer-links {
    gap: 10px;
    margin: 1.5px 0;
  }
  
  .footer-links a {
    font-size: 11px;
    padding: 3px 6px;
  }
  
  footer p {
    font-size: 10px;
    margin-top: 6px;
  }
}

/* style.css */
:root {
  --primary-color: #38cadd;
  --secondary-color: #6a11cb;
  --accent-color: #e62ecd;
  --dark-color: #0a0a11; /* затемнено */
  --darker-color: #07070c; /* затемнено */
  --light-color: #f0f0f0;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.18);
  --header-height: 72px;
}

[data-theme="light"] {
  --dark-color: #f5f7ff;
  --darker-color: #eaf0ff;
  --light-color: #0b1120;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

html {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--darker-color) 0%, var(--dark-color) 100%);
  color: var(--light-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Aurora background */
.aurora { 
  position: fixed; 
  inset: 0; 
  pointer-events: none; 
  filter: blur(60px) saturate(110%) brightness(0.95); 
  mix-blend-mode: screen; 
  z-index: 0; 
  display: block;
}
.blob { 
  position: absolute; 
  width: 80vmax; 
  height: 80vmax; 
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.6), transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(6,182,212,.6), transparent 55%),
              radial-gradient(circle at 50% 50%, rgba(244,114,182,.5), transparent 55%);
  animation: float 42s linear infinite;
  cursor: grab;
  pointer-events: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
  display: block;
  opacity: 1;
  filter: brightness(1.2) saturate(1.3);
}
.blob:active { 
  cursor: grabbing; 
  transform: scale(1.1);
  filter: brightness(1.2) saturate(1.3);
}
.blob:nth-child(2) { transform: translate(45vw, -15vh) scale(.9); animation-duration: 46s; }
.blob:nth-child(3) { transform: translate(-35vw, 40vh) scale(1.2); animation-duration: 52s; }
@keyframes float { 0% { transform: translate(-20vw, -10vh) scale(1);} 50% { transform: translate(20vw, 15vh) scale(1.08);} 100% { transform: translate(-20vw, -10vh) scale(1);} }

/* Взрыв звезды */
@keyframes starExplosion {
  0% { 
    transform: scale(1); 
    opacity: 1; 
    filter: brightness(1);
  }
  50% { 
    transform: scale(2.5); 
    opacity: 0.8; 
    filter: brightness(2) hue-rotate(60deg);
  }
  100% { 
    transform: scale(4); 
    opacity: 0; 
    filter: brightness(3) hue-rotate(120deg);
  }
}

.star-exploding {
  animation: starExplosion 0.8s ease-out forwards;
}

/* vivid режим убран (эффект по умолчанию достаточно насыщенный) */

#space { position: fixed; inset: 0; z-index: 10; pointer-events: auto; }

/* Elevate content above background */
header, main, footer { position: relative; z-index: 2; }

header {
  padding: 10px 5%;
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.1);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
}

a {
  text-decoration: none;
}

header h1 {
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0;
  padding: 0;
}

.spacer {
  flex-grow: 1;
}

nav {
  display: flex;
  gap: 15px;
}

nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--light-color);
  padding: 6px 12px;
  border-radius: 50px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* убраны остатки стилей кнопок в навигации */

nav img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

main {
  padding: 30px 5%;
}

/* Убираем лишний нижний зазор после последнего блока */
main > *:last-child { margin-bottom: 0; }

.banner {
  text-align: center;
  padding: 50px 20px;
  margin: 30px auto;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* отступ для якорной прокрутки */
.banner, .post, #updates { scroll-margin-top: calc(var(--header-height) + 10px); }

.banner h1 {
  font-size: 42px;
  margin-bottom: 15px;
}

.banner p {
  font-size: 18px;
  max-width: 700px;
  margin: 0 auto;
}

.post {
  text-align: center;
  padding: 40px 20px;
  margin: 40px auto;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.post h1 {
  font-size: 36px;
  margin-bottom: 20px;
}

.post img {
  border-radius: 15px;
  max-width: 90%;
  height: auto;
  margin: 15px 0;
}

.post iframe {
  border-radius: 15px;
  border: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.post h3 {
  font-size: 28px;
  color: var(--accent-color);
  margin: 15px 0;
}

footer {
  background: var(--glass);
  text-align: center;
  padding: 10px 0; /* компактнее */
  margin-top: 30px; /* меньше отступ сверху */
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(12px) saturate(1.1);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}

footer p {
  font-size: 12px;
  margin-top: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 4px 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--light-color);
  text-decoration: none;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.footer-links a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
}

.social-links a {
  display: inline-block;
  width: 40px;
  height: 40px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-links img {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 10px;
  }

  nav {
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .banner h1 {
    font-size: 32px;
  }

  .banner p {
    font-size: 16px;
  }
}

.social-links a {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

a > p {
  color: #f0f0f0;
}

/* Переключатель темы */
.theme-switch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; backdrop-filter: blur(6px); }
.theme-switch input { width: 34px; height: 18px; appearance: none; background: rgba(255,255,255,.25); border-radius: 999px; position: relative; outline: none; cursor: pointer; transition: background .2s ease; }
.theme-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.theme-switch input:checked { background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)); }
.theme-switch input:checked::after { transform: translateX(16px); }
.theme-switch span { font-size: 14px; color: var(--light-color); }

/* Контраст в светлой теме для header/footer/nav */
[data-theme="light"] header { background: rgba(255, 255, 255, 0.65); border-bottom-color: rgba(0,0,0,.06); }
[data-theme="light"] footer { background: rgba(255, 255, 255, 0.65); border-top-color: rgba(0,0,0,.06); }
[data-theme="light"] body {
  background:
    radial-gradient(900px 700px at 70% -10%, rgba(124,58,237,0.45) 0%, transparent 60%),
    radial-gradient(900px 700px at -10% 80%, rgba(6,182,212,0.38) 0%, transparent 55%),
    linear-gradient(180deg, var(--dark-color) 0%, var(--darker-color) 100%);
}
[data-theme="light"] .aurora { 
  display: block; 
  filter: blur(80px) saturate(120%) brightness(1.1); 
  mix-blend-mode: multiply;
}
[data-theme="light"] .blob {
  background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.3), transparent 55%),
              radial-gradient(circle at 70% 60%, rgba(6,182,212,.3), transparent 50%),
              radial-gradient(circle at 50% 50%, rgba(244,114,182,.2), transparent 50%);
  opacity: 0.8;
}
[data-theme="light"] nav a { color: #0b1120; }
[data-theme="light"] nav img { filter: brightness(0) invert(0); }
[data-theme="light"] .social-links img { filter: brightness(0) invert(0); }
[data-theme="light"] header h1 { color: #0b1120; background: none; -webkit-background-clip: initial; background-clip: initial; }
[data-theme="light"] .theme-switch { border-color: rgba(0,0,0,.15); }
[data-theme="light"] .theme-switch span { color: #0b1120; }
[data-theme="light"] footer p { color: #0b1120; }
[data-theme="light"] .banner h1, [data-theme="light"] .post h1, [data-theme="light"] .banner p, [data-theme="light"] .post p, [data-theme="light"] .post h3 { color: #0b1120; }

/* 3D стекло */
.glass3d {
  --filter-glass3d: blur(3px) brightness(1) saturate(1.5);
  --color-glass3d: hsl(189 80% 10% / 0.2);
  --noise-glass3d: none;
  position: relative;
  z-index: 4;
  box-shadow:
    0 0 0.75px hsl(205 20% 10% / 0.2),
    0.7px 0.8px 1.2px -0.4px hsl(205 20% 10% / 0.1),
    1.3px 1.5px 2.2px -0.8px hsl(205 20% 10% / 0.1),
    2.3px 2.6px 3.9px -1.2px hsl(205 20% 10% / 0.1),
    3.9px 4.4px 6.6px -1.7px hsl(205 20% 10% / 0.1),
    6.5px 7.2px 10.9px -2.1px hsl(205 20% 10% / 0.1),
    8px 9px 14px -2.5px hsl(205 20% 10% / 0.2);
}
.glass3d::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  z-index: 3;
  -webkit-backdrop-filter: var(--filter-glass3d);
  backdrop-filter: var(--filter-glass3d);
  background-color: var(--color-glass3d);
  background-image: var(--noise-glass3d);
  background-size: 100px;
  background-repeat: repeat;
}
.glass3d::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  z-index: 5;
  box-shadow:
    inset 2px 2px 1px -3px hsl(205 20% 90% / 0.8),
    inset 4px 4px 2px -6px hsl(205 20% 90% / 0.3),
    inset 1.5px 1.5px 1.5px -0.75px hsl(205 20% 90% / 0.15),
    inset 1.5px 1.5px 0.25px hsl(205 20% 90% / 0.03),
    inset 0 0 0.25px 0.5px hsl(205 20% 90% / 0.03);
}
.glass3d > * { position: relative; z-index: 6; }

/* Glassmorphism */
.glass {
  position: relative;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 30px rgba(0,0,0,.2);
  isolation: isolate;
  transition: transform .4s ease, box-shadow .4s ease, background .4s ease;
  overflow: hidden; /* clip inner glow pseudo-element */
}
.glass::before {
  content: "";
  position: absolute; inset: -200% -50%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.2) 50%, transparent 70%);
  transform: rotate(8deg) translate3d(-30%, -20%, 0);
  opacity: .25; pointer-events: none;
}
.glass:hover { box-shadow: 0 10px 60px rgba(0,0,0,.25); }
.glass:hover::before { transform: rotate(8deg) translate3d(-20%, -15%, 0); }


/* Custom cursor */
.cursor { position: fixed; width: 24px; height: 24px; border-radius: 999px; border: 2px solid rgba(255,255,255,.9); mix-blend-mode: difference; pointer-events: none; z-index: 1000; transform: translate(-50%, -50%); transition: width .2s ease, height .2s ease, border-color .2s ease, opacity .3s ease; opacity: .9; }
.cursor.active { width: 36px; height: 36px; }
.cursor.hide { opacity: 0; }
