/* ============================================================
   Shubhabrata Ganguly — Portfolio
   Dark navy / electric-blue system (matches personal brand)
   ============================================================ */

:root {
  --bg:        #060915;
  --bg-2:      #0a1024;
  --surface:   rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border:    rgba(140, 170, 255, 0.14);
  --border-2:  rgba(140, 170, 255, 0.28);
  --text:      #eaf0ff;
  --muted:     #97a4c9;
  --muted-2:   #6d7aa0;
  --brand:     #3b82f6;
  --brand-lt:  #60a5fa;
  --cyan:      #22d3ee;
  --grad:      linear-gradient(115deg, #4d9fff 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(77,159,255,0.16), rgba(34,211,238,0.10));
  --shadow:    0 24px 60px -24px rgba(0, 8, 40, 0.85);
  --ring:      0 0 0 1px var(--border);
  --radius:    20px;
  --maxw:      1180px;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Ambient background ---------- */
.bg-atmosphere { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 90% at 80% -10%, #0d1636 0%, var(--bg) 55%); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; will-change: transform; }
.blob-1 { width: 620px; height: 620px; top: -180px; right: -140px; background: radial-gradient(circle, #1f5cff 0%, transparent 70%); animation: float1 22s ease-in-out infinite; }
.blob-2 { width: 520px; height: 520px; top: 40%; left: -180px; background: radial-gradient(circle, #16b8d8 0%, transparent 70%); opacity: 0.4; animation: float2 26s ease-in-out infinite; }
.blob-3 { width: 480px; height: 480px; bottom: -180px; right: 10%; background: radial-gradient(circle, #3a2fff 0%, transparent 70%); opacity: 0.35; animation: float1 30s ease-in-out infinite reverse; }
.grid-overlay {
  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;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.35;
}
.grain {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(-40px,50px) scale(1.08);} }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(60px,-40px) scale(1.1);} }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 52px);
  transition: background .3s, backdrop-filter .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 12, 28, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.nav__brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; }
.nav__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #04122e; font-weight: 800; font-size: 15px; letter-spacing: -0.5px;
}
.nav__name { font-size: 15px; letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a { font-size: 14.5px; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 9px 18px; border-radius: 100px; color: var(--text) !important;
  background: var(--surface-2); border: 1px solid var(--border-2); font-weight: 600 !important;
}
.nav__cta:hover { background: var(--grad); color: #04122e !important; border-color: transparent; }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 100px; font-weight: 600; font-size: 14.5px;
  font-family: var(--font-head); cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--grad); color: #04122e; box-shadow: 0 12px 30px -10px rgba(45,150,255,0.6); }
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(45,150,255,0.75); }
.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface); border-color: var(--brand-lt); }
.btn--line { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn--line:hover { border-color: var(--brand-lt); color: var(--brand-lt); }
.btn--full { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 130px clamp(18px,4vw,52px) 70px; max-width: var(--maxw); margin: 0 auto; }
.hero__inner { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: clamp(30px, 5vw, 70px); align-items: center; width: 100%; }
.kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.28em; color: var(--brand-lt); margin-bottom: 22px; }
.hero__title { font-size: clamp(48px, 8vw, 92px); font-weight: 800; letter-spacing: -0.03em; }
.hero__lead { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--muted); max-width: 560px; margin: 24px 0 20px; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 30px; }
.hero__meta .dot { color: var(--muted-2); }
.avail { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.avail i { width: 9px; height: 9px; border-radius: 50%; background: #38e08a; box-shadow: 0 0 0 4px rgba(56,224,138,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(56,224,138,0); } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.hero__stats { display: grid; grid-template-columns: repeat(4, auto); gap: clamp(18px, 3vw, 40px); }
.stat b { display: block; font-family: var(--font-head); font-size: clamp(26px, 3vw, 34px); font-weight: 800; color: var(--text); }
.stat span { font-size: 12.5px; color: var(--muted); }

.hero__portrait { position: relative; justify-self: center; }
.portrait__frame { position: relative; width: clamp(240px, 26vw, 330px); aspect-ratio: 3/3.6; border-radius: 26px; overflow: hidden; border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: contrast(1.03) saturate(1.02); }
.portrait__ring { position: absolute; inset: 0; border-radius: 26px; background: linear-gradient(160deg, rgba(77,159,255,0.14), transparent 45%); pointer-events: none; }
.chip {
  position: absolute; padding: 8px 14px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
  font-family: var(--font-head); background: rgba(10,16,36,0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: bob 5s ease-in-out infinite;
}
.chip--tl { top: 26px; left: -34px; color: var(--brand-lt); }
.chip--br { bottom: 60px; right: -30px; color: var(--cyan); animation-delay: 1s; }
.chip--bl { bottom: 14px; left: -20px; color: var(--text); animation-delay: 2s; }
@keyframes bob { 50% { transform: translateY(-9px); } }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 30px; color: var(--muted); animation: bob 2.4s infinite; }

/* ---------- Section shell ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 10vw, 120px) clamp(18px,4vw,52px); }
.section__head { margin-bottom: 52px; max-width: 760px; }
.tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.22em; color: var(--brand-lt); text-transform: uppercase; }
.section__head h2 { font-size: clamp(30px, 4.5vw, 50px); margin-top: 14px; }
.section__sub { color: var(--muted); margin-top: 16px; font-size: 16.5px; }
.section__sub a { color: var(--brand-lt); border-bottom: 1px solid transparent; }
.section__sub a:hover { border-color: var(--brand-lt); }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.about__text p { color: var(--muted); margin-bottom: 18px; font-size: 16.5px; }
.about__text strong { color: var(--text); font-weight: 600; }
.about__badges { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.about__badges span { font-size: 12.5px; padding: 7px 13px; border-radius: 100px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--text); }
.about__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); position: sticky; top: 100px; }
.about__photo { width: 100%; height: 230px; object-fit: cover; object-position: top center; border-radius: 14px; margin-bottom: 18px; }
.about__facts { list-style: none; margin-bottom: 20px; }
.about__facts li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.about__facts li:last-child { border-bottom: 0; }
.about__facts span { color: var(--muted); }
.about__facts b { color: var(--text); text-align: right; font-weight: 600; }

/* ---------- Services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.svc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; transition: transform .3s, border-color .3s, background .3s; position: relative; overflow: hidden;
}
.svc::before { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: 0; transition: opacity .3s; }
.svc:hover { transform: translateY(-6px); border-color: var(--border-2); }
.svc:hover::before { opacity: 1; }
.svc > * { position: relative; }
.svc--feature { border-color: var(--border-2); background: linear-gradient(160deg, rgba(77,159,255,0.09), var(--surface)); }
.svc__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.svc__num { font-family: var(--font-mono); font-size: 13px; color: var(--brand-lt); letter-spacing: 0.1em; }
.svc__icon { font-size: 30px; }
.svc h3 { font-size: 23px; margin-bottom: 8px; }
.svc > p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.svc ul { list-style: none; }
.svc ul li { position: relative; padding-left: 24px; margin-bottom: 9px; font-size: 14.5px; color: var(--text); }
.svc ul li::before { content: "▸"; position: absolute; left: 4px; color: var(--brand-lt); }
.services__cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 32px; border-radius: var(--radius); background: var(--grad-soft); border: 1px solid var(--border-2); }
.services__cta p { font-family: var(--font-head); font-size: 18px; font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), var(--cyan), transparent); }
.tl { position: relative; margin-bottom: 40px; }
.tl:last-child { margin-bottom: 0; }
.tl__dot { position: absolute; left: -34px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand-lt); box-shadow: 0 0 0 5px rgba(77,159,255,0.12); }
.tl__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.tl__body h3 { font-size: 19px; }
.tl__date { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand-lt); white-space: nowrap; }
.tl__org { color: var(--cyan); font-weight: 600; font-size: 14.5px; margin: 4px 0 12px; }
.tl__body ul { list-style: none; }
.tl__body ul li { position: relative; padding-left: 20px; margin-bottom: 7px; color: var(--muted); font-size: 15px; }
.tl__body ul li::before { content: "—"; position: absolute; left: 0; color: var(--brand-lt); }

/* ---------- Projects ---------- */
.proj__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: transform .3s, border-color .3s, box-shadow .3s;
}
.proj:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow); }
.proj__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.proj__tags span { font-size: 11px; font-family: var(--font-mono); padding: 4px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.proj h3 { font-size: 19px; margin-bottom: 8px; }
.proj p { color: var(--muted); font-size: 14.5px; flex-grow: 1; margin-bottom: 16px; }
.proj__link { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--brand-lt); }
.proj:hover .proj__link { color: var(--cyan); }
.proj__note { margin-top: 22px; padding: 20px 24px; border-radius: var(--radius); border: 1px dashed var(--border-2); color: var(--muted); font-size: 14.5px; }
.proj__note strong { color: var(--text); }

/* ---------- Skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skillset { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.skillset h4 { font-size: 16px; color: var(--brand-lt); margin-bottom: 16px; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 13.5px; padding: 7px 13px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); transition: border-color .2s, color .2s, transform .2s; }
.chips span:hover { border-color: var(--brand-lt); color: var(--brand-lt); transform: translateY(-2px); }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(50px, 8vw, 90px); }
.contact__card {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 4vw, 56px);
  background: linear-gradient(160deg, rgba(77,159,255,0.10), var(--surface));
  border: 1px solid var(--border-2); border-radius: 28px; padding: clamp(30px, 5vw, 56px); box-shadow: var(--shadow);
}
.contact__left h2 { font-size: clamp(28px, 4vw, 44px); margin: 14px 0 16px; }
.contact__left p { color: var(--muted); max-width: 480px; margin-bottom: 28px; }
.contact__links { display: flex; flex-direction: column; gap: 12px; }
.cl { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .2s; }
.cl:hover { border-color: var(--brand-lt); transform: translateX(4px); }
.cl--static { cursor: default; }
.cl--static:hover { transform: none; border-color: var(--border); }
.cl__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--grad-soft); border: 1px solid var(--border); font-size: 15px; font-weight: 700; color: var(--brand-lt); flex-shrink: 0; }
.cl span:last-child { display: flex; flex-direction: column; font-size: 14.5px; }
.cl span:last-child b { font-family: var(--font-head); font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.contact__right { display: flex; flex-direction: column; gap: 14px; justify-content: center; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 40px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.footer__built { color: var(--muted-2); font-size: 13px; margin-top: 6px; }

/* ---------- Reveal animation ---------- */
.reveal, .section__head, .svc, .tl, .proj, .skillset, .about__grid, .contact__card { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in, .section__head.in, .svc.in, .tl.in, .proj.in, .skillset.in, .about__grid.in, .contact__card.in { opacity: 1; transform: none; }
.svc.in { transition-delay: calc(var(--i) * 90ms); }
.hero .reveal { transition-delay: .05s; }
.hero .reveal:nth-child(2){transition-delay:.12s}
.hero .reveal:nth-child(3){transition-delay:.2s}
.hero .reveal:nth-child(4){transition-delay:.28s}
.hero .reveal:nth-child(5){transition-delay:.36s}
.hero .reveal:nth-child(6){transition-delay:.44s}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 26px; padding: 40px; background: rgba(8,12,28,0.97); backdrop-filter: blur(16px); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 18px; }
  .nav__burger { display: flex; z-index: 101; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { order: 2; }
  .hero__portrait { order: 1; margin-bottom: 10px; }
  .hero__lead, .hero__meta { margin-left: auto; margin-right: auto; }
  .hero__meta, .hero__actions { justify-content: center; }
  .hero__stats { justify-content: center; }
  .about__grid { grid-template-columns: 1fr; }
  .about__card { position: static; }
  .services__grid { grid-template-columns: 1fr; }
  .proj__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
  .contact__card { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .chip--tl { left: 2px; } .chip--br { right: 2px; } .chip--bl { left: 2px; }
  .stat { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal, .section__head, .svc, .tl, .proj, .skillset, .about__grid, .contact__card { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
