:root {
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.5);
  --glass-reflect: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

[data-theme="dark"] {
  --bg-color: #030305;
  --text-main: #e2e8f0;
  --text-muted: #8b9bb4;
  --panel-bg: rgba(10, 10, 15, 0.85);
  --grid-color: rgba(0, 240, 255, 0.1);
}

[data-theme="light"] {
  --bg-color: #f0f4f8;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --panel-bg: rgba(255, 255, 255, 0.9);
  --grid-color: rgba(0, 240, 255, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "Montserrat", sans-serif;
  overflow-x: hidden;
  transition: 0.4s;
}

/* Фоны */
.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  transform: perspective(600px) rotateX(60deg) translateY(-100px)
    translateZ(-250px);
  transform-origin: top;
  z-index: -2;
  opacity: 0.6;
}
.glow-orb {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
  z-index: -1;
  filter: blur(50px);
  opacity: 0.4;
}
.orb-1 {
  top: -100px;
  left: -100px;
}
.orb-2 {
  bottom: 20%;
  right: -150px;
}

.top-controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  border-bottom: 1px solid var(--grid-color);
}

.logo-holder {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-box {
  width: 65px;
  height: 65px;
  border: 2px solid var(--cyan);
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  transition: background-image 0.4s ease-in-out;
}

[data-theme="dark"] .logo-box {
  background-image: url("/sources/logo.jpg");
}

[data-theme="light"] .logo-box {
  background-image: url("/sources/logo_light.jpeg");
}

.logo-text {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  color: var(--cyan);
  letter-spacing: 2px;
  margin: 0;
}

.controls-panel {
  display: flex;
  gap: 15px;
  align-items: center;
}

.control-btn {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.control-btn:hover {
  background: var(--cyan);
  color: var(--bg-color);
}

@media (max-width: 768px) {
  .top-controls {
    padding: 10px 15px;
  }
  .logo-box {
    width: 48px;
    height: 48px;
  }
  .logo-text {
    display: none;
  }
  .controls-panel {
    gap: 8px;
  }
  .control-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}
@media (max-width: 360px) {
  .controls-panel {
    gap: 4px;
  }
  .control-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }
}

.side-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  height: 400px;
  width: 60px;
  z-index: 999;
}
.git-tree-container {
  position: relative;
  width: 100%;
  height: 100%;
}
.git-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}
.git-path-bg {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  opacity: 0.3;
}
.git-path-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  filter: drop-shadow(0 0 8px var(--cyan));
}
.nav-commit {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 3px solid var(--text-muted);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: 0.4s;
}
.commit-1 {
  top: 10%;
  left: 80%;
}
.commit-2 {
  top: 38%;
  left: 20%;
}
.commit-3 {
  top: 65%;
  left: 80%;
}
.commit-4 {
  top: 90%;
  left: 50%;
}
.nav-commit.active {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan);
}
.nav-commit::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 30px;
  top: -5px;
  background: var(--panel-bg);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--cyan);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  white-space: nowrap;
}
.nav-commit:hover::after {
  opacity: 1;
}

.section-block {
  min-height: 100vh;
  width: 100%;
  padding: 100px 100px 80px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.content-wrapper {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}
.centered-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 50px;
}

.section-title {
  font-family: "Barlow Condensed";
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 30px;
  text-transform: uppercase;
  border-left: 5px solid var(--cyan);
  padding-left: 15px;
}
.centered-wrapper .section-title {
  border-left: none;
  border-bottom: 5px solid var(--cyan);
  padding-left: 0;
  padding-bottom: 10px;
  display: inline-block;
}

.hero-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 5px 15px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  background: rgba(0, 240, 255, 0.05);
}
.glitch {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 15px 0;
  color: var(--text-main);
}
.hero-desc {
  line-height: 1.8;
  font-size: 1.1rem;
}
.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 20px;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.cyber-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition:
    opacity 0.6s ease-in-out,
    transform 0.6s ease-in-out;
}
[data-theme="dark"] .light-photo {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
[data-theme="light"] .dark-photo {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
[data-theme="dark"] .dark-photo {
  opacity: 1;
  transform: scale(1);
}
[data-theme="light"] .light-photo {
  opacity: 1;
  transform: scale(1);
}
.hidden {
  display: none !important;
}

.cyber-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.2));
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}
.timeline-item {
  border-top: 2px solid var(--grid-color);
  padding-top: 20px;
  position: relative;
}
.timeline-date {
  position: absolute;
  top: -15px;
  left: 0;
  background: var(--cyan);
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.8rem;
}
.timeline-item h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  margin-top: 15px;
}
.timeline-item p {
  color: var(--text-muted);
  line-height: 1.6;
}

.device-laptop {
  width: 100%;
  max-width: 800px;
  perspective: 1000px;
  margin: 0 auto;
}
.laptop-screen {
  background: linear-gradient(to bottom, #2b2b2b 0%, #1a1a1a 100%);
  border-radius: 12px 12px 0 0;
  padding: 15px 15px 25px 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.laptop-bezel {
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  height: 400px;
  border: 2px solid #0a0a0a;
}
.laptop-camera {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #222;
  border-radius: 50%;
  z-index: 5;
}
.screen-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  flex-grow: 1;
  border-radius: 4px;
}

.tablet-wrapper {
  border-radius: 20px;
}

.laptop-wrapper iframe {
  position: absolute;
  top: 0; 
  left: 0;
  width: 200%;
  height: 200%;
  transform: scale(0.5);
  transform-origin: top left;
  border: none;
  background: #fff;
}

.tablet-wrapper iframe {
  position: absolute;
  top: 0; 
  left: 0;
  width: 150%; 
  height: 150%;
  transform: scale(0.6666);
  transform-origin: top left;
  border: none;
  background: #fff;
}
.laptop-base {
  width: 100%;
  height: 25px;
  background: linear-gradient(to bottom, #e5e5e5 0%, #8c8c8c 100%);
  border-radius: 2px 2px 15px 15px;
  position: relative;
  display: flex;
  justify-content: center;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
}
.laptop-keyboard {
  width: 75%;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #333,
    #333 4px,
    #111 4px,
    #111 5px
  );
  margin-top: 2px;
  border-radius: 2px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}
.touchpad {
  position: absolute;
  width: 80px;
  height: 6px;
  background: #a3a3a3;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 50px 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  transition: 0.3s;
}
.app-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
}
.app-card-info {
  text-align: center;
}
[data-theme="light"] .app-card-info h3 {
  color: var(--text-main);
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.app-card-info p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ТЕЛЕФОН */
.device-tablet {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9 / 19;
  background: linear-gradient(135deg, #4a4a4a 0%, #1a1a1a 100%);
  padding: 4px;
  border-radius: 35px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}
.tablet-bezel {
  background: #000;
  border-radius: 31px;
  padding: 15px 10px 25px 10px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tablet-camera {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #222;
  border-radius: 50%;
  z-index: 5;
}

.tablet-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 35%;
  height: 4px;
  background: #444;
  border-radius: 4px;
}
.tablet-bezel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 31px;
  background: var(--glass-reflect);
  pointer-events: none;
}

/* УТИЛИТЫ */
.text-block {
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 900px;
  margin: 0 auto;
}
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.btn-wrap {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}
.cyber-button {
  background: var(--cyan);
  color: #000;
  padding: 14px 30px;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  display: inline-flex;
  transition: 0.3s;
  text-transform: uppercase;
  border: 1px solid var(--cyan);
}
.cyber-button:hover {
  box-shadow: 0 0 25px var(--cyan);
  transform: scale(1.05);
}
.cyber-button.outline {
  background: transparent;
  color: var(--cyan);
}
.cyber-button.outline:hover {
  background: var(--cyan);
  color: #000;
}

@media (max-width: 1024px) {
  .side-nav {
    display: none;
  }
  .section-block {
    padding: 100px 30px 60px 30px;
  }
  .hero-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image-wrapper {
    margin: 30px auto 0 auto;
  }
  .device-laptop {
    display: none;
  }

  .timeline {
    grid-template-columns: 1fr;
    border-top: none;
    border-left: 2px solid var(--cyan);
    padding-left: 25px;
    margin-left: 5px;
  }
  .timeline-item {
    border-top: none;
    padding-top: 0;
    margin-bottom: 45px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .timeline-date {
    position: relative;
    top: 0;
    left: 0;
    display: inline-block;
    margin-bottom: 12px;
  }
  .timeline-item::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--cyan);
  }
  .timeline-item h3 {
    margin-top: 0;
    text-align: left;
  }
  .timeline-item p {
    text-align: left;
  }
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) var(--bg-color);
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #fff;
  box-shadow: 0 0 10px var(--cyan);
}

.cyber-footer {
  margin-top: 100px;
  padding: 60px 40px 20px 40px;
  background: var(--panel-bg);
  border-top: 1px solid var(--grid-color);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}
.footer-content {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.social-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.social-link {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.2rem;
  color: var(--text-main);
  text-decoration: none;
  padding: 8px 25px;
  border: 1px solid var(--grid-color);
  border-radius: 4px;
  transition: 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.social-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  background: rgba(0, 240, 255, 0.05);
}
.github-note {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.4);
  padding: 15px 25px;
  border-radius: 8px;
  border-left: 3px solid var(--cyan);
  max-width: 600px;
}
.note-icon {
  font-size: 1.5rem;
}
.github-note p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}
.footer-bottom {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: monospace;
}
[data-theme="light"] .github-note {
  background: #f5f0e6;
  border-left-color: var(--cyan);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .github-note p {
  color: var(--text-main);
}
[data-theme="light"] .laptop-screen {
  background: linear-gradient(to bottom, #fdfbf7 0%, #e2dfd8 100%);
}
[data-theme="light"] .laptop-base {
  background: linear-gradient(to bottom, #fdfbf7 0%, #dcdad5 100%);
  border-top: 1px solid #fff;
}
[data-theme="light"] .device-tablet {
  background: linear-gradient(135deg, #fdfbf7 0%, #e2dfd8 100%);
}
[data-theme="light"] .touchpad,
[data-theme="light"] .tablet-home-bar {
  background: #cfccc4;
}
[data-theme="light"] .laptop-keyboard {
  background: repeating-linear-gradient(
    90deg,
    #e2dfd8,
    #e2dfd8 4px,
    #cfccc4 4px,
    #cfccc4 5px
  );
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.friendly-tooltip {
  position: absolute;
  top: 70px;
  right: 40px;
  background: var(--panel-bg);
  border: 2px solid var(--cyan);
  color: var(--text-main);
  padding: 15px 30px 15px 20px;
  border-radius: 10px;
  width: 280px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 10px 25px rgba(0, 240, 255, 0.15);
  z-index: 1001;
  opacity: 0;
  transform: translateY(-15px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  pointer-events: none;
}

.friendly-tooltip.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tooltip-arrow {
  position: absolute;
  top: -12px;
  right: 15px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid var(--cyan);
}
.tooltip-arrow::after {
  content: "";
  position: absolute;
  top: 3px;
  left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--panel-bg);
}

.close-tooltip-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: 0.3s;
}
.close-tooltip-btn:hover {
  color: var(--cyan);
}

@media (max-width: 768px) {
  .friendly-tooltip {
    right: 15px;
    width: 240px;
    top: 60px;
  }
  .tooltip-arrow {
    right: 10px;
  }
}
