/* =========================================================
   Abdulla Al Tanjim — Portfolio
   ========================================================= */
:root {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #121a2e;
  --surface-2: #172136;
  --border: #24304d;
  --text: #e6ecf5;
  --muted: #9fb0c9;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-grad: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --shadow: 0 20px 45px -20px rgba(0, 0, 0, 0.65);
  --radius: 16px;
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
a { text-decoration: none; color: var(--accent); transition: color .2s ease; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #05121f; }

/* ---------- Layout helpers ---------- */
.section-pad { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 640px; margin: 0 auto 60px; text-align: center; }
.section-index {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .9rem;
  letter-spacing: 3px;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin: 8px 0 10px;
}
.section-sub { color: var(--muted); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-head);
  font-weight: 600;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: .95rem;
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-accent {
  background: var(--accent-grad);
  border: none;
  color: #05121f;
  box-shadow: 0 12px 30px -10px rgba(56, 189, 248, .6);
}
.btn-accent:hover { color: #05121f; box-shadow: 0 16px 38px -10px rgba(56, 189, 248, .75); }
.btn-outline-light { border: 1px solid var(--border); color: var(--text); }
.btn-outline-light:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent); }

/* ---------- Navbar ---------- */
#mainNav {
  padding: 18px 0;
  transition: padding .3s ease, background .3s ease, box-shadow .3s ease;
  background: transparent;
}
#mainNav.scrolled {
  padding: 10px 0;
  background: rgba(11, 17, 32, .88);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text) !important;
  letter-spacing: .5px;
}
.brand-mark { color: var(--accent); font-size: 1.2em; }
.navbar-toggler { border: 1px solid var(--border); color: var(--text); padding: 6px 12px; }
.navbar-toggler:focus { box-shadow: none; }
.navbar-nav .nav-link {
  color: var(--muted) !important;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .95rem;
  margin: 0 4px;
  padding: 8px 14px !important;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--text) !important; }
.navbar-nav .nav-link.active { background: var(--surface-2); }
.nav-cta {
  background: var(--accent-grad);
  color: #05121f !important;
  font-weight: 600;
}
.nav-cta:hover { color: #05121f !important; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 140px;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .12), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(129, 140, 248, .12), transparent 45%),
    linear-gradient(rgba(36, 48, 77, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 48, 77, .35) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 2px;
  font-size: .9rem;
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  margin: 0 0 10px;
  background: linear-gradient(120deg, #ffffff 30%, #9fb0c9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-role {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  color: var(--accent);
  font-weight: 600;
  min-height: 1.6em;
  margin: 0 0 20px;
}
.hero-role .cursor { animation: blink 1s steps(1) infinite; color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { color: var(--muted); max-width: 560px; margin-bottom: 30px; }
.hero-desc strong { color: var(--text); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-socials { display: flex; gap: 14px; }
.hero-socials a, .footer-socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  transition: all .2s ease;
}
.hero-socials a:hover, .footer-socials a:hover {
  color: #05121f; background: var(--accent-grad); border-color: transparent;
  transform: translateY(-3px);
}

/* Hero photo */
.hero-photo-wrap { position: relative; display: inline-block; max-width: 360px; }
.hero-photo {
  width: 100%;
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative; z-index: 2;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.hero-photo-ring {
  position: absolute; inset: -18px;
  border-radius: 40px;
  background: var(--accent-grad);
  opacity: .25;
  filter: blur(6px);
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px); } }
.hero-badge {
  position: absolute;
  z-index: 3;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .82rem;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.hero-badge i { color: var(--accent); }
.hero-badge { top: 24px; left: -26px; animation: float 5s ease-in-out infinite; }
.hero-badge-2 { top: auto; bottom: 30px; left: auto; right: -26px; animation: float 5s ease-in-out infinite reverse; }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-size: 1.1rem;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 10px); } }

/* ---------- Stats ---------- */
.stats { background: var(--bg-alt); padding: 44px 0; border-block: 1px solid var(--border); }
.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-size: .9rem; }

/* ---------- About ---------- */
.about-photo-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.about-photo { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; transition: transform .5s ease; }
.about-photo-wrap:hover .about-photo { transform: scale(1.04); }
.about-lead { font-size: 1.3rem; margin-bottom: 18px; }
#about p { color: var(--muted); }
.about-info { margin: 24px 0; }
.about-info div { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .93rem; }
.about-info i { color: var(--accent); margin-top: 4px; }
.about-info strong { color: var(--text); }
.about-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 40px; }
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent), var(--accent-2));
}
.tl-item { position: relative; margin-bottom: 34px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute; left: -40px; top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--accent);
  display: grid; place-items: center; color: var(--accent); font-size: .7rem;
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.tl-card:hover { transform: translateX(6px); border-color: var(--accent); }
.tl-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.tl-role { font-size: 1.15rem; margin: 0; }
.tl-tag {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--accent); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.tl-org { color: var(--accent-2); font-size: .9rem; margin: 6px 0 12px; }
.tl-org i { margin-right: 6px; }
.tl-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.tl-list li { margin-bottom: 6px; }

/* ---------- Skills ---------- */
.skill-group-title { font-size: 1.15rem; margin-bottom: 22px; }
.skill-group-title i { color: var(--accent); margin-right: 8px; }
.skill-bar { margin-bottom: 18px; }
.skill-bar-head { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 7px; color: var(--muted); }
.skill-bar-head span:last-child { font-family: var(--font-mono); color: var(--accent); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar { width: 0; background: var(--accent-grad); border-radius: 999px; transition: width 1.4s cubic-bezier(.16, 1, .3, 1); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .88rem;
  color: var(--muted);
  transition: all .2s ease;
}
.chip i { color: var(--accent); margin-right: 7px; }
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }

/* ---------- Research cards ---------- */
.rcard {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.rcard:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: var(--shadow); }
.rcard-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--accent); font-size: 1.35rem;
  margin-bottom: 18px;
}
.rcard h3 { font-size: 1.12rem; margin: 0 0 8px; }
.rcard p { color: var(--muted); font-size: .92rem; margin: 0; }
.rcard-quote { display: flex; flex-direction: column; justify-content: center; gap: 12px; background: var(--accent-grad); color: #05121f; }
.rcard-quote i { font-size: 1.6rem; opacity: .6; }
.rcard-quote p { color: #05121f; font-weight: 500; font-style: italic; }

/* ---------- Education ---------- */
.edu-card {
  height: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: transform .22s ease, border-color .22s ease;
}
.edu-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.edu-icon {
  width: 64px; height: 64px; border-radius: 50%;
  margin: 0 auto 18px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--accent); font-size: 1.5rem;
}
.edu-card h3 { font-size: 1.15rem; margin: 0 0 4px; }
.edu-field { color: var(--accent-2); font-weight: 600; margin: 0 0 8px; }
.edu-note { color: var(--muted); font-size: .9rem; margin: 0; }

.lang-block { margin-top: 60px; max-width: 820px; margin-inline: auto; }
.lang-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.lang-name { font-family: var(--font-head); font-weight: 600; display: block; }
.lang-level { color: var(--muted); font-size: .82rem; display: block; margin-bottom: 10px; }

/* ---------- Contact ---------- */
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-line {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--text);
}
.contact-line small { color: var(--muted); font-size: .78rem; }
a.contact-line:hover { border-color: var(--accent); transform: translateX(4px); transition: all .2s ease; }
.ci-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--accent); font-size: 1.05rem;
}
.contact-form .form-control {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: .95rem;
}
.contact-form .form-control::placeholder { color: #6b7c99; }
.contact-form .form-control:focus {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
}
.send-via { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.send-via .btn[data-send="whatsapp"] i { color: #05121f; }
.cf-status { font-size: .9rem; }
.cf-status.ok { color: #34d399; }
.cf-status.err { color: #f87171; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-tag { color: var(--muted); font-size: .85rem; }
.footer-socials { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.footer-socials { justify-content: flex-end; }
.footer-copy { color: var(--muted); font-size: .82rem; }

/* ---------- Back to top ---------- */
#toTop {
  position: fixed; right: 24px; bottom: 24px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-grad); color: #05121f;
  display: grid; place-items: center;
  box-shadow: 0 12px 30px -10px rgba(56, 189, 248, .6);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .28s ease; z-index: 900;
}
#toTop.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  #mainNav .navbar-collapse {
    background: rgba(11, 17, 32, .96);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
  }
  .navbar-nav .nav-link { margin: 3px 0; }
  .footer-socials { justify-content: center; }
  .hero-badge { left: 6px; }
  .hero-badge-2 { right: 6px; }
}
@media (max-width: 767px) {
  .section-pad { padding: 78px 0; }
  .hero { padding-top: 120px; }
  .tl-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
