/* =====================================================================
   Portfolio — Muhammad Haroon
   Light "blueprint paper" palette. Cool-white ground, white cards that
   lift off it, deep blue ink, and blue bloom instead of dark-mode glow.
   Every colour derives from the token block in section 2.
   ===================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background-color: rgba(var(--glow-rgb), 0.32);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

input,
textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

/* ---------- 2. Design tokens ---------- */
:root {
  color-scheme: light;

  /* Surfaces — cool paper, white cards */
  --bg-body: #EEF3FA;
  --bg-card: #FFFFFF;
  --bg-elevated: #E3EBF7;
  --border: #DCE5F2;
  --border-strong: #BFD0EB;

  /* Blue ink. --accent-primary is used as TEXT, so it must clear 4.5:1
     on white (#1D4ED8 ≈ 6.4:1). --accent-glow is bloom only, never text. */
  --accent-primary: #1D4ED8;
  --accent-deep: #2563EB;
  --accent-glow: #60A5FA;
  --accent-darkest: #1E3A8A;
  --on-accent: #FFFFFF;

  /* RGB channels for alpha compositing */
  --accent-rgb: 37, 99, 235;
  --glow-rgb: 96, 165, 250;
  --ink-rgb: 12, 27, 51;

  --text-primary: #0C1B33;
  --text-secondary: #47597A;
  --text-muted: #5E6E88;

  /* Glow, reinterpreted for light: coloured bloom + tinted lift, never
     a grey drop shadow. Grey shadows on pale blue read as dirt. */
  --shadow-card: 0 1px 2px rgba(var(--ink-rgb), 0.04),
                 0 6px 20px rgba(var(--accent-rgb), 0.07);
  --shadow-glow-soft: 0 4px 18px rgba(var(--accent-rgb), 0.14),
                      0 0 40px rgba(var(--glow-rgb), 0.22);
  --shadow-glow-strong: 0 10px 34px rgba(var(--accent-rgb), 0.26),
                        0 0 64px rgba(var(--glow-rgb), 0.38),
                        0 0 0 1px rgba(var(--accent-rgb), 0.10);
  --shadow-glow: var(--shadow-glow-strong);
  --shadow-ring: 0 0 0 1px rgba(var(--accent-rgb), 0.28),
                 0 10px 30px rgba(var(--accent-rgb), 0.16),
                 0 0 44px rgba(var(--glow-rgb), 0.28);

  --font-body: 'Poppins', system-ui, sans-serif;
  --font-italic: 'Playfair Display', Georgia, serif;

  /* One easing curve for the whole site. Snappy material-style curves are
     what made this feel sharp; this is a long, soft ease-out. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.35s;
  --dur: 0.5s;
  --dur-slow: 0.7s;

  --header-height: 3.5rem;

  --z-fixed: 100;
  --z-modal: 200;
  --z-cursor: 9999;
}

/* ---------- 3. Layout helpers ---------- */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.section {
  padding-block: 5rem 2rem;
  scroll-margin-top: 5rem;
}

.section__eyebrow {
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section__title {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.section__title--center {
  text-align: center;
  margin-bottom: 2.5rem;
}

.italic-accent,
.accent {
  color: var(--accent-primary);
}

.italic-accent {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
}

.accent {
  font-weight: 500;
}

/* ---------- 4. Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background-color: var(--accent-deep);
  color: var(--on-accent);
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.button {
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28),
              0 0 26px rgba(var(--glow-rgb), 0.30);
}

.button:hover {
  transform: translateY(-2px);
  background-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.button i {
  font-size: 1.1rem;
}

.button--outline {
  background: var(--bg-card);
  color: var(--accent-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

.button--outline:hover {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ---------- 5. Header / nav ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-fixed);
  background-color: transparent;
  transition: background-color var(--dur-slow) var(--ease),
              backdrop-filter var(--dur-slow) var(--ease),
              border-color var(--dur-slow) var(--ease),
              box-shadow var(--dur-slow) var(--ease);
  border-bottom: 1px solid transparent;
}

.scroll-header {
  background-color: rgba(238, 243, 250, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.07);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.nav__logo {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.nav__logo::first-letter {
  color: var(--accent-primary);
}

.nav__toggle,
.nav__close {
  font-size: 1.4rem;
  color: var(--text-primary);
}

.nav__list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.nav__link {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--dur-fast) var(--ease);
}

.nav__link:hover,
.nav__link.active-link {
  color: var(--accent-primary);
}

.nav__link-button {
  background-color: var(--accent-primary);
  color: var(--on-accent);
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  transition: background-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.nav__link-button:hover {
  background-color: var(--accent-deep);
  color: var(--on-accent);
  transform: translateY(-1px);
}

/* Mobile + tablet overlay menu — desktop nav only at ≥1150px */
@media (max-width: 1149px) {
  .nav__menu {
    position: fixed;
    inset: 0;
    background-color: rgba(246, 249, 254, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.55s var(--ease);
    z-index: var(--z-fixed);
  }

  .nav__menu.show-menu {
    transform: translateY(0);
  }

  .nav__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
  }

  .nav__list {
    font-size: 1.1rem;
    flex-direction: column;
    row-gap: 2.5rem;
    text-align: center;
  }

  /* Contain the CTA pill INSIDE the overlay — no floating outside.
     !important + position: static defensively neutralizes any rule
     (present or future) that would fix/absolute-position it in the header. */
  .nav__link-button,
  .nav__cta,
  .nav__button {
    position: static !important;
    display: inline-flex !important;
  }
}

/* Lock body scroll while the overlay is open */
body.menu-open {
  overflow: hidden;
}

@media (min-width: 1150px) {
  .nav__toggle,
  .nav__close {
    display: none;
  }

  .nav__list {
    flex-direction: row;
    gap: 2rem;
  }
}

/* ---------- Glow ----------
   The portrait and the CTA used to pulse on a 4s infinite loop. Nothing on a
   real page breathes like that; the glow is now static and only responds to
   the pointer. */

/* Typed.js caret */
.typed-cursor {
  color: var(--accent-primary);
  font-weight: 300;
  margin-left: 2px;
}

/* ---------- 6. Home / hero ---------- */
.home {
  padding-top: 8rem;
  position: relative;
  overflow: hidden;
}

.home::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(circle,
    rgba(var(--glow-rgb), 0.55) 0%,
    rgba(var(--glow-rgb), 0.16) 42%,
    transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.home__container {
  gap: 3rem;
  text-align: center;
  justify-items: center;
  position: relative;
  z-index: 1;
}

#nn-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  /* Blue-on-white carries far more weight than blue-on-black, so the mesh
     is masked out of the headline area and fades toward every edge. */
  -webkit-mask-image: radial-gradient(
    ellipse 80% 70% at 62% 45%,
    #000 0%,
    rgba(0, 0, 0, 0.55) 45%,
    transparent 78%
  );
  mask-image: radial-gradient(
    ellipse 80% 70% at 62% 45%,
    #000 0%,
    rgba(0, 0, 0, 0.55) 45%,
    transparent 78%
  );
}

@media (pointer: coarse) {
  #nn-canvas {
    display: none;
  }
}

/* Smaller halos behind About + Contact section titles */
.about,
.contact {
  position: relative;
  overflow: hidden;
}

.about::before,
.contact::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55vw;
  height: 55vw;
  max-width: 520px;
  max-height: 520px;
  background: radial-gradient(circle, rgba(var(--glow-rgb), 0.26) 0%, transparent 62%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.about__container,
.contact__container {
  position: relative;
  z-index: 1;
}

.home__eyebrow {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.home__title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  line-height: 1.05;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.home__title-line {
  display: block;
  color: var(--text-primary);
}

.home__title-italic {
  display: block;
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  color: var(--accent-primary);
}

.home__description {
  color: var(--text-secondary);
  max-width: 32ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

@media (min-width: 1150px) {
  .home__actions {
    justify-content: flex-start;
  }
}

.home__social {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 2rem;
  font-size: 1.35rem;
}

.home__social a {
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease),
              transform var(--dur) var(--ease);
}

.home__social a:hover {
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Portrait card */
.home__portrait,
.about__portrait {
  position: relative;
  width: 260px;
  height: 320px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--accent-deep), var(--accent-darkest));
  box-shadow: var(--shadow-glow-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.home__portrait {
  box-shadow: var(--shadow-glow-soft);
  transition: box-shadow var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}

.home__portrait:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-4px);
}

.home__portrait-img,
.about__portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home__portrait-fallback,
.about__portrait-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 5rem;
  font-weight: 500;
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-glow), var(--accent-darkest));
}

.home__badge {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-color: var(--bg-card);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-ring);
}

/* ---------- 7. About ---------- */
.about__container {
  gap: 2.5rem;
  align-items: center;
  justify-items: center;
}

.about__description {
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.about__stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.about__stat-number {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--accent-primary);
  line-height: 1;
}

.about__stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ---------- 8. Work ---------- */
.work__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.work__filter {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.work__filter:hover {
  color: var(--accent-primary);
  border-color: var(--border-strong);
}

.work__filter.active-filter {
  background-color: var(--accent-primary);
  color: var(--on-accent);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.30),
              0 0 24px rgba(var(--glow-rgb), 0.35);
}

.work__grid {
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.work__card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-slow) var(--ease),
              box-shadow var(--dur-slow) var(--ease),
              border-color var(--dur-slow) var(--ease);
}

.work__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-ring);
  border-color: transparent;
}

.work__image-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg-elevated), rgba(var(--glow-rgb), 0.45));
  aspect-ratio: 16 / 10;
  margin-bottom: 0.75rem;
}

.work__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: var(--bg-elevated);
}

.work__button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

.work__button:hover {
  transform: rotate(-15deg);
  background-color: var(--accent-deep);
}

.work__number {
  display: block;
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--accent-primary);
  margin: 0.5rem 0 0.25rem;
}

.work__title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.work__description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.work__links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.work__link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
  font-weight: 500;
}

.work__link:hover {
  color: var(--accent-primary);
}

.work__card.is-hidden {
  display: none;
}

/* Filtering used to pop cards in and out instantly. display:none can't be
   transitioned, so the cards that survive a filter fade back in. */
.work__grid.is-filtering .work__card:not(.is-hidden) {
  animation: card-settle 0.55s var(--ease) both;
}

@keyframes card-settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.work__footer {
  text-align: center;
  margin-top: 2.5rem;
}

.work__view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color var(--dur) var(--ease);
}

.work__view-all:hover {
  border-bottom-color: var(--accent-primary);
}

/* ---------- 9. Services ---------- */
.services__grid {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.services__card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-slow) var(--ease),
              box-shadow var(--dur-slow) var(--ease),
              border-color var(--dur-slow) var(--ease);
}

.services__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-ring);
  border-color: transparent;
}

.services__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-deep), var(--accent-darkest));
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.services__title {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.services__description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.services__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: gap var(--dur) var(--ease);
}

.services__link:hover {
  gap: 0.6rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: rgba(var(--ink-rgb), 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal.show-modal {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal__card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-glow);
}

.modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.modal__close:hover {
  background-color: var(--accent-primary);
  color: var(--on-accent);
}

.modal__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-deep), var(--accent-darkest));
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.modal__title {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.modal__description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.modal__list {
  display: grid;
  gap: 0.5rem;
}

.modal__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.modal__list i {
  color: var(--accent-primary);
  margin-top: 3px;
}

/* ---------- 10. Skills ---------- */
.skills__list {
  display: grid;
  gap: 1.25rem;
}

.skills__card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-slow) var(--ease),
              box-shadow var(--dur-slow) var(--ease);
}

.skills__card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-ring);
}

.skills__category {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
}

.skills__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skills__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background-color: rgba(var(--glow-rgb), 0.12);
  color: var(--text-primary);
  font-size: 0.78rem;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.skills__tag:hover {
  background-color: rgba(var(--glow-rgb), 0.20);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 16px rgba(var(--glow-rgb), 0.45);
}

.skills__tag i {
  color: var(--accent-primary);
}

/* ---------- 11. Testimonials ---------- */
.testimonials__swiper {
  padding-block: 1rem 3rem;
}

.testimonials__card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.5rem;
  height: auto;
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
}

.testimonials__rating {
  color: var(--accent-primary);
  display: flex;
  gap: 0.15rem;
  font-size: 0.9rem;
}

.testimonials__quote {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
}

.testimonials__author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
}

.testimonials__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-deep), var(--accent-darkest));
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 0.85rem;
}

.testimonials__name {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.testimonials__role {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.swiper-pagination-bullet {
  background-color: rgba(var(--accent-rgb), 0.22);
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(var(--glow-rgb), 0.7);
}

/* ---------- 12. Contact ---------- */
.contact__container {
  gap: 2.5rem;
}

.contact__form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact__input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.contact__input::placeholder {
  color: var(--text-muted);
}

.contact__input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.28),
              0 0 18px rgba(var(--accent-rgb), 0.14);
}

.contact__textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}

.contact__submit {
  justify-self: start;
}

.contact__status {
  min-height: 1.5rem;
  font-size: 0.85rem;
  color: var(--accent-primary);
}

.contact__info {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.contact__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.contact__card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-ring);
}

.contact__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent-deep), var(--accent-darkest));
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact__label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.contact__value {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 400;
  word-break: break-word;
}

/* ---------- 13. Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 4rem 2rem;
  margin-top: 3rem;
}

.footer__container {
  display: grid;
  gap: 2.5rem;
}

.footer__statement {
  font-size: clamp(1.4rem, 4vw, 2.75rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--dur-fast) var(--ease);
}

.footer__link:hover {
  color: var(--accent-primary);
}

.footer__social {
  display: flex;
  gap: 1.25rem;
  font-size: 1.35rem;
}

.footer__social a {
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease),
              transform var(--dur) var(--ease);
}

.footer__social a:hover {
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.footer__copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ---------- 14. Scroll-up ---------- */
.scroll-up {
  position: fixed;
  right: 1.25rem;
  bottom: -40%;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--accent-primary);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
  transition: bottom var(--dur-slow) var(--ease),
              transform var(--dur) var(--ease);
  z-index: var(--z-fixed);
}

.scroll-up:hover {
  transform: translateY(-3px);
}

.scroll-up.show-scroll {
  bottom: 1.5rem;
}

/* ---------- 15. Custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
  z-index: var(--z-cursor);
  mix-blend-mode: multiply;
  display: none;
}

.cursor.is-active {
  display: block;
}

.cursor.is-hover {
  width: 34px;
  height: 34px;
  background-color: rgba(var(--accent-rgb), 0.30);
}

@media (pointer: coarse) {
  .cursor {
    display: none !important;
  }
}

/* ---------- 15b. Detection-reticle cursor + work-card bbox ---------- */
.cursor-reticle {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-1000px, -1000px);
  transition: opacity var(--dur) var(--ease);
  will-change: transform;
}

body.custom-cursor,
body.custom-cursor a,
body.custom-cursor button,
body.custom-cursor input,
body.custom-cursor textarea,
body.custom-cursor .work__card {
  cursor: none;
}

/* Legacy blue-dot cursor is superseded by the reticle when active */
body.custom-cursor .cursor {
  display: none !important;
}

@media (pointer: coarse) {
  .cursor-reticle {
    display: none !important;
  }
}

.work__card.is-detected {
  transform: translateY(-4px);
}

.work__card.is-detected::before {
  content: '';
  position: absolute;
  inset: -4px;
  pointer-events: none;
  background:
    linear-gradient(to right,  var(--accent-primary) 14px, transparent 14px) top left     / 14px  1.5px no-repeat,
    linear-gradient(to bottom, var(--accent-primary) 14px, transparent 14px) top left     / 1.5px 14px  no-repeat,
    linear-gradient(to left,   var(--accent-primary) 14px, transparent 14px) top right    / 14px  1.5px no-repeat,
    linear-gradient(to bottom, var(--accent-primary) 14px, transparent 14px) top right    / 1.5px 14px  no-repeat,
    linear-gradient(to right,  var(--accent-primary) 14px, transparent 14px) bottom left  / 14px  1.5px no-repeat,
    linear-gradient(to top,    var(--accent-primary) 14px, transparent 14px) bottom left  / 1.5px 14px  no-repeat,
    linear-gradient(to left,   var(--accent-primary) 14px, transparent 14px) bottom right / 14px  1.5px no-repeat,
    linear-gradient(to top,    var(--accent-primary) 14px, transparent 14px) bottom right / 1.5px 14px  no-repeat;
  animation: reticle-in 0.45s var(--ease) both;
}

.work__card.is-detected::after {
  content: attr(data-detection-label);
  position: absolute;
  top: -22px;
  left: 4px;
  background: var(--accent-primary);
  color: var(--on-accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes reticle-in {
  from { opacity: 0; }
  to   { opacity: 0.9; }
}

/* ---------- 16. Focus states (a11y) ---------- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 17. Breakpoints ---------- */

/* Small tablets */
@media (min-width: 576px) {
  .container {
    padding-inline: 1.75rem;
  }

  .home__portrait,
  .about__portrait {
    width: 300px;
    height: 360px;
  }
}

/* Tablets — 2-col grids */
@media (min-width: 768px) {
  .section {
    padding-block: 6rem 3rem;
  }

  .section__title {
    font-size: 2.5rem;
  }

  .work__grid,
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills__card {
    grid-template-columns: 180px 1fr;
    align-items: center;
  }

  .contact__container {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop — final layout */
@media (min-width: 1150px) {
  .container {
    padding-inline: 2rem;
  }

  .home {
    padding-top: 9rem;
  }

  .home__container {
    grid-template-columns: 1fr auto;
    text-align: left;
    align-items: center;
    justify-items: start;
    gap: 4rem;
  }

  .home__description {
    margin-inline: 0;
    max-width: 44ch;
  }

  .home__social {
    justify-content: flex-start;
  }

  .home__portrait,
  .about__portrait {
    width: 340px;
    height: 420px;
  }

  .about__container {
    grid-template-columns: 380px 1fr;
    gap: 4rem;
    justify-items: start;
  }

  .work__grid,
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section__title {
    font-size: 2.75rem;
  }

  .footer__container {
    grid-template-columns: 1fr;
  }
}

/* ---------- 18. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Typed.js cursor for rotating hero role */
.typed-cursor {
  color: var(--accent-primary);
  font-weight: 300;
  margin-left: 2px;
  opacity: 1;
  animation: typed-blink 0.9s infinite;
}
@keyframes typed-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Mobile: hide the duplicate About-section portrait (already shown in hero) */
@media screen and (max-width: 767px) {
  .about__image { display: none; }
  .about__container { grid-template-columns: 1fr; }
  .about__content { grid-column: 1 / -1; }
}

/* Neural-network hero canvas: desktop only (perf on mobile) */
@media screen and (max-width: 899px) {
  #nn-canvas { display: none !important; }
}
