﻿:root {
  --bg-900: #090517;
  --bg-850: #130b2a;
  --bg-800: #1e123f;
  --surface: rgba(26, 18, 58, 0.76);
  --surface-strong: rgba(29, 21, 65, 0.92);
  --line: rgba(169, 147, 255, 0.24);
  --text: #f2edff;
  --muted: #b9aed6;
  --accent: #8d6cff;
  --accent-2: #b59eff;
  --shadow: 0 24px 56px rgba(5, 2, 15, 0.58);
  --radius-lg: 20px;
  --radius-md: 14px;
  --header-h: 78px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(980px 520px at 6% 5%, rgba(179, 128, 255, 0.18), transparent 62%),
    radial-gradient(860px 500px at 94% 18%, rgba(114, 102, 255, 0.16), transparent 62%),
    linear-gradient(148deg, var(--bg-900), var(--bg-850) 45%, var(--bg-800));
}

body.modal-open {
  overflow: hidden;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.container { width: min(1120px, 92vw); margin-inline: auto; }
.section { position: relative; padding: clamp(58px, 10vw, 104px) 0; }

#tech-stack { scroll-margin-top: calc(var(--header-h) + 6px); }
.portfolio { min-height: calc(100svh - var(--header-h)); padding-bottom: clamp(120px, 16vw, 220px); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100%;
  z-index: 200;
  background: var(--accent);
  color: #120a2a;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
}

.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 5, 20, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.navbar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand { display: grid; gap: 2px; }
.brand-latin { font-family: "Space Grotesk", "Sora", sans-serif; font-size: 1.05rem; font-weight: 700; }
.brand-latin em { font-style: normal; color: var(--accent); }
.brand-cyrillic { font-size: 0.72rem; color: var(--muted); }

.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

.nav-list {
  width: 100%;
  display: none;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
}

.nav-list.is-open { display: flex; }

.nav-list a { padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav-list a:hover,
.nav-list a:focus-visible,
.nav-list a.is-active { color: var(--text); background: rgba(152, 122, 255, 0.16); }

.language-switch {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lang-btn {
  border: 1px solid var(--line);
  background: rgba(22, 15, 46, 0.7);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.is-active {
  color: var(--text);
  border-color: rgba(150, 122, 255, 0.65);
  box-shadow: inset 0 -2px 0 rgba(150, 122, 255, 0.92);
}

.hero { overflow: clip; }
.bg-glow { position: absolute; width: 360px; height: 360px; pointer-events: none; }
.bg-glow-left { left: -130px; top: 0; background: radial-gradient(circle, rgba(174, 128, 255, 0.34), transparent 70%); }
.bg-glow-right { right: -120px; bottom: 2%; background: radial-gradient(circle, rgba(123, 106, 255, 0.3), transparent 72%); }

.hero-grid,
.about-grid,
.stats-grid,
.cards-grid,
.contact-wrap {
  display: grid;
  gap: 16px;
}

.hero-copy,
.hero-interactive,
.about-card,
.profile-card,
.empty-state,
.item-card,
.contact-wrap,
.modal-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-interactive,
.about-card,
.profile-card,
.contact-wrap { padding: 24px; }

.kicker {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 { font-family: "Space Grotesk", "Sora", sans-serif; font-size: clamp(2rem, 5.5vw, 3.8rem); line-height: 1.04; }
h1 span { color: var(--accent); }
.hero-copy p { color: var(--muted); line-height: 1.72; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { border-radius: 12px; border: 1px solid transparent; padding: 10px 14px; font-weight: 700; transition: transform 0.16s ease; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(90deg, #8b6dff, #b67bff); color: #120b2a; box-shadow: 0 12px 24px rgba(139, 109, 255, 0.28); }
.btn-secondary { border-color: var(--line); background: rgba(22, 15, 46, 0.48); color: var(--text); }

.mini-title { font-family: "Space Grotesk", "Sora", sans-serif; font-size: 1.15rem; }
.mini-subline { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

.focus-tabs { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.focus-tab { border: 1px solid var(--line); border-radius: 10px; background: rgba(20, 13, 43, 0.72); color: var(--muted); padding: 8px; font-weight: 700; cursor: pointer; }
.focus-tab.is-active { color: var(--text); border-color: rgba(150, 122, 255, 0.65); box-shadow: inset 0 -2px 0 rgba(150, 122, 255, 0.92); }

.focus-panel { margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(12, 8, 28, 0.8); display: grid; gap: 10px; }
.focus-panel p, .focus-panel li, .section-subline, .about-card p, .contact-wrap p, .item-card p, .empty-state p { color: var(--muted); }
.focus-panel ul { list-style: disc; padding-left: 18px; display: grid; gap: 6px; }
.live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2); font-size: 0.82rem; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 6px rgba(178, 153, 255, 0.22); }

.section-head { display: grid; gap: 10px; margin-bottom: 20px; }
h2 { font-family: "Space Grotesk", "Sora", sans-serif; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; }

.profile-card { align-content: start; }
.profile-photo-wrap { width: min(280px, 100%); aspect-ratio: 1 / 1; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 14px; }
.profile-photo { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-box { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 10, 30, 0.76); display: grid; gap: 5px; }
.stat-box strong { font-size: 1.25rem; color: var(--accent); }
.stat-box span { font-size: 0.77rem; color: var(--muted); }

.career-timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 22px;
}

.career-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(112, 228, 255, 0.85), rgba(141, 108, 255, 0.42));
  box-shadow: 0 0 14px rgba(111, 221, 255, 0.22);
}

.career-item {
  position: relative;
  display: grid;
  gap: 10px;
}

.career-dot {
  position: absolute;
  left: -22px;
  top: 26px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff9879 0 42%, #ff6a3d 43% 100%);
  box-shadow: 0 0 0 7px rgba(255, 110, 77, 0.12), 0 0 18px rgba(255, 118, 84, 0.34);
}

.career-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(22, 17, 42, 0.96), rgba(14, 18, 37, 0.98));
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.career-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.career-card h3 {
  color: var(--text);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.career-type {
  color: #7fe4ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.career-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 144, 114, 0.24);
  background: rgba(46, 31, 27, 0.72);
  color: #ff9a79;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.career-card p {
  color: var(--muted);
  line-height: 1.72;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 0;
  justify-items: center;
}

.tech-tile {
  --tile-glow: rgba(116, 164, 255, 0.30);
  position: relative;
  width: min(100%, 118px);
  min-height: 118px;
  border-radius: 12px;
  border: 1px solid rgba(130, 153, 255, 0.35);
  background:
    radial-gradient(circle at 18% 18%, var(--tile-glow), transparent 58%),
    linear-gradient(160deg, rgba(12, 18, 40, 0.92), rgba(9, 14, 33, 0.96));
  display: grid;
  place-items: center;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(5, 2, 15, 0.46);
  overflow: visible;
}

.tech-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(143, 166, 255, 0.32);
  background: rgba(10, 17, 39, 0.86);
  display: grid;
  place-items: center;
}

.tech-icon-image {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.tech-icon-fallback {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
}

.tech-tooltip {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: -30px;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(187, 169, 255, 0.45);
  background: rgba(12, 9, 28, 0.97);
  color: #efe8ff;
  font-size: 0.76rem;
  font-weight: 600;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 10;
}

.tech-tile:hover .tech-tooltip,
.tech-tile:focus-within .tech-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tech-tile.label-top .tech-tooltip {
  top: -30px;
  bottom: auto;
  transform: translateX(-50%) translateY(-4px);
}

.tech-tile.label-top:hover .tech-tooltip,
.tech-tile.label-top:focus-within .tech-tooltip {
  transform: translateX(-50%) translateY(0);
}

.portfolio-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tab { border: 1px solid var(--line); background: rgba(19, 13, 41, 0.78); color: var(--muted); border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; }
.tab.is-active { color: var(--text); border-color: rgba(150, 122, 255, 0.65); box-shadow: inset 0 -2px 0 rgba(150, 122, 255, 0.92); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.cards-grid { grid-template-columns: 1fr; }

.item-card, .empty-state { padding: 16px; }
.item-card { display: grid; gap: 10px; }
.item-card h3 { color: var(--text); }
.project-preview {
  position: relative;
  min-height: 148px;
  border-radius: 14px;
  border: 1px solid rgba(136, 155, 255, 0.28);
  background:
    radial-gradient(circle at 20% 18%, rgba(139, 109, 255, 0.18), transparent 42%),
    linear-gradient(155deg, rgba(16, 11, 34, 0.96), rgba(11, 16, 37, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
}
.project-preview.has-image {
  background:
    linear-gradient(180deg, rgba(10, 8, 26, 0.04), rgba(10, 8, 26, 0.14)),
    var(--preview-image) center / cover no-repeat;
}
.project-preview.has-image .project-preview-label,
.project-preview.has-image .project-preview-title {
  display: none;
}
.project-preview-label {
  color: #ddd5ff;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-preview-title {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  color: rgba(244, 240, 255, 0.96);
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}
.project-status-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 207, 87, 0.35);
  background: rgba(44, 28, 8, 0.9);
  color: #ffd86b;
  font-size: 0.74rem;
  font-weight: 700;
}
.project-status-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      -45deg,
      #ffcc4d 0 3px,
      #4a3410 3px 6px
    );
  box-shadow: 0 0 0 1px rgba(255, 216, 107, 0.25);
}
.item-card button, .empty-action { justify-self: start; border: 1px solid var(--line); background: rgba(16, 11, 34, 0.78); color: var(--text); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.empty-state { display: grid; gap: 10px; }

.contact-wrap { grid-template-columns: 1fr; }
.contact-links { display: grid; gap: 10px; }
.contact-links a { border: 1px solid var(--line); background: rgba(17, 12, 38, 0.78); border-radius: 12px; padding: 12px; color: #e0d8ff; }
.contact-links a:hover, .contact-links a:focus-visible { border-color: rgba(150, 122, 255, 0.65); }

.detail-modal { border: none; padding: 0; background: transparent; }
.detail-modal::backdrop { background: rgba(1, 1, 8, 0.86); }
.modal-card {
  width: min(820px, 94vw);
  max-height: min(82vh, 760px);
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  background: rgba(24, 16, 52, 0.98);
  border: 1px solid rgba(169, 147, 255, 0.28);
  box-shadow: 0 28px 70px rgba(3, 2, 10, 0.62);
}
.modal-card.is-document {
  width: min(1180px, 96vw);
  max-height: 94vh;
}
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}
.modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.modal-head h3,
#modal-title {
  color: var(--text);
}
.modal-kicker {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-body {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  display: grid;
  gap: 16px;
  overscroll-behavior: contain;
}
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(141, 108, 255, 0.35);
  border-radius: 999px;
  border: 2px solid rgba(18, 11, 40, 0.95);
}
.modal-preview {
  position: relative;
  min-height: 190px;
  border-radius: 16px;
  border: 1px solid rgba(136, 155, 255, 0.28);
  background:
    radial-gradient(circle at 18% 16%, rgba(139, 109, 255, 0.22), transparent 44%),
    linear-gradient(155deg, rgba(16, 11, 34, 0.98), rgba(11, 16, 37, 0.98));
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}
.modal-card.has-project-image .modal-preview {
  background:
    linear-gradient(180deg, rgba(10, 8, 26, 0.08), rgba(10, 8, 26, 0.18)),
    var(--modal-preview-image) center / cover no-repeat;
}
.modal-card.has-project-image .modal-preview-label,
.modal-card.has-project-image .modal-preview-title,
.modal-card.has-project-image .modal-preview-subtitle {
  display: none;
}
.modal-card.is-document .modal-preview {
  min-height: min(72vh, 860px);
}
.modal-file-viewer {
  width: 100%;
  height: 100%;
  min-height: 190px;
  border: 0;
  background: rgba(255, 255, 255, 0.98);
}
.modal-card.is-document .modal-file-viewer {
  min-height: min(72vh, 860px);
}
.modal-preview-label {
  color: #efe8ff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modal-preview-title {
  color: #fbf8ff;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.08;
  max-width: 90%;
}
.modal-preview-subtitle {
  color: #c9bbef;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.modal-close {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(28, 19, 56, 0.82);
  color: var(--text);
  border-radius: 12px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.modal-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 193, 255, 0.28);
  background: rgba(15, 33, 60, 0.92);
  color: #dff0ff;
  font-weight: 700;
  white-space: nowrap;
}
.modal-download:hover,
.modal-download:focus-visible {
  border-color: rgba(124, 193, 255, 0.52);
  background: rgba(20, 43, 78, 0.98);
}
.modal-close:hover,
.modal-close:focus-visible {
  border-color: rgba(150, 122, 255, 0.72);
  background: rgba(40, 28, 76, 0.94);
}
.modal-description {
  display: grid;
  gap: 14px;
  color: #e6ddff;
}
.modal-description p {
  line-height: 1.78;
  margin: 0;
}
#modal-meta { list-style: disc; padding-left: 18px; color: #ddd2ff; display: grid; gap: 6px; margin: 0; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 18px 0 24px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.48s ease, transform 0.48s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 700px) {
  .hero-grid, .about-grid, .contact-wrap { grid-template-columns: 1.08fr 0.92fr; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 720px; margin-inline: auto; }
}

@media (min-width: 960px) {
  .navbar { flex-wrap: nowrap; gap: 18px; padding: 0; }
  .nav-toggle { display: none; }
  .nav-list { display: flex; width: auto; flex-direction: row; margin-left: auto; border: none; background: transparent; padding: 0; gap: 2px; }
  .language-switch { width: auto; grid-template-columns: repeat(4, 52px); }
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tech-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 860px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tech-tile { width: min(100%, 98px); min-height: 98px; padding: 8px; }
  .tech-icon { width: 54px; height: 54px; }
  .tech-icon-image { width: 44px; height: 44px; }
  .career-card-head { grid-template-columns: 1fr; display: grid; }
  .career-badge { justify-self: start; }
}
