/* Featured projects: dark editorial portfolio. Header on one row, then a single-row carousel
   whose centre card is raised. Data comes from config.projects; behaviour is in projects-vmax.js. */
#du-an {
  --pj-navy: #061b27;
  --pj-navy-2: #0b2532;
  --pj-foot: #071e2b;
  --pj-text: #bbc9d1;
  --pj-line: rgba(255, 255, 255, 0.12);
  --pj-orange: #ff6b00;
  --pj-pad: clamp(24px, 3.2vw, 80px);
  position: relative;
  padding: clamp(64px, 6.2vw, 108px) 0 clamp(56px, 5.4vw, 96px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(60% 52% at 50% 66%, var(--pj-navy-2) 0, transparent 72%),
    radial-gradient(38% 42% at 0% 100%, #ff6b0014 0, transparent 70%),
    var(--pj-navy);
}
#du-an .projects-orbits {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  pointer-events: none;
}
#du-an .projects-orbits path {
  stroke: var(--pj-orange);
  stroke-opacity: 0.3;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
#du-an .projects-orbits .orbit-faint {
  stroke: #fff;
  stroke-opacity: 0.07;
}
#du-an .projects-orbits circle {
  fill: var(--pj-orange);
  filter: drop-shadow(0 0 5px #ff6b00aa);
}
#du-an .projects-inner {
  position: relative;
  z-index: 1;
  width: calc(100% - 2 * var(--pj-pad));
  max-width: 1700px;
  margin-inline: auto;
}
#du-an .projects-head {
  margin-bottom: clamp(26px, 3vw, 44px);
}
#du-an .projects-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
#du-an .projects-head .eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--pj-orange);
  font-size: clamp(12px, 0.9vw, 14px);
  font-weight: 600;
  letter-spacing: 2px;
}
#du-an .projects-head .eyebrow::after {
  content: "";
  width: 52px;
  height: 1px;
  background: var(--pj-orange);
}
#du-an #projects-heading {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
#du-an #projects-heading span {
  color: var(--pj-orange);
}
#du-an .projects-head-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  margin-top: clamp(14px, 1.6vw, 22px);
}
#du-an .projects-description {
  max-width: 560px;
  margin: 0;
  color: var(--pj-text);
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.65;
}
#du-an .projects-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 24px;
}
#du-an .projects-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pj-text);
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.2s;
}
#du-an .projects-source svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #7cc9a8;
  stroke-width: 1.5;
}
#du-an .projects-source:hover {
  color: #fff;
}
#du-an .projects-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 14px 28px;
  border-radius: 30px;
  color: #fff;
  background: var(--pj-orange);
  font-size: 15px;
  font-weight: 700;
  transition:
    background 0.25s,
    box-shadow 0.25s;
}
#du-an .projects-cta .icon {
  width: 19px;
  height: 19px;
  transition: transform 0.25s;
}
#du-an .projects-cta:hover {
  background: #ff7d1f;
  box-shadow: 0 10px 24px #ff6b0033;
}
#du-an .projects-cta:hover .icon {
  transform: translateX(4px);
}
#du-an .project-controls {
  position: static;
  inset: auto;
  display: flex;
  flex: none;
  gap: 10px;
  margin: 0;
  transform: none;
}
#du-an .slider-control {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #ffffff2e;
  border-radius: 50%;
  color: #e5edf1;
  background: #ffffff0d;
  transition:
    color 0.25s,
    border-color 0.25s,
    background 0.25s;
}
#du-an .slider-control:last-child {
  color: #0f172a;
  border-color: #fff;
  background: #fff;
}
#du-an .slider-control:hover {
  color: #fff;
  border-color: var(--pj-orange);
  background: var(--pj-orange);
}
#du-an .slider-control .icon {
  width: 20px;
  height: 20px;
}
#du-an button:focus-visible,
#du-an a:focus-visible,
#du-an .project-track:focus-visible {
  outline: 2px solid var(--pj-orange);
  outline-offset: 3px;
}

/* Carousel stage: 3D curved coverflow slider whose centre card is raised and highlighted */
#du-an .portfolio {
  position: relative;
  min-width: 0;
  perspective: 1200px;
  perspective-origin: 50% 50%;
}

#du-an .project-track {
  --cw: 410px;
  position: relative;
  display: block;
  height: calc(var(--cw) / 1.6 + 34px + 82px);
  min-height: 360px;
  padding: 0;
  overflow: visible;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  scroll-snap-type: none;
  transform-style: preserve-3d;
}

/* Radiant aura spotlight behind the active centre card */
#du-an .project-track::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(calc(var(--cw) * 2.3), 100%);
  height: calc(var(--cw) * 1.35);
  background: radial-gradient(closest-side, rgba(255, 107, 0, 0.32), rgba(255, 107, 0, 0.08) 65%, transparent 100%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#du-an .project-track.is-dragging {
  cursor: grabbing;
}
#du-an .project-track.is-dragging .project-card {
  transition: none !important;
}

#du-an .project-card {
  position: absolute;
  top: 24px;
  left: 50%;
  flex: none;
  width: var(--cw);
  margin-left: calc(var(--cw) / -2);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #061b27;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform 0.52s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.4s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* 3D glare reflection overlay */
#du-an .project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  background: radial-gradient(circle 320px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.18), transparent 70%);
  transition: opacity 0.25s ease;
  mix-blend-mode: overlay;
}
#du-an .project-card:hover::after {
  opacity: 1;
}

/* Active Centre Card */
#du-an .project-card.is-active {
  border-color: rgba(255, 107, 0, 0.75);
  box-shadow:
    0 0 0 1px rgba(255, 107, 0, 0.6),
    0 35px 80px -10px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(255, 107, 0, 0.35);
}

#du-an .project-card.is-active:hover {
  border-color: #ff8800;
  box-shadow:
    0 0 0 2px rgba(255, 107, 0, 0.9),
    0 45px 95px -10px rgba(0, 0, 0, 0.95),
    0 0 80px rgba(255, 107, 0, 0.55);
}

/* Non-active cards */
#du-an .project-card:not(.is-active) .project-thumbnail img {
  filter: brightness(0.72) saturate(0.85);
}
#du-an .project-card:not(.is-active):hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.65);
}

#du-an .project-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #071e2b;
  text-align: left;
  cursor: inherit;
  text-decoration: none;
}

/* 1. Sleek Browser Window Chrome Bar */
#du-an .card-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  background: linear-gradient(180deg, #0d2837 0%, #081d29 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  z-index: 2;
  position: relative;
}
#du-an .browser-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
#du-an .b-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.85;
}
#du-an .b-dot-red { background: #ff5f56; box-shadow: 0 0 6px rgba(255,95,86,0.4); }
#du-an .b-dot-amber { background: #ffbd2e; box-shadow: 0 0 6px rgba(255,189,46,0.4); }
#du-an .b-dot-green { background: #27c93f; box-shadow: 0 0 6px rgba(39,201,63,0.4); }

#du-an .browser-url {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 78%;
  padding: 2px 10px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #8da4b2;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#du-an .b-lock {
  width: 10px;
  height: 10px;
  stroke: #7cc9a8;
  flex: none;
}
/* 2. Mockup Thumbnail */
#du-an .project-thumbnail {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: #081d29;
}
#du-an .project-thumbnail.official img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.45s ease;
}
#du-an .project-card:hover .project-thumbnail img {
  transform: scale(1.05);
  filter: brightness(0.85);
}

#du-an .mockup-reflection {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

/* 3. Bottom Glass Slide-up Overlay (Recommended Choice) */
#du-an .project-bottom-glass {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 84px;
  padding: 16px 20px 14px;
  background: linear-gradient(180deg, rgba(6, 27, 39, 0.75) 0%, rgba(6, 27, 39, 0.96) 45%, #061b27 100%);
  /* Bỏ backdrop-filter: nền đã đục 75–96% nên blur gần như không thấy, nhưng 16 card blur làm cuộn khựng */
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(102%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s ease;
}

#du-an .project-card:hover .project-bottom-glass {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#du-an .project-glass-content {
  min-width: 0;
  flex: 1;
  transform: translateY(8px);
  opacity: 0;
  transition:
    transform 0.34s 0.04s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s 0.04s ease;
}

#du-an .project-card:hover .project-glass-content {
  transform: translateY(0);
  opacity: 1;
}

#du-an .project-glass-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: #61C73F;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#du-an .cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #61C73F;
  box-shadow: 0 0 6px rgba(97, 199, 63, 0.6);
}

#du-an .project-glass-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s ease;
}

#du-an .project-card:hover .project-glass-title {
  color: #ff9d42;
}

#du-an .round-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--pj-orange);
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transform: translateY(8px) scale(0.9);
  opacity: 0;
  transition:
    transform 0.34s 0.08s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s 0.08s ease,
    color 0.25s,
    background 0.25s,
    box-shadow 0.25s;
}

#du-an .project-card:hover .round-arrow {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#du-an .round-arrow:hover {
  color: #fff;
  background: var(--pj-orange);
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.5);
  transform: translateY(0) scale(1.08);
}

#du-an .round-arrow .icon,
#du-an .round-arrow svg {
  width: 17px;
  height: 17px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  #du-an {
    --pj-pad: 20px;
    padding: 56px 0 48px;
  }
  #du-an .project-track {
    --cw: 85vw;
    height: calc(var(--cw) / 1.6 + 34px + 50px);
  }
  #du-an .project-card {
    top: 15px;
  }
  #du-an .project-glass-title {
    font-size: 14px;
  }
  /* Điện thoại: mô tả + nút xếp dọc, tránh nút "Xem tất cả dự án" bị ép rớt từng chữ */
  #du-an .projects-head-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  #du-an .projects-description {
    max-width: none;
  }
  #du-an .projects-actions {
    width: 100%;
    justify-content: flex-start;
  }
  #du-an .projects-cta {
    white-space: nowrap;
    padding: 13px 26px;
  }
  #du-an .projects-head .eyebrow {
    white-space: nowrap;
    gap: 10px;
    letter-spacing: 1px;
  }
  #du-an .projects-head .eyebrow::after {
    width: 28px;
  }
}

/* Touch devices support */
@media (hover: none) {
  #du-an .project-card.is-active .project-bottom-glass {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  #du-an .project-card.is-active .project-glass-content,
  #du-an .project-card.is-active .round-arrow {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #du-an .project-card,
  #du-an .project-thumbnail.official img,
  #du-an .round-arrow,
  #du-an .project-bottom-glass {
    transition: none;
  }
}