/* ═══════════════════════════════════════════════
   SHOBHIT KUNDU PORTFOLIO — GLOBAL STYLESHEET
   Fonts: Syne (display) + DM Sans (body)
   Palette: Cyprus/Sand (light) | Persian/Ghost (dark)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─── CSS VARIABLES ─── */
:root {
  /* Light Mode — Cyprus & Sand */
  --bg-primary:    #F0EDE5;
  --bg-secondary:  #E8E4DB;
  --bg-card:       rgba(255,255,255,0.72);
  --bg-glass:      rgba(240,237,229,0.15);
  --bg-glass-dark: rgba(0,70,67,0.08);
  --hero-from:     #004643;
  --hero-to:       #006b65;
  --accent:        #004643;
  --accent2:       #00857c;
  --accent-rgb:    0,70,67;
  --text-primary:  #0e1f1e;
  --text-secondary:#3d5754;
  --text-muted:    #7a9490;
  --text-hero:     #F0EDE5;
  --border:        rgba(0,70,67,0.12);
  --border-glass:  rgba(240,237,229,0.28);
  --tag-bg:        rgba(0,70,67,0.09);
  --tag-text:      #004643;
  --nav-bg:        rgba(240,237,229,0.75);
  --card-shadow:   0 4px 32px rgba(0,70,67,0.08);
  --grid-line:     rgba(0,70,67,0.06);
  --orb1:          rgba(0,133,124,0.35);
  --orb2:          rgba(240,237,229,0.2);
  --pill-active:   #004643;
  --pill-text:     #F0EDE5;
  --timeline-line: rgba(0,70,67,0.2);
  --footer-bg:     #004643;
  --footer-text:   rgba(240,237,229,0.7);
  --scrollbar:     rgba(0,70,67,0.25);
}

[data-theme="dark"] {
  /* Dark Mode — Persian & Ghost */
  --bg-primary:    #070b1a;
  --bg-secondary:  #0e1228;
  --bg-card:       rgba(14,18,40,0.8);
  --bg-glass:      rgba(39,24,126,0.22);
  --bg-glass-dark: rgba(39,24,126,0.35);
  --hero-from:     #070b1a;
  --hero-to:       #1a0f4a;
  --accent:        #6b5de8;
  --accent2:       #a89cf0;
  --accent-rgb:    107,93,232;
  --text-primary:  #F7F7FF;
  --text-secondary:#b8b0f0;
  --text-muted:    #6b6490;
  --text-hero:     #F7F7FF;
  --border:        rgba(107,93,232,0.2);
  --border-glass:  rgba(107,93,232,0.38);
  --tag-bg:        rgba(107,93,232,0.2);
  --tag-text:      #c4bef7;
  --nav-bg:        rgba(7,11,26,0.82);
  --card-shadow:   0 4px 32px rgba(39,24,126,0.25);
  --grid-line:     rgba(39,24,126,0.3);
  --orb1:          rgba(39,24,126,0.6);
  --orb2:          rgba(107,93,232,0.2);
  --pill-active:   #27187E;
  --pill-text:     #c4bef7;
  --timeline-line: rgba(107,93,232,0.3);
  --footer-bg:     #050810;
  --footer-text:   rgba(247,247,255,0.5);
  --scrollbar:     rgba(107,93,232,0.35);
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
html::-webkit-scrollbar { width: 5px; }
html::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ─── TYPOGRAPHY ─── */
h1,h2,h3,h4 { font-family: 'Syne', sans-serif; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { font-size: 1rem; color: var(--text-secondary); }
a  { text-decoration: none; color: inherit; }

/* ─── NAV ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.4s ease;
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb),0.6);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.8)} }

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--text-primary); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  background: var(--bg-glass-dark);
  border: 0.5px solid var(--border);
  border-radius: 24px;
  width: 48px; height: 26px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
}
.theme-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), background 0.3s;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(22px); }

.nav-cta {
  font-size: 0.82rem; font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 6px 16px; border-radius: 20px;
  transition: opacity 0.2s, transform 0.2s;
  border: none; cursor: pointer;
}
.nav-cta:hover { opacity: 0.88; transform: translateY(-1px); }

.nav-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-hamburger span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s; }

/* ─── HERO BASE ─── */
.hero {
  min-height: 100vh;
  background: linear-gradient(140deg, var(--hero-from) 0%, var(--hero-to) 100%);
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  padding: 100px clamp(1.5rem,6vw,5rem) 80px;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.8;
}
.hero-orb {
  position: absolute; border-radius: 50%;
  pointer-events: none; will-change: transform;
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle at 40% 40%, var(--orb1), transparent 70%);
  top: -150px; right: -100px;
}
.orb2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle at 50% 50%, var(--orb2), transparent 70%);
  bottom: -100px; left: 10%;
}

/* ─── GLASS CARD ─── */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
}
.glass-light {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

/* ─── SECTION LAYOUT ─── */
.section { padding: clamp(4rem,8vw,7rem) clamp(1.5rem,6vw,5rem); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { margin-bottom: 3rem; }
.section-eyebrow {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 8px;
}
.section-eyebrow::before {
  content: ''; width: 24px; height: 1.5px; background: var(--accent);
}
.section-title { color: var(--text-primary); }
.section-sub { margin-top: 0.75rem; max-width: 560px; }

/* ─── TAGS / PILLS ─── */
.tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 10px; border-radius: 20px;
  border: 0.5px solid rgba(var(--accent-rgb),0.18);
}
.tag-outline {
  background: transparent;
  border: 0.5px solid var(--border);
  color: var(--text-muted);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  padding: 10px 22px; border-radius: 24px;
  cursor: pointer; transition: all 0.22s ease;
  border: none;
}
.btn-primary {
  background: var(--text-hero);
  color: var(--accent);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(var(--accent-rgb),0.2); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-hero);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { opacity: 0.88; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(var(--accent-rgb),0.3); }

/* ─── PROJECT CARD ─── */
.project-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  position: relative;
}
.project-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 16px 48px rgba(var(--accent-rgb),0.15);
  border-color: rgba(var(--accent-rgb),0.35);
}
.project-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.project-card-body { padding: 1.25rem 1.4rem 1.4rem; }
.project-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0.75rem; }
.project-card-title { font-size: 1.05rem; font-weight: 700; font-family: 'Syne', sans-serif; color: var(--text-primary); margin-bottom: 0.4rem; }
.project-card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 0.5px solid var(--border); }
.project-card-meta { font-size: 0.75rem; color: var(--text-muted); }
.project-card-link { font-size: 0.78rem; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.project-card-link:hover { gap: 7px; }

/* 3D TILT */
.tilt-card { transform-style: preserve-3d; }
.tilt-card .tilt-shine {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.tilt-card:hover .tilt-shine { opacity: 1; }

/* ─── SKILL BAR ─── */
.skill-bar-wrap { margin-bottom: 1rem; }
.skill-bar-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.skill-bar-label { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.skill-bar-pct { font-size: 0.78rem; color: var(--text-muted); }
.skill-bar-track { height: 5px; background: var(--border); border-radius: 4px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; width: 0; transition: width 1.2s cubic-bezier(.4,0,.2,1); }

/* ─── TIMELINE ─── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--timeline-line);
}
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-dot {
  position: absolute; left: -1.85rem; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.3);
  transition: background 0.3s;
}
.timeline-item:hover .timeline-dot { box-shadow: 0 0 0 4px rgba(var(--accent-rgb),0.2); }
.timeline-date { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.3rem; }
.timeline-title { font-size: 1rem; font-weight: 700; font-family: 'Syne', sans-serif; color: var(--text-primary); }
.timeline-desc { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.3rem; }

/* ─── STAT CARD ─── */
.stat-card {
  background: var(--bg-glass-dark);
  border: 0.5px solid var(--border);
  border-radius: 14px; padding: 1.2rem 1.4rem;
  text-align: center;
}
.stat-card-number { font-family: 'Syne', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-card-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ─── FOOTER ─── */
footer {
  background: var(--footer-bg);
  padding: 3rem clamp(1.5rem,6vw,5rem);
  color: var(--text-hero);
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; }
.footer-logo { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 800; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--footer-text); transition: color 0.2s; }
.footer-links a:hover { color: var(--text-hero); }
.footer-copy { font-size: 0.78rem; color: var(--footer-text); }
.footer-socials { display: flex; gap: 12px; }
.footer-social-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--footer-text);
  transition: all 0.2s;
}
.footer-social-btn:hover { border-color: rgba(255,255,255,0.6); color: #fff; transform: translateY(-2px); }

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.45s; }

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1.2rem; }

/* ─── FILTER PILLS ─── */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; }
.filter-pill {
  font-size: 0.8rem; font-weight: 500;
  padding: 5px 14px; border-radius: 20px;
  border: 0.5px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

/* ─── PAGE HERO (inner pages) ─── */
.page-hero {
  padding: 120px clamp(1.5rem,6vw,5rem) 60px;
  background: linear-gradient(140deg, var(--hero-from) 0%, var(--hero-to) 100%);
  position: relative; overflow: hidden;
}
.page-hero .hero-grid, .page-hero .hero-orb { opacity: 0.5; }
.page-hero-content { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; }
.page-hero-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(240,237,229,0.6); margin-bottom: 0.75rem; }
.page-hero h1 { color: var(--text-hero); }
.page-hero p { color: rgba(240,237,229,0.65); margin-top: 0.75rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    padding: 1.5rem 2rem; gap: 1.2rem;
    border-bottom: 0.5px solid var(--border);
  }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ─── CANVAS / THREE.JS CONTAINER ─── */
#hero-canvas {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
}

/* ─── TOOLTIP ─── */
.tooltip {
  position: fixed; z-index: 9999;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.72rem; font-weight: 500;
  padding: 5px 10px; border-radius: 8px;
  pointer-events: none; opacity: 0;
  transition: opacity 0.2s;
}
