:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #efefeb;
  --text: #161616;
  --muted: #6d6d68;
  --line: #d9d9d3;
  --line-strong: #b9b9b1;
  --accent: #1f1f1d;
  --on-accent: #ffffff;
  --max-width: 1160px;
  --header-h: 72px;
  --radius: 10px;
  --section-space: clamp(4.5rem, 10vw, 8rem);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --surface: #1b1b1a;
  --surface-muted: #222220;
  --text: #f0f0ed;
  --muted: #a7a7a1;
  --line: #363632;
  --line-strong: #54544e;
  --accent: #f0f0ed;
  --on-accent: #151515;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: "Noto Naskh Arabic", "Times New Roman", serif; }
html[lang="bn"] body { font-family: "Noto Sans Bengali", "Nirmala UI", "Vrinda", sans-serif; }
a { color: inherit; }
img { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
.container { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-wrap {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav > a {
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
}
.site-nav > a:hover, .site-nav > a:focus-visible { color: var(--text); }
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle > span:not(.sr-only) { width: 18px; height: 1px; display: block; margin: 3px auto; background: currentColor; }

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-btn {
  min-width: 40px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding: 6px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.lang-btn:hover, .lang-btn:focus-visible { color: var(--text); }
.lang-btn.is-active { background: var(--accent); color: var(--on-accent); }
.lang-flag {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.hero {
  display: grid;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding: clamp(5rem, 12vw, 9rem) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.7fr);
  gap: clamp(48px, 9vw, 120px);
  align-items: end;
}
.eyebrow, .section-number, .card-label, .project-type, .skill-index {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 880px;
  margin: 1.2rem 0 1.5rem;
  font-size: clamp(2.9rem, 7vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 760;
}
.hero-text {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.65;
}
.hero-actions, .about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 19px;
  border: 1px solid var(--text);
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button-primary:hover { background: var(--text); }
.button-secondary, .button-ghost { background: transparent; color: var(--text); }
.button-secondary:hover { background: var(--surface-muted); }
.button-ghost:hover { background: var(--accent); color: var(--on-accent); }

.hero-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-photo {
  width: min(100%, 210px);
  aspect-ratio: 1;
  display: block;
  margin: 0 0 24px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.hero-card > div + div { margin-top: 18px; }
.card-label { margin-bottom: 3px; font-size: 0.62rem; }
.card-value { margin: 0; font-size: 0.92rem; font-weight: 700; }

.section { padding: var(--section-space) 0; border-top: 1px solid var(--line); }
.section-muted { background: var(--surface-muted); }
.section-grid, .contact-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.42fr);
  gap: clamp(44px, 8vw, 112px);
}
.section h2 {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.section-heading { margin-bottom: 3.5rem; }
.section-heading h2 { max-width: 850px; }
.section-content > p { max-width: 730px; color: var(--muted); }
.section-content .lead, .lead { color: var(--text); font-size: clamp(1.08rem, 1.8vw, 1.2rem); line-height: 1.7; font-weight: 450; }
.section h3 { margin: 2.2rem 0 0.8rem; font-size: clamp(1.05rem, 1.6vw, 1.18rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 700; }
.divider { margin: 3.25rem 0; border: 0; border-top: 1px solid var(--line); }

.about-toc-wrapper {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
}
.about-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.about-toc a {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: color 140ms ease, background 140ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.about-toc a:hover,
.about-toc a:focus {
  color: var(--text);
  background: var(--surface-muted);
}
.about-toc a.active {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}
.about-block {
  scroll-margin-top: calc(var(--header-h) + 24px);
  margin-bottom: 3rem;
}
.about-block:last-child { margin-bottom: 0; }
.about-block > p:not(.lead),
.about-block > ul > li,
.about-block > ul > li > strong {
  max-width: 730px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  line-height: 1.7;
}
.about-block > h4 {
  margin: 1.8rem 0 1rem;
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.about-block > h3 {
  margin: 2.4rem 0 0.9rem;
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.about-block + .about-block { margin-top: 0; }
.about-block > p + p { margin-top: 0.9rem; }
.about-block > ul + p { margin-top: 0.9rem; }

.work-list { margin: 0; }

.work-list { margin: 0; }
.work-list dt { padding-top: 18px; border-top: 1px solid var(--line); font-weight: 700; }
.work-list dd { max-width: 730px; margin: 7px 0 0; padding-bottom: 18px; color: var(--muted); }
.tech-list, .approach-list { margin: 0; padding: 0; }
.tech-list li, .approach-list li {
  margin: 0;
  padding: 10px 0 10px 1.2rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  list-style: disc inside;
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  line-height: 1.7;
}
.tech-list li::marker, .approach-list li::marker { color: var(--text); }
.approach-list li strong { font-weight: 650; }
.positioning {
  margin-top: 2rem;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--text);
  background: var(--surface-muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.8;
}
.profile-details { margin-top: 48px; border-top: 1px solid var(--line); }
.profile-details div { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.profile-details dt { color: var(--muted); font-size: 0.83rem; font-weight: 700; }
.profile-details dd { margin: 0; font-size: 0.9rem; }
.profile-details a { text-underline-offset: 3px; }

.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.skill-card {
  min-height: 230px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-muted);
  transition: background 160ms ease;
}
.skill-card:hover { background: var(--surface); }
.skill-card:nth-child(4), .skill-card:nth-child(5) { grid-column: span 1; }
.skill-card h3 { margin: 48px 0 10px; font-size: 1.28rem; }
.skill-card p { max-width: 350px; margin: 0; color: var(--muted); font-size: 0.9rem; }

.projects-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; }
.projects-heading > p { max-width: 360px; margin: 0; color: var(--muted); }
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.project-card {
  min-height: 290px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  transition: background 160ms ease;
}
.project-card:hover { background: var(--surface-muted); }
.project-card h3 { margin: auto 0 10px; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.045em; }
.project-card p { max-width: 470px; margin: 0; color: var(--muted); }

.contact-links { margin-top: 42px; border-top: 1px solid var(--line); }
.contact-links a {
  display: grid;
  grid-template-columns: 42px 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.contact-links a:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.contact-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.contact-links span:not(.contact-icon) { color: var(--muted); font-size: 0.8rem; }
.contact-links strong { font-size: 0.9rem; font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); }
.footer-wrap { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-wrap p, .footer-wrap a { margin: 0; color: var(--muted); font-size: 0.78rem; }
.footer-wrap a { text-underline-offset: 4px; }

[dir="rtl"] .hero-grid, [dir="rtl"] .section-grid, [dir="rtl"] .contact-grid, [dir="rtl"] .contact-links a, [dir="rtl"] .profile-details div { direction: rtl; }
[dir="rtl"] .eyebrow, [dir="rtl"] .section-number, [dir="rtl"] .card-label, [dir="rtl"] .project-type, [dir="rtl"] .skill-index { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .positioning { border-left: 1px solid var(--line); border-right: 3px solid var(--text); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

@media (max-width: 820px) {
  :root { --header-h: 68px; }
  .container { width: min(calc(100% - 28px), var(--max-width)); }
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    inset-inline: 14px;
    display: none;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  body.menu-open { overflow: hidden; }
  .site-nav > a { padding: 12px 10px; }
  .lang-switcher { margin-top: 8px; align-self: flex-start; }
  .hero { min-height: auto; padding: 6.5rem 0 5.5rem; }
  .hero-grid, .section-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: clamp(3.2rem, 15vw, 5.8rem); }
  .profile-photo { margin-bottom: 20px; }
  .section h2 { font-size: clamp(2.35rem, 9vw, 4.6rem); }
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .skill-card, .skill-card:nth-child(4), .skill-card:nth-child(5) { grid-column: auto; min-height: 190px; }
  .projects-heading { display: block; }
  .projects-heading > p { margin-top: 18px; }
}

@media (max-width: 540px) {
  .hero-actions, .about-actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .profile-details div { grid-template-columns: 1fr; gap: 4px; }
  .contact-links a { grid-template-columns: 40px 1fr; gap: 10px 14px; }
  .contact-links a strong { grid-column: 2; }
  .footer-wrap { min-height: 108px; align-items: flex-start; justify-content: center; flex-direction: column; }
  .about-toc-wrapper { position: static; }
}

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