/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a1a;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --accent-secondary: #00d4aa;
  --text-primary: #f0f0ff;
  --text-secondary: #8888aa;
  --border: rgba(108, 99, 255, 0.15);
  --radius: 20px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== Particles Canvas ===== */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 40px 0 50px;
  animation: fadeInDown 0.8s ease-out;
}

.avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 24px;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-secondary), var(--accent));
  animation: spin 4s linear infinite;
  opacity: 0.8;
}

.avatar {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4a42d4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.avatar-initials {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.name {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #c0c0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.3);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  animation: fadeInUp 0.6s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(108, 99, 255, 0.35);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  font-size: 1.3rem;
}

/* ===== About ===== */
.about-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 14px;
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: default;
}

.skill-item:hover {
  background: rgba(108, 99, 255, 0.12);
  border-color: var(--border);
  transform: translateY(-2px);
}

.skill-icon {
  font-size: 1.6rem;
}

.skill-item span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-secondary));
  border-radius: 2px;
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 4px 0;
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ===== Games Section ===== */
.games-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-preview {
  background: rgba(108, 99, 255, 0.04);
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.3s ease;
}

.game-preview:hover {
  border-color: rgba(108, 99, 255, 0.3);
}

.game-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.game-emoji {
  font-size: 2.2rem;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.game-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 2px;
}

.game-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #080818;
  border: 2px solid rgba(108, 99, 255, 0.2);
}

.game-container canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 24, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.game-overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  padding: 20px;
}

.overlay-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.overlay-content p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.game-btn {
  background: linear-gradient(135deg, var(--accent), #4a42d4);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.game-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.game-btn:active {
  transform: scale(0.97);
}

.game-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 4;
  pointer-events: none;
}

.hud-item {
  background: rgba(8, 8, 24, 0.8);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border: 1px solid rgba(108, 99, 255, 0.15);
}

.hud-item strong {
  color: var(--accent);
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.control-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ===== Mobile D-Pad ===== */
.mobile-dpad {
  display: none;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}

.dpad-btn {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(108, 99, 255, 0.3);
  background: rgba(108, 99, 255, 0.1);
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
  background: rgba(108, 99, 255, 0.3);
  transform: scale(0.92);
}

.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-left  { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down  { grid-column: 2; grid-row: 3; }

@media (max-width: 600px) {
  .mobile-dpad {
    display: grid;
  }
}

/* ===== Contacts ===== */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all 0.3s ease;
}

.contact-item:hover {
  background: rgba(108, 99, 255, 0.14);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.contact-icon {
  font-size: 1.3rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer .year {
  margin-top: 4px;
  opacity: 0.6;
  font-size: 0.78rem;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .container {
    padding: 20px 14px 40px;
  }

  .name {
    font-size: 1.8rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .card {
    padding: 24px 18px;
  }
}