:root {
  --bg: #070a12;
  --bg-2: #0c1324;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --text-muted: #a9b3c7;
  --line: rgba(255, 255, 255, 0.18);
  --accent: #6fd3ff;
  --accent-2: #7f89ff;
  --accent-3: #9d8dff;
  --success: #68f2c0;
  --shadow-lg: 0 20px 60px rgba(5, 10, 30, 0.55);
  --shadow-md: 0 10px 30px rgba(5, 10, 30, 0.45);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1120px;
  --ease: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -20%, #1e2f62 0%, transparent 60%),
    radial-gradient(1000px 500px at 95% 5%, #1d2955 0%, transparent 56%),
    linear-gradient(160deg, var(--bg), var(--bg-2) 50%, #070910 100%);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--container), calc(100% - 2.5rem));
  margin-inline: auto;
}

.bg-orb {
  position: fixed;
  width: 34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(34px);
  z-index: -3;
  opacity: 0.35;
  pointer-events: none;
}

.orb-1 {
  top: -10rem;
  left: -8rem;
  background: radial-gradient(circle at 40% 40%, var(--accent), transparent 70%);
}

.orb-2 {
  right: -12rem;
  bottom: -8rem;
  background: radial-gradient(circle at 50% 50%, var(--accent-3), transparent 68%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
  mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
  z-index: -2;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 10;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

.brand {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}


.hero {
  padding: 6.5rem 0 4.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.77rem;
  color: var(--text-muted);
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 1rem 0 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
}

.btn-primary {
  margin-top: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(100deg, rgba(111, 211, 255, 0.25), rgba(127, 137, 255, 0.22));
  box-shadow: 0 12px 24px rgba(27, 66, 130, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-weight: 600;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 18px 30px rgba(33, 81, 160, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.section {
  padding: 2.5rem 0 1.5rem;
}

h2 {
  margin: 0 0 1rem;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.glass-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 40%);
  pointer-events: none;
}

.about-card {
  padding: 1.35rem 1.35rem 1.45rem;
  max-width: 860px;
  color: #d7def0;
}

.about-card > p {
  margin: 0 0 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.about-block {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.9rem;
}

.about-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  color: #eef4ff;
}

.about-list {
  margin: 0;
  padding-left: 1rem;
  color: #cdd7ee;
}

.about-list li {
  margin-bottom: 0.3rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(104, 242, 192, 0.32);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: #bff5e3;
  background: rgba(104, 242, 192, 0.12);
  font-size: 0.83rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  grid-column: span 6;
  padding: 1.25rem;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.project-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(111, 211, 255, 0.5);
  box-shadow: 0 24px 45px rgba(9, 25, 58, 0.62), 0 0 25px rgba(111, 211, 255, 0.1);
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

h3 {
  margin: 0;
  font-size: 1.2rem;
}

.status {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
}

.status.in-progress {
  color: #d8ecff;
  background: rgba(109, 163, 255, 0.2);
  border: 1px solid rgba(109, 163, 255, 0.4);
}

.project-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.project-points {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: #d3dbef;
}

.project-points li {
  margin-bottom: 0.45rem;
}

.project-link {
  color: var(--accent);
  font-weight: 600;
  transition: text-shadow var(--ease), opacity var(--ease);
}

.project-link:hover {
  text-shadow: 0 0 15px rgba(111, 211, 255, 0.65);
  opacity: 0.95;
}

.contacts-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.8rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 211, 255, 0.4);
  background: rgba(111, 211, 255, 0.1);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--accent);
  font-weight: 700;
}

.icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.reveal {
  --reveal-y: 26px;
  --reveal-scale: 0.98;
  --scroll-y: 0px;
  --scroll-scale: 1;
  opacity: 0;
  transform: translateY(var(--reveal-y)) scale(var(--reveal-scale));
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(var(--scroll-y)) scale(var(--scroll-scale));
}

.reveal-fade {
  --reveal-y: 0px;
  --reveal-scale: 1;
}

.reveal-fade.is-visible {
  --scroll-y: 0px;
  --scroll-scale: 1;
}

.reveal-slide {
  --reveal-y: 38px;
  --reveal-scale: 1;
}

.reveal-scale {
  --reveal-y: 0px;
  --reveal-scale: 0.95;
}

.scroll-zoom.is-visible {
  transition: transform 120ms linear, opacity 700ms ease;
}

.lang-picker {
  width: 100%;
  margin: 0;
  padding: 10px 12px; 
  box-sizing: border-box;
  

  background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  

  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 30px;
}


.lang-picker:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}


.lang-picker option {
  background: #1e293b; 
  color: white;
  padding: 10px;
}


@media (max-width: 960px) {
  .project-card {
    grid-column: span 12;
  }

  .contacts-wrap {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .container {
    width: min(var(--container), calc(100% - 1.3rem));
  }

  .site-header {
    top: 0.5rem;
    padding: 0.75rem 0.8rem;
    gap: 0.5rem; 
    flex-wrap: nowrap; 
    justify-content: space-between;
    align-items: center;
  }

  .brand {
    font-size: 1.1rem; 
  }

  .hero {
    padding-top: 4.8rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .contacts-wrap {
    grid-template-columns: 1fr;
  }
}


@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}


.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2001;
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.dot { width: 4px; height: 4px; background: white; border-radius: 50%; }


.menu-overlay {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  left: auto !important;
  width: 280px;
  height: auto; 
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000;
  pointer-events: none;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.menu-card {
  background: rgba(15, 23, 42, 0.8);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}


.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav a {
  font-size: 1.2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: white;
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  transition: 0.3s;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #6fd3ff;
}


.lang-scroll-area {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}


.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav a {
  font-size: 1.25rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: white;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 12px;
  transition: 0.2s;
  text-align: left;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  padding-left: 1.2rem;
  color: #6fd3ff;
}


.lang-scroll-area {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

/* Контейнер для выравнивания */
.lang-container {
  display: flex;
  align-items: center;
  margin-left: 1.5rem;
}

/* Стилизация выпадающего списка */
.lang-picker {
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 6px 28px 6px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 0.2s ease;
}

.lang-picker:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-picker option {
  background: #0f172a; /* Темный фон для выпадающего списка в Windows */
  color: #fff;
}

/* --- Tech Stack Section --- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.tech-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  text-align: center;
  font-weight: 600;
  color: #d8ecff;
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
  text-decoration: none; /* For <a> tags */
  cursor: pointer;
}

.tech-card:hover {
  transform: translateY(-4px);
  border-color: rgba(111, 211, 255, 0.4);
  background: rgba(111, 211, 255, 0.1);
  color: #fff;
}

/* --- Workflow Section --- */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.workflow-card {
  padding: 1.25rem;
  transition: transform var(--ease);
}

.workflow-card:hover {
  transform: translateY(-4px);
}

.workflow-card h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1.1rem;
}

.workflow-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Project Page Updates --- */
.read-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.hide-details-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  padding-bottom: 2rem;
}

.details-hidden {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.details-hidden.expanded {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-tech {
  color: var(--accent-2);
  font-size: 0.9rem;
  margin-bottom: 0.5rem !important;
  font-weight: 500;
}

/* Project Details Layout with Sidebar */
.details-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

.details-sidebar {
  position: sticky;
  top: 6rem;
}

.toc {
  padding: 1rem;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  display: block;
  padding: 0.4rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toc a:hover, .toc a.active {
  color: var(--accent);
  background: rgba(111, 211, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .details-layout {
    grid-template-columns: 1fr;
  }
  .details-sidebar {
    display: none; /* Hide sidebar on mobile for simplicity, or make it horizontal */
  }
}

/* Anchor offset for fixed header */
:target {
  scroll-margin-top: 6rem; 
}

/* Stack Items in Project Page */
.stack-item {
  padding: 0.85rem;
  display: grid;
  gap: 0.3rem;
  text-decoration: none; /* For <a> tags */
  transition: transform var(--ease), background var(--ease), border-color var(--ease);
  cursor: pointer;
}

.stack-item:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(111, 211, 255, 0.3);
}

.stack-item strong {
  font-size: 0.94rem;
  color: #eef4ff;
}

.stack-item span {
  font-size: 0.85rem;
  color: #d0daef;
}
