/* =========================================================
   OWAIS — Portfolio (Light Editorial, Blue Accent)
   Cream-dominant. Dark blocks only for Why / CTA / Footer.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg-cream: #F5F3EE;
  --bg-cream-deep: #EFEBE2;
  --bg-soft-blue: #DCE4F5;
  --card-white: #FFFFFF;
  --border-subtle: #E5E0D5;
  --border-soft: #EAE5D8;

  /* Dark blocks */
  --bg-dark: #0A1628;
  --bg-dark-2: #0D1B33;

  /* Blue palette */
  --primary: #1E40AF;
  --primary-hover: #1E3A8A;
  --accent: #3B82F6;
  --accent-soft: #DCE7FF;
  --accent-tint: #EEF2FF;

  /* Text */
  --text-dark: #0A1628;
  --text-body: #1F2937;
  --text-muted: #6B7280;
  --text-light: #F5F3EE;
  --text-light-muted: rgba(245, 243, 238, 0.7);

  /* Status */
  --online-green: #10B981;

  /* Type */
  --font-display: "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;

  /* Layout */
  --container-max: 1180px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);
  --nav-height: 70px;
  --nav-height-shrunk: 58px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, picture, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text-dark);
}
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--primary); color: var(--text-light); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
  color: var(--text-dark);
}
.section-heading--light { color: var(--text-light); text-align: left; margin-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.65rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition:
    background 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
  will-change: transform;
}
.btn--primary {
  background: var(--primary);
  color: var(--text-light);
  box-shadow: 0 8px 24px -8px rgba(30, 64, 175, 0.45);
}
.btn--primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 14px 32px -10px rgba(30, 64, 175, 0.55);
}
.btn--ghost-light {
  background: rgba(245, 243, 238, 0.08);
  color: var(--text-light);
  border: 1px solid rgba(245, 243, 238, 0.25);
}
.btn--ghost-light:hover {
  background: rgba(245, 243, 238, 0.14);
  border-color: rgba(245, 243, 238, 0.4);
}
.btn--block { width: 100%; }

/* ---------- Pills / Chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill--ghost {
  background: var(--primary);
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 12px;
}
.pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffffff;
}
.chip {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    height 0.35s var(--ease-out),
    background 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    backdrop-filter 0.35s var(--ease-out);
}
.nav.is-scrolled {
  height: var(--nav-height-shrunk);
  background: rgba(245, 243, 238, 0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--border-soft);
}
.nav__inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity 0.2s var(--ease-out);
}
.nav__logo:hover { opacity: 0.7; }
.nav__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  display: block;
}
.nav__logo-text {
  line-height: 1;
}
.nav.is-scrolled .nav__avatar {
  width: 34px;
  height: 34px;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out);
}
.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dark);
}
.nav__status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--online-green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%      { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: var(--bg-soft-blue);
  padding: calc(var(--nav-height) + 5rem) var(--container-pad) clamp(5rem, 10vw, 8rem);
  display: flex;
  justify-content: center;
}
.hero__card {
  width: 100%;
  max-width: 1000px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: center;
  margin-top: 0;
}
.hero__tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.hero__title {
  font-family: "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--text-dark);
}
.hero__title-em {
  display: inline;
  font-style: normal;
  color: var(--primary);
  font-weight: 900;
}
.hero__sub {
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.6;
  color: var(--text-muted);
}

/* =========================================================
   STATS
   ========================================================= */
.stats {
  padding: 0 var(--container-pad) clamp(3rem, 5vw, 4rem);
  background: var(--bg-cream);
}
.stats__card {
  max-width: var(--container-max);
  margin: 0 auto;
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.5rem 0.5rem;
}
.stat__icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--primary);
}
.stat__icon svg { width: 20px; height: 20px; }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  line-height: 1;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}
.stat__label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.35;
}
.stat__sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
@media (max-width: 820px) {
  .stats__card { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .stats__card { grid-template-columns: 1fr; }
}

/* =========================================================
   CREDENTIALS
   ========================================================= */
.credentials {
  background: var(--bg-cream);
  padding: clamp(1rem, 2vw, 1.5rem) var(--container-pad);
}
.credentials__inner {
  max-width: var(--container-max);
  margin: 0 auto;
}
.credentials__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0.85rem;
}
.credential {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--card-white);
  color: var(--text-dark);
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.25s, transform 0.25s;
}
.credential:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.credential__icon {
  width: 16px; height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee-section {
  background: var(--bg-cream);
  padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}
.marquee-section__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 2rem;
}
.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__group {
  display: flex;
  align-items: center;
  gap: 3.25rem;
  padding-right: 3.25rem;
  flex-shrink: 0;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.3s, transform 0.3s;
}
.marquee__logo:hover {
  opacity: 1;
  transform: translateY(-2px);
}
.marquee__logo img { width: 24px; height: 24px; }
.marquee__logo span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-dark);
}

@media (prefers-reduced-motion: reduce) {
  .marquee { mask-image: none; -webkit-mask-image: none; }
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: 100%; gap: 1.25rem; }
  .marquee__group { padding-right: 0; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
  .marquee__group[aria-hidden="true"] { display: none; }
}

/* =========================================================
   SERVICES — "What I do" (light cards)
   ========================================================= */
.services {
  background: var(--bg-cream);
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(3rem, 5vw, 4.5rem);
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.card {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -16px rgba(30, 64, 175, 0.3);
}
.card__icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--primary);
  margin-bottom: 1.25rem;
}
.card__icon svg { width: 22px; height: 22px; }
.card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.6rem;
  color: var(--text-dark);
}
.card__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}
@media (max-width: 960px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .services__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   MY WORK
   ========================================================= */
.work {
  background: var(--bg-cream);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.project {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
  position: relative;
}
.project:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -16px rgba(30, 64, 175, 0.25);
}
.project__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  cursor: zoom-in;
  background: var(--bg-cream-deep);
}
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--bg-dark);
  transition: transform 0.6s var(--ease-out);
}
.project__media:hover img { transform: scale(1.02); }
.project__media-label {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(10, 22, 40, 0.3);
}
.project__media--g1 { background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%); }
.project__media--g2 { background: linear-gradient(135deg, #0A1628 0%, #1E3A8A 100%); }
.project__media--g3 { background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); }
.project__media--g4 { background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 50%, #0A1628 100%); }

.project__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.project__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0;
  color: var(--text-dark);
}
.project__tags {
  display: inline-flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.project__tag {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
}
.project__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
@media (max-width: 720px) {
  .work__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CLIENTS — "My favorite collaborators"
   ========================================================= */
.clients {
  background: var(--bg-cream);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.clients__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.clients__inner .section-heading { text-align: left; margin-bottom: 1rem; }
.clients__lead {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 420px;
}
.clients__list { display: flex; flex-direction: column; gap: 0.75rem; }
.clients__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.clients__item strong {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.clients__item span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.clients__check {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.clients__check svg { width: 14px; height: 14px; }
@media (max-width: 820px) {
  .clients__inner { grid-template-columns: 1fr; }
}

/* =========================================================
   PROCESS
   ========================================================= */
.process {
  background: var(--bg-cream);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.process__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.step {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem 1.75rem;
  transition: border-color 0.3s, transform 0.3s;
}
.step:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
.step__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  color: var(--text-dark);
}
.step__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
@media (max-width: 960px) {
  .process__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .process__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   WHY (DARK)
   ========================================================= */
.why {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: clamp(4rem, 9vw, 7rem) 0;
  position: relative;
  overflow: hidden;
}
.why::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(59,130,246,0.18), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99,102,241,0.15), transparent 50%);
  pointer-events: none;
}
.why__inner {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  position: relative;
  z-index: 1;
}
.why__lead {
  font-size: 1rem;
  color: var(--text-light-muted);
  line-height: 1.6;
  margin: 0 0 2rem;
  font-style: italic;
}
.why__list { display: flex; flex-direction: column; gap: 0.75rem; }
.why__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  background: rgba(245, 243, 238, 0.04);
  border: 1px solid rgba(245, 243, 238, 0.1);
  border-radius: var(--radius-md);
}
.why__item strong {
  display: block;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.why__item span {
  font-size: 0.85rem;
  color: var(--text-light-muted);
}
.why__check {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.why__check svg { width: 14px; height: 14px; }
@media (max-width: 820px) {
  .why__inner { grid-template-columns: 1fr; }
}

/* =========================================================
   SKILLS BENTO
   ========================================================= */
.skills {
  background: var(--bg-cream);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.skills__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.skills__grid .bento:nth-child(1) { grid-column: span 4; }
.skills__grid .bento:nth-child(2) { grid-column: span 2; }
.skills__grid .bento:nth-child(3) { grid-column: span 2; }
.skills__grid .bento:nth-child(4) { grid-column: span 2; }
.skills__grid .bento:nth-child(5) { grid-column: span 2; }

/* Tablet: 2-column stacked pairs */
@media (max-width: 960px) {
  .skills__grid { grid-template-columns: repeat(2, 1fr); }
  .skills__grid .bento,
  .skills__grid .bento:nth-child(1),
  .skills__grid .bento:nth-child(2),
  .skills__grid .bento:nth-child(3),
  .skills__grid .bento:nth-child(4),
  .skills__grid .bento:nth-child(5) {
    grid-column: auto;
  }
}

/* Mobile: single column, full width */
@media (max-width: 640px) {
  .skills__grid { grid-template-columns: 1fr; }
}
.bento {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.6rem;
  transition: border-color 0.3s, transform 0.3s;
}
.bento:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.bento--lg { /* spans full row on certain rows if needed */ }
.bento__icon {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--primary);
  margin-bottom: 1rem;
}
.bento__icon svg { width: 20px; height: 20px; }
.bento__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--text-dark);
}
.bento__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .bento { padding: 1.5rem 1.25rem; }
  .bento__title { font-size: 1.15rem; }
  .chip { font-size: 0.68rem; padding: 0.3rem 0.6rem; }
}
@media (max-width: 820px) {
  .skills__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   TESTIMONIALS
   ========================================================= */
.testimonials {
  background: var(--bg-cream);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .testimonials__grid { grid-template-columns: 1fr; }
}
.t-card {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.t-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.t-card__stars {
  color: #F59E0B;
  letter-spacing: 0.1em;
  font-size: 1rem;
}
.t-card__flag { font-size: 1.4rem; }
.t-card__quote {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin: 0 0 1.25rem;
  flex: 1;
}
.t-card__author strong {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-dark);
}
.t-card__author span {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.testimonials__note {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 720px) {
  .testimonials__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CTA (DARK)
   ========================================================= */
.cta {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: clamp(4rem, 8vw, 6rem) 0;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.22), transparent 60%);
  pointer-events: none;
}
.cta__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.cta__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  color: var(--text-light);
  margin: 0 0 1rem;
}
.cta__title em {
  color: var(--accent);
  font-weight: 400;
}
.cta__sub {
  color: var(--text-light-muted);
  font-size: 1rem;
  margin: 0 0 2rem;
}
.cta__actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact {
  background: var(--bg-cream);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact__inner .section-heading { text-align: left; margin-bottom: 1rem; }
.contact__lead {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 2rem;
  max-width: 420px;
}
.contact__channels {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.contact__channels li {
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.25s;
}
.contact__channels li:hover { border-color: var(--primary); }
.contact__lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-tint);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact__channels a {
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 500;
}
.contact__channels a:hover { color: var(--primary); }

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field__lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-cream);
  transition: border-color 0.25s, background 0.25s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-white);
}
@media (max-width: 820px) {
  .contact__inner { grid-template-columns: 1fr; }
}

/* =========================================================
   FOOTER (DARK)
   ========================================================= */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: clamp(3rem, 6vw, 4rem) 0 0;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(245, 243, 238, 0.1);
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.footer__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-light);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.5rem;
  font-weight: 600;
}
.footer__name {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: -0.02em;
  margin: 0;
}
.footer__role {
  font-size: 0.82rem;
  color: var(--text-light-muted);
  margin: 0;
}
.footer__nav,
.footer__socials {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer__socials { justify-content: flex-end; }
.footer__nav a,
.footer__socials a {
  font-size: 0.9rem;
  color: var(--text-light-muted);
  transition: color 0.2s;
}
.footer__nav a:hover,
.footer__socials a:hover { color: var(--text-light); }

.footer__copy {
  text-align: center;
  padding: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light-muted);
  letter-spacing: 0.02em;
}
@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr; text-align: center; }
  .footer__brand { justify-content: center; }
  .footer__nav, .footer__socials { justify-content: center; }
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}
.services__grid [data-reveal]:nth-child(2),
.process__grid [data-reveal]:nth-child(2),
.testimonials__grid [data-reveal]:nth-child(2),
.work__grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.services__grid [data-reveal]:nth-child(3),
.process__grid [data-reveal]:nth-child(3),
.testimonials__grid [data-reveal]:nth-child(3),
.work__grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.services__grid [data-reveal]:nth-child(4),
.process__grid [data-reveal]:nth-child(4),
.testimonials__grid [data-reveal]:nth-child(4),
.work__grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
/* ===== Profile avatar — sits beside "Owais" at top, slides right on scroll ===== */
.floating-avatar {
  position: fixed;
  top: 12px;
  left: max(var(--container-pad), calc(50vw - var(--container-max) / 2 + var(--container-pad)));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 200;
  transition:
    left 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    top 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    transform 0.3s var(--ease-out);
  will-change: left, top, transform;
}
.floating-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card-white);
  box-shadow: 0 4px 14px -4px rgba(10, 22, 40, 0.2);
  display: block;
}
.floating-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--online-green);
  border: 2px solid var(--card-white);
  z-index: 2;
}
.floating-avatar:hover {
  transform: scale(1.08);
}

/* Detached state — glides to right edge */
.floating-avatar.is-detached {
  left: min(
    calc(100vw - 44px - var(--container-pad)),
    calc(50vw + var(--container-max) / 2 - 44px - var(--container-pad))
  );
}

/* Push "Owais" text to sit just after the avatar */
.nav__logo {
  padding-left: 56px;
  transition: padding-left 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.floating-avatar.is-detached ~ * .nav__logo,
body:has(.floating-avatar.is-detached) .nav__logo {
  padding-left: 0;
}

.nav__status { display: none; }

@media (max-width: 640px) {
  .floating-avatar { width: 38px; height: 38px; top: 14px; }
  .floating-avatar::after { width: 9px; height: 9px; }
  .floating-avatar.is-detached {
    left: calc(100vw - 38px - var(--container-pad));
  }
  .nav__logo { padding-left: 48px; }
  body:has(.floating-avatar.is-detached) .nav__logo { padding-left: 0; }
}
/* Credentials row inside stats card */
.stats__creds {
  max-width: var(--container-max);
  margin: 1.25rem auto 0;
  padding: 1.25rem 1rem 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.75rem;
}
.stats__cred {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stats__cred:not(:last-child)::after {
  content: '·';
  margin-left: 0.75rem;
  color: var(--border-subtle);
}
/* Alternating heading alignment for editorial rhythm */
.services .section-heading,
.skills .section-heading {
  text-align: left;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--container-pad);
  box-sizing: border-box;
}

.hero__ctas {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn--ghost-dark {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--text-dark);
}
.btn--ghost-dark:hover {
  background: var(--text-dark);
  color: var(--card-white);
}
/* Scroll-to-top button (bottom-left, appears after scroll) */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 150;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--card-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(30, 64, 175, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), background 0.25s;
}
.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top:hover { background: var(--primary-hover); transform: translateY(-2px); }
.scroll-top svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .scroll-top { width: 42px; height: 42px; bottom: 1rem; left: 1rem; }
}
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Lightbox — click project image to zoom */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 22, 40, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
  cursor: zoom-out;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.3s var(--ease-out);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(245, 243, 238, 0.12);
  color: var(--text-light);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox__close:hover { background: rgba(245, 243, 238, 0.25); }