/* Project archive & single — uses :root tokens from buildmeone.css */

/* ——— Projects gate (Experiences | Tools) ——— */
body.projects-gate-page {
  --gate-vh: 100dvh;
  overflow: hidden;
}

body.projects-gate-page .site-main--projects-archive {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: var(--gate-vh);
}

.projects-gate {
  --gate-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gate-duration: 0.98s;
  --gate-vh: 100dvh;
  position: relative;
  height: var(--gate-vh);
  min-height: var(--gate-vh);
  overflow: hidden;
  color: #f5f1ec;
}

.projects-gate__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 2;
}

.projects-gate__panels {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  min-height: 100%;
}

@media (max-width: 768px) {
  .projects-gate__panels {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    height: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .projects-gate__panel {
    flex: 0 0 var(--gate-vh);
    min-height: var(--gate-vh);
    height: var(--gate-vh);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

.projects-gate__panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  border: none;
  outline: none;
  transition:
    flex-grow var(--gate-duration) var(--gate-ease),
    opacity var(--gate-duration) ease;
}

.projects-gate__panel:hover {
  text-decoration: none;
  color: inherit;
}

.projects-gate__panel--experiences {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.projects-gate__panel--tools {
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .projects-gate__panel--experiences {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .projects-gate__panel--tools {
    border-left: none;
  }
}

.projects-gate__panel-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: transform 0.6s var(--gate-ease), filter 0.5s ease;
}

.projects-gate__panel--experiences .projects-gate__panel-bg {
  background:
    radial-gradient(ellipse 70% 55% at 52% 38%, rgba(54, 98, 227, 0.14) 0%, transparent 55%),
    linear-gradient(220deg, #0a0c14 0%, #06080e 100%);
}

.projects-gate__cosmic {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.projects-gate__cosmic-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.projects-gate__drafting {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.projects-gate__drafting-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.projects-gate__panel--experiences .projects-gate__panel-inner {
  z-index: 2;
}

.projects-gate__panel--tools .projects-gate__panel-inner {
  z-index: 2;
}

.projects-gate__panel--experiences:hover .projects-gate__panel-bg,
.projects-gate__panel--experiences:focus-visible .projects-gate__panel-bg {
  filter: brightness(1.05);
}

.projects-gate__panel--tools .projects-gate__panel-bg {
  background:
    radial-gradient(ellipse 52% 46% at 50% 44%, rgba(237, 133, 29, 0.1) 0%, transparent 62%),
    radial-gradient(ellipse 70% 55% at 48% 40%, rgba(100, 120, 145, 0.06) 0%, transparent 58%),
    linear-gradient(168deg, #0c0d0f 0%, #08090b 48%, #040506 100%);
  transition: background 0.55s var(--gate-ease), transform 0.6s var(--gate-ease), filter 0.5s ease;
}

.projects-gate__panel--tools:hover .projects-gate__panel-bg,
.projects-gate__panel--tools:focus-visible .projects-gate__panel-bg {
  background:
    radial-gradient(ellipse 56% 50% at 50% 44%, rgba(237, 133, 29, 0.18) 0%, rgba(237, 133, 29, 0.05) 38%, transparent 66%),
    radial-gradient(ellipse 70% 55% at 48% 40%, rgba(100, 120, 145, 0.06) 0%, transparent 58%),
    linear-gradient(168deg, #0c0d0f 0%, #08090b 48%, #040506 100%);
  filter: brightness(1.04);
}

.projects-gate__panel:hover .projects-gate__panel-bg,
.projects-gate__panel:focus-visible .projects-gate__panel-bg {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.projects-gate__panel-inner {
  position: relative;
  z-index: 2;
  max-width: 22rem;
  transform: translateY(0);
  transition: transform 0.45s var(--gate-ease);
}

.projects-gate__panel:hover .projects-gate__panel-inner,
.projects-gate__panel:focus-visible .projects-gate__panel-inner {
  transform: translateY(-6px);
}

.projects-gate__panel-num {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(245, 241, 236, 0.38);
  margin-bottom: 0.75rem;
}

.projects-gate__panel-title {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
}

.projects-gate__panel-desc {
  margin: 0 0 1rem;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  line-height: 1.55;
  color: rgba(245, 241, 236, 0.78);
}

.projects-gate__panel-meta {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 241, 236, 0.4);
  margin-bottom: 1.25rem;
}

.projects-gate__panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.3s ease;
}

.projects-gate__panel--experiences .projects-gate__panel-cta {
  color: #6b8cff;
}

.projects-gate__panel--tools .projects-gate__panel-num {
  color: rgba(237, 133, 29, 0.52);
}

.projects-gate__panel--tools .projects-gate__panel-cta {
  color: var(--accent);
}

.projects-gate__panel:hover .projects-gate__panel-cta,
.projects-gate__panel:focus-visible .projects-gate__panel-cta {
  gap: 0.75rem;
}

.projects-gate__panel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

/* Gate exit transition */
body.projects-gate-exiting {
  overflow: hidden;
}

.projects-gate.is-transitioning .projects-gate__panel {
  pointer-events: none;
}

.projects-gate__panel.is-expanding {
  align-items: center;
  justify-content: center;
  border: none !important;
  overflow: hidden;
  will-change: top, left, width, height;
}

.projects-gate__panel.is-fading {
  opacity: 0;
  transition: opacity calc(var(--gate-duration) * 0.4) ease;
}

.projects-gate.is-transitioning .projects-gate__grain {
  opacity: 0;
  transition: opacity calc(var(--gate-duration) * 0.45) ease;
}

body.projects-gate-exiting .projects-gate__panel-inner {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .projects-gate__panel.is-expanding {
    will-change: auto;
  }
}

/* Category archive entrance */
body.projects-gate-entering::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: #161311;
  opacity: 1;
  transition: opacity var(--gate-duration) var(--gate-ease);
}

body.projects-gate-entering--active::before {
  opacity: 0;
}

body.projects-gate-entering--experiences::before {
  background: linear-gradient(135deg, #1a2238 0%, #161311 100%);
}

body.projects-gate-entering--tools::before {
  background: linear-gradient(135deg, #14110f 0%, #08090b 55%, #050608 100%);
}

/* Category archive back link */
.projects-archive__back {
  position: fixed;
  top: calc(3.5rem + 0.65rem);
  left: clamp(0.75rem, 3vw, 1.25rem);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 241, 236, 0.55);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(22, 19, 17, 0.75);
  backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.projects-archive__back:hover {
  color: #f5f1ec;
  border-color: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.projects-archive__back--inline {
  position: static;
  margin-top: 1rem;
}

.projects-archive__empty-wrap {
  padding: 4rem 1.25rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .projects-gate__panel,
  .projects-gate__panel-bg,
  .projects-gate__panel-inner,
  body.projects-gate-entering::before {
    transition: none !important;
    animation: none !important;
  }

  body.projects-gate-exiting .projects-gate__panels {
    grid-template-columns: 1fr 1fr;
  }
}

.site-main--projects-archive,
.site-main--project-single {
  max-width: 72rem;
  margin-inline: auto;
  padding-bottom: 3rem;
}

.site-main--projects-archive {
  padding-top: clamp(2.5rem, 8vw, 56px);
  max-width: 78rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1rem, 3.5vw, 1.75rem);
  padding-inline: clamp(0.875rem, 4vw, 1.25rem);
}

@media (min-width: 56.3125rem) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.project-card {
  min-width: 0;
  border: 1px solid var(--gray);
  background: var(--white);
  overflow: hidden;
  border-radius: 6px;
  box-shadow:
    0 2px 6px rgba(44, 44, 44, 0.06),
    0 1px 2px rgba(44, 44, 44, 0.04);
  transition:
    box-shadow 0.28s ease,
    transform 0.28s ease;
}

.project-card:has(.project-card__link:hover),
.project-card:has(.project-card__link:focus-visible) {
  box-shadow:
    0 14px 28px rgba(44, 44, 44, 0.12),
    0 6px 12px rgba(44, 44, 44, 0.08);
  transform: translateY(-4px);
}

.project-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card__link:hover {
  text-decoration: none;
}

.project-card__media {
  aspect-ratio: 1.618 / 1;
  overflow: hidden;
  background: var(--gray);
}

@media (max-width: 36rem) {
  .project-card__media {
    aspect-ratio: 16 / 10;
  }
}

.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.35s ease;
}

.project-card__link:hover .project-card__img,
.project-card__link:focus-visible .project-card__img {
  filter: brightness(1.09) saturate(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-card__img {
    transition: none;
  }

  .project-card:has(.project-card__link:hover),
  .project-card:has(.project-card__link:focus-visible) {
    transform: none;
  }
}

@media (hover: none) {
  .project-card:has(.project-card__link:hover) {
    transform: none;
  }
}

.project-card__body {
  padding: clamp(0.875rem, 3vw, 1.125rem) clamp(0.875rem, 3vw, 1.125rem)
    clamp(1rem, 3.2vw, 1.375rem);
}

.project-card__title {
  font-size: clamp(1rem, 2.4vw + 0.65rem, 1.125rem);
  line-height: 1.25;
  color: var(--gray);
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.project-card__subtitle {
  font-size: clamp(0.8125rem, 1.5vw + 0.65rem, 0.875rem);
  color: var(--gray);
  opacity: 0.85;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.projects-archive__pagination {
  padding: 2rem clamp(0.875rem, 4vw, 1.25rem) 0;
}

.projects-archive__pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
}

.projects-archive__pagination .page-numbers {
  color: var(--gray);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}

.projects-archive__pagination a.page-numbers:hover {
  color: var(--accent);
  text-decoration: none;
}

.projects-archive__pagination span.page-numbers.current {
  font-weight: 700;
  color: var(--accent);
}

.projects-archive__empty {
  padding: 2rem 1.25rem;
}

/* ——— Archive view toggle ——— */
.projects-archive {
  position: relative;
}

body.projects-category-archive .projects-view-toggle {
  top: calc(3.5rem + 2.75rem);
}

.projects-view-toggle {
  position: fixed;
  top: calc(3.5rem + 0.35rem);
  right: clamp(0.75rem, 3vw, 1.25rem);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--project-dark-border-subtle, #3d3834);
  border-radius: 8px;
  background: rgba(52, 48, 44, 0.92);
  backdrop-filter: blur(8px);
}

.projects-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--project-dark-text-muted, #aea49c);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.projects-view-toggle__btn:hover {
  color: var(--project-dark-heading, #f5f1ec);
  background: rgba(255, 255, 255, 0.06);
}

.projects-view-toggle__btn.is-active,
.projects-view-toggle__btn[aria-pressed='true'] {
  color: var(--project-dark-heading, #f5f1ec);
  background: rgba(255, 255, 255, 0.12);
}

.projects-view-toggle__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.projects-view-toggle__icon {
  display: block;
}

/* ——— Single / 3D stack view (no vertical scroll) ——— */
body.post-type-archive-project.projects-view--single {
  overflow: hidden;
}

body.post-type-archive-project.projects-view--single .site-main--projects-archive {
  max-width: none;
  margin-inline: 0;
  padding: 0;
}

.projects-single {
  --projects-slide-height: 100dvh;
  --projects-stack-duration: 0.88s;
  --projects-stack-ease: cubic-bezier(0.33, 1, 0.38, 1);
  position: relative;
  height: var(--projects-slide-height);
  overflow: hidden;
  touch-action: none;
}

.projects-single[hidden] {
  display: none !important;
}

.projects-grid-wrap[hidden] {
  display: none !important;
}

.projects-single__ui {
  position: absolute;
  top: clamp(1rem, 3vw, 1.5rem);
  left: clamp(1rem, 4vw, 2rem);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
}

.projects-single__label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 241, 236, 0.45);
}

.projects-single__counter {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(245, 241, 236, 0.72);
  font-variant-numeric: tabular-nums;
}

.projects-single__counter-sep {
  opacity: 0.35;
  margin-inline: 0.15rem;
}

.projects-single__hint {
  position: absolute;
  bottom: clamp(1rem, 3vw, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 241, 236, 0.35);
  pointer-events: none;
  animation: projectsHintPulse 2.4s ease-in-out infinite;
}

@keyframes projectsHintPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

.projects-single__stage {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1400px;
  perspective-origin: 50% 48%;
  transform-style: preserve-3d;
}

.projects-single__stage.is-glitching {
  animation: projectsGlitch 0.32s steps(2, end);
}

@keyframes projectsGlitch {
  0% { filter: none; transform: translateX(0); }
  25% { filter: contrast(1.15) saturate(1.1); transform: translateX(-3px); }
  50% { filter: none; transform: translateX(2px); }
  75% { filter: contrast(1.08); transform: translateX(-1px); }
  100% { filter: none; transform: translateX(0); }
}

.projects-single::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.project-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform: translate3d(0, 0, -360px) scale(0.72);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition:
    transform var(--projects-stack-duration) var(--projects-stack-ease),
    opacity calc(var(--projects-stack-duration) * 0.72) ease;
  will-change: transform, opacity;
}

.project-slide.is-active {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  z-index: 20;
  pointer-events: auto;
}

.project-slide.is-past {
  transform: translate3d(0, 0, -520px) scale(0.58);
  opacity: 0;
  z-index: 2;
}

.project-slide.is-future {
  transform: translate3d(0, 0, -280px) scale(0.8);
  opacity: 0;
  z-index: 3;
}

.project-slide.is-leaving {
  transform: translate3d(0, 0, -480px) scale(0.62);
  opacity: 0;
  z-index: 12;
  pointer-events: none;
}

.project-slide.is-entering {
  transform: translate3d(0, 0, -340px) scale(0.78);
  opacity: 0;
  z-index: 18;
  pointer-events: none;
}

.project-slide.is-entering.is-active {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.project-slide__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--project-dark-border-subtle, #3d3834);
}

.project-slide__media--placeholder {
  background: linear-gradient(145deg, #3d3834 0%, #2a2623 100%);
}

.project-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
}

.project-slide.is-active .project-slide__img {
  animation: projectKenBurns 16s ease-out forwards;
}

@keyframes projectKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

.project-slide__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(22, 19, 17, 0.35) 0%,
    rgba(22, 19, 17, 0.15) 38%,
    rgba(22, 19, 17, 0.55) 72%,
    rgba(22, 19, 17, 0.82) 100%
  );
  pointer-events: none;
}

.project-slide__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 40rem;
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2.5rem)
    clamp(2rem, 6vw, 3.5rem);
  color: #f5f1ec;
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.project-slide.is-active .project-slide__content {
  opacity: 1;
  transform: translateY(0);
}

.project-slide__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.project-slide__desc {
  margin: 0 0 1.25rem;
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  line-height: 1.55;
  color: rgba(245, 241, 236, 0.9);
  max-width: 36rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.project-slide__cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.32);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}

.project-slide__cta:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
  text-decoration: none;
  color: var(--white);
}

.project-slide__cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ——— Grid view header ——— */
.projects-grid-head {
  padding: clamp(2.5rem, 8vw, 4rem) clamp(0.875rem, 4vw, 1.25rem) 1.5rem;
  text-align: center;
}

.projects-grid-head__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--project-dark-text-muted, #aea49c);
}

.projects-grid-head__title {
  margin: 0;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  color: var(--project-dark-heading, #f5f1ec);
}

body.projects-view--grid .site-main--projects-archive {
  padding-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .projects-single {
    --projects-stack-duration: 0.01ms;
  }

  .projects-single__stage {
    perspective: none;
  }

  .project-slide,
  .project-slide.is-past,
  .project-slide.is-future,
  .project-slide.is-leaving,
  .project-slide.is-entering {
    transform: none;
    transition: opacity 0.15s ease;
  }

  .project-slide:not(.is-active) {
    opacity: 0;
    pointer-events: none;
  }

  .project-slide.is-active .project-slide__img {
    animation: none;
  }

  .project-slide.is-active .project-slide__content {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .projects-single__hint {
    animation: none;
  }
}

.project-single {
  padding: 1.5rem 1.25rem 0;
}

.project-single__header {
  margin-bottom: 3.25rem;
}

.project-single__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 0.35rem;
}

.project-single__subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

/* Hero: cover image left, description + CTA stacked on the right */
.project-single__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.25rem, 4vw, 2.75rem);
  align-items: start;
  margin: 0 0 1.75rem;
}

.project-single__hero-media {
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--gray);
}

.project-single__hero-media .project-single__figure {
  margin: 0;
}

.project-single__hero-aside {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  min-width: 0;
}

.project-single__content--hero {
  margin-bottom: 0;
}

.project-single__hero-actions {
  margin: 0;
}

.project-single__details--hero {
  margin: 0;
  padding: 0;
  border-top: none;
}

.project-single__content--hero + .project-single__details--hero {
  padding-top: clamp(0.75rem, 2vw, 1.25rem);
  margin-top: 0;
  border-top: 1px solid var(--gray);
}

.project-single__explore-standalone {
  margin: 0 0 1.75rem;
}

@media (max-width: 48rem) {
  .project-single__hero {
    grid-template-columns: 1fr;
  }
}

.project-single__media {
  position: relative;
  margin: 0 0 1.5rem;
}

.project-single__figure {
  margin: 0;
}

.project-single__image {
  display: block;
  width: 100%;
  height: auto;
}

.project-single__explore {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 2px;
}

.project-single__explore:hover {
  filter: brightness(0.92);
  text-decoration: none;
  color: var(--white);
}

.project-single__content {
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.project-single__content a {
  color: var(--accent);
}

.project-single__details {
  margin-bottom: 1.75rem;
  padding-top: 1.25rem;
}

.project-single__details-heading {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.project-single__details-body {
  line-height: 1.6;
}

.project-single__cta {
  margin-top: 1rem;
}

.project-single__external {
  font-weight: 600;
  text-decoration: none;
}

.project-single__external:hover {
  text-decoration: underline;
}

/* ——— Projects archive & single: dark page theme ——— */
/* Page fill matches invoice-generator scrim: rgba(0,0,0,0.28) over a warm base (html) */

html:has(body.post-type-archive-project),
html:has(body.single-project) {
  background-color: #2a2623;
}

body.post-type-archive-project,
body.single-project {
  color-scheme: dark;
  --project-dark-surface: #34302c;
  --project-dark-border: #454039;
  --project-dark-border-subtle: #3d3834;
  --project-dark-text: #ede8e3;
  --project-dark-text-muted: #aea49c;
  --project-dark-heading: #f5f1ec;
  background-color: rgba(0, 0, 0, 0.28);
  color: var(--project-dark-text);
  /* Semi-transparent body bg only paints the body box; extend to viewport so
     the area below short content matches the hero/header blend over html. */
  min-height: 100vh;
  min-height: 100dvh;
}

body.post-type-archive-project .site-header,
body.single-project .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10003;
  background: transparent;
}

body.site-nav-open.post-type-archive-project .site-header,
body.site-nav-open.single-project .site-header {
  z-index: 10005;
}

body.post-type-archive-project .site-header__inner,
body.single-project .site-header__inner {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.post-type-archive-project .site-header__logo,
body.post-type-archive-project .site-header__logo:hover,
body.single-project .site-header__logo,
body.single-project .site-header__logo:hover {
  color: var(--project-dark-text);
}

body.post-type-archive-project .site-nav,
body.single-project .site-nav {
  background-color: #161311;
}

body.post-type-archive-project .site-nav__list a,
body.single-project .site-nav__list a {
  color: rgba(245, 241, 236, 0.9);
}

body.post-type-archive-project .site-nav__list a:hover,
body.single-project .site-nav__list a:hover {
  color: var(--accent);
}

body.post-type-archive-project .site-nav__list .current-menu-item > a,
body.post-type-archive-project .site-nav__list .current-menu-ancestor > a,
body.post-type-archive-project .site-nav__list .current_page_item > a,
body.single-project .site-nav__list .current-menu-item > a,
body.single-project .site-nav__list .current-menu-ancestor > a,
body.single-project .site-nav__list .current_page_item > a {
  color: var(--accent);
}

body.post-type-archive-project .site-header__menu-toggle,
body.single-project .site-header__menu-toggle {
  color: var(--project-dark-text);
}

body.post-type-archive-project .site-header__menu-toggle:hover,
body.single-project .site-header__menu-toggle:hover {
  color: var(--accent);
}

body.post-type-archive-project .site-main--projects-archive {
  color: var(--project-dark-text);
}

body.post-type-archive-project .project-card {
  border-color: var(--project-dark-border-subtle);
  background: var(--project-dark-surface);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.28),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

body.post-type-archive-project .project-card:has(.project-card__link:hover),
body.post-type-archive-project .project-card:has(.project-card__link:focus-visible) {
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.4),
    0 6px 14px rgba(0, 0, 0, 0.28);
}

body.post-type-archive-project .project-card__media {
  background: var(--project-dark-border-subtle);
}

body.post-type-archive-project .project-card__title {
  color: var(--project-dark-heading);
}

body.post-type-archive-project .project-card__subtitle {
  color: var(--project-dark-text-muted);
  opacity: 1;
}

body.post-type-archive-project .projects-archive__pagination .page-numbers {
  color: var(--project-dark-text-muted);
}

body.post-type-archive-project .projects-archive__pagination span.page-numbers.current {
  color: var(--accent);
}

body.post-type-archive-project .projects-archive__empty {
  color: var(--project-dark-text-muted);
}

body.single-project .site-main--project-single {
  color: var(--project-dark-text);
}

body.single-project .project-single__subtitle {
  color: var(--project-dark-text-muted);
}

body.single-project .project-single__hero-media {
  background: var(--project-dark-border-subtle);
}

body.single-project .project-single__details {
  border-top-color: var(--project-dark-border-subtle);
}

body.single-project .project-single__content--hero + .project-single__details--hero {
  border-top-color: var(--project-dark-border-subtle);
}

body.single-project .project-single__details-body,
body.single-project .project-single__content {
  color: rgba(237, 232, 227, 0.94);
}

body.single-project .project-single__content h1,
body.single-project .project-single__content h2,
body.single-project .project-single__content h3,
body.single-project .project-single__content h4 {
  color: var(--project-dark-heading);
}

body.single-project .project-single__details-heading {
  color: var(--project-dark-heading);
}

body.single-project hr,
body.single-project .project-single__content hr {
  border-top-color: var(--project-dark-border-subtle);
}
