/* ===================================================================
   DUONG VIET TRUNG — Developer Portfolio & Game Portal Styles
   Redesigned with modern glassmorphism, animations & responsive
   =================================================================== */

:root {
  --bg-primary: #050810;
  --bg-secondary: #0c1120;
  --bg-card: rgba(15, 23, 42, 0.6);
  --bg-card-hover: rgba(20, 30, 55, 0.8);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(56, 189, 248, 0.4);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --accent: #f43f5e;
  --amber: #fbbf24;
  --green: #34d399;
  --purple: #a855f7;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 60px rgba(56, 189, 248, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.25s ease;
}

a:hover {
  color: #7dd3fc;
}

/* ── Scroll Animations ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-in {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(5, 8, 16, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(5, 8, 16, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: #fff;
}

.logo-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--primary) !important;
  border-radius: 20px !important;
}

.nav-btn:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #fff !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ── Hero Section ── */
.hero-section {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 85vh;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.glow-1 {
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
  animation: pulse 6s ease-in-out infinite;
}

.glow-2 {
  top: 50px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite reverse;
}

.glow-3 {
  bottom: -50px;
  left: -50px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.12) 0%, transparent 70%);
  animation: pulse 7s ease-in-out infinite 2s;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 8px 20px;
  border-radius: 40px;
  margin-bottom: 28px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #fff;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-desc strong {
  color: #fff;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.btn {
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.45);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: #fff;
}

.btn svg {
  flex-shrink: 0;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 20px 36px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ── AdSense Ad Slot Container ── */
.ad-container-wrap {
  max-width: 1200px;
  margin: 0 auto 50px;
  padding: 0 24px;
  text-align: center;
}

.ad-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

/* ── Section Headers ── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--primary);
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin: 10px 0 8px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Games Grid ── */
.games-section {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.game-card:hover .card-glow {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  background: var(--bg-card-hover);
}

.featured-game {
  border-color: rgba(244, 63, 94, 0.25);
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.04) 0%, rgba(168, 85, 247, 0.04) 100%);
}

.featured-game:hover {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: var(--shadow-card), 0 0 60px rgba(244, 63, 94, 0.12);
}

.card-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.badge-hot {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  color: #fde047;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.game-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.25);
  transition: transform 0.3s ease;
}

.game-card:hover .game-icon {
  transform: scale(1.05);
}

.custom-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.game-card:hover .custom-icon-box {
  transform: scale(1.05);
}

.bg-blue { background: rgba(56, 189, 248, 0.12); }
.bg-purple { background: rgba(168, 85, 247, 0.12); }
.bg-amber { background: rgba(251, 191, 36, 0.12); }
.bg-green { background: rgba(52, 211, 153, 0.12); }

.game-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
}

.game-id {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.game-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 16px;
}

.game-desc strong {
  color: #fff;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-actions {
  margin-top: auto;
}

.card-btn {
  display: block;
  text-align: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-policy {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--primary);
}

.btn-policy:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── About Section ── */
.about-section {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--purple), var(--accent));
}

.about-title {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  margin: 10px 0 4px;
  letter-spacing: -0.5px;
}

.about-role {
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 18px;
}

.about-bio {
  color: #cbd5e1;
  font-size: 1.05rem;
  max-width: 700px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.principle-item {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.principle-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.p-icon-wrap {
  flex-shrink: 0;
}

.p-icon {
  font-size: 1.8rem;
  display: block;
}

.principle-item h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 6px;
  font-weight: 700;
}

.principle-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Contact Section ── */
.contact-section {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.contact-card-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.contact-card-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  color: #fff;
}

.contact-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.contact-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.contact-value {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.contact-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.contact-card-item:hover .contact-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 24px 30px;
  background: #030508;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand h3 {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 800;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 320px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--text-dim);
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  margin-top: 28px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 8, 16, 0.98);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 4px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .hero-section {
    padding: 60px 20px 60px;
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .hero-stats {
    gap: 16px;
    padding: 16px 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .stat-divider {
    display: none;
  }

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

  .about-card {
    padding: 28px 20px;
  }

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

  .footer-container {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 6px 14px;
  }
}