:root {
  --bg: #0b0b0f;
  --panel: #121218;
  --text: #eaeaea;
  --muted: #a3a3a3;
  --accent: #64ffda;
  --accent-2: #8e7dff;
  --ring: rgba(100, 255, 218, 0.35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  height: 100%;
}

body {
  background: radial-gradient(1200px 800px at 10% -10%, rgba(100, 255, 218, 0.06), transparent 50%),
              radial-gradient(1000px 700px at 100% 0%, rgba(142, 125, 255, 0.05), transparent 50%),
              var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  overflow-x: hidden;
  width: 100%;
}

/* Header Styles */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.9;
}

.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.15), rgba(142, 125, 255, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.05), 0 10px 30px rgba(0, 0, 0, 0.35);
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: block;
}

.nav-link:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  transform: scale(1.05);
}

/* Footer Styles */
.footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding-bottom: 20px;
}

.socials {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.social-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: inline-block;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Hero Section (Home Page) */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 12px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  max-width: 70ch;
  margin-top: 8px;
}

/* Profile Card */
.profile {
  display: grid;
  gap: 14px;
  align-content: start;
}

.avatar {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 16px;
  background:
    radial-gradient(120px 120px at 30% 20%, rgba(100, 255, 218, 0.15), transparent 60%),
    radial-gradient(160px 160px at 70% 80%, rgba(142, 125, 255, 0.15), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  transition: all 0.3s ease;
}

.avatar:hover {
  transform: scale(1.02);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.profile .card {
  padding: 16px;
}

.profile .card:hover {
  transform: scale(1.02);
  border-color: rgba(100, 255, 218, 0.2);
}

.label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.value {
  font-weight: 700;
}

/* Skills Page */
.page-title {
  margin: 24px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.skill-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.3s ease;
}

.skill-card:hover {
  transform: scale(1.03);
  border-color: rgba(100, 255, 218, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(100, 255, 218, 0.1);
}

/* Contact Page */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--ring);
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.20), rgba(142, 125, 255, 0.15));
  border-color: rgba(100, 255, 218, 0.45);
}

.contact-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.input,
.textarea {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(100, 255, 218, 0.45);
  box-shadow: 0 0 0 4px var(--ring);
  transform: scale(1.01);
}

.textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  appearance: none;
  border: 1px solid rgba(100, 255, 218, 0.45);
  color: var(--text);
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.20), rgba(142, 125, 255, 0.15));
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  border-color: rgba(100, 255, 218, 0.6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--ring);
  transform: scale(1.02) translateY(-2px);
}

/* Gallery Page */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 60px 20px;
  min-height: 500px;
  width: 100%;
  max-width: 100%;
  justify-items: center;
}

.picture-frame {
  position: relative;
  max-width: 350px;
  width: 100%;
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.frame-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  padding: 0 10px;
}

.frame-date {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0 10px;
  margin-top: -6px;
}

.frame-border {
  position: relative;
  padding: 20px;
  background: linear-gradient(145deg, 
    rgba(200, 200, 200, 0.25), 
    rgba(180, 180, 180, 0.18));
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 3px 6px rgba(255, 255, 255, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4),
    inset 0 0 40px rgba(255, 255, 255, 0.05);
  transition: all 0.4s ease;
  animation: float 6s ease-in-out infinite;
}

.frame-border:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 15px 35px rgba(100, 255, 218, 0.2),
    inset 0 3px 6px rgba(255, 255, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4),
    inset 0 0 40px rgba(255, 255, 255, 0.08),
    0 0 40px rgba(100, 255, 218, 0.25);
  border-color: rgba(100, 255, 218, 0.5);
}

.frame-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: 
    radial-gradient(circle at 30% 30%, rgba(100, 255, 218, 0.08), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(142, 125, 255, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 2px solid rgba(0, 0, 0, 0.3);
  box-shadow: 
    inset 0 3px 10px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.frame-inner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
  filter: brightness(1) contrast(1.05);
}

.frame-border:hover .frame-inner img {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.08);
}

.picture-frame:nth-child(1) .frame-border {
  animation-delay: 0s;
}

.picture-frame:nth-child(2) .frame-border {
  animation-delay: 2s;
}

.picture-frame:nth-child(3) .frame-border {
  animation-delay: 4s;
}

.frame-shadow {
  position: absolute;
  bottom: -30px;
  left: 10%;
  right: 10%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4), transparent);
  filter: blur(15px);
  opacity: 0.6;
  transition: all 0.4s ease;
}

.frame-border:hover .frame-shadow {
  bottom: -40px;
  opacity: 0.8;
  filter: blur(20px);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Music Button */
.music-button {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.2), rgba(142, 125, 255, 0.2));
  border: 2px solid rgba(100, 255, 218, 0.4);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(100, 255, 218, 0.2);
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: musicPulse 2s ease-in-out infinite;
}

.music-button:hover {
  transform: scale(1.1);
  box-shadow: 
    0 6px 30px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(100, 255, 218, 0.3);
  border-color: rgba(100, 255, 218, 0.6);
}

.music-button:active {
  transform: scale(0.95);
}

.music-icon {
  position: absolute;
  transition: all 0.3s ease;
}

.music-button .music-icon.playing {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.music-button .music-icon.paused {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

.music-button:not(.playing) .music-icon.playing {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.music-button:not(.playing) .music-icon.paused {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

@keyframes musicPulse {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 30px rgba(100, 255, 218, 0.2);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 40px rgba(100, 255, 218, 0.4);
  }
}

/* Latency Monitor Button */
.latency-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(142, 125, 255, 0.2), rgba(100, 255, 218, 0.2));
  border: 2px solid rgba(142, 125, 255, 0.4);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(142, 125, 255, 0.2);
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: latencyPulse 2s ease-in-out infinite;
}

.latency-button:hover {
  transform: scale(1.1);
  box-shadow: 
    0 6px 30px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(142, 125, 255, 0.3);
  border-color: rgba(142, 125, 255, 0.6);
}

.latency-button:active {
  transform: scale(0.95);
}

.latency-icon {
  width: 24px;
  height: 24px;
}

@keyframes latencyPulse {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 30px rgba(142, 125, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 40px rgba(142, 125, 255, 0.4);
  }
}

/* Latency Modal */
.latency-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  padding: 16px;
}

.latency-modal.active {
  display: flex;
}

.latency-modal-content {
  background: linear-gradient(180deg, rgba(18, 18, 24, 0.98), rgba(11, 11, 15, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(142, 125, 255, 0.2);
  animation: slideUp 0.3s ease;
}

.latency-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.latency-modal-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.latency-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.latency-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.latency-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.latency-stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.latency-stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.latency-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.latency-stat-unit {
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
}

.latency-canvas-container {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

#latencyCanvas {
  width: 100%;
  height: 250px;
  display: block;
}

.latency-status {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1100px) {
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
  }
  
  .picture-frame {
    max-width: 380px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-container {
    grid-template-columns: 1fr;
    gap: 60px;
    padding: 40px 15px;
  }
  
  .picture-frame {
    max-width: 400px;
    width: 90%;
    gap: 14px;
  }
  
  .frame-title {
    font-size: 22px;
  }
  
  .frame-date {
    font-size: 13px;
  }
  
  .latency-modal-content {
    padding: 24px 20px;
  }
  
  .latency-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  #latencyCanvas {
    height: 220px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 16px;
  }
  
  .header {
    padding: 12px 14px;
    gap: 12px;
  }
  
  .brand strong {
    display: none;
  }
  
  .nav {
    gap: 4px;
  }
  
  .nav-link {
    padding: 8px 10px;
    font-size: 14px;
  }
  
  .logo {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  
  .gallery-container {
    grid-template-columns: 1fr;
    gap: 50px;
    padding: 30px 10px;
    min-height: 400px;
  }
  
  .picture-frame {
    max-width: 320px;
    width: 95%;
    gap: 12px;
  }
  
  .frame-title {
    font-size: 20px;
  }
  
  .frame-date {
    font-size: 12px;
  }
  
  .frame-border {
    padding: 16px;
    border-width: 3px;
  }
  
  .music-button {
    bottom: 24px;
    left: 16px;
    width: 50px;
    height: 50px;
  }
  
  .music-icon {
    width: 22px;
    height: 22px;
  }
  
  .latency-button {
    bottom: 24px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
  
  .latency-icon {
    width: 22px;
    height: 22px;
  }
  
  .latency-modal {
    padding: 12px;
    align-items: flex-start;
    padding-top: 60px;
  }
  
  .latency-modal-content {
    padding: 20px 16px;
    max-height: 85vh;
    border-radius: 16px;
  }
  
  .latency-modal-header {
    margin-bottom: 16px;
  }
  
  .latency-modal-title {
    font-size: 18px;
  }
  
  .latency-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  
  .latency-stat-card {
    padding: 12px;
  }
  
  .latency-stat-label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  .latency-stat-value {
    font-size: 20px;
  }
  
  .latency-stat-unit {
    font-size: 13px;
  }
  
  .latency-canvas-container {
    padding: 16px 12px;
    margin-bottom: 12px;
  }
  
  #latencyCanvas {
    height: 200px;
  }
  
  .latency-status {
    font-size: 12px;
    margin-top: 12px;
    line-height: 1.4;
  }
  
  .latency-close {
    width: 28px;
    height: 28px;
  }
  
  .latency-close svg {
    width: 14px;
    height: 14px;
  }
}

