/* =========================================================
   Humayun Kabir — Portfolio
   Clean, minimal, responsive. Apple-style motion.
   ========================================================= */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #0066cc;
  --accent-ink: #004f9e;
  --accent-soft: #e8f1fc;
  --dark: #0b0b0d;
  --dark-2: #1c1c1f;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1160px;
  --pad: clamp(20px, 5vw, 40px);
  --section: clamp(72px, 11vw, 140px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.08; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: var(--section) 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.h2 { font-size: clamp(34px, 5.2vw, 56px); }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); line-height: 1.55; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 16px; border: 1px solid transparent; cursor: pointer;
  transition: transform .4s var(--ease), background-color .3s, box-shadow .4s var(--ease), color .3s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 102, 204, 0.25); }
.btn--ghost { background: transparent; color: var(--ink); border-color: #d2d2d7; }
.btn--ghost:hover { color: var(--ink); background: var(--surface-2); transform: translateY(-2px); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(251, 251, 253, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(251, 251, 253, 0.85); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav__logo { font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.nav__logo:hover { color: var(--ink); }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a:not(.btn) { color: var(--ink-2); font-size: 15px; font-weight: 500; position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--ink); }
.nav__links a:not(.btn):hover::after { transform: scaleX(1); }
.nav__toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .4s var(--ease), opacity .3s; }
.nav__toggle span:nth-child(1) { top: 16px; }
.nav__toggle span:nth-child(2) { top: 26px; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: 64px; left: 0; right: 0; height: calc(100dvh - 64px);
    flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 24px var(--pad);
    background: rgba(251, 251, 253, 0.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .4s var(--ease), transform .5s var(--ease), visibility .4s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav__links a:not(.btn) { font-size: 28px; font-weight: 600; color: var(--ink); padding: 8px 0; }
  .nav__links a:not(.btn)::after { display: none; }
  .nav__links .btn { margin-top: 16px; }
  body.menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { padding: calc(64px + clamp(48px, 9vw, 120px)) 0 clamp(56px, 8vw, 110px); }
.hero__grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero__title { font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.035em; margin: 6px 0 24px; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > span { display: inline-block; }
.hero__title .grad { background: linear-gradient(90deg, #0066cc, #5e5ce6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 32px 0 22px; }
.hero__meta { display: flex; gap: 10px 22px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.18); }
.hero__media { position: relative; }
.hero__photo {
  border-radius: 28px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface-2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.18);
  transform: translateY(var(--parallax, 0px));
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom, 1.06)); transition: transform 1.6s var(--ease); }
.hero__badge {
  position: absolute; left: -28px; bottom: 32px; background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 18px; padding: 16px 20px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.18);
  animation: float 6s ease-in-out infinite;
}
.hero__badge strong { display: block; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.hero__badge span { font-size: 13px; color: var(--muted); }
.hero__badge--top { left: auto; right: -20px; top: 28px; bottom: auto; animation-delay: -3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { max-width: 460px; width: 100%; margin: 0 auto; order: -1; }
  .hero__badge { left: 12px; bottom: 16px; padding: 12px 16px; }
  .hero__badge strong { font-size: 24px; }
  .hero__badge--top { right: 12px; top: 16px; left: auto; bottom: auto; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.stat__num { font-size: clamp(40px, 5vw, 60px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.stat__num em { font-style: normal; color: var(--accent); }
.stat__label { margin-top: 10px; font-size: 15px; color: var(--muted); max-width: 220px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about__text { display: grid; gap: 20px; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { background: var(--accent-soft); color: var(--accent-ink); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

/* ---------- Cards / grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 56px); }
.section__head p { max-width: 420px; }

.skill {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .3s;
}
.skill:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.18); border-color: transparent; }
.skill__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.skill h3 { font-size: 21px; margin-bottom: 10px; letter-spacing: -0.02em; }
.skill p { font-size: 15.5px; color: var(--muted); }

.case {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; overflow: hidden; color: var(--ink);
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}
.case:hover { color: var(--ink); transform: translateY(-8px); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.25); }
.case__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.case__media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 1.2s var(--ease); }
.case:hover .case__media img { transform: scale(1.05); }
.case__media--stat { display: grid; place-items: center; background: linear-gradient(135deg, #0066cc, #5e5ce6); color: #fff; text-align: center; padding: 24px; }
.case__media--stat strong { display: block; font-size: clamp(48px, 6vw, 64px); letter-spacing: -0.04em; line-height: 1; }
.case__media--stat span { font-size: 15px; opacity: 0.9; }
.case__body { padding: 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case__tag { font-size: 12.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.case__title { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.case__num { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; color: var(--accent); margin-top: 6px; line-height: 1.1; }
.case__label { font-size: 15px; color: var(--muted); }
.case__more { margin-top: auto; padding-top: 14px; font-weight: 600; font-size: 15px; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; }
.case__more .arrow { transition: transform .4s var(--ease); }
.case:hover .case__more .arrow { transform: translateX(5px); }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; }
.job { display: grid; grid-template-columns: 220px 1fr; gap: 8px 40px; padding: 30px 0; border-top: 1px solid var(--line); }
.job:last-child { border-bottom: 1px solid var(--line); }
.job__date { font-size: 15px; font-weight: 500; color: var(--muted); padding-top: 3px; }
.job__role { font-size: 22px; letter-spacing: -0.02em; line-height: 1.25; }
.job__co { font-size: 15.5px; font-weight: 600; color: var(--accent); margin: 4px 0 10px; }
.job ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 16px; display: grid; gap: 6px; }
@media (max-width: 720px) { .job { grid-template-columns: 1fr; } }

/* ---------- Toolkit ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tool { background: var(--surface); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; transition: transform .4s var(--ease), border-color .3s; }
.tool:hover { transform: translateY(-3px); border-color: #c7c7cc; }
.certs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.certs li { display: flex; gap: 14px; align-items: center; font-size: 16px; }
.certs svg { flex: 0 0 auto; color: var(--accent); }

/* ---------- Contact ---------- */
.contact { background: var(--dark); color: #f5f5f7; }
.contact .eyebrow { color: #64a8ff; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.contact__title { font-size: clamp(36px, 5.4vw, 60px); margin-bottom: 24px; }
.contact__links { display: grid; gap: 12px; font-size: 18px; margin-top: 28px; }
.contact__links a { color: #f5f5f7; display: inline-flex; gap: 12px; align-items: center; }
.contact__links a:hover { color: #64a8ff; }
.form { background: var(--dark-2); border-radius: 24px; padding: clamp(22px, 4vw, 34px); display: grid; gap: 16px; }
.form label { display: grid; gap: 8px; font-size: 14px; color: #a1a1a6; }
.form input, .form textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #3a3a3c; background: #111113;
  color: #f5f5f7; font: inherit; font-size: 16px; transition: border-color .3s, box-shadow .3s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: #0a84ff; box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.25); }
.form .btn { width: 100%; background: #0a84ff; }
.form .btn:hover { background: #0071e3; }
.form__note { font-size: 13px; color: #8e8e93; text-align: center; }
@media (max-width: 820px) { .contact__grid { grid-template-columns: 1fr; } }
.footer { border-top: 1px solid #2c2c2e; padding: 26px 0; font-size: 14px; color: #8e8e93; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: #a1a1a6; }

/* ---------- Case study page ---------- */
.cs-hero { padding: calc(64px + clamp(48px, 8vw, 100px)) 0 clamp(32px, 4vw, 48px); }
.narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--pad); }
.back { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 15px; margin-bottom: 28px; }
.cs-title { font-size: clamp(38px, 6vw, 68px); letter-spacing: -0.035em; margin-bottom: 20px; }
.snapshot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 40px; }
.snapshot div { background: var(--surface); padding: 20px; }
.snapshot small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.snapshot strong { font-size: 16px; font-weight: 600; }
@media (max-width: 720px) { .snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-block { padding: clamp(44px, 6vw, 72px) 0 0; }
.cs-block h2 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 18px; }
.cs-block > p, .cs-block .narrow > p { font-size: 18px; color: var(--ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; font-size: 17.5px; color: var(--ink-2); counter-increment: s; }
.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.result strong { display: block; font-size: clamp(34px, 4.4vw, 48px); letter-spacing: -0.04em; color: var(--accent); line-height: 1.05; }
.result span { font-size: 15px; color: var(--muted); }
@media (max-width: 720px) { .results { grid-template-columns: 1fr; } }
.proof { margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(10px, 2vw, 16px); overflow: hidden; }
.proof img { border-radius: 12px; width: 100%; cursor: zoom-in; }
.proof figcaption { font-size: 14px; color: var(--muted); padding: 14px 6px 4px; }
.next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--dark); color: #f5f5f7;
  border-radius: 24px; padding: clamp(24px, 4vw, 40px); margin: clamp(56px, 8vw, 96px) 0; transition: transform .6s var(--ease);
}
.next:hover { color: #f5f5f7; transform: translateY(-4px); }
.next small { color: #64a8ff; font-size: 14px; display: block; margin-bottom: 6px; }
.next strong { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; }
.next .arrow { font-size: 30px; transition: transform .4s var(--ease); }
.next:hover .arrow { transform: translateX(6px); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.86); display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s; cursor: zoom-out; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-height: 90vh; width: auto; border-radius: 12px; transform: scale(0.94); transition: transform .5s var(--ease); }
.lightbox.is-open img { transform: none; }

/* ---------- Motion (Apple-style reveals) ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); filter: blur(8px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }
.js .reveal--scale { transform: scale(0.94) translateY(30px); }
.js .hero__title .line > span { transform: translateY(105%); transition: transform 1.2s var(--ease); transition-delay: var(--d, 0s); }
.js .is-loaded .hero__title .line > span { transform: none; }
.js .fade-in { opacity: 0; transition: opacity 1.2s var(--ease); transition-delay: var(--d, 0s); }
.js .is-loaded .fade-in { opacity: 1; }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); z-index: 60; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal, .js .fade-in { opacity: 1; transform: none; filter: none; }
  .js .hero__title .line > span { transform: none; }
}
