/* ============================================================
   Portfolio Website — style.css
   Dark/light theme via CSS custom properties
   ============================================================ */
:root {
  --bg: #0b1020;
  --bg-soft: #0f1528;
  --card: #151c36;
  --text: #e8ecf8;
  --muted: #9aa5c4;
  --primary: #7c5cff;
  --primary-2: #00d4ff;
  --gradient: linear-gradient(135deg, #7c5cff, #00d4ff);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #f5f7fd;
  --bg-soft: #eef1fa;
  --card: #ffffff;
  --text: #1a2140;
  --muted: #5b6480;
  --border: rgba(20, 30, 80, 0.1);
  --shadow: 0 12px 32px rgba(30, 40, 90, 0.12);
}

/* ---------- Reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

img, svg { vertical-align: middle; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { width: min(1120px, 92%); margin-inline: auto; }

/* ---------- Background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
  animation: float 14s ease-in-out infinite alternate;
}
.blob-1 { width: 420px; height: 420px; background: #7c5cff; top: -120px; left: -100px; }
.blob-2 { width: 380px; height: 380px; background: #00d4ff; bottom: -140px; right: -80px; animation-delay: -5s; }
.blob-3 { width: 260px; height: 260px; background: #ff5ea8; top: 40%; left: 60%; animation-delay: -9s; opacity: 0.2; }

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.12); }
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 0; transition: padding 0.3s, background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.5px; }
.logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; gap: 26px; }
.nav-link { font-weight: 600; font-size: 0.95rem; color: var(--muted); position: relative; transition: color 0.25s; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 3px; width: 0;
  background: var(--gradient); border-radius: 3px; transition: width 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  font-size: 1.15rem; width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  display: grid; place-items: center; transition: transform 0.3s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }

.hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.hamburger span { width: 24px; height: 3px; border-radius: 2px; background: var(--text); transition: 0.3s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px;
  font-weight: 700; font-size: 0.98rem; transition: transform 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(124, 92, 255, 0.5); }
.btn-ghost { border: 2px solid var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--primary); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; text-align: center; padding-top: 80px; }
.hero-inner { max-width: 780px; }
.hero-greet { font-size: 1.2rem; color: var(--muted); margin-bottom: 8px; }
.hero-name {
  font-size: clamp(2.8rem, 7vw, 4.8rem); font-weight: 900; line-height: 1.1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 600; margin: 12px 0 18px; min-height: 1.7em; }
#typed { color: var(--primary-2); }
.type-cursor { animation: blink 0.8s steps(1) infinite; color: var(--primary-2); }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.hero-socials { display: flex; gap: 14px; justify-content: center; }
.hero-socials a {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  transition: transform 0.25s, color 0.25s, border-color 0.25s;
}
.hero-socials a:hover { transform: translateY(-4px); color: var(--primary-2); border-color: var(--primary-2); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-soft); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); text-align: center; margin-bottom: 10px; }
.section-title span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 48px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.code-card {
  background: #0d1326; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.code-dots { display: flex; gap: 8px; padding: 14px 16px; background: rgba(255, 255, 255, 0.04); }
.code-dots span { width: 12px; height: 12px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }
.code-card pre { padding: 22px; overflow-x: auto; font-size: 0.92rem; line-height: 1.8; color: #c9d4f2; }
.c-kw  { color: #c792ea; }
.c-var { color: #82aaff; }
.c-str { color: #c3e88d; }
.c-num { color: #f78c6c; }

.about-text p { color: var(--muted); margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0; }
.stat { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 8px; }
.stat > span { font-size: 1.5rem; font-weight: 900; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat p { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; margin-bottom: 40px; }
.skill-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; font-size: 0.95rem; }
.skill-bar { height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; }
.skill-fill {
  height: 100%; width: 0; border-radius: 6px; background: var(--gradient);
  transition: width 1.1s cubic-bezier(0.25, 1, 0.4, 1);
}
.toolbox { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tool-chip {
  padding: 9px 18px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--border); font-size: 0.88rem; font-weight: 600; color: var(--muted);
  transition: transform 0.25s, border-color 0.25s;
}
.tool-chip:hover { transform: translateY(-3px); border-color: var(--primary); color: var(--text); }

/* ---------- Projects ---------- */
.filter-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 42px; }
.filter-btn {
  padding: 10px 26px; border-radius: 999px; font-weight: 700; font-size: 0.92rem;
  background: var(--card); border: 1px solid var(--border); color: var(--muted); transition: 0.25s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--gradient); color: #fff; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--primary); }
.project-card.hide { display: none; }
.project-thumb {
  height: 150px; display: grid; place-items: center; font-size: 3.6rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}
.thumb-1 { background: linear-gradient(135deg, #ff9a9e, #fecfef); }
.thumb-2 { background: linear-gradient(135deg, #f6d365, #fda085); }
.thumb-3 { background: linear-gradient(135deg, #5ee7df, #b490ca); }
.thumb-4 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.thumb-5 { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.thumb-6 { background: linear-gradient(135deg, #fccb90, #d57eeb); }
.project-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body h3 { font-size: 1.15rem; }
.project-body p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span {
  font-size: 0.75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-2);
}
.project-links { display: flex; gap: 18px; margin-top: 4px; }
.project-links a { font-size: 0.88rem; font-weight: 700; color: var(--muted); transition: color 0.25s; }
.project-links a:hover { color: var(--primary-2); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 44px; align-items: start; }
.contact-info h3 { font-size: 1.4rem; margin-bottom: 12px; }
.contact-info p { color: var(--muted); margin-bottom: 22px; }
.info-item {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; font-weight: 600;
}
.contact-form {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--bg-soft);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  transition: border-color 0.25s, box-shadow 0.25s; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.field input.invalid, .field textarea.invalid { border-color: #ff5e78; }
.error { color: #ff5e78; font-size: 0.78rem; min-height: 1em; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.footer-links a:hover { color: var(--primary-2); }

/* ---------- Back to top & toast ---------- */
#backToTop {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem;
  background: var(--gradient); color: #fff; box-shadow: 0 8px 22px rgba(124, 92, 255, 0.4);
  opacity: 0; pointer-events: none; transform: translateY(14px); transition: 0.3s;
}
#backToTop.show { opacity: 1; pointer-events: auto; transform: none; }
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 80px);
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  padding: 14px 26px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; transition: 0.35s; z-index: 200; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: fixed; top: 64px; right: 0; flex-direction: column; gap: 0;
    background: var(--card); min-width: 220px; border: 1px solid var(--border);
    border-radius: 0 0 0 16px; padding: 10px 0; box-shadow: var(--shadow);
    transform: translateX(110%); transition: transform 0.3s;
  }
  .nav-links.open { transform: none; }
  .nav-links li { padding: 12px 26px; }
  .hamburger { display: flex; }
  .hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 620px) {
  .projects-grid, .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 72px 0; }
}
