/* ===== THEME ===== */
:root {
  --bg: #0b1020; --bg2: #111833; --card: #151d3b;
  --text: #e8ecf8; --mut: #9aa6c7; --acc: #38bdf8; --line: #243056;
  box-sizing: border-box;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fc; --bg2: #eaeff8; --card: #ffffff;
    --text: #0f172a; --mut: #51607f; --acc: #0284c7; --line: #d5deee;
  }
}
:root[data-theme="light"] {
  --bg: #f6f8fc; --bg2: #eaeff8; --card: #ffffff;
  --text: #0f172a; --mut: #51607f; --acc: #0284c7; --line: #d5deee;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6; overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
section { padding: 80px 0; }
h2.t { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 8px; }
.sub { color: var(--mut); margin: 0 0 36px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  border: 1px solid var(--acc); background: var(--acc); color: #04121f;
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(56,189,248,.25); }
.btn.o { background: transparent; color: var(--acc); }
.btn.o:hover { background: var(--acc); color: #04121f; }

/* ===== HEADER ===== */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  animation: down 0.6s ease;
}
@keyframes down { from { transform: translateY(-100%); } to { transform: none; } }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { font-weight: 700; font-size: 0.95rem; letter-spacing: .3px; }
.links { display: flex; align-items: center; gap: 22px; }
.links a.l { color: var(--mut); transition: 0.2s; }
.links a.l:hover { color: var(--acc); }
.burger {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; width: 42px; height: 42px; font-size: 1.3rem; cursor: pointer;
}

/* ===== HERO ===== */
.hero { padding-top: 130px; min-height: 100vh; display: flex; align-items: center; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: center; }
.pic {
  width: min(320px, 80%); aspect-ratio: 1; margin: auto; border-radius: 28px;
  border: 2px solid var(--acc); overflow: hidden; background: var(--card);
  animation: float 5s ease-in-out infinite; transition: 0.3s;
  box-shadow: 0 20px 50px rgba(56,189,248,.15);
}
.pic:hover { transform: scale(1.04) rotate(-1deg); }
.pic img { width: 100%; height: 100%; object-fit: cover; }
@keyframes float { 50% { translate: 0 -12px; } }
.hi { color: var(--acc); font-weight: 600; margin: 0; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.15; margin: 6px 0; }
.role { font-size: 1.3rem; color: var(--acc); font-weight: 600; margin: 0 0 14px; }
.hero p.i { color: var(--mut); max-width: 560px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ===== GRID / CARD ===== */
.grid { display: grid; gap: 18px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; transition: 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--acc); box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.card h3 { margin: 8px 0; }
.card p { color: var(--mut); margin: 0; }
.ic { font-size: 1.6rem; }
.about ul { color: var(--mut); padding-left: 20px; }

/* ===== PROJECTS ===== */
.proj { cursor: pointer; padding: 0; overflow: hidden; }
.proj img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.proj .b { padding: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag {
  font-size: .78rem; padding: 3px 10px; border-radius: 99px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--acc);
}
.pb { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pb:empty { display: none; }
.pb .btn { padding: 8px 16px; font-size: .9rem; }

/* ===== EDUCATION TIMELINE ===== */
.tl { position: relative; padding-left: 28px; border-left: 2px solid var(--line); max-width: 700px; }
.tl .card { margin-bottom: 22px; position: relative; }
.tl .card::before {
  content: ""; position: absolute; left: -37px; top: 26px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--acc); border: 3px solid var(--bg);
}

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
}
.modal.open { display: flex; }
.mb {
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px;
  max-width: 900px; width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 26px; position: relative; animation: pop .3s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.x { position: absolute; right: 14px; top: 12px; background: none; border: 0; color: var(--text); font-size: 1.6rem; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.two h3 { font-size: 1.7rem; margin: 0 0 8px; }

/* ===== CONTACT ===== */
.cl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cl a {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); transition: .25s; font-weight: 600;
}
.cl a:hover { border-color: var(--acc); transform: translateY(-3px); }

/* ===== FOOTER ===== */
footer { border-top: 1px solid var(--line); padding: 36px 0; text-align: center; color: var(--mut); }
footer strong { color: var(--text); display: block; font-size: 1.05rem; }
.soc { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.soc a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: .88rem; transition: .2s; }
.soc a:hover { color: var(--acc); border-color: var(--acc); }

/* ===== SCROLL REVEAL ===== */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.rv.in { opacity: 1; transform: none; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .burger { display: block; }
  .links {
    position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
    flex-direction: column; background: var(--bg); padding: 20px;
    border-bottom: 1px solid var(--line); display: none; align-items: stretch; text-align: center;
  }
  .links.open { display: flex; }
  .hero .wrap, .two { grid-template-columns: 1fr; }
  .hero { text-align: center; }
  .hero p.i { margin: auto; }
  .cta { justify-content: center; }
  section { padding: 60px 0; }
  .logo { font-size: .8rem; }
}
/* PRELOADER (loading page)  */
body.loading { overflow: hidden; }

.preloader {
  position: fixed; inset: 0; z-index: 999; overflow: hidden;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 0 16px;
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.done { opacity: 0; visibility: hidden; }

.pl-name {
  display: flex; gap: .35em; white-space: nowrap;
  font-weight: 800; letter-spacing: .08em;
  font-size: clamp(1.5rem, 8vw, 4rem);
}
.pl-l { color: var(--text); animation: pl-left .9s cubic-bezier(.2, .8, .2, 1) both; }
.pl-r { color: var(--acc);  animation: pl-right .9s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes pl-left  { from { transform: translateX(-60vw); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pl-right { from { transform: translateX(60vw);  opacity: 0; } to { transform: none; opacity: 1; } }

.pl-bar {
  width: min(220px, 50vw); height: 3px; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.pl-bar span {
  display: block; height: 100%; background: var(--acc);
  transform: scaleX(0); transform-origin: left;
  animation: pl-fill 1.1s ease .9s forwards;
}
@keyframes pl-fill { to { transform: scaleX(1); } }

/* style.css reduced-motion e shob animation bondho kore dey; loading page er ta
   jate phone e-o dekha jay, tai ekhane abar chalu kora hoyeche */
@media (prefers-reduced-motion: reduce) {
  .pl-l { animation: pl-left .9s cubic-bezier(.2, .8, .2, 1) both !important; }
  .pl-r { animation: pl-right .9s cubic-bezier(.2, .8, .2, 1) both !important; }
  .pl-bar span { animation: pl-fill 1.1s ease .9s forwards !important; }
  .preloader { transition: opacity .6s ease, visibility .6s ease !important; }
}



@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
}

/* ===== SCREENSHOT: card + modal ===== */
.proj img { object-position: top; background: var(--bg2); }

.shot-wrap { position: relative; }
.zoomable { cursor: zoom-in; transition: .25s; }
.zoomable:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(56,189,248,.25); }
.shot-main {
  width: 100%; max-height: 70vh; object-fit: contain;
  background: var(--bg2); border-radius: 12px; border: 1px solid var(--line);
}
.zoom-hint {
  position: absolute; right: 10px; bottom: 10px; pointer-events: none;
  background: rgba(0,0,0,.65); color: #fff; font-size: .8rem;
  padding: 5px 10px; border-radius: 99px;
}
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs img {
  width: 64px; height: 64px; flex: none; object-fit: cover; object-position: top;
  border-radius: 8px; border: 2px solid var(--line); cursor: zoom-in; transition: .2s;
}
.thumbs img:hover { border-color: var(--acc); }

/* ===== LIGHTBOX (full screen) ===== */
.lb {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.lb.open { display: flex; }
.lb > img {
  max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 10px;
  animation: pop .25s ease; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.lb button {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 1.7rem;
  line-height: 1; transition: .2s;
}
.lb button:hover { background: var(--acc); color: #04121f; }
.lb-x { top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-c {
  position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%); color: #fff; font-size: .9rem;
  background: rgba(0,0,0,.5); padding: 4px 12px; border-radius: 99px;
}
.lb.single .lb-prev, .lb.single .lb-next, .lb.single .lb-c { display: none; }