/* ================== Variables ================== */
:root {
  --bg: #f7f7fb;
  --card: rgba(255,255,255,0.95);
  --text: #0f1724;
  --muted: #6b7280;
  --accent: linear-gradient(90deg,#ef4444,#dc2626); /* red gradient */
  --glass: rgba(255,255,255,0.9);
  --shadow: 0 8px 24px rgba(12,14,20,0.06);
}

[data-theme="dark"] {
  --bg: #1f1f23;
  --card: rgba(31,31,35,0.95);
  --text: #f3f4f6;
  --muted: #9aa6bd;
  --accent: linear-gradient(90deg,#ef4444,#b91c1c); /* darker red gradient */
  --glass: rgba(255,255,255,0.05);
  --shadow: 0 8px 24px rgba(2,6,23,0.7);
}

/* ================== Fonts & Box Sizing ================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Poppins:wght@600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg));
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

/* ================== Background Pattern ================== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(239,68,68,0.03),
    rgba(239,68,68,0.03) 1px,
    transparent 1px,
    transparent 6px
  );
  pointer-events: none;
  z-index: -1;
}

/* ================== Layout ================== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  flex: 1; /* allow container to expand to push footer down */
  display: flex;
  flex-direction: column;
}

/* header and brand */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.header-actions { display:flex; align-items:center; gap:12px; }
.brand { display: flex; gap: 12px; align-items: center; }

.profile {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.profile:hover { transform: scale(1.05); box-shadow: 0 12px 24px rgba(237,58,58,0.25); }
.profile img { width: 100%; height: 100%; object-fit: cover; display: block; }

h1 { font-size: 20px; margin: 0; }
p.lead { margin: 0; color: var(--muted); }

nav a {
  margin-left: 14px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.3s;
}
nav a:hover { color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: var(--glass);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.theme-toggle i { transition: transform 0.3s; }
.theme-toggle:hover i { transform: rotate(20deg); }

/* ================== Hero ================== */
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: center;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at top left, rgba(239,68,68,0.1), transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(237,58,58,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(237,58,58,0.25); }

.intro h2 { margin: 0 0 8px 0; font-size: 28px; font-family: Poppins, sans-serif; }
.intro p { margin: 0 0 12px 0; color: var(--muted); }

.cta { display: flex; gap: 10px; }

/* ================== Buttons ================== */
.btn {
  background: var(--accent);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background-position 0.5s;
}
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid rgba(237,58,58,0.12);
}

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

/* ================== About / Timeline ================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { margin-bottom: 12px; padding-left: 12px; border-left: 2px dashed rgba(0,0,0,0.06); }

[data-theme="dark"] .timeline li { border-left: 2px dashed rgba(255,255,255,0.15); }

/* ================== Skills ================== */
.skills { display: flex; gap: 8px; flex-wrap: wrap; }
.skill {
  padding: 8px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(237, 58, 58, 0.12), rgba(237, 58, 58, 0.06));
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: box-shadow 0.3s, transform 0.3s;
}
.skill:hover {
  box-shadow: 0 0 8px rgba(237, 58, 58, 0.3);
  transform: scale(1.05);
}
[data-theme="dark"] .skill:hover { box-shadow:0 0 8px rgba(246,92,92,0.6); }

/* ================== Projects ================== */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s, background 0.4s; }
.project:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(237,58,58,0.25); }
.project .thumb {
  height: 140px;
  background: linear-gradient(135deg, rgba(237,58,58,0.12), rgba(237,58,58,0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
}
[data-theme="dark"] .project .thumb {
  background: linear-gradient(135deg, rgba(237,58,58,0.2), rgba(237,58,58,0.1));
}
.project .meta { padding: 14px; background: var(--card); }
.project h3 { margin: 0 0 6px 0; font-family: Poppins, sans-serif; }
.project p { margin: 0; color: var(--muted); font-size: 14px; }

/* ================== Contact ================== */
form { display: flex; flex-direction: column; gap: 10px; }
input, textarea {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  color: var(--text);
  transition: border-color 0.3s, background 0.3s;
}
textarea { min-height: 110px; }

/* ================== Footer ================== */
footer {
  margin-top: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0; /* ensures footer is not squeezed in flex container */
}

/* ================== Responsive Enhancements ================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero .intro h2 { font-size: 24px; }
  .hero .intro p { font-size: 14px; }
}

@media (max-width: 900px) {
  .projects { grid-template-columns: 1fr; gap: 14px; }
  .grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .profile { width: 56px; height: 56px; border-radius: 12px; }
  nav a { margin-left: 10px; font-size: 14px; }
  .cta { flex-direction: column; gap: 8px; }
}

@media (max-width: 600px) {
  .container { padding: 16px; margin: 24px auto; }
  h1 { font-size: 18px; }
  .intro h2 { font-size: 20px; }
  .intro p { font-size: 13px; }
  .projects .project .thumb { height: 120px; font-size: 12px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  input, textarea { font-size: 14px; }
  .scroll-btn { width: 100%; padding: 10px 0; font-size: 15px; }
}

@media (max-width: 400px) {
  h1 { font-size: 16px; }
  .intro h2 { font-size: 18px; }
  .intro p { font-size: 12px; }
  .theme-toggle { padding: 6px; gap: 6px; font-size: 12px; }
  .btn { padding: 6px 10px; font-size: 13px; }
}

/* ================== Utility ================== */
.muted { color: var(--muted); }
.caps { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* ================== Scroll Animations ================== */
.fade-up, .fade-left, .fade-right {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease;
}
.fade-left { transform: translateX(-20px); }
.fade-right { transform: translateX(20px); }
.visible { transform: none; opacity: 1; }

/* ================== Welcome Popup ================== */
#welcomePopup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--card);
  color: var(--text);
  padding: 24px 32px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s, transform 0.3s;
  z-index: 9999;
}
#welcomePopup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
#welcomePopup button {
  margin-top: 12px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}
#welcomePopup button:active { transform: scale(0.95); }

/* ================== Scroll Button Styling ================== */
.scroll-btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  background: linear-gradient(90deg, #ef4444, #dc2626);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 4px 12px rgba(237,58,58,0.3);
  transition: transform 0.2s, box-shadow 0.3s;
}
.scroll-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(237,58,58,0.4); }
.scroll-btn:active { transform: scale(0.95); box-shadow: 0 3px 8px rgba(237,58,58,0.3); }

/* ================== Custom Scrollbar ================== */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #ef4444, #dc2626); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #dc2626, #b91c1c); }
* { scrollbar-width: thin; scrollbar-color: #ef4444 var(--bg); }

/* ============================
   📱 BURGER MENU STYLE
============================ */
#burgerMenu {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: inherit;
  margin-right: 10px;
}

/* Rotate icon when active */
#burgerMenu.active i {
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

#burgerMenu i {
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* Default nav style */
header nav {
  display: flex;
  gap: 1rem;
}

header nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

/* 📱 Mobile view */
@media (max-width: 768px) {
  #burgerMenu {
    display: block;
    font-size: 28px;
  }

  header nav {
    display: none;
    flex-direction: column;
    background: var(--bg, #fff);
    position: absolute;
    top: 70px;
    right: 20px;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
  }

  header nav.show {
    display: flex;
  }

  header nav a {
    display: block;
    padding: 0.5rem 0;
  }
}
