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

html {
  scroll-behavior: smooth;
}

:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --accent-white: #ffffff;
  --accent-gray: #ffffff;
  --gradient-primary: linear-gradient(135deg, #ffffff, #ffffff);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --bg-photo:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.7)),
    url("assets/bg.jpg"),
    linear-gradient(160deg, #1a1a1a 0%, #000000 55%, #2d2d2d 100%);

  --glass-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 1.8px 3px 0px -2px rgba(255, 255, 255, 0.27),
    inset -2px -2px 0px -2px rgba(255, 255, 255, 0.24),
    inset -3px -8px 1px -6px rgba(255, 255, 255, 0.18),
    inset -0.3px -1px 4px 0px rgba(0, 0, 0, 0.24),
    inset -1.5px 2.5px 0px -2px rgba(0, 0, 0, 0.4),
    inset 0px 3px 4px -2px rgba(0, 0, 0, 0.4),
    inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.2),
    0px 1px 5px 0px rgba(0, 0, 0, 0.2),
    0px 6px 16px 0px rgba(0, 0, 0, 0.16);

  --glass-shadow-active:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.15),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.15);

  --glass-shadow-indicator:
    inset 0 0 0 1px #ffffff08,
    inset 2px 1px 0 -1px #ffffff45,
    inset -1.5px -1px 0 -1px #ffffff3d,
    inset -2px -6px 1px -5px #ffffff2e,
    inset -1px 2px 3px -1px #0006,
    inset 0 -4px 1px -2px #0003,
    0 3px 6px #00000029;
}

.glass {
  box-shadow: var(--glass-shadow);
}

.glass-active {
  box-shadow: var(--glass-shadow-active);
}

.glass-indicator {
  box-shadow: var(--glass-shadow-indicator);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(
    135deg,
    #000000 0%,
    #1a1a1a 25%,
    #2d2d2d 50%,
    #1a1a1a 75%,
    #000000 100%
  );
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  cursor: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-photo);
  background-size: cover;
  background-position: center;
  filter: blur(7px);
  transform: scale(1.1);
  pointer-events: none;
}

.custom-cursor,
.cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
}

.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 1);
  transition: all 0.1s ease;
}

.cursor-dot {
  width: 4px;
  height: 4px;
  background: white;
  transition: all 0.05s ease;
}

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  pointer-events: none;
  z-index: 999;
  animation: scanline 8s linear infinite;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.5));
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 10;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0 40px;
  animation: fadeInDown 0.8s ease;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
}

.header-controls {
  display: flex;
  gap: 12px;
}

.music-status {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 44px;
  max-width: 0;
  padding: 0;
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
}

.music-status.playing {
  gap: 8px;
  max-width: 220px;
  padding: 0 16px;
  opacity: 1;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}

.equalizer span {
  width: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  height: 4px;
  animation: eqBounce 0.9s ease-in-out infinite;
}

.equalizer span:nth-child(1) {
  animation-delay: 0s;
}

.equalizer span:nth-child(2) {
  animation-delay: 0.2s;
}

.equalizer span:nth-child(3) {
  animation-delay: 0.4s;
}

.music-track-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.icon-inline {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

.icon[hidden] {
  display: none !important;
}

.status-dot {
  width: 8px;
  height: 8px;
  fill: currentColor;
  stroke: none;
  vertical-align: 1px;
  margin-right: 2px;
}

.icon-flag {
  width: 1.5em;
  height: 1em;
  vertical-align: -0.125em;
  border-radius: 2px;
}

.music-toggle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.music-toggle:hover {
  transform: scale(1.08);
  box-shadow:
    var(--glass-shadow),
    0 8px 20px rgba(0, 0, 0, 0.25);
}

.music-toggle:active {
  box-shadow: var(--glass-shadow-active);
}

.hero {
  text-align: center;
  padding: 40px 0 60px;
  animation: fadeIn 1s ease;
}

h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
  animation: slideInLeft 0.8s ease;
}

h1:hover {
  animation: glitch 0.3s infinite;
}

.subtitle {
  font-size: clamp(16px, 3vw, 20px);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
  animation: slideInLeft 0.8s ease 0.1s backwards;
}

.experience {
  display: inline-block;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--glass-bg);
  padding: 8px 16px;
  border-radius: 12px;
  margin-top: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow);
}

.description {
  margin: 20px auto 0;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
  min-height: 80px;
  animation: fadeIn 1s ease 0.2s backwards;
}

.typing-cursor {
  display: inline-block;
  animation: blink 1s infinite;
  color: var(--text-primary);
  font-weight: 400;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
  animation: fadeInUp 0.8s ease 0.3s backwards;
}

.btn {
  padding: 14px 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--glass-shadow),
    0 8px 24px rgba(255, 255, 255, 0.2);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--glass-shadow-active);
}

.section {
  padding: 40px 0;
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 28px;
  background: var(--gradient-primary);
  border-radius: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.skill-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  will-change: transform;
}

.section.visible .skill-card {
  opacity: 1;
  transform: translateY(0);
}

.skill-card:nth-child(1) { transition: all 0.6s var(--transition-smooth) 0.05s; }
.skill-card:nth-child(2) { transition: all 0.6s var(--transition-smooth) 0.1s; }
.skill-card:nth-child(3) { transition: all 0.6s var(--transition-smooth) 0.15s; }
.skill-card:nth-child(4) { transition: all 0.6s var(--transition-smooth) 0.2s; }
.skill-card:nth-child(5) { transition: all 0.6s var(--transition-smooth) 0.25s; }
.skill-card:nth-child(6) { transition: all 0.6s var(--transition-smooth) 0.3s; }
.skill-card:nth-child(7) { transition: all 0.6s var(--transition-smooth) 0.35s; }
.skill-card:nth-child(8) { transition: all 0.6s var(--transition-smooth) 0.4s; }

.skill-card:hover {
  transform: translateY(-5px) !important;
  box-shadow:
    var(--glass-shadow),
    0 10px 30px rgba(0, 0, 0, 0.2);
}

.skill-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.skill-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.skill-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  transition: all 0.4s var(--transition-smooth);
  opacity: 0;
  transform: translateY(40px);
  will-change: transform;
}

.section.visible .project-card {
  opacity: 1;
  transform: translateY(0);
}

.project-card:nth-child(1) { transition: all 0.8s var(--transition-smooth) 0.1s; }
.project-card:nth-child(2) { transition: all 0.8s var(--transition-smooth) 0.2s; }
.project-card:nth-child(3) { transition: all 0.8s var(--transition-smooth) 0.3s; }
.project-card:nth-child(4) { transition: all 0.8s var(--transition-smooth) 0.4s; }

.project-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow:
    var(--glass-shadow),
    0 20px 60px rgba(0, 0, 0, 0.4);
}

.project-content {
  padding: 24px;
}

.project-status {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent-white);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.project-status.archived {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.3);
}

.project-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.project-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

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

.tag {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--glass-shadow);
}

.contact-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
}

.contact-item:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--glass-shadow),
    0 8px 20px rgba(0, 0, 0, 0.2);
}

.contact-item:active {
  box-shadow: var(--glass-shadow-active);
}

footer {
  text-align: center;
  margin-top: 60px;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.5s;
}

.visit-counter {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0.85;
}

.visit-counter span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.visit-counter span:not(:first-child)::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.visit-counter b {
  color: var(--text-primary);
  font-weight: 600;
}

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  font-size: 24px;
  color: white;
  box-shadow:
    var(--glass-shadow),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow:
    var(--glass-shadow),
    0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-active);
}

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 20px;
  background: white;
  color: black;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 20px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glitch {
  0%,
  100% {
    text-shadow:
      2px 2px 0 rgba(255, 255, 255, 0.3),
      -2px -2px 0 rgba(255, 255, 255, 0.3);
  }
  25% {
    text-shadow:
      -2px 2px 0 rgba(255, 255, 255, 0.3),
      2px -2px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    text-shadow:
      2px -2px 0 rgba(255, 255, 255, 0.3),
      -2px 2px 0 rgba(255, 255, 255, 0.3);
  }
  75% {
    text-shadow:
      -2px -2px 0 rgba(255, 255, 255, 0.3),
      2px 2px 0 rgba(255, 255, 255, 0.3);
  }
}

@keyframes scanline {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100vh);
  }
}

@keyframes eqBounce {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 12px;
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  .custom-cursor,
  .cursor-dot {
    display: none;
  }

  #particles-js {
    display: none;
  }

  .description,
  .project-content p,
  .skill-card p {
    color: rgba(255, 255, 255, 0.75);
  }

  .container {
    padding: 20px 16px;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  .site-header {
    padding: 8px 0 24px;
  }

  .logo {
    font-size: 20px;
  }

  .music-status.playing {
    max-width: 140px;
    font-size: 11px;
  }

  .hero {
    padding: 24px 0 40px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .subtitle {
    font-size: 16px;
  }

  .experience {
    font-size: 12px;
    padding: 6px 12px;
  }

  .description {
    font-size: 14px;
    min-height: auto;
    padding: 0 8px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 15px;
  }

  .section {
    padding: 24px 0;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .section-title::before {
    width: 3px;
    height: 22px;
  }

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

  .skill-card {
    padding: 16px;
  }

  .skill-icon {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .skill-card h3 {
    font-size: 15px;
  }

  .skill-card p {
    font-size: 12px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-content {
    padding: 20px;
  }

  .project-card:hover {
    transform: translateY(-4px) scale(1.01) !important;
  }

  .project-content h3 {
    font-size: 18px;
  }

  .project-content p {
    font-size: 13px;
  }

  .tag {
    font-size: 11px;
    padding: 5px 10px;
  }

  .contact-item {
    padding: 10px 18px;
    font-size: 14px;
  }

  footer {
    margin-top: 40px;
    padding: 20px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 15px;
  }

  .experience {
    font-size: 11px;
    padding: 5px 10px;
  }

  .description {
    font-size: 13px;
  }

  .section-title {
    font-size: 20px;
  }

  .skill-card {
    padding: 14px;
  }

  .project-content {
    padding: 16px;
  }

  .project-status {
    font-size: 11px;
    padding: 5px 10px;
  }

  .project-content h3 {
    font-size: 17px;
  }

  .contact-item {
    padding: 9px 16px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn:hover::before {
    left: -100% !important;
  }

  .skill-card:hover {
    transform: none !important;
    box-shadow: var(--glass-shadow) !important;
  }

  .project-card:hover {
    transform: none !important;
    box-shadow: var(--glass-shadow) !important;
  }

  .contact-item:hover {
    transform: none;
  }

  .contact-item:active {
    box-shadow: var(--glass-shadow-active);
  }

  .music-toggle:hover {
    transform: none;
  }

  body {
    cursor: auto !important;
  }

  .custom-cursor,
  .cursor-dot {
    display: none !important;
  }
}
