/* ============ Mageshkumar P — Portfolio ============ */
:root {
  --bg: #070b14;
  --bg-alt: #0b1120;
  --card: #101a2e;
  --card-2: #14203a;
  --line: rgba(120, 160, 220, 0.14);
  --ink: #e6edf7;
  --muted: #93a4bd;
  --blue: #2f81f7;
  --cyan: #00c6ff;
  --orange: #ffb020;
  --grad: linear-gradient(90deg, #2f81f7, #00c6ff);
  --grad-orange: linear-gradient(90deg, #ffb020, #ff7a45);
  --radius: 18px;
  --nav-h: 68px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.6;
}
::selection { background: rgba(47, 129, 247, 0.4); }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#preloader.done { opacity: 0; visibility: hidden; }
/* failsafe: even if the load event never fires, never trap visitors behind the loader */
#preloader { animation: preloaderFailsafe 0.6s ease 4s forwards; }
@keyframes preloaderFailsafe { to { opacity: 0; visibility: hidden; } }
.loader-inner { text-align: center; }
.loader-logo {
  font-size: 3rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: pulse 1.2s ease infinite;
}
@keyframes pulse { 50% { transform: scale(1.12); opacity: 0.7; } }
.loader-bar { width: 160px; height: 3px; background: var(--line); border-radius: 3px; margin: 18px auto 0; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 3px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%);} 100% { transform: translateX(400%);} }

/* ---------- Scroll progress ---------- */
#scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 1001; }

/* ---------- Nav ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5vw;
  background: rgba(7, 11, 20, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
#navbar.scrolled { border-color: var(--line); background: rgba(7, 11, 20, 0.85); }
.nav-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: 1px; }
.nav-logo .dot { color: var(--cyan); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 0.92rem; font-weight: 500; color: var(--muted); position: relative; padding: 6px 0; transition: color 0.25s; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--grad); border-radius: 2px; transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  padding: 9px 22px; border-radius: 30px; font-weight: 600; font-size: 0.9rem;
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 20px rgba(47, 129, 247, 0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 198, 255, 0.45); }
#hamburger { display: none; background: none; border: 0; cursor: pointer; z-index: 1002; }
#hamburger span { display: block; width: 26px; height: 3px; margin: 5px 0; background: var(--ink); border-radius: 3px; transition: 0.3s; }
#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); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 5vw 60px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.hero-hello { color: var(--cyan); font-weight: 600; letter-spacing: 1px; margin-bottom: 10px; }
.hero-name {
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800; line-height: 1.05; margin-bottom: 8px;
}
.hero-name .ch { display: inline-block; white-space: pre; }
.hero-role {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 700; margin-bottom: 14px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-type { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--muted); margin-bottom: 16px; min-height: 1.8em; }
.hero-type #typewriter { color: var(--orange); font-weight: 700; }
.cursor-blink { animation: blink 0.8s step-end infinite; color: var(--orange); }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.hero-sub b { color: var(--ink); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: 32px; font-weight: 600; font-size: 0.97rem;
  border: 0; cursor: pointer; transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 24px rgba(47, 129, 247, 0.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 198, 255, 0.45); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid rgba(120, 160, 220, 0.35); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-3px); }
.btn-full { width: 100%; justify-content: center; }
.hero-social { display: flex; gap: 14px; }
.hero-social a {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.hero-social svg { width: 20px; height: 20px; fill: var(--muted); transition: fill 0.25s; }
.hero-social a:hover { transform: translateY(-4px); border-color: var(--cyan); background: rgba(0,198,255,0.08); }
.hero-social a:hover svg { fill: var(--cyan); }

/* hero photo */
.hero-photo-wrap { position: relative; display: flex; justify-content: center; align-items: flex-end; }
.photo-glow {
  position: absolute; width: 78%; aspect-ratio: 1; bottom: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.28), rgba(47, 129, 247, 0.12) 55%, transparent 72%);
  filter: blur(8px);
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse { 50% { transform: scale(1.08); opacity: 0.8; } }
.photo-ring {
  position: absolute; width: 72%; aspect-ratio: 1; bottom: -4%;
  border-radius: 50%;
  border: 2px dashed rgba(0, 198, 255, 0.35);
  animation: spin 26s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-photo { position: relative; z-index: 2; width: min(340px, 78%); filter: drop-shadow(0 24px 48px rgba(0,0,0,0.55)); }
.float-badge {
  position: absolute; z-index: 3;
  padding: 9px 16px; border-radius: 14px; font-size: 0.8rem; font-weight: 600;
  background: rgba(16, 26, 46, 0.85); border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.badge-1 { top: 12%; left: -2%; animation: floatY 5s ease-in-out infinite; }
.badge-2 { top: 42%; right: -4%; animation: floatY 6s ease-in-out 0.8s infinite; }
.badge-3 { bottom: 10%; left: 2%; animation: floatY 5.5s ease-in-out 1.6s infinite; }
@keyframes floatY { 50% { transform: translateY(-14px); } }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 44px; border: 2px solid rgba(147, 164, 189, 0.5); border-radius: 16px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--cyan); border-radius: 3px;
  animation: wheel 1.6s ease infinite;
}
@keyframes wheel { 0% { opacity: 1; transform: translateY(0);} 100% { opacity: 0; transform: translateY(16px);} }

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 5vw; }
.section-tag { color: var(--cyan); font-family: 'SF Mono', Consolas, monospace; font-size: 0.9rem; margin-bottom: 10px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; margin-bottom: 44px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-orange { background: var(--grad-orange); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 50px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 18px; font-size: 1.02rem; }
.about-text b { color: var(--ink); }
.about-actions { margin-top: 26px; }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.counter-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 18px; text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}
.counter-card:hover { transform: translateY(-6px); border-color: rgba(0, 198, 255, 0.45); }
.counter { font-size: 2.6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter-card span { color: var(--muted); font-size: 0.85rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  transform-style: preserve-3d;
}
.skill-card:hover { border-color: rgba(0, 198, 255, 0.5); box-shadow: 0 18px 44px rgba(0, 100, 220, 0.16); }
.skill-icon { font-size: 2rem; margin-bottom: 12px; }
.skill-card h3 { margin-bottom: 14px; font-size: 1.15rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-size: 0.78rem; font-weight: 500; color: #bcd6f5;
  background: rgba(47, 129, 247, 0.12); border: 1px solid rgba(47, 129, 247, 0.25);
  padding: 5px 12px; border-radius: 20px;
  transition: background 0.25s, transform 0.25s;
}
.tags span:hover { background: rgba(0, 198, 255, 0.22); transform: translateY(-2px); }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--cyan), transparent);
}
.timeline-item { position: relative; margin-bottom: 40px; }
.timeline-dot {
  position: absolute; left: -34px; top: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--cyan);
  box-shadow: 0 0 0 5px rgba(0, 198, 255, 0.15), 0 0 18px rgba(0, 198, 255, 0.5);
}
.timeline-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; transition: transform 0.3s, border-color 0.3s;
}
.timeline-card:hover { border-color: rgba(0, 198, 255, 0.45); }
.timeline-date {
  display: inline-block; font-size: 0.78rem; font-weight: 700; color: #fff;
  background: var(--grad); padding: 4px 14px; border-radius: 20px; margin-bottom: 12px;
}
.timeline-card h3 { font-size: 1.2rem; }
.timeline-card h4 { color: var(--cyan); font-weight: 600; margin: 2px 0 12px; }
.timeline-card li { color: var(--muted); font-size: 0.93rem; padding-left: 18px; position: relative; margin-bottom: 7px; }
.timeline-card li::before { content: '▹'; position: absolute; left: 0; color: var(--orange); }

/* ---------- Projects ---------- */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-btn {
  padding: 9px 22px; border-radius: 26px; cursor: pointer; font-weight: 600; font-size: 0.88rem;
  background: transparent; color: var(--muted); border: 1.5px solid var(--line);
  transition: all 0.25s;
}
.filter-btn:hover { color: var(--ink); border-color: rgba(0, 198, 255, 0.5); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 18px rgba(47, 129, 247, 0.35); }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  transform-style: preserve-3d;
}
.project-card:hover { border-color: rgba(0, 198, 255, 0.55); box-shadow: 0 22px 50px rgba(0, 90, 200, 0.22); }
.project-thumb {
  height: 175px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.5s; }
.project-card:hover .project-thumb img { transform: scale(1.07); }
.thumb-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  font-size: 2.6rem;
}
.thumb-placeholder small { font-size: 0.68rem; color: rgba(230, 237, 247, 0.55); letter-spacing: 1px; text-transform: uppercase; }
.project-body { padding: 20px 22px 22px; }
.project-body h3 { font-size: 1.08rem; margin-bottom: 6px; }
.project-body p { color: var(--muted); font-size: 0.87rem; margin-bottom: 14px; min-height: 40px; }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.project-stack span {
  font-size: 0.7rem; font-weight: 600; color: var(--cyan);
  background: rgba(0, 198, 255, 0.09); border: 1px solid rgba(0, 198, 255, 0.22);
  padding: 3px 10px; border-radius: 14px;
}
.project-links-hint {
  margin-top: 14px; font-size: 0.8rem; font-weight: 600; color: var(--orange);
  display: flex; align-items: center; gap: 6px;
}
.live-pill {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.6px;
  background: rgba(20, 160, 80, 0.92); color: #fff;
  padding: 4px 12px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(20, 160, 80, 0.45);
  animation: livePulse 2s ease infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 4px 22px rgba(20, 220, 100, 0.75); } }

/* ---------- Game spotlight ---------- */
.game-spot { background: radial-gradient(ellipse at 20% 50%, rgba(255, 122, 69, 0.08), transparent 55%), var(--bg); }
.game-card {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center;
  background: linear-gradient(135deg, var(--card) 0%, #1a1428 100%);
  border: 1px solid rgba(255, 176, 32, 0.25); border-radius: 26px;
  padding: 52px; overflow: hidden; position: relative;
}
.game-card::before {
  content: ''; position: absolute; top: -60px; right: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255, 176, 32, 0.18), transparent 70%); border-radius: 50%;
}
.game-info p { color: var(--muted); margin-bottom: 26px; max-width: 520px; }
.game-info b { color: var(--orange); }
.game-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.game-emoji { font-size: 7rem; animation: floatY 4s ease-in-out infinite; filter: drop-shadow(0 14px 30px rgba(255, 176, 32, 0.35)); }
.spot-dots span {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--orange); opacity: 0;
  animation: spotPop 3.2s ease infinite;
}
.spot-dots span:nth-child(1) { top: 12%; left: 18%; animation-delay: 0s; }
.spot-dots span:nth-child(2) { top: 68%; left: 10%; animation-delay: 0.6s; background: var(--cyan); }
.spot-dots span:nth-child(3) { top: 22%; right: 12%; animation-delay: 1.2s; background: var(--cyan); }
.spot-dots span:nth-child(4) { bottom: 8%; right: 22%; animation-delay: 1.8s; }
.spot-dots span:nth-child(5) { top: 48%; right: 4%; animation-delay: 2.4s; }
@keyframes spotPop {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  15%, 55% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 176, 32, 0.15); }
  70% { opacity: 0; transform: scale(0.3); }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 50px; }
.contact-lead { color: var(--muted); margin-bottom: 30px; font-size: 1.02rem; }
.contact-line {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink); font-weight: 500; margin-bottom: 18px;
  transition: color 0.25s;
}
a.contact-line:hover { color: var(--cyan); }
.ci {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: rgba(47, 129, 247, 0.12); border: 1px solid rgba(47, 129, 247, 0.25);
}
.contact-socials { display: flex; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.contact-socials a {
  color: var(--muted); font-weight: 600; font-size: 0.9rem;
  border-bottom: 2px solid transparent; padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.contact-socials a:hover { color: var(--cyan); border-color: var(--cyan); }
.contact-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { position: relative; margin-bottom: 20px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 15px 16px; border-radius: 12px;
  background: rgba(7, 11, 20, 0.6); border: 1.5px solid var(--line);
  color: var(--ink); font: inherit; font-size: 0.95rem;
  outline: none; transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0, 198, 255, 0.12);
}
.form-field label {
  position: absolute; left: 14px; top: 14px; padding: 0 6px;
  color: var(--muted); font-size: 0.92rem; pointer-events: none;
  background: transparent; transition: all 0.2s ease;
}
.form-field input:focus + label, .form-field textarea:focus + label,
.form-field input:not(:placeholder-shown) + label, .form-field textarea:not(:placeholder-shown) + label {
  top: -9px; font-size: 0.74rem; color: var(--cyan); background: var(--card); border-radius: 6px;
}
.form-status { margin-top: 14px; font-size: 0.9rem; min-height: 1.4em; }
.form-status.ok { color: #3ddc84; }
.form-status.err { color: #ff6b6b; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0; background: var(--bg-alt); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer p { color: var(--muted); font-size: 0.85rem; }
.back-top {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 1.1rem;
  transition: transform 0.25s;
}
.back-top:hover { transform: translateY(-4px); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 4vh 4vw; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 12, 0.82); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; z-index: 2; width: min(880px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 22px;
  padding: 38px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,0.05); color: var(--ink); font-size: 1rem; cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.modal-close:hover { background: rgba(255, 107, 107, 0.2); transform: rotate(90deg); }
.modal-body h3 { font-size: 1.6rem; margin-bottom: 4px; }
.modal-cat { color: var(--cyan); font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; }
.modal-body > p { color: var(--muted); margin-bottom: 18px; }
.modal-feats { margin-bottom: 20px; }
.modal-feats li { color: var(--muted); font-size: 0.92rem; padding-left: 18px; position: relative; margin-bottom: 6px; }
.modal-feats li::before { content: '▹'; position: absolute; left: 0; color: var(--orange); }
.modal-links { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.gallery-title { font-size: 0.85rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); margin: 20px 0 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery.mobile-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.gallery img {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  cursor: zoom-in; transition: transform 0.3s, border-color 0.3s;
}
.gallery img:hover { transform: scale(1.04); border-color: var(--cyan); }
.gallery-empty {
  border: 1.5px dashed rgba(120, 160, 220, 0.3); border-radius: 12px;
  padding: 26px 18px; text-align: center; color: var(--muted); font-size: 0.85rem;
  grid-column: 1 / -1;
}
.gallery-empty b { color: #bcd6f5; }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 3000; display: none;
  align-items: center; justify-content: center;
  background: rgba(2, 4, 9, 0.92); cursor: zoom-out; padding: 3vh 3vw;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 100%; max-height: 94vh; border-radius: 12px; }

/* ---------- Reveal helpers ---------- */
.reveal-up { opacity: 0; transform: translateY(46px); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .skills-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: calc(var(--nav-h) + 24px); gap: 24px; }
  .hero-photo-wrap { order: -1; }
  .hero-photo { width: min(240px, 62%); }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-social { justify-content: center; }
  .float-badge { font-size: 0.7rem; padding: 7px 12px; }
  .badge-1 { left: 4%; } .badge-2 { right: 0; } .badge-3 { left: 6%; }
  .about-grid, .contact-grid, .game-card { grid-template-columns: 1fr; }
  .game-card { padding: 34px 26px; }
  .section { padding: 80px 0; }
  .nav-cta { display: none; }
  #hamburger { display: block; }
  .nav-links {
    position: fixed; inset: 0; z-index: 1001;
    flex-direction: column; align-items: center; justify-content: center; gap: 34px;
    background: rgba(7, 11, 20, 0.97); backdrop-filter: blur(16px);
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.2rem; }
}
@media (max-width: 560px) {
  .skills-grid, .projects-grid, .form-row, .counters { grid-template-columns: 1fr; }
  .modal-card { padding: 26px 20px; }
  .timeline { padding-left: 28px; }
  .counters { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
