/* =========================================
   PRIYANSHU KUMAR — PORTFOLIO
   Enhancements: scroll bar, live GitHub card,
   redesigned certificates, tilt polish
   ========================================= */

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  box-shadow: 0 0 12px rgba(0,245,255,0.5);
  will-change: transform;
}

/* Tilt cards need preserve-3d + smooth reset */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.23,1,0.32,1),
              border-color 0.3s, box-shadow 0.4s;
  will-change: transform;
}

/* =========================================
   LIVE GITHUB CARD
   ========================================= */
.gh-card {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(168,85,247,0.08), transparent 45%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gh-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,245,255,0.1);
}

.gh-card .stats-header .s-icon svg { width: 20px; height: 20px; display: block; fill: var(--cyan); }

.gh-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }

/* Metrics */
.gh-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.gh-metric {
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 6px;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.gh-metric:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  background: rgba(0,245,255,0.05);
}

.gh-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
}

.gh-lbl {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 7px;
}

/* Section labels inside card */
.gh-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.gh-sub-head span:last-child { color: var(--cyan-dim); letter-spacing: 0.5px; }

/* Language bar */
.gh-lang-bar {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-surface);
}

.gh-lang-seg {
  height: 100%;
  transition: width 0.9s cubic-bezier(0.23,1,0.32,1);
}

.gh-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}

.gh-lang-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}

.gh-lang-item i {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.gh-lang-item b { color: var(--text); font-weight: 600; }

/* Heatmap */
.gh-hm-grid {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gh-hm-col { display: flex; flex-direction: column; gap: 3px; }

.gh-hm-cell {
  width: 13px; height: 13px;
  border-radius: 3px;
  background: var(--bg-surface);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s;
  flex: 0 0 auto;
}

.gh-hm-cell[data-lv="empty"] { background: transparent; }
.gh-hm-cell[data-lv="0"] { background: rgba(255,255,255,0.05); }
.gh-hm-cell[data-lv="1"] { background: rgba(0,245,255,0.25); }
.gh-hm-cell[data-lv="2"] { background: rgba(0,245,255,0.45); }
.gh-hm-cell[data-lv="3"] { background: rgba(0,245,255,0.7); }
.gh-hm-cell[data-lv="4"] { background: var(--cyan); box-shadow: 0 0 6px rgba(0,245,255,0.6); }

.gh-legend-scale {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 10px;
  font-size: 0.62rem;
  color: var(--muted);
  font-family: var(--mono);
}

.gh-legend-scale i {
  width: 11px; height: 11px; border-radius: 3px; display: inline-block;
}

.gh-status {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.gh-status.ok { color: var(--green); }

/* =========================================
   LEETCODE NATIVE CARD
   ========================================= */
.leet-native {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 30px 20px;
}

.leet-ring {
  position: relative;
  width: 168px; height: 168px;
}

.leet-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.leet-ring .ring-bg { fill: none; stroke: var(--bg-surface); stroke-width: 10; }
.leet-ring .ring-fg {
  fill: none;
  stroke: url(#leetGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 110;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.23,1,0.32,1);
}

.leet-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.leet-ring-center .big {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
}

.leet-ring-center .small {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 6px;
}

.leet-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.leet-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.leet-chip b { color: var(--cyan); }

/* =========================================
   CERTIFICATES — REDESIGN
   ========================================= */
.certs-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cert-banner {
  position: relative;
  height: 168px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  isolation: isolate;
}

.cert-banner--threat {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(0,245,255,0.28), transparent 60%),
    linear-gradient(135deg, #06121f, #0a1f2e 60%, #071018);
}

.cert-banner--cyber {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(168,85,247,0.3), transparent 60%),
    linear-gradient(135deg, #120a24, #1a1030 60%, #0a0716);
}

.cert-banner--ncert {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(34,197,94,0.28), transparent 60%),
    linear-gradient(135deg, #081b12, #0f3020 60%, #071009);
}

.cert-banner--leet {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(251,146,60,0.28), transparent 60%),
    linear-gradient(135deg, #1c1206, #241705 60%, #140d04);
}

.cert-banner--pega {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(37,99,235,0.3), transparent 60%),
    linear-gradient(135deg, #07152f, #0c2a5c 60%, #061124);
}

.cert-banner--englishscore {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(168,85,247,0.34), transparent 60%),
    linear-gradient(135deg, #17093d, #32106b 60%, #10062b);
}

.cert-banner--shl {
  background:
    radial-gradient(90% 120% at 50% -10%, rgba(20,184,166,0.3), transparent 60%),
    linear-gradient(135deg, #062b35, #0a5260 60%, #041c27);
}

/* Decorative guilloché grid */
.cert-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
  z-index: -1;
}

.cert-seal {
  width: 66px; height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.22);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.04), inset 0 0 18px rgba(255,255,255,0.06);
  position: relative;
}

.cert-seal::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.25);
  animation: spin 16s linear infinite;
}

.cert-brand {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  font-weight: 700;
}

.cert-verify {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 1px;
  padding: 4px 9px;
  border-radius: 20px;
  background: rgba(57,255,20,0.12);
  border: 1px solid rgba(57,255,20,0.4);
  color: var(--green);
}

.cert-verify::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* Shine sweep on hover */
.cert-banner .cert-shine {
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.14), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}

.cert-card:hover .cert-shine { left: 130%; }

.cert-info { padding: 20px; }
.cert-tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--purple);
}
.cert-name { font-size: 0.98rem; font-weight: 600; margin: 8px 0 6px; line-height: 1.4; }
.cert-issuer { font-family: var(--mono); font-size: 0.72rem; color: var(--cyan); letter-spacing: 0.5px; }
.cert-date { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

.cert-actions { display: flex; gap: 10px; margin-top: 16px; }

.cert-btn {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid var(--cyan);
  color: #050810;
  background: var(--cyan);
  transition: all 0.25s;
}

.cert-btn:hover { box-shadow: 0 0 18px rgba(0,245,255,0.35); transform: translateY(-2px); }

.cert-btn--ghost {
  background: transparent;
  color: var(--cyan);
}

.cert-btn--ghost:hover { background: rgba(0,245,255,0.08); }

/* =========================================
   TECH MARQUEE
   ========================================= */
.marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-item {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.marquee-item::before { content: '\25C6'; color: var(--cyan); font-size: 0.6rem; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================
   RESPONSIVE TWEAKS
   ========================================= */
@media (max-width: 600px) {
  .gh-metrics { grid-template-columns: repeat(2, 1fr); }
  .gh-num { font-size: 1.35rem; }
  .cert-banner { height: 150px; }
  .marquee-item { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .cert-seal::after { animation: none; }
  .avatar-ring::before { animation: none; }
  .gh-hm-cell { transition: none; }
}
