:root {
  --bg: #1A1A1A;
  --bg-card: #151515;
  --bg-link: #323232;
  --bg-link-hover: #424242;
  --bg-link-active: #3b3b3b;

  --bg-telegram: radial-gradient(
    circle,
    rgba(30, 149, 208, 0.25) 0%,
    rgba(30, 149, 208, 0) 70%
  );
  --bg-telegram-active: radial-gradient(
    circle,
    rgba(30, 149, 208, 0.15) 0%,
    rgba(30, 149, 208, 0) 70%
  );

  --bg-discord: radial-gradient(
    circle,
    rgba(86, 98, 246, 0.25) 0%,
    rgba(86, 98, 246, 0) 70%
  );
  --bg-discord-active: radial-gradient(
    circle,
    rgba(86, 98, 246, 0.15) 0%,
    rgba(86, 98, 246, 0) 70%
  );

  --bg-spotify: radial-gradient(
    circle,
    rgba(30, 215, 96, 0.25) 0%,
    rgba(30, 215, 96, 0) 70%
  );
  --bg-spotify-active: radial-gradient(
    circle,
    rgba(30, 215, 96, 0.15) 0%,
    rgba(30, 215, 96, 0) 70%
  );

  --bg-appvault: rgba(251, 84, 84, 0.2);
  --bg-appvault-active: rgba(251, 84, 84, 0.1);

  --bg-nova: rgba(73, 125, 228, 0.2);
  --bg-nova-active: rgba(73, 125, 228, 0.1);

  --bg-lumi: rgba(81, 113, 170, 0.2);
  --bg-lumi-active: rgba(81, 113, 170, 0.1);


  --border: #3A3A3A;
  --border-hover: #5b5b5b;
  
  --border-telegram: rgba(30, 149, 208, 0.6);
  --border-telegram-active: rgba(30, 149, 208, 0.4);

  --border-discord: rgba(86, 98, 246, 0.6);
  --border-discord-active: rgba(86, 98, 246, 0.4);

  --border-spotify: rgba(30, 215, 96, 0.6);
  --border-spotify-active: rgba(30, 215, 96, 0.4);

  --border-appvault: rgba(251, 84, 84, 0.4);
  --border-appvault-active: rgba(251, 84, 84, 0.2);

  --border-nova: rgba(73, 125, 228, 0.4);
  --border-nova-active: rgba(73, 125, 228, 0.2);

  --border-lumi: rgba(81, 113, 170, 0.4);
  --border-lumi-active: rgba(81, 113, 170, 0.2);


  --text-muted: #cfcfcf;
  --text: #ffffff;

  --accent: #fdeb9f;
  --accent-rgb: 253, 235, 159;
  --glow-alpha: 0;

  --selection-color: #e6d3a7;
  --scrollbar-thumb: #2e2e2e;

  font-family: "JetBrains Mono", monospace;
  color-scheme: dark;
}

::selection {
  background-color: var(--selection-color);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
  margin: 5px 0;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--border);
}

* {
	box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; 
}

img {
  user-select: none;
  -webkit-user-drag: none;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1200px;
  margin: 27px auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px;
}

.g {
  position: relative;
}
.g::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
  border: 2px solid var(--border);
  background: transparent;
}
.g > svg.g-border-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.g .g-highlight-rect {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.g[data-border-width] .g-highlight-rect {
  stroke-width: attr(data-border-width number);
}


.profile, .tech {
  opacity: 0;
  transform: translateX(0);
  will-change: transform, opacity;
}

.bottom-card {
  opacity: 0;
  transform: translateY(0);
  will-change: transform, opacity;
}

.profile.enter-profile {
  animation: profile-in 420ms ease forwards;
}
.tech.enter-tech {
  animation: tech-in 420ms ease forwards;
}
.bottom-card.enter-bottom {
  animation: bottom-in 420ms ease forwards;
}

@media (max-width: 599px) {
  .profile.enter-profile { animation: profile-in-mobile 360ms ease forwards; }
  .tech.enter-tech { animation: tech-in-mobile 360ms ease forwards; }
  .bottom-card.enter-bottom { animation: bottom-in 360ms ease forwards; }
}

@keyframes profile-in {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes tech-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes profile-in-mobile {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tech-in-mobile {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bottom-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .profile, .tech, .bottom-card,
  .profile.enter-profile, .tech.enter-tech, .bottom-card.enter-bottom {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.top {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
  margin-bottom: -4px;
}

.profile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.profile-main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.avatar {
  width: 135px;
  height: 135px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-info {
  flex: 1 1 auto;
}

.name {
  margin: 0 0 6px 0;
  font-size: 2.5rem;
  font-weight: 700;
  cursor: default;
}

.bio {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.contacts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 2px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  user-select: none;
}

.contact-pill .icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-block;
  transform: scale(1.3);
}

.tg {
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}
.tg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-telegram);
  transform: scale(0);
  transition: transform 0.3s ease, background 0.3s ease;
  pointer-events: none;
}
.tg:hover::after {
  transform: scale(4);
}
.tg:active::after {
  background: var(--bg-telegram-active);
}
.tg:hover {
  border-color: var(--border-telegram);
}
.tg:active {
  border-color: var(--border-telegram-active);
}

.ds {
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}
.ds::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-discord);
  transform: scale(0);
  transition: transform 0.3s ease, background 0.3s ease;
  pointer-events: none;
}
.ds:hover::after {
  transform: scale(4);
}
.ds:active::after {
  background: var(--bg-discord-active);
}
.ds:hover {
  border-color: var(--border-discord);
}
.ds:active {
  border-color: var(--border-discord-active);
}

.sp {
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}
.sp::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-spotify);
  transform: scale(0);
  transition: transform 0.3s ease, background 0.3s ease;
  pointer-events: none;
}
.sp:hover::after {
  transform: scale(4);
}
.sp:active::after {
  background: var(--bg-spotify-active);
}
.sp:hover {
  border-color: var(--border-spotify);
}
.sp:active {
  border-color: var(--border-spotify-active);
}

.tech h2 {
  margin: 0 0 12px 0;
  font-size: 1.8rem;
  cursor: default;
}

.tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 25px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
  transition: border-color 0.3s ease;
}
.tag:hover {
  border-color: var(--border-hover);
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  position: relative;
  padding-top: 6px;
  padding-bottom: 6px;
}

.bottom-grid::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  width: 2px;
  height: 277px;
  transform: translateX(-50%);
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.bottom-grid > .projects {
  padding-right: 2px;
}

.bottom-grid > .hobbies {
  padding-left: 23px;
}

.bottom-grid h2 {
  margin: 0 0 12px 0;
  font-size: 1.8rem;
  cursor: default;
}

.projects-list {
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 11px;
  padding-bottom: 3px;
  scrollbar-gutter: stable;
  position: relative;
  z-index: 2;
}
.projects-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.projects-list::-webkit-scrollbar-track {
  margin: 2px 0;
}
.projects-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}
.projects-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--border);
}

.inner-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding-right: 12px;
  padding-left: 12px;
  border: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.av {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.av:hover {
  background-color: var(--bg-appvault);
  border-color: var(--border-appvault);
}
.av:active {
  background-color: var(--bg-appvault-active);
  border-color: var(--border-appvault-active);
}

.nv {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nv:hover {
  background-color: var(--bg-nova);
  border-color: var(--border-nova);
}
.nv:active {
  background-color: var(--bg-nova-active);
  border-color: var(--border-nova-active);
}

.lm {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.lm:hover {
  background-color: var(--bg-lumi);
  border-color: var(--border-lumi);
}
.lm:active {
  background-color: var(--bg-lumi-active);
  border-color: var(--border-lumi-active);
}

.project-left {
  display: flex;
  margin: -3px 0;
  gap: 12px;
  align-items: center;
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.header {
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  user-select: none;
}

.muted {
  background-color: var(--border);
  border-radius: 25px;
  color: var(--text-muted);
  padding: 6px 12px;
  margin-left: 8px;
  font-size: 0.85rem;
  user-select: none;
}

.project-stats {
  display: flex;
  gap: 8px;
}

.project-stats span {
  background: var(--bg-link);
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  border: none;
  user-select: none;
}
.stats-icon {
  font-size: 0.95rem;
}

.project-actions {
  display: flex;
  gap: 8px;
}

.btn {
  background: var(--bg-link);
  border-style: none;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  user-select: none;
  transition: background 0.3s ease;
}
.btn-icon {
  font-size: 0.95rem;
  margin-right: 3px;
}
.btn:hover {
  background: var(--bg-link-hover);
}
.btn:active {
  background: var(--bg-link-active);
}

.av:active:has(.btn:active) {
  background-color: var(--bg-appvault);
  border-color: var(--border-appvault);
}
.nv:active:has(.btn:active) {
  background-color: var(--bg-nova);
  border-color: var(--border-nova);
}

.hobby {
  display: grid;
  grid-template-columns: 1fr 75px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  position: relative;
  z-index: 2;
  background: transparent;
  border: 2px solid var(--border);
}


.hobbies .hobby {
  margin-bottom: 12px;
}
.hobbies .hobby:last-child {
  margin-bottom: 0;
}

.hobby h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 1.3rem;
  cursor: default;
}

.hobby p {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.25;
}

.hobby-img {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 75px;
  height: 75px;
  border-radius: 8px;
  object-fit: cover;
  justify-self: end;
  align-self: flex-start;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.modal.active .modal-overlay {
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.22,.9,.26,1), opacity 0.3s ease;
  z-index: 10;
  padding: 20px;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-banner {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.8rem;
  margin: 0;
  color: var(--text);
  cursor: default;
}

.modal-description {
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  user-select: none;
}

.modal-tag {
  background: var(--bg-link);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.85rem;
  transition: background 0.3s ease;
}
.modal-tag:hover {
  background: var(--bg-link-hover);
}

.modal-buttons {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.modal-buttons .modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s ease;
  width: 100%;
  flex: 1 1 0;
  min-width: 0;
  text-decoration: none;
}

@media (min-width: 600px) {
  .modal-buttons {
    flex-direction: row;
  }
}

.modal-btn.visual {
  cursor: default;
  opacity: 0.85;
  transition: border-color 0.3s ease;
}
.modal-btn.visual:hover {
  border-color: var(--border-hover);
}

.modal-btn:not(.visual):hover {
  background: var(--bg-link-hover);
}
.modal-btn:not(.visual):active {
  background: var(--bg-link-active);
}


@media (min-width: 1024px) and (max-width: 1399px) {
  .page {
    max-width: 1180px;
    margin: 28px auto;
    padding: 22px;
    gap: 22px;
  }

  .avatar {
    width: 135px;
    height: 135px;
  }

  .name {
    font-size: 2.6rem;
  }

  .bio {
    font-size: 1.12rem;
  }

  .top {
    grid-template-columns: 1fr 320px;
    gap: 18px;
  }

  .project-icon {
    width: 44px;
    height: 44px;
  }

  .header {
    font-size: 1.35rem;
  }

  .projects-list {
    max-height: 360px;
    gap: 12px;
  }

  .bottom-grid::before {
    height: 300px;
  }

  .modal-content {
    max-width: 700px;
  }

  .modal-banner {
    height: 260px;
  }

  .btn {
    padding: 10px 16px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .page {
    max-width: 920px;
    margin: 22px auto;
    padding: 18px;
    gap: 18px;
  }

  .top {
    grid-template-columns: 1fr 300px;
    gap: 14px;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .name {
    font-size: 2.2rem;
  }

  .bio {
    font-size: 1.02rem;
  }

  .project-icon {
    width: 40px;
    height: 40px;
  }

  .projects-list {
    max-height: 320px;
    gap: 10px;
  }

  .bottom-grid::before {
    height: 260px;
  }

  .modal-content {
    max-width: 640px;
  }

  .modal-banner {
    height: 220px;
  }

  .hobby {
    grid-template-columns: 1fr 68px;
    grid-template-rows: auto auto;
  }

  .hobby-img {
    width: 68px;
    height: 68px;
  }
}

@media (min-width: 600px) and (max-width: 767px) {
  .page {
    max-width: 720px;
    margin: 18px auto;
    padding: 14px;
    gap: 14px;
  }

  .top {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .avatar {
    width: 110px;
    height: 110px;
  }

  .name {
    font-size: 2rem;
  }

  .bio {
    font-size: 1rem;
  }

  .projects-list {
    max-height: 300px;
    gap: 10px;
  }

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

  .bottom-grid::before {
    display: none;
  }

  .bottom-grid > .projects {
    padding-right: 0;
  }
  .bottom-grid > .hobbies {
    padding-left: 0;
  }

  .modal-content {
    max-width: 600px;
    padding: 18px;
  }

  .modal-banner {
    height: 200px;
  }

  .contacts {
    gap: 8px;
  }

  .contact-pill {
    padding: 8px 12px;
    font-size: 0.95rem;
  }
}

@media (max-width: 599px) {
  .page {
    max-width: 100%;
    margin: 12px;
    padding: 12px;
    gap: 12px;
  }

  .top {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .avatar {
    width: 90px;
    height: 90px;
    border-radius: 8px;
  }

  .name {
    font-size: 1.6rem;
  }

  .bio {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .contact-pill {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem;
    min-height: 44px;
  }

  .tags {
    gap: 8px;
  }
  .tag {
    padding: 12px 14px;
    font-size: 0.85rem;
    border-radius: 20px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .bottom-grid::before {
    display: none;
  }
  .bottom-grid > .projects,
  .bottom-grid > .hobbies {
    padding: 0;
  }

  .projects-list {
    max-height: 260px;
    gap: 10px;
    padding-right: 6px;
  }

  .inner-card {
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .project-left {
    gap: 10px;
    align-items: center;
  }

  .project-icon {
    width: 36px;
    height: 36px;
  }

  .project-stats {
    margin-top: -8px;
  }

  .project-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: -8px;
    width: 100%;
  }

  .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.95rem;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .btn .btn-icon { margin-right: 4px; }

  .hobby h3 { font-size: 1.15rem; }
  .hobby p { font-size: 0.95rem; }

  .modal-content {
    width: 94%;
    max-width: none;
    max-height: 92vh;
    padding: 16px;
    border-radius: 10px;
    overflow: auto;
  }
  .modal-banner {
    height: 140px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .modal-buttons {
    gap: 8px;
    flex-direction: column;
  }
  .modal-buttons .modal-btn {
    width: 100%;
    padding: 12px;
  }

  .inner-card, .contact-pill, .btn, .modal-btn {
    -webkit-tap-highlight-color: rgba(255,255,255,0.04);
    touch-action: manipulation;
  }

  .projects-list::-webkit-scrollbar {
    width: 8px;
  }

  .stats-icon, .btn-icon, .contact-pill .icon {
    font-size: 0.95rem;
  }
}

@media (max-width: 1400px) {
  .projects-list {
    scrollbar-gutter: stable;
  }

  .modal-content {
    will-change: transform, opacity;
  }
}

@media (hover: none) and (pointer: coarse) {
  .contact-pill, .btn, .modal-btn, .tag {
    min-height: 44px;
  }
}
