/* ============================================================
   Praveen Kumar Pal — Portfolio
   Design system / app stylesheet
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Light theme (default) */
  --bg:           #FBFAF7;
  --bg-soft:      #F3F1EB;
  --surface:      #FFFFFF;
  --surface-2:    #FAF8F3;
  --border:       #E9E6DD;
  --border-strong:#D9D5C9;
  --ink:          #16151A;
  --ink-soft:     #3A3942;
  --muted:        #6B6A75;
  --primary:      #5538EE;
  --primary-ink:  #4226D6;
  --accent:       #FF6B5E;
  --accent-soft:  #FFE7E2;
  --primary-soft: #ECE7FF;
  --ring:         rgba(85,56,238,.35);
  --shadow-sm:    0 1px 2px rgba(22,21,26,.05), 0 1px 1px rgba(22,21,26,.04);
  --shadow-md:    0 10px 30px -12px rgba(22,21,26,.18);
  --shadow-lg:    0 30px 60px -22px rgba(40,30,90,.28);
  --grad:         linear-gradient(120deg, #5538EE 0%, #7A4DF0 45%, #FF6B5E 100%);

  /* Type */
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Layout */
  --maxw: 1160px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --nav-h: 70px;
}

html[data-theme="dark"] {
  --bg:           #0D0C11;
  --bg-soft:      #131219;
  --surface:      #17161E;
  --surface-2:    #1C1B25;
  --border:       #2A2934;
  --border-strong:#3A3947;
  --ink:          #F4F3F0;
  --ink-soft:     #D7D5DD;
  --muted:        #9C9AA6;
  --primary:      #8E73FF;
  --primary-ink:  #A992FF;
  --accent:       #FF7E72;
  --accent-soft:  #34222A;
  --primary-soft: #211B3D;
  --ring:         rgba(142,115,255,.4);
  --shadow-sm:    0 1px 2px rgba(0,0,0,.4);
  --shadow-md:    0 12px 34px -14px rgba(0,0,0,.6);
  --shadow-lg:    0 30px 70px -24px rgba(0,0,0,.7);
  --grad:         linear-gradient(120deg, #8E73FF 0%, #9A6BFF 45%, #FF7E72 100%);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* skip link */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Eyebrow / section heading ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary-ink);
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; border-radius: 2px;
  background: var(--grad);
}
.section { padding-block: clamp(64px, 9vw, 120px); }
.section__head { max-width: 640px; margin-bottom: clamp(34px, 5vw, 56px); }
.section__title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  margin-top: 14px;
}
.section__lead { color: var(--muted); font-size: 1.06rem; margin-top: 16px; }
.text-grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   Navbar
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 700; box-shadow: var(--shadow-sm);
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  padding: 9px 14px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  transition: background .2s ease, color .2s ease;
}
.nav__links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .94rem;
  border: 1px solid transparent; transition: transform .18s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  will-change: transform;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary-ink); }
.btn--sm { padding: 9px 16px; font-size: .88rem; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  transition: transform .18s ease, border-color .2s, color .2s, background .2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary-ink); }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* mobile nav */
.nav__burger { display: none; }
@media (max-width: 880px) {
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 14px var(--gutter) 22px; box-shadow: var(--shadow-md);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s ease;
  }
  .nav__links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 13px 12px; font-size: 1rem; }
  .nav__burger { display: grid; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(28px, 6vw, 70px)); padding-bottom: clamp(40px, 7vw, 90px); overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.hero__blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
}
.hero__blob--1 { width: 460px; height: 460px; background: var(--primary-soft); top: -120px; right: -80px; }
.hero__blob--2 { width: 380px; height: 380px; background: var(--accent-soft); bottom: -120px; left: -60px; opacity: .7; }
html[data-theme="dark"] .hero__blob { opacity: .35; }

.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero__avail {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .84rem; font-weight: 500; color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; position: relative; }
.dot-pulse::after { content:""; position:absolute; inset:-4px; border-radius:50%; border:2px solid #22C55E; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0%{transform:scale(.6);opacity:.8} 100%{transform:scale(1.6);opacity:0} }

.hero h1 {
  font-size: clamp(2.6rem, 6.6vw, 4.6rem);
  margin-top: 22px;
}
.hero__role {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap;
  font-family: var(--font-display); font-size: clamp(1.05rem, 2.4vw, 1.4rem); color: var(--ink-soft);
}
.hero__role .bar { width: 30px; height: 3px; border-radius: 3px; background: var(--grad); }
.hero__lead { margin-top: 22px; max-width: 540px; color: var(--muted); font-size: 1.08rem; }
.hero__cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 10px; margin-top: 28px; }

/* portrait */
.hero__portrait { position: relative; justify-self: center; }
.portrait-frame {
  position: relative; width: min(360px, 78vw); aspect-ratio: 4/5; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  background: var(--bg-soft);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.portrait-frame::after {
  content:""; position:absolute; inset:0; border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(20,16,40,.35));
}
.portrait-badge {
  position: absolute; left: -18px; bottom: 26px; z-index: 2;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 2px;
}
.portrait-badge b { font-family: var(--font-display); font-size: 1.5rem; color: var(--primary-ink); }
.portrait-badge span { font-size: .76rem; color: var(--muted); letter-spacing: .03em; }
.portrait-swatches { position: absolute; right: -14px; top: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.portrait-swatches i { width: 26px; height: 26px; border-radius: 8px; box-shadow: var(--shadow-sm); border: 2px solid var(--surface); }

/* metrics strip (signature) */
.metrics {
  position: relative; z-index: 1; margin-top: clamp(40px, 6vw, 70px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.metric { background: var(--surface); padding: 26px 22px; }
.metric__num { font-family: var(--font-display); font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -.03em; }
.metric__num .suffix { color: var(--accent); }
.metric__label { color: var(--muted); font-size: .9rem; margin-top: 4px; }
@media (max-width: 760px){ .metrics { grid-template-columns: repeat(2,1fr); } }

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; }
  .hero__lead { max-width: none; }
}

/* ============================================================
   About
   ============================================================ */
.about__grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(28px, 5vw, 60px); align-items: start; }
.about__body p + p { margin-top: 18px; }
.about__body p { color: var(--ink-soft); font-size: 1.06rem; }
.about__body strong { color: var(--ink); font-weight: 600; }
.about__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--nav-h) + 16px);
}
.about__card h3 { font-size: 1.05rem; margin-bottom: 16px; }
.strength-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.strength-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; color: var(--ink-soft); }
.strength-list svg { flex: 0 0 auto; margin-top: 2px; color: var(--primary); }
@media (max-width: 880px){ .about__grid { grid-template-columns: 1fr; } .about__card { position: static; } }

/* ============================================================
   Skills
   ============================================================ */
.skill-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.skill-card__head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.skill-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.skill-card__icon svg { width: 22px; height: 22px; }
.skill-card h3 { font-size: 1.12rem; }
.skill-card__sub { font-size: .82rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .82rem; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-soft);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.chip:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); transform: translateY(-2px); }
.chip--ai { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip--ai:hover { background: var(--accent); color: #fff; }
@media (max-width: 900px){ .skill-cols { grid-template-columns: 1fr; } }

/* competencies marquee-ish band */
.comp-band { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.comp-tag { font-size: .85rem; padding: 8px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px dashed var(--border-strong); color: var(--ink-soft); }

/* ============================================================
   Experience timeline
   ============================================================ */
.timeline { position: relative; display: flex; flex-direction: column; gap: 26px; }
.timeline::before {
  content:""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--primary), var(--accent)); opacity: .35;
}
.tl-item { position: relative; padding-left: 56px; }
.tl-dot {
  position: absolute; left: 8px; top: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--primary); display: grid; place-items: center;
  box-shadow: 0 0 0 5px var(--bg);
}
.tl-dot::after { content:""; width: 9px; height: 9px; border-radius: 50%; background: var(--grad); }
.tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tl-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.tl-role { font-size: 1.18rem; }
.tl-period { font-size: .82rem; font-weight: 600; color: var(--primary-ink); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.tl-org { color: var(--accent); font-weight: 600; margin-top: 4px; font-size: .96rem; }
.tl-desc { color: var(--muted); font-size: .94rem; margin-top: 10px; }
.tl-points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tl-points li { display: flex; gap: 11px; align-items: flex-start; font-size: .95rem; color: var(--ink-soft); }
.tl-points svg { flex: 0 0 auto; margin-top: 3px; color: var(--primary); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.tl-tags span { font-size: .76rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; }
@media (max-width: 560px){ .tl-item { padding-left: 46px; } }

/* ============================================================
   Projects
   ============================================================ */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.proj-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px 22px; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.proj-card::before {
  content:""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.proj-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.proj-card:hover::before { transform: scaleX(1); }
.proj-card__idx { font-family: var(--font-display); font-size: .8rem; color: var(--muted); letter-spacing: .1em; }
.proj-card h3 { font-size: 1.3rem; margin: 10px 0 8px; }
.proj-card p { color: var(--muted); font-size: .92rem; }
.proj-card__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.proj-card__meta span { font-size: .74rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-soft); }
.proj-card__link { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-weight: 600; font-size: .9rem; color: var(--primary-ink); }
.proj-card__link svg { transition: transform .2s ease; }
.proj-card:hover .proj-card__link svg { transform: translate(3px,-3px); }
@media (max-width: 900px){ .proj-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .proj-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Education
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.edu-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; }
.edu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.edu-card__cap { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.edu-card h3 { font-size: 1.4rem; }
.edu-card .school { color: var(--ink-soft); margin-top: 6px; font-size: .96rem; }
.edu-card .yr { color: var(--muted); font-size: .84rem; margin-top: 10px; font-weight: 500; }
@media (max-width: 800px){ .edu-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Contact
   ============================================================ */
.contact {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(36px, 6vw, 64px); box-shadow: var(--shadow-md);
}
.contact__glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(80px); background: var(--primary-soft); top: -160px; right: -120px; opacity: .8; pointer-events: none; }
.contact__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px,5vw,56px); align-items: center; }
.contact h2 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
.contact__lead { color: var(--muted); margin-top: 16px; font-size: 1.06rem; }
.contact__cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.contact-list { display: grid; gap: 12px; }
.contact-row {
  display: flex; align-items: center; gap: 15px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: transform .2s ease, border-color .2s ease;
}
.contact-row:hover { transform: translateX(4px); border-color: var(--primary); }
.contact-row .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; flex: 0 0 auto; }
.contact-row small { display: block; color: var(--muted); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
.contact-row b { font-weight: 600; font-size: .98rem; word-break: break-word; }
@media (max-width: 820px){ .contact__grid { grid-template-columns: 1fr; } }

/* ============================================================
   Footer
   ============================================================ */
.footer { padding-block: 40px 30px; border-top: 1px solid var(--border); margin-top: clamp(48px,7vw,90px); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer small { color: var(--muted); font-size: .85rem; }
.footer__socials { display: flex; gap: 10px; }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"]{ transition-delay: .08s; }
.reveal[data-d="2"]{ transition-delay: .16s; }
.reveal[data-d="3"]{ transition-delay: .24s; }
.reveal[data-d="4"]{ transition-delay: .32s; }

/* scroll progress bar */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 110; background: var(--grad); transition: width .1s linear; }

/* back-to-top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; background: var(--primary); color: #fff; border: none; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: .25s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--primary-ink); }
