/* Ritesh Kumar Mishra — Portfolio Styles */
:root {
  --bg-1: #0f0c29;
  --bg-2: #302b63;
  --bg-3: #24243e;
  --text: #e6e6f0;
  --muted: #b8b9c3;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.06);
  --accent-1: #6ee7f9;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
  color: var(--text);
  background: linear-gradient(-45deg, var(--bg-1), var(--bg-2), var(--bg-3));
  background-size: 400% 400%;
  animation: gradientShift 25s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}
.container.narrow { width: min(900px, 92%); }

.section { padding: 96px 0; position: relative; }
.section-title { font-size: clamp(28px, 3vw, 40px); margin: 0 0 24px; }
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: linear-gradient( to bottom, rgba(10,10,18,.55), rgba(10,10,18,.15)); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { font-weight: 700; letter-spacing: .3px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: rgba(255,255,255,.06); border: 1px solid var(--border); padding: 2px; transition: transform .2s ease, box-shadow .2s ease; }
.brand:hover .brand-logo { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle { display: none; border: 1px solid var(--border); background: rgba(255,255,255,.06); color: var(--text); border-radius: 10px; padding: 8px; width: 42px; height: 42px; align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: transform .18s ease, background .2s ease; }
.nav-toggle:hover { transform: translateY(-1px); }
.nav-toggle .bar { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-toggle .bar + .bar { margin-top: 4px; }

.nav { display: flex; gap: 14px; align-items: center; }
.nav-link { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; transition: color .25s, background .25s, transform .2s; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.08); transform: translateY(-1px); }

/* Prevent body scroll when mobile menu open */
.no-scroll { overflow: hidden; }

/* Hero */
.hero { padding-top: 120px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .hero { padding-top: 96px; } }

/* Mobile layout enhancements */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  /* Transform nav into a dropdown panel */
  .nav { position: fixed; top: 68px; right: 4%; left: 4%; display: grid; gap: 8px; background: linear-gradient(to bottom, rgba(10,10,18,.95), rgba(10,10,18,.85)); border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.5); transform: scaleY(0); transform-origin: top; opacity: 0; pointer-events: none; backdrop-filter: blur(10px); }
  .nav.open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .nav-link { padding: 12px 14px; border-radius: 12px; }
  .brand-logo { width: 28px; height: 28px; }
  .section { padding: 84px 0; }
  .cta { flex-direction: column; align-items: stretch; }
  .code-output { max-height: 300px; }
}

@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .site-header .container { padding: 12px 0; }
  .social { width: 40px; height: 40px; }
}
.title { font-size: clamp(30px, 6vw, 56px); line-height: 1.1; margin: 0 0 14px; }
.grad { background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { color: var(--muted); margin: 0 0 24px; }
.cta { display: flex; gap: 12px; margin: 20px 0 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); color: var(--text); text-decoration: none; padding: 12px 18px; border-radius: 14px; transition: transform .18s ease, box-shadow .2s ease, background .2s ease, color .2s ease; position: relative; overflow: hidden; }
.btn-sm { padding: 8px 12px; border-radius: 10px; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: linear-gradient(135deg, rgba(110,231,249,.2), rgba(167,139,250,.2)); border-color: rgba(255,255,255,.25); }
.btn-primary:hover { background: linear-gradient(135deg, rgba(110,231,249,.35), rgba(167,139,250,.35)); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-link { color: var(--accent-1); border: none; padding: 0; }
.btn-link:hover { color: #8be9f9; box-shadow: none; transform: none; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--glass); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 2px 16px rgba(0,0,0,.25); }
.card.glass { backdrop-filter: blur(8px); }
.hover-rise { transition: transform .2s ease, box-shadow .25s ease; }
.hover-rise:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,.45); }

.hero-art { display: grid; gap: 16px; }

/* Code box (transparent terminal) */
.code-box { background: rgba(10,10,18,.35); border: 1px solid var(--border); border-radius: 16px; backdrop-filter: blur(8px); box-shadow: 0 2px 20px rgba(0,0,0,.35); overflow: hidden; }
.code-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,.02)); }
.code-header .dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5f56; box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f; opacity: .85; }
.code-title { margin-left: auto; color: var(--muted); font-size: 12px; }
.code-output { margin: 0; padding: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; line-height: 1.5; white-space: pre-wrap; max-height: 360px; overflow: auto; color: var(--text); }
.caret { display: inline-block; width: 8px; height: 1em; background: rgba(255,255,255,.85); vertical-align: -2px; animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }

/* Socials */
.socials { display: flex; gap: 10px; margin-top: 10px; }
.social { color: var(--muted); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; transition: transform .18s, background .18s, color .18s; }
.social:hover { background: rgba(255,255,255,.1); color: var(--text); transform: translateY(-2px) scale(1.03); }

/* Skills */
.skills { display: grid; gap: 14px; }
.skill .label { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.bar { background: rgba(255,255,255,.08); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; height: 12px; }
.fill { display: block; height: 100%; width: var(--val, 0%); background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3)); box-shadow: inset 0 0 12px rgba(255,255,255,.2); border-right: 1px solid rgba(255,255,255,.45); transition: width 1.6s cubic-bezier(.2,.65,.2,1); position: relative; overflow: hidden; }
/* Sliding shimmer while bar animates */
.fill.animated::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(120deg, rgba(255,255,255,.0) 0%, rgba(255,255,255,.25) 40%, rgba(255,255,255,.0) 70%); background-size: 200% 100%; animation: progressSlide 1.2s ease-in-out infinite; mix-blend-mode: overlay; }
@keyframes progressSlide { 0% { background-position: -100% 0; } 100% { background-position: 100% 0; } }

/* Quote & Highlights */
.quote { margin: 18px 0 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.06); backdrop-filter: blur(6px); font-style: italic; color: var(--text); box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.highlights { margin-top: 14px; }
.highlights-title { margin: 8px 0 8px; font-size: 18px; color: var(--muted); }
.highlights-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.highlights-list li { position: relative; padding: 10px 12px 10px 40px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.05); transition: transform .15s ease, background .2s ease; }
.highlights-list li:hover { transform: translateY(-2px); background: rgba(255,255,255,.07); }
.highlights-list li strong { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #0b0b12; background: linear-gradient(135deg, rgba(110,231,249,.9), rgba(167,139,250,.9)); border: 1px solid rgba(255,255,255,.35); }
.highlights-list li::before { content: "•"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
/* Specific icons for categories */
.highlights-list li.tag-leadership::before { content: "🏆"; font-size: 16px; }
.highlights-list li.tag-workshops::before { content: "🛠️"; font-size: 16px; }
@media (max-width: 800px) { .highlights-list { grid-template-columns: 1fr; } }

/* Contact */
.contact-form { display: grid; gap: 14px; margin-top: 10px; }
.field { display: grid; gap: 6px; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.06); color: var(--text); outline: none; transition: border-color .25s, background .25s, box-shadow .25s; }
.field input:focus, .field textarea:focus { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.1); box-shadow: 0 0 0 4px rgba(167,139,250,.18); }
.form-status { color: var(--muted); min-height: 1.25em; margin-top: 4px; }

.contact-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); text-decoration: none; transition: background .2s, transform .2s, color .2s; }
.chip:hover { background: rgba(255,255,255,.08); color: var(--text); transform: translateY(-2px); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 48px; text-align: center; color: var(--muted); }

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

/* Background Blobs */
.bg-blobs { position: fixed; inset: -10% -10% -10% -10%; z-index: -1; overflow: hidden; filter: blur(40px) saturate(120%); pointer-events: none; }
.blob { position: absolute; border-radius: 50%; opacity: .5; mix-blend-mode: screen; animation: float 16s ease-in-out infinite; }
.b1 { width: 520px; height: 520px; background: radial-gradient(circle at 30% 30%, rgba(110,231,249,.6), rgba(110,231,249,0)); top: 8%; left: 5%; animation-duration: 23s; }
.b2 { width: 600px; height: 600px; background: radial-gradient(circle at 60% 40%, rgba(167,139,250,.6), rgba(167,139,250,0)); bottom: 6%; right: -6%; animation-duration: 19s; }
.b3 { width: 460px; height: 460px; background: radial-gradient(circle at 40% 60%, rgba(244,114,182,.6), rgba(244,114,182,0)); top: 30%; right: 18%; animation-duration: 21s; }
@keyframes float { 0%, 100% { transform: translate(0,0) scale(1);} 50% { transform: translate(10px, -14px) scale(1.05);} }

/* Starfield background overlay */
.starfield { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .35; background:
  radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.6), rgba(255,255,255,0)) 0 0/200px 200px,
  radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,.6), rgba(255,255,255,0)) 0 0/180px 180px,
  radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,.5), rgba(255,255,255,0)) 0 0/220px 220px; animation: starScroll 120s linear infinite; }
@keyframes starScroll { from { background-position: 0 0, 0 0, 0 0; } to { background-position: -2000px 0, -1200px 0, -1600px 0; } }

/* Canvas particle layer (above starfield, below blobs) */
.bg-canvas { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Custom Cursor */
#cursor-dot, #cursor-outline { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1000; transform: translate(-50%, -50%); }
#cursor-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; mix-blend-mode: difference; }
#cursor-outline { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.75), rgba(255,255,255,.05)); mix-blend-mode: difference; transition: width .15s ease, height .15s ease, opacity .2s ease; opacity: .7; }
.cursor-hover #cursor-outline { width: 50px; height: 50px; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Spacing helpers */
.hero .card h3 { margin: 0 0 6px; }
.hero .card p { margin: 0; color: var(--muted); }

/* Ensure sections account for sticky header when linked */
#home, #about, #skills, #work, #contact { scroll-margin-top: 80px; }

/* Touch devices: hide custom cursor */
@media (pointer: coarse) {
  #cursor-dot, #cursor-outline { display: none; }
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.gallery-item { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,.06); aspect-ratio: 4 / 3; }
.gallery-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0)); opacity: 0; transition: opacity .4s ease; z-index: 1; }
.gallery-item:hover::after { opacity: 1; }
.gallery-item a { position: relative; display: block; height: 100%; }
.gallery-item img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .5s ease, opacity .5s ease; position: relative; z-index: 0; }
.gallery-item:hover img { transform: scale(1.05); }
/* Always-visible badge for linked projects */
.project-badge { position: absolute; left: 10px; bottom: 10px; z-index: 3; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #0b0b12; background: linear-gradient(135deg, rgba(110,231,249,.9), rgba(167,139,250,.9)); border: 1px solid rgba(255,255,255,.35); box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .2s ease, opacity .2s ease; }
.gallery-item:hover .project-badge { transform: translateY(-1px); }
