/* ═══════════════════════════════════════════════
   DEFAULTS on :root  — these show even before JS
═══════════════════════════════════════════════ */
:root {
  /* default = dark + fire */
  --bg:      #0f0f10;
  --bg2:     #161618;
  --card:    #1c1c1f;
  --border:  #2c2c30;
  --text:    #f2f2f4;
  --muted:   #888892;
  --nav:     rgba(15,15,16,0.92);
  --inp:     #232328;
  --ph:      #555560;

  --accent:  #e63030;
  --ag:      rgba(230,48,48,0.20);
  --as:      rgba(230,48,48,0.08);
  --ai:      brightness(0) saturate(100%) invert(26%) sepia(90%) saturate(800%) hue-rotate(340deg);
}

/* ── DARK MODE ── */
[data-mode="dark"] {
  --bg:      #0f0f10;
  --bg2:     #161618;
  --card:    #1c1c1f;
  --border:  #2c2c30;
  --text:    #f2f2f4;
  --muted:   #888892;
  --nav:     rgba(15,15,16,0.92);
  --inp:     #232328;
  --ph:      #555560;
}

/* ── LIGHT MODE ── */
[data-mode="light"] {
  --bg:      #f8f8f9;
  --bg2:     #eeeeef;
  --card:    #ffffff;
  --border:  #dddde0;
  --text:    #111114;
  --muted:   #666672;
  --nav:     rgba(248,248,249,0.92);
  --inp:     #f0f0f2;
  --ph:      #aaaaaa;
}

/* ── ACCENT COLORS ── */
[data-color="fire"]     { --accent:#e63030; --ag:rgba(230,48,48,0.20);   --as:rgba(230,48,48,0.08);   --ai:brightness(0) saturate(100%) invert(26%) sepia(90%) saturate(800%) hue-rotate(340deg); }
[data-color="sky"]      { --accent:#0ea5e9; --ag:rgba(14,165,233,0.20);  --as:rgba(14,165,233,0.08);  --ai:brightness(0) saturate(100%) invert(52%) sepia(80%) saturate(600%) hue-rotate(180deg); }
[data-color="mint"]     { --accent:#10b981; --ag:rgba(16,185,129,0.20);  --as:rgba(16,185,129,0.08);  --ai:brightness(0) saturate(100%) invert(55%) sepia(70%) saturate(500%) hue-rotate(120deg); }
[data-color="gold"]     { --accent:#f59e0b; --ag:rgba(245,158,11,0.20);  --as:rgba(245,158,11,0.08);  --ai:brightness(0) saturate(100%) invert(72%) sepia(80%) saturate(600%) hue-rotate(10deg); }
[data-color="violet"]   { --accent:#8b5cf6; --ag:rgba(139,92,246,0.20);  --as:rgba(139,92,246,0.08);  --ai:brightness(0) saturate(100%) invert(42%) sepia(60%) saturate(600%) hue-rotate(240deg); }
[data-color="rose"]     { --accent:#f43f5e; --ag:rgba(244,63,94,0.20);   --as:rgba(244,63,94,0.08);   --ai:brightness(0) saturate(100%) invert(35%) sepia(90%) saturate(700%) hue-rotate(320deg); }
[data-color="midnight"] { --accent:#6366f1; --ag:rgba(99,102,241,0.20);  --as:rgba(99,102,241,0.08);  --ai:brightness(0) saturate(100%) invert(40%) sepia(70%) saturate(700%) hue-rotate(210deg); }

/* ═══════════════════════════════════════════════
   RESET
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.65;
}

a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
img { display: block; }

/* ═══════════════════════════════════════════════
   THEME PANEL
═══════════════════════════════════════════════ */
.theme-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
}

.theme-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: border-color 0.2s;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn img   { width: 15px; height: 15px; filter: var(--ai); }
.caret { transition: transform 0.25s; }
.theme-panel.open .caret { transform: rotate(180deg); }

.theme-drop {
  display: none;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  bottom: calc(100% + 10px); right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.theme-panel.open .theme-drop { display: flex; }

.mode-row { display: flex; gap: 8px; }
.mode-pill {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 0; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.mode-pill img { width: 13px; height: 13px; filter: var(--ai); }
.mode-pill:hover,
.mode-pill.on { border-color: var(--accent); color: var(--accent); background: var(--as); }

.tp-hr { border: none; border-top: 1px solid var(--border); }

.clr-list { display: flex; flex-direction: column; gap: 2px; }
.clr-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 10px; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.clr-btn span {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.clr-btn:hover { background: var(--as); color: var(--text); }
.clr-btn.on    { border-color: var(--accent); color: var(--text); background: var(--as); }

/* ═══════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 36px;
  background-color: var(--nav);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 21px; font-weight: 800;
  letter-spacing: -0.03em;
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.hamburger {
  display: none;
  background: none; border: none;
  width: 36px; height: 36px;
  cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.hamburger img { width: 24px; height: 24px; filter: var(--ai); }

.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed; top: 62px; left: 0; right: 0;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 850;
  padding: 20px 28px; gap: 18px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 16px; font-weight: 500; color: var(--text); }

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
.hero {
  position: relative;
  background-color: var(--bg);   /* solid — always visible */
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 70px;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

#fireCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.72;
}

.hero-inner {
  position: relative; z-index: 2;
  max-width: 1080px; margin: 0 auto;
  padding: 60px 28px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 48px; width: 100%;
}

.hero-text { flex: 1; max-width: 560px; }

.badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); border: 1px solid var(--accent);
  padding: 3px 12px; border-radius: 50px;
  margin-bottom: 20px;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: var(--text);
}
h1 em { font-style: normal; color: var(--accent); }

.role { font-size: 17px; color: var(--muted); margin-bottom: 16px; }
.bio  { font-size: 15px; color: var(--muted); line-height: 1.75; max-width: 460px; margin-bottom: 30px; }

.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

.btn-solid {
  display: inline-flex; align-items: center; gap: 8px;
  background-color: var(--accent); color: #fff;
  padding: 11px 24px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
  border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-solid:hover { opacity: 0.88; transform: translateY(-2px); box-shadow: 0 8px 24px var(--ag); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); color: var(--text);
  background: transparent;
  padding: 11px 24px; border-radius: 8px;
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--as); }

.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat  { display: flex; flex-direction: column; }
.stat b    { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }

/* avatar */
.hero-avatar { position: relative; width: 260px; height: 260px; flex-shrink: 0; }

.av-ring {
  width: 200px; height: 200px; border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 40px var(--ag);
  display: flex; align-items: center; justify-content: center;
  margin: 30px auto 0;
  animation: spin 12s linear infinite;
  position: relative;
}
.av-ring::before {
  content: '';
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px dashed var(--accent); opacity: 0.3;
}
.av-core {
  width: 168px; height: 168px; border-radius: 50%;
  background-color: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 42px; font-weight: 800;
  color: var(--accent);
  animation: spin 12s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  position: absolute;
  background-color: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 4px 12px; border-radius: 50px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  animation: float 3s ease-in-out infinite;
}
.chip1 { top: 0;   left: 0;      animation-delay: 0s; }
.chip2 { top: 38%; right: -16px; animation-delay: 0.8s; }
.chip3 { bottom: 14px; left: 4px; animation-delay: 1.6s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-9px); }
}

/* ═══════════════════════════════════════════════
   SECTIONS — all have explicit solid backgrounds
═══════════════════════════════════════════════ */
.section {
  background-color: var(--bg);
  padding: 96px 0;
}
.section.alt {
  background-color: var(--bg2);
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

.sec-h {
  font-family: 'Syne', sans-serif;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
}
.sec-h::after { content: '.'; color: var(--accent); }
.sec-p { font-size: 15px; color: var(--muted); margin-bottom: 44px; }

/* ═══════════════════════════════════════════════
   SKILLS
═══════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 13px;
}
.skill {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: default;
}
.skill:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px var(--ag);
}
.skill img { width: 36px; height: 36px; object-fit: contain; }
[data-mode="dark"] .skill img[alt="Django"],
[data-mode="dark"] .skill img[alt="GitHub"] { filter: invert(1); }

/* ═══════════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════════ */
.proj-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.proj-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--ag);
}
.proj-img { width: 240px; flex-shrink: 0; overflow: hidden; }
.proj-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.proj-card:hover .proj-img img { transform: scale(1.04); }

.proj-info {
  padding: 28px 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.proj-tag  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.proj-info h3 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--text); }
.proj-info p  { font-size: 14px; color: var(--muted); line-height: 1.7; }

.proj-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--accent);
  margin-top: 4px; transition: gap 0.2s;
}
.proj-link:hover { gap: 9px; }
.proj-link img { width: 14px; height: 14px; filter: var(--ai); }

/* ═══════════════════════════════════════════════
   TIMELINE
═══════════════════════════════════════════════ */
.timeline { border-left: 2px solid var(--border); padding-left: 28px; }
.tl-item  { position: relative; padding-bottom: 32px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute; left: -37px; top: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 12px var(--ag);
}
.tl-date { display: block; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.tl-body h3 { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.tl-body p  { font-size: 14px; color: var(--muted); }

/* ═══════════════════════════════════════════════
   EDUCATION & ACHIEVEMENTS
═══════════════════════════════════════════════ */
.group-title {
  display: flex; align-items: center; gap: 9px;
  font-family: 'Syne', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}
.group-title img { width: 20px; height: 20px; filter: var(--ai); }

/* Education list */
.edu-list {
  border-left: 2px solid var(--border);
  padding-left: 24px;
  margin-bottom: 8px;
}
.edu-item {
  position: relative;
  padding-bottom: 28px;
}
.edu-item:last-child { padding-bottom: 0; }
.edu-item::before {
  content: '';
  position: absolute; left: -32px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--ag);
}
.edu-year { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 4px; }
.edu-body h4 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.edu-body p  { font-size: 13px; color: var(--muted); }

/* Certificate grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.cert-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}
.cert-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.cert-ico  { width: 28px; height: 28px; flex-shrink: 0; filter: var(--ai); margin-top: 2px; }
.cert-body h4 { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.cert-body p  { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
.contact-wrap { display: flex; gap: 60px; align-items: flex-start; }
.contact-left .sec-p { margin-bottom: 24px; }

.socials { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.socials a {
  width: 42px; height: 42px; border-radius: 10px;
  background-color: var(--card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.socials a:hover { border-color: var(--accent); background: var(--as); transform: translateY(-3px); }
.socials a img { width: 18px; height: 18px; filter: var(--ai); }

.loc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.loc img { width: 16px; height: 16px; filter: var(--ai); }

.contact-form { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.fg input,
.fg textarea {
  background-color: var(--inp);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--text);
  outline: none; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fg input::placeholder,
.fg textarea::placeholder { color: var(--ph); }
.fg input:focus,
.fg textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--as); }

.form-submit { border: none; cursor: pointer; margin-top: 4px; justify-content: center; }
.form-submit img { width: 15px; height: 15px; filter: brightness(10); }
.form-note { font-size: 13px; color: var(--accent); min-height: 18px; }

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.footer {
  background-color: var(--bg);
  text-align: center;
  padding: 28px;
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════
   REVEAL ANIMATION
═══════════════════════════════════════════════ */

/* Only hide elements when JS is ready (js-ready class on body) */
body.js-ready .rev {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.rev.show {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .hero-inner { flex-direction: column; text-align: center; padding: 40px 28px 60px; }
  .hero-text  { max-width: 100%; }
  .bio        { max-width: 100%; }
  .hero-btns, .stats { justify-content: center; }
  .hero-avatar { width: 200px; height: 200px; }
  .av-ring  { width: 160px; height: 160px; }
  .av-core  { width: 130px; height: 130px; font-size: 34px; }
  .contact-wrap { flex-direction: column; gap: 40px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .navbar    { padding: 16px 20px; }
  .proj-card { flex-direction: column; }
  .proj-img  { width: 100%; height: 180px; }
  .cert-grid { grid-template-columns: 1fr; }
  .theme-panel { bottom: 16px; right: 16px; }
}
