/* ==========================================================
   Satyajit Sethy - Portfolio
   Theme tokens first. Change colors here and the whole site updates.
   ========================================================== */
:root {
  --bg: #0a0f1e;
  --bg-2: #0d1426;
  --panel: #111936;
  --panel-2: #172044;
  --line: #243059;
  --text: #e9edff;
  --muted: #94a0cf;
  --accent: #5b8cff;
  --accent-2: #ffb454;
  --accent-soft: rgba(91, 140, 255, .14);
  --shadow: 0 20px 50px rgba(2, 6, 20, .45);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 72px;
}
:root[data-theme="light"] {
  --bg: #f4f6ff;
  --bg-2: #eaeeff;
  --panel: #ffffff;
  --panel-2: #f0f3ff;
  --line: #d7ddf5;
  --text: #121735;
  --muted: #5b668f;
  --accent: #3a63e8;
  --accent-2: #d9860b;
  --accent-soft: rgba(58, 99, 232, .1);
  --shadow: 0 20px 40px rgba(40, 60, 140, .12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 10px); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.02em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--muted); }

#bg-canvas { position: fixed; inset: 0; z-index: -1; opacity: .55; pointer-events: none; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Navbar ---------- */
#site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: background .3s, box-shadow .3s; }
#site-header.scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line); }
.nav { max-width: 1180px; margin: 0 auto; height: var(--nav-h); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-family: var(--font-display);
  font-weight: 800; font-size: .95rem; color: #0a0f1e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand-mark { position: relative; overflow: hidden; }
.brand-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: .25s; }
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); display: grid; place-items: center; cursor: pointer; transition: .25s; }
.icon-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 19px; height: 19px; }
.burger { display: none; flex-direction: column; gap: 4px; justify-content: center; align-items: center; }
.burger span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: .3s; }
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
.page-hero { padding: calc(var(--nav-h) + 70px) 0 30px; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 14ch; }
.page-hero p { margin-top: 18px; max-width: 56ch; color: var(--muted); font-size: 1.1rem; }
.section-head { margin-bottom: 44px; max-width: 60ch; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.section-head p { margin-top: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: .98rem; transition: transform .25s, box-shadow .25s, background .25s; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 50%, transparent); }
.btn-ghost { border-color: var(--line); background: var(--panel); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-3px); }
.btn-sm { padding: 9px 16px; border-radius: 11px; font-size: .88rem; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 30px) 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.4rem); font-weight: 800; }
.hero h1 .name { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role-line { margin-top: 20px; font-family: var(--font-mono); font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--accent-2); min-height: 2em; }
.cursor { display: inline-block; width: .55ch; height: 1.1em; background: currentColor; margin-left: 3px; vertical-align: -.15em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-text { margin-top: 18px; max-width: 52ch; color: var(--muted); font-size: 1.08rem; }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-socials { margin-top: 30px; display: flex; gap: 12px; }
.hero-socials a, .socials a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--panel); transition: .25s; }
.hero-socials a:hover, .socials a:hover { transform: translateY(-4px) scale(1.06); border-color: var(--accent); color: var(--accent); }
.hero-socials svg, .socials svg { width: 18px; height: 18px; }

/* Terminal */
.terminal { background: #070b17; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  font-family: var(--font-mono); font-size: .9rem; color: #d6defc; transform-style: preserve-3d; }
:root[data-theme="light"] .terminal { background: #101636; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #0e1530; border-bottom: 1px solid #1d2850; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; color: #7e8bbd; font-size: .8rem; }
.term-body { padding: 20px; min-height: 290px; white-space: pre-wrap; line-height: 1.8; }
.term-body .p { color: var(--accent-2); }
.term-body .o { color: #8fb0ff; }
.term-body .g { color: #7ee2a8; }

/* Scroll hint */
.scroll-hint { position: absolute; bottom: 26px; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 14px; }
.scroll-hint::after { content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent-2); animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat { padding: 28px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-display); font-size: 2.8rem; line-height: 1; }
.stat span { color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .3s, border-color .3s, box-shadow .3s; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* About */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: center; }
.avatar { position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel-2), var(--panel)); display: grid; place-items: center; box-shadow: var(--shadow); }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar .initials { font-family: var(--font-display); font-weight: 800; font-size: 6rem; color: var(--accent); }
.about-text p { color: var(--muted); font-size: 1.07rem; margin-bottom: 16px; }
.about-text p strong { color: var(--text); }
.focus-card h3 { font-size: 1.2rem; margin: 14px 0 8px; }
.focus-card p { color: var(--muted); font-size: .98rem; }
.focus-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.focus-icon svg { width: 22px; height: 22px; }

/* Chips + marquee */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: .86rem; border: 1px solid var(--line); }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee .chip { font-size: 1rem; padding: 11px 22px; white-space: nowrap; }

/* ---------- Skills ---------- */
.skill-group h3 { font-size: 1.45rem; }
.skill-group > p { color: var(--muted); margin: 4px 0 22px; }
.skill { margin-bottom: 18px; }
.skill-top { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 8px; font-size: .96rem; }
.skill-top span:last-child { color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.3s cubic-bezier(.2, .8, .2, 1); }

/* ---------- Projects ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.search { position: relative; flex: 1 1 320px; max-width: 460px; }
.search svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; padding: 14px 18px 14px 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; transition: .25s; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  cursor: pointer; font: inherit; font-weight: 500; transition: .25s; }
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.result-count { color: var(--muted); margin-bottom: 20px; font-size: .95rem; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.project { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .35s, border-color .35s, box-shadow .35s; }
.project:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-2); }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover .project-img img { transform: scale(1.07); }
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cat { font-size: .78rem; font-weight: 600; color: var(--accent-2); }
.cat + .cat::before { content: "/"; margin-right: 8px; color: var(--line); }
.project h3 { font-size: 1.3rem; }
.project p { color: var(--muted); font-size: .96rem; }
.project .chips { gap: 6px; }
.project .chip { font-size: .76rem; padding: 4px 11px; }
.project-links { margin-top: auto; padding-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); display: none; }
.empty.show { display: block; }
.empty h3 { color: var(--text); margin-bottom: 8px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.contact-card { display: block; padding: 32px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); transition: transform .3s, border-color .3s, box-shadow .3s; }
.contact-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.contact-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.contact-icon svg { width: 24px; height: 24px; }
.contact-card h3 { font-size: 1.3rem; }
.contact-main { margin: 6px 0; font-weight: 600; word-break: break-all; }
.cta-band { text-align: center; padding: 64px 28px; border-radius: 28px; border: 1px solid var(--line);
  background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 60%), var(--panel); }
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.cta-band p { color: var(--muted); margin: 14px auto 28px; max-width: 48ch; }

/* ---------- Footer ---------- */
#site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px 24px 24px; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; }
.footer-brand p { margin-top: 16px; color: var(--muted); max-width: 34ch; }
.footer-col h4 { margin-bottom: 14px; font-size: 1.05rem; }
.footer-col > a { display: block; color: var(--muted); padding: 3px 0; transition: .2s; word-break: break-all; }
.footer-col > a:hover { color: var(--accent); transform: translateX(4px); }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.footer-bottom { max-width: 1180px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

.to-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; display: grid; place-items: center; z-index: 90; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .3s; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Scroll reveal animations ---------- */
.reveal { opacity: 0; transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.reveal[data-anim="up"], .reveal:not([data-anim]) { transform: translateY(46px); }
.reveal[data-anim="left"] { transform: translateX(-60px); }
.reveal[data-anim="right"] { transform: translateX(60px); }
.reveal[data-anim="pop"] { transform: scale(.78); transition: opacity .5s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.pop-in { animation: popIn .55s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: var(--d, 0ms); }
@keyframes popIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

/* Page enter */
body { animation: pageIn .6s ease both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .avatar { max-width: 320px; }
}
@media (max-width: 780px) {
  section { padding: 72px 0; }
  .burger { display: flex; }
  .nav-links { position: fixed; top: var(--nav-h); left: 14px; right: 14px; flex-direction: column; padding: 14px; gap: 4px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transform: translateY(-14px) scale(.97); transition: .3s; }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { padding: 14px 18px; border-radius: 12px; }
  .brand-name { display: none; }
  .stats, .grid-2, .grid-3, .contact-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}