/* ===== THEME VARIABLES ===== */
:root {
  --bg-hero:        #0d1117;
  --bg-about:       #0d1117;
  --bg-projects:    #111827;
  --bg-credentials: #0f172a;
  --bg-contact:     #0d1117;

  --bg2:    #161b22;
  --bg3:    #1c2333;
  --border: #30363d;
  --accent:  #58a6ff;
  --accent2: #3fb950;
  --text:       #e6edf3;
  --text-muted: #8b949e;

  --card-shadow:       0 0 0 1px #30363d, 0 4px 24px rgba(0,0,0,0.4);
  --card-hover-shadow: 0 0 0 1px #58a6ff44, 0 8px 32px rgba(88,166,255,0.12);

  --glow-projects:    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(88,166,255,0.07) 0%, transparent 70%);
  --glow-credentials: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(63,185,80,0.06) 0%, transparent 70%);
}

[data-theme="light"] {
  --bg-hero:        #f5f7fa;
  --bg-about:       #f5f7fa;
  --bg-projects:    #eef2f7;
  --bg-credentials: #f0f6ff;
  --bg-contact:     #f5f7fa;

  --bg2:    #ffffff;
  --bg3:    #eaeef2;
  --border: #d0d7de;
  --accent:  #0969da;
  --accent2: #1a7f37;
  --text:       #1f2328;
  --text-muted: #656d76;

  --card-shadow:       0 0 0 1px #d0d7de, 0 4px 16px rgba(0,0,0,0.08);
  --card-hover-shadow: 0 0 0 1px #0969da66, 0 8px 24px rgba(9,105,218,0.12);

  --glow-projects:    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(9,105,218,0.05) 0%, transparent 70%);
  --glow-credentials: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(26,127,55,0.05) 0%, transparent 70%);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Syne', sans-serif;
  color: var(--text);
  transition: color 0.3s;
  overflow-x: hidden;
}

/* ===== SECTION BACKGROUNDS ===== */
.sec-hero        { background: var(--bg-hero); }
.sec-about       { background: var(--bg-about); }
.sec-projects    { background: var(--bg-projects); position: relative; }
.sec-credentials { background: var(--bg-credentials); position: relative; }
.sec-contact     { background: var(--bg-contact); }

.sec-projects::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--glow-projects);
  pointer-events: none;
}
.sec-credentials::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--glow-credentials);
  pointer-events: none;
}

/* Divider lines between sections */
.sec-about, .sec-projects, .sec-credentials, .sec-contact {
  border-top: 1px solid var(--border);
}

/* ===== HEADER ===== */
header {
  position: fixed; top: 0; width: 100%; z-index: 999;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 60px;
  background: rgba(13,17,23,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  transition: border-color 0.3s;
}
[data-theme="light"] header { background: rgba(245,247,250,0.85); }

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--accent); }

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 28px;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.3px;
  transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

.theme-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 8px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; margin-left: 24px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ===== SECTION LAYOUT ===== */
section { min-height: 100vh; }
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 60px 100px;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; color: var(--accent2);
  letter-spacing: 1px; margin-bottom: 12px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -1px; margin-bottom: 48px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -36px;
  margin-bottom: 40px;
}

/* ===== HERO ===== */
.sec-hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  padding: 120px 60px 60px;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
}
.hero-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 100px; padding: 6px 16px;
  font-size: 0.8rem; font-family: 'JetBrains Mono', monospace;
  color: var(--accent2); margin-bottom: 8px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent2); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.profile-img {
  width: 140px; height: 140px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--bg-hero), 0 0 0 5px var(--accent);
  margin-bottom: 4px;
}
.hero-content h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800; letter-spacing: -2px; line-height: 1.1;
}
.typing-wrap {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--accent); font-weight: 400;
  display: flex; align-items: center; gap: 2px;
}
.cursor { animation: blink 0.8s step-end infinite; color: var(--accent); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-content p {
  max-width: 560px; color: var(--text-muted); line-height: 1.75; font-size: 1rem;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.btn-primary, .btn-outline {
  padding: 11px 24px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem;
  text-decoration: none; transition: all 0.2s; letter-spacing: 0.2px;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== ABOUT ===== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.about-text p { color: var(--text-muted); line-height: 1.85; font-size: 1rem; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  font-family: 'JetBrains Mono', monospace; letter-spacing: -1px;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ===== PROJECT CARDS ===== */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; position: relative;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0; transform: translateY(30px);
}
.card.visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--card-hover-shadow); }
.card-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; font-weight: 700;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 2px 10px;
  border-radius: 100px; margin-bottom: 12px; letter-spacing: 0.5px;
}
.card-badge.tech { color: var(--accent); border-color: var(--accent)44; background: var(--accent)0d; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.card > p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ===== LIGHTBOX TRIGGER (shared) ===== */
.cert-card { cursor: pointer; }
.cert-img-wrap, .cred-img-wrap {
  position: relative; overflow: hidden; border-radius: 8px; margin-bottom: 14px;
}
.cert-img-wrap img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  margin-bottom: 0; border-radius: 0; display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.cert-zoom-hint {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-family: 'JetBrains Mono', monospace;
  color: #fff; opacity: 0; transition: opacity 0.25s ease;
  border-radius: 8px; letter-spacing: 0.3px;
}
.cert-card:hover .cert-zoom-hint { opacity: 1; }
.cert-card:hover .cert-img-wrap img,
.cert-card:hover .cred-img-wrap img { transform: scale(1.04); filter: brightness(0.75); }

/* ===== CREDENTIALS SLIDER ===== */
.cred-slider-wrap {
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.cred-slider {
  display: flex; gap: 16px;
  overflow: hidden;
  flex: 1;
  scroll-behavior: smooth;
}
.cred-item {
  flex: 0 0 calc(33.333% - 12px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--card-shadow);
}
.cred-item:hover { transform: translateY(-4px); box-shadow: var(--card-hover-shadow); }

.cred-img-wrap { margin-bottom: 0; border-radius: 0; }
.cred-img-wrap img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.cred-item .cert-zoom-hint { border-radius: 0; font-size: 0.75rem; }

.cred-info { padding: 12px 14px 14px; }
.cred-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; font-weight: 700;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 1px 8px;
  border-radius: 100px; margin-bottom: 6px;
}
.cred-info h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 3px; line-height: 1.3; }
.cred-info p  { font-size: 0.75rem; color: var(--text-muted); }

.cred-arrow {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); width: 36px; height: 36px;
  border-radius: 8px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s; z-index: 1;
}
.cred-arrow:hover { border-color: var(--accent); color: var(--accent); }
.cred-arrow:disabled { opacity: 0.25; cursor: default; }

.cred-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 20px;
}
.cred-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.cred-dot.active { background: var(--accent); transform: scale(1.3); }

/* ===== CONTACT ===== */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.contact-item {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  text-decoration: none; color: var(--text); transition: all 0.2s;
}
.contact-item:hover { border-color: var(--accent); transform: translateY(-4px); }
.contact-icon { font-size: 1.5rem; }
.contact-label {
  font-size: 0.75rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;
}
.contact-value { font-size: 0.9rem; font-weight: 700; word-break: break-all; }

/* ===== FOOTER ===== */
footer {
  text-align: center; padding: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-contact);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(6px); cursor: zoom-out;
}
.lightbox-content {
  position: relative; z-index: 1; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: scale(0.92); transition: transform 0.25s ease;
}
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-content img {
  max-width: 90vw; max-height: 80vh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1); display: block;
}
.lightbox-caption {
  color: rgba(255,255,255,0.7); font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; text-align: center; letter-spacing: 0.3px;
}
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; width: 38px; height: 38px; border-radius: 50%;
  font-size: 1rem; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .cred-item { flex: 0 0 calc(50% - 8px); }
}
@media (max-width: 768px) {
  header { padding: 16px 24px; }
  nav a { margin-left: 16px; font-size: 0.8rem; }
  .section-inner { padding: 100px 24px 80px; }
  .sec-hero { padding: 100px 24px 60px; }
  .about-grid { grid-template-columns: 1fr; }
  .cred-item { flex: 0 0 calc(100% - 0px); }
}
@media (max-width: 500px) {
  nav { display: none; }
}
