/* ===== Professional Theme Variables ===== */
:root {
  --primary: #438ae6;
  --primary-dark: #1e63c6;
  --secondary: #d4e5ff;
  --accent: #00c853;
  --bg-body: #f4f7fa;
  --bg-gradient: linear-gradient(135deg, #e0f2fe, #bae6fd);
  --text-main: #2d3436;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(255, 255, 255, 0.5);
  --footer-bg: linear-gradient(135deg, #1e3a8a, #1e40af);
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --blur: 15px;
}

body.dark {
  --bg-body: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b);
  --text-main: #f1f5f9;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.05);
  --secondary: #334155;
  --footer-bg: linear-gradient(135deg, #020617, #0f172a);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background 0.4s ease, color 0.4s ease, border 0.4s ease;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  background: var(--bg-gradient);
  color: var(--text-main);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ===== Header ===== */
header {
  background: rgba(67, 138, 230, 0.85);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  transition: 0.5s;
}

nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  opacity: 0.9;
}

.toggle-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Hamburger ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  padding: 9px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(22, 60, 140, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 16px 5%;
  z-index: 998;
}

.nav-dropdown.open {
  display: block;
}

.nav-dropdown ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-dropdown ul a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.9;
}

/* ===== Hero ===== */
#hero {
  padding: 100px 5%;
  text-align: center;
  background: linear-gradient(-45deg, #438ae6, #1e63c6, #020617, #3b82f6);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: #fff;
  clip-path: ellipse(150% 100% at 50% 0%);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.LogoContainer img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ===== Layout & Static Cards ===== */
.blog-section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-section h2 {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 40px;
}

.blog-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

/* ===== Pill Tags ===== */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tag-paper {
  background: rgba(67, 138, 230, 0.18);
  color: #438ae6;
  border: 1px solid rgba(67, 138, 230, 0.35);
}

.tag-folia {
  background: rgba(0, 200, 83, 0.15);
  color: #00c853;
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.tag-version {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tag-type {
  background: rgba(251, 191, 36, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ===== Scroll Wrapper ===== */
.scroll-wrapper {
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.blog-scroll {
  display: flex;
  width: max-content;
  gap: 20px;
  animation: scroll 10s linear infinite;
}

.scroll-wrapper:hover .blog-scroll {
  animation-play-state: paused;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 10px)); }
}

.blog-card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--blur));
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  min-width: 50px;
  max-width: 400px;
  flex-shrink: 0;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.blog-card h3 {
  color: var(--primary-dark);
  margin-bottom: 15px;
}

.blog-card a {
  margin-top: auto;
  text-decoration: none;
  color: var(--primary);
  font-weight: bold;
  padding-top: 15px;
  display: inline-block;
}

.skill-card {
  text-align: center;
  min-width: 180px;
  padding: 20px;
}

/* ===== Footer ===== */
footer {
  padding: 50px 5%;
  background: var(--footer-bg);
  color: #fff;
  text-align: center;
}

#copyMessage {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 10px 25px;
  border-radius: 50px;
  opacity: 0;
  z-index: 2000;
  transition: 0.4s;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Header */
  header {
    padding: 0.85rem 4%;
    position: relative; /* so dropdown is relative to header */
  }

  .logo {
    font-size: 1.2rem;
  }

  /* Hide desktop nav links, show hamburger */
  nav > .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Hero */
  #hero {
    padding: 60px 5% 70px;
    clip-path: ellipse(200% 100% at 50% 0%);
  }

  .LogoContainer img {
    width: 100px;
    height: 100px;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero p {
    font-size: 0.9rem;
  }

  /* Sections */
  .blog-section {
    padding: 50px 4%;
  }

  .blog-section h2 {
    font-size: 1.7rem;
    margin-bottom: 28px;
  }

  /* Featured cards — stack to single column */
  .blog-container {
    grid-template-columns: 1fr;
  }

  /* Featured full-width cards — remove forced min-width */
  .blog-card[style*="min-width: 100%"] {
    min-width: unset !important;
    width: 100%;
  }

  /* Scroll cards — narrower on mobile */
  .scroll-wrapper .blog-card {
    min-width: 260px;
    max-width: 280px;
    padding: 20px;
  }

  .skill-card {
    min-width: 130px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.1rem;
    gap: 8px;
  }

  .nav-logo {
    width: 32px;
    height: 32px;
  }

  #hero h1 {
    font-size: 1.75rem;
  }

  .blog-section h2 {
    font-size: 1.5rem;
  }

  .blog-card {
    padding: 20px;
  }

  footer {
    padding: 35px 5%;
    font-size: 0.9rem;
  }
}