/* BASE */
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}
body {
  padding: 40px;
  box-sizing: border-box;
}
ul, li, p, a, h1, h2, h3, h4, h5, h6 { color: inherit; }

/* TYPOGRAPHY */
* { font-family: "IBM Plex Mono", monospace; }
h1 { font-size: 1.2rem; font-weight: 400; margin-block: 0; line-height: 30px; }
h2 { font-size: 1rem; margin-block: 0; }
h3 { font-size: 1rem; font-weight: 400; margin: 13px 0; }
h4 { font-size: 1rem; }
h5 { font-size: 1rem; }
h6 { font-weight: 400; }
p  { font-size: 0.9rem; margin-top: 18px 0; font-weight: 200;}
b { font-weight: 500; }

/* IMAGES & MEDIA */
img { width: 100%; height: 100%; }
.flex-item img { object-fit: contain; aspect-ratio: 1 / 1; }
.project.flex-item img { object-fit: contain; aspect-ratio: 0 !important; }
.smallproject.flex-item img { object-fit: contain; aspect-ratio: 0 !important; }
.small.flex-item img { object-fit: contain; aspect-ratio: 1.5; }
.video-container {
  display: flex; justify-content: center; align-items: center;
  width: 100%; height: 100%; border: none; outline: none; box-shadow: none;
  object-fit: contain; aspect-ratio: 1 / 1;
}

/* GRID LAYOUTS */
.container-lg, .container-md, .container-ms {
  display: grid;
  grid-template-columns: 50px 1.5fr 1fr;
  grid-template-rows: 1fr;
  grid-column-gap: 55px;
  grid-row-gap: 0;
  justify-items: stretch;
  align-items: start;
  height: auto;
  position: relative;
}
.container-sm {
  display: grid;
  grid-template-rows: 44px 1fr;
  row-gap: 50px;
  justify-items: stretch;
  height: calc(100vh - 80px);
}

/* About page variants */
.container-lg.abt, .container-md.abt, .container-ms.abt { grid-template-columns: 50px 342px 1fr; }
.container-sm.abt { grid-template-rows: 44px 300px 1.5fr; }

/* STICKY ITEMS */
.item1, .item4, .item7 {
  position: sticky; top: 40px; height: fit-content; display: flex; flex-direction: column;
  min-height: calc(100vh - 80px);
}

.item8 {
    top: 40px;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.item1 { z-index: 10; }
.item4 { z-index: 90; }
.item7 { z-index: 100; }
.item2 { position: relative; z-index: 1; }

/* FLEX LAYOUT */
.flex-container, .flex-container-lg {
  display: flex; flex-wrap: wrap; width: 100%; margin: 5px auto 0; position: relative; z-index: 1;
}
.flex-container { padding-bottom: 45px; }
.container-sm .flex-container { margin-top: 0; }

.flex-item {
  position: relative; width: 100%; height: 100%; padding: 25px; box-sizing: border-box;
  transition: ease-in-out 0.3s; z-index: 2;
}

.small.flex-item {
  position: relative; width: 100%; height: 100%; padding: 0; box-sizing: border-box;
  transition: ease-in-out 0.3s; z-index: 2;
}

.small.flex-item:hover { padding: 20px; }

.flex-item a { position: relative; z-index: 3; display: block; }
.flex-item img { position: relative; z-index: 2; }
.flex-item:hover { padding: 30px; }
.project.flex-item:hover { padding: 25px; }

/* CORNER DOTS */
.flex-item::before, .flex-item::after, .flex-item > span::before, .flex-item > span::after {
  content: ''; position: absolute; width: 6px; height: 6px; border: 1px solid; border-radius: 50%;
  transition: ease-in-out 0.6s; pointer-events: none; z-index: 1;
}
@media (min-width: 768px) {
  .project.flex-item::before,
  .project.flex-item::after,
  .project.flex-item > span::before,
  .project.flex-item > span::after { background: #0f0e0e; border: 3px solid #0f0e0e; }

  .flex-item:not(.project):hover::before,
  .flex-item:not(.project):hover::after,
  .flex-item:not(.project):hover > span::before,
  .flex-item:not(.project):hover > span::after { background: #0f0e0e; border: 3px solid #0f0e0e; transition: all .3s ease-in-out; }

  .small.flex-item:hover::before,
  .small.flex-item:hover::after,
  .small.flex-item:hover > span::before,
  .small.flex-item:hover > span::after {
    width: 6px !important; height: 6px !important; border: 1px solid !important; background: white !important;
  }
}
.smalldot.small.flex-item::before,
.smalldot.small.flex-item::after,
.smalldot.small.flex-item > span::before,
.smalldot.small.flex-item > span::after { background: #0f0e0e; border: 1px solid #0f0e0e; }

.flex-item::before { top: 0; left: 0; transform: translate(-50%, -50%); }
.flex-item::after { top: 0; right: 0; transform: translate(50%, -50%); }
.flex-item > span::before { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.flex-item > span::after { bottom: 0; right: 0; transform: translate(50%, 50%); }

/* NAV */
nav ul { list-style: none; margin: 0; padding: 0; overflow: auto; }
nav ul li a { text-decoration: none; transition: opacity .3s ease; }
nav ul li a.active {
  text-decoration: underline; text-underline-offset: 3px; opacity: 1;
}
nav ul li a:not(.active):hover ~ li a.active { opacity: 0; }
nav ul li a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* MOBILE NAV WRAPPER + OVERLAY + BURGER */
.phone-nav { display: flex; justify-content: space-between; align-items: center; width: 100%; position: relative; }
.menu-overlay {
  position: fixed; inset: 0; background: white; z-index: 1000;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; pointer-events: none;
}
.menu-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.menu-content { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.menu-content ul { list-style: none; padding: 0; margin: 0; text-align: center; }
.menu-content li { margin: 2rem 0; }
.menu-content a { text-decoration: none; color: #0f0e0e; font-size: 1.5rem; position: relative; cursor: pointer; }
.menu-content a:hover, .menu-content a.active { text-decoration: underline; text-underline-offset: 8px; }

.burger-menu {
  position: relative; z-index: 1002; color: #0f0e0e; background: none; border: 0;
  width: 35px; height: 35px; padding: 0; cursor: pointer;
}
.burger-menu:focus { outline: none; }
.burger-menu span {
  position: absolute; left: 0; width: 35px; height: 2px; background: currentColor;
  transition: transform .3s ease, top .3s ease; pointer-events: none;
}
.burger-menu span:nth-child(1){ top: 2px; }
.burger-menu span:nth-child(2){ top: 20px; }
.burger-menu.active span:nth-child(1){ transform: rotate(45deg); top: 11px; }
.burger-menu.active span:nth-child(2){ transform: rotate(-45deg); top: 11px; }

/* PROJECT DETAILS TOGGLE */
.project-details { margin-top: auto; position: relative; }
.toggle-button {
  background: none; border: none; padding: 0; font: inherit; font-size: .85rem; display: flex; align-items: center; color: #0f0e0e; gap: 4px; cursor: pointer;
}
.symbol { position: relative; width: 12px; height: 12px; margin-right: 2px; pointer-events: none; }
.symbol::before, .symbol::after {
  content: ''; position: absolute; background: #0f0e0e; transition: transform .3s cubic-bezier(.4,0,.2,1); transform-origin: center; pointer-events: none;
}
.symbol::before { width: 12px; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
.symbol::after  { width: 1.5px; height: 12px; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(0); }
.toggle-button.active .symbol::after { transform: translate(-50%,-50%) rotate(-90deg); }

/* Filter panel: no built-in height/opacity transitions (JS handles it) */
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;                 /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;   /* theme colors handled elsewhere */
}

/* open state (opacity only; height is driven by JS) */
.details-content.active{ opacity: 1; }


/* Theme animation should only tween colors, not opacity/height */
.theme-anim .details-content {
  transition: background-color 300ms cubic-bezier(.4,0,.2,1);
}

/* Make filter rows flex containers */
.details-content p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  transform: translateY(20px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  margin: 12px 0;
  line-height: 1.4;
}

/* Remove the separate margin for filter-chips container */
.details-content.active p { transform: translateY(0); opacity: 1; }
.details-content.active p:nth-child(1){ transition-delay: .1s; }
.details-content.active p:nth-child(2){ transition-delay: .2s; }
.details-content.active p:nth-child(3){ transition-delay: .3s; }

/* BUTTONS & FILTERS (single source of truth) */
.details-content button, .filter-chip {
  background: transparent !important; color: #0f0e0e !important; font: inherit;
  transition: all .2s ease; font-size: inherit; border: 0; padding: 2px 6px; cursor: pointer; 
}
.details-content button:hover, .filter-chip:hover { background: rgb(152, 216, 188) !important; }
.details-content button.active, .filter-chip.active {
  background: #0f0e0e !important; color: white !important; border: 0;
}
.filter-chips { display: contents;  }
.details-content .filter-chip { margin: 0; border-radius: 0;}

/* PROJECT NAVIGATION */
.project-navigation {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  margin-top: auto; z-index: 1000; position: relative;
}
.nav-prev, .nav-next {
  display: flex; align-items: center; text-decoration: none; color: #0f0e0e; transition: opacity .3s ease;
  margin: -12px; cursor: pointer; position: relative; z-index: 1001;
  padding: 8px 12px; border-radius: 0;
}

.project.flex-item img { position: relative; z-index: 2; }
.project.flex-item { position: relative; z-index: 1; }



/* CURSOR (desktop only shows custom cursor; touch keeps native) */
a, button, input, textarea, select, [role="button"],
.flex-item a, .flex-item img, .burger-menu, .toggle-button, .filter-chip, .theme-button { cursor: pointer !important; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea, select, [role="button"],
  .flex-item a, .flex-item img, .burger-menu, .toggle-button, .filter-chip, .theme-button { cursor: none !important; }


  .cursor-ring {
    /* keep your existing rules */
    transform: translate(-50%, -50%);
    will-change: left, top;              /* was: transform */
    transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out;
  }

  /* click feedback (adds a subtle press) */
  .cursor-ring.clicking {
    transform: translate(-50%, -50%) scale(0.92);
  }
  .cursor-ring.enlarge { width: 32px; height: 32px; }
}
@media (hover: none) and (pointer: coarse) {
  body { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* SCROLL INDICATOR */
@keyframes bouncing { 0%{bottom:0} 50%{bottom:10px} 100%{bottom:0} }
.scroll { animation: bouncing 2s infinite ease-in-out; position: relative; width: 40px; margin-top: auto; transition: opacity .3s ease-out; opacity: 1; }

/* DEFAULT: hide all containers; enable via MQs */
.container-lg, .container-md, .container-ms, .container-sm { display: none; }

/* Large (≥1475px) */
@media (min-width: 1475px) {
  .container-lg { display: grid; }
  .flex-item { flex: 0 0 33.3%; }
  .project.flex-item { flex: 100%; width: 100%; flex-direction: column;align-items: center; }
}

/* Medium (1060–1474px) */
@media (min-width: 1060px) and (max-width: 1474px) {
  .container-md { display: grid; }
  .flex-item { flex: 0 0 50%; }
  .project.flex-item { flex: 0 0 100%; width: 100%; flex-direction: column; align-items: center;}
}

/* Medium-Small (768–1059px) */
@media (min-width: 768px) and (max-width: 1059px) {
  .container-ms { display: grid; }
  .flex-item { flex: 0 0 100%; }
  .project.flex-item { width: 100%; flex-direction: column; align-items: center; }
}

/* Small (≤767px) */
@media (max-width: 767px) {
  .container-sm { display: grid; }
  .small.flex-item { flex: 1 1 100%; padding: 20px;}

  .item1, .item7 { position: relative; width: 100%; z-index: 1000; pointer-events: none; }
  .item1 nav, .item1 nav *,
.item7 .phone-nav, .item7 .phone-nav *,
.menu-overlay, .menu-overlay *,
.theme-button {
  pointer-events: auto;
  font-weight: 400;
}


  .container-sm .project-navigation { position: static !important; background: none; }

  .project-navigation .nav-prev, .project-navigation .nav-next {
    position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 500; background: transparent; border: 0; padding: 10px; line-height: 1; -webkit-tap-highlight-color: transparent;
  }
  .project-navigation .nav-prev { left: 16px; }
  .project-navigation .nav-next { right: 16px; }

  .phone-nav.is-open .menu-overlay { opacity: 1; visibility: visible; pointer-events: auto; z-index: 1000; }
}

/* Custom cursor base (required) */
.cursor-dot {
  width: 4px;
  height: 4px;
  background: #0f0e0e;
  border-radius: 0;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
}

.cursor-ring {
  width: 10px;
  height: 10px;
  border: 1px solid #0f0e0e;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out;
}

/* Align gallery content with filter bar */
#gallery-large,
#gallery-medium,
#gallery-medium-small,
#gallery-small {
  padding-bottom: 50px; /* adjust to match your filter bar’s height */
}


/* Force cursor to stay visible across modes */

/* === Cursor always visible === */
.cursor-dot,
.cursor-ring {
  filter: none !important;        /* never inherit inversion */
  mix-blend-mode: normal !important;
}

/* Light mode cursor (default) */
.cursor-dot {
  background: #0f0e0e !important;
}
.cursor-ring {
  border-color: #0f0e0e !important;
}

/* Night mode cursor (force white for contrast) */
.night-mode .cursor-dot {
  background: #fff !important;
}
.night-mode .cursor-ring {
  border-color: #fff !important;
}/* === NIGHT MODE (explicit opposites, no global invert) === */
.night-mode {
  background-color: #0f0e0e;
  color: #fff;
}

/* Text, headings, links */
.night-mode h1, .night-mode h2, .night-mode h3,
.night-mode h4, .night-mode h5, .night-mode h6,
.night-mode p,  .night-mode li,  .night-mode a {
  color: #fff !important;
}

/* Logo (adjust selector to your actual logo class/ID) */
.night-mode .logo img,
.night-mode .brand img {
  filter: invert(1) contrast(1.1) !important;
}
.night-mode .logo svg,
.night-mode .brand svg {
  fill: #fff !important;
  stroke: #fff !important;
}

/* Filter chips + buttons */
.night-mode .details-content button,
.night-mode .filter-chip {
  background: transparent !important;
  color: #fff !important;
  border: 0 !important;
}
.night-mode .details-content button:hover,
.night-mode .filter-chip:hover {
  background: rgb(167, 106, 169) !important;
}
.night-mode .details-content button.active,
.night-mode .filter-chip.active {
  background: #fff !important;
  color: #0f0e0e !important;
  border: 0 !important;
}

/* Corner dots */
/* === NIGHT MODE corner dots (inverted from light mode) === */
.night-mode .flex-item::before,
.night-mode .flex-item::after,
.night-mode .flex-item > span::before,
.night-mode .flex-item > span::after {
  background: transparent !important;   /* transparent like light mode */
  border: 1px solid #fff !important;    /* white outline instead of #0f0e0e */
}

@media (min-width: 768px) {
  .night-mode .flex-item:not(.project):hover::before,
  .night-mode .flex-item:not(.project):hover::after,
  .night-mode .flex-item:not(.project):hover > span::before,
  .night-mode .flex-item:not(.project):hover > span::after {
    background: #fff !important;        /* filled white on hover */
    border: 3px solid #fff !important;  /* thicker white border */
    transition: all .3s ease-in-out;
  }
}

.night-mode .project.flex-item::before,
.night-mode .project.flex-item::after,
.night-mode .project.flex-item > span::before,
.night-mode .project.flex-item > span::after {
  background: #fff !important;
  border: 3px solid #fff !important;
}

  /* Small card hover: opposite (#0f0e0e fill with thin white outline) */
  .night-mode .small.flex-item:hover::before,
  .night-mode .small.flex-item:hover::after,
  .night-mode .small.flex-item:hover > span::before,
  .night-mode .small.flex-item:hover > span::after {
    background: #ffffff !important;
    border: 1px solid #fff !important;
    width: 6px !important;
    height: 6px !important;
  }


  /* Night mode for small filled dots */
.night-mode .smalldot.small.flex-item::before,
.night-mode .smalldot.small.flex-item::after,
.night-mode .smalldot.small.flex-item > span::before,
.night-mode .smalldot.small.flex-item > span::after {
  background: #fff !important;   /* filled (inverse of light’s #0f0e0e) */
  border: 1px solid #fff !important;
}

/* (Optional) keep the hover identical in night mode */
@media (min-width: 768px) {
  .night-mode .smalldot.small.flex-item:hover::before,
  .night-mode .smalldot.small.flex-item:hover::after,
  .night-mode .smalldot.small.flex-item:hover > span::before,
  .night-mode .smalldot.small.flex-item:hover > span::after {
    background: #fff !important;
    border: 1px solid #fff !important;
  }
}


/* Mobile menu: dark theme */
.night-mode .menu-overlay {
  background: #0f0e0e !important;
 /* helps iOS/UI controls pick dark styling */
}

/* Make overlay links readable in dark */
.night-mode .menu-content a {
  color: #fff !important;
}

/* Keep the hover/active underline visible in dark */


.night-mode img.logo,
.night-mode .logo img,
.night-mode .brand img,
.night-mode img[src$="logo.png"] {
  filter: invert(1) contrast(1.1) brightness(1.1) !important;
}
element.style {
    background-color: #0f0e0e;
    color-scheme: dark;
}


/* Burger menu */
.night-mode .burger-menu { color: #fff !important; }

/* Media stays normal */
.night-mode img,
.night-mode iframe,
.night-mode video {
  filter: none !important;
}

/* Cursor */
.night-mode .cursor-dot {
  background: #fff !important;
}
.night-mode .cursor-ring {
  border-color: #fff !important;
}


/* Ensure burger is always clickable above overlay */
.burger-menu { z-index: 1002; pointer-events: auto; }

/* Overlay sits under burger and only captures clicks when open */
.menu-overlay {
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.menu-overlay.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Don’t let wrapper block taps on mobile */
.item7, .item1 { pointer-events: none; }
.item7 .phone-nav, .item7 .phone-nav * ,
.item1 nav, .item1 nav * ,
.menu-overlay, .menu-overlay * { pointer-events: auto; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}
.project.flex-item iframe,
.flex-container iframe,
.video-container iframe {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;   /* 🔹 force square shape */
  height: auto;          /* lets the aspect-ratio control height */
  background: transparent;
  border: none;
}
/* default (mobile) */
.project-nav-slot {
  margin-top: 0;
  padding-top: 0;
}

/* tablets/desktop only */
@media (min-width: 768px) {
  .project-nav-slot {
    margin-top: auto;
    padding-top: 1rem;
  }
}
/* Light mode (guard): force #0f0e0e text */
:root:not(.night-mode) body,
:root:not(.night-mode) h1,
:root:not(.night-mode) h2,
:root:not(.night-mode) h3,
:root:not(.night-mode) h4,
:root:not(.night-mode) h5,
:root:not(.night-mode) h6,
:root:not(.night-mode) p,
:root:not(.night-mode) li,
:root:not(.night-mode) a {
  color: #0f0e0e !important;
}

/* Optional: light-mode nav overlay text */
:root:not(.night-mode) .menu-content a { color: #0f0e0e !important; }
/* Filter reset button */
.details-content .filter-reset {
  display: none;                /* only shown when there are active chips */
  margin-left: 6px;
  font: inherit;
  font-size: .75rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.details-content .filter-reset.show { display: inline-block; }

/* Night mode color match */
.night-mode .filter-reset {
  color: #fff;
  border-color: #fff;
}
/* Night mode: invert filter toggle + plus/close bars */
.night-mode .toggle-button { 
  color: #fff !important; 
}
.night-mode .symbol::before,
.night-mode .symbol::after {
  background: #fff !important;
}
/* Place reset beside the Filter toggle */
.project-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reset button base */
.filter-reset-all{
  display: none;               /* shown only when there are active chips */
  padding: 0;
  font: inherit;
  font-size: .9rem;
  border: none;
  background: transparent;
  line-height: 1.2;
  font-weight: 300;
  color: #787575 !important;
  cursor: pointer;
  opacity: .5;                 /* 50% by default */
  transition: opacity .2s ease, color .2s ease, border-color .2s ease, background-color .2s ease;
}
.filter-reset-all.show{ display: inline-flex; }
.filter-reset-all:hover,
.filter-reset-all:focus{ opacity: 1; } /* 100% on hover/focus */

/* Light mode colour = #0f0e0e (inherits from surrounding text) */
:root:not(.night-mode) .filter-reset-all{ color: #0f0e0e; }

/* Night mode colour = white */
.night-mode .filter-reset-all{ color: #fff; }

/* ===== Unified theme transition ===== */
:root {
  --theme-dur: 300ms;
  --theme-ease: cubic-bezier(.4, 0, .2, 1);
}

/* Only transition when JS adds .theme-anim to <html> */
.theme-anim,
.theme-anim body,
.theme-anim .container-lg,
.theme-anim .container-md,
.theme-anim .container-ms,
.theme-anim .container-sm,
.theme-anim .flex-container,
.theme-anim .flex-container-lg,
.theme-anim .item1,
.theme-anim .item2,
.theme-anim .item4,
.theme-anim .item7 {
  transition: background-color var(--theme-dur) var(--theme-ease),
              color var(--theme-dur) var(--theme-ease);
}

/* Text & links everywhere (nav, content, filter labels, etc.) */
.theme-anim h1, .theme-anim h2, .theme-anim h3, .theme-anim h4, .theme-anim h5, .theme-anim h6,
.theme-anim p, .theme-anim li, .theme-anim a, .theme-anim b,
.theme-anim .content, .theme-anim nav a {
  transition: color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}

/* Filter UI (toggle, panel, chips, reset, prev/next, burger, overlay links) */
.theme-anim .project-details,
.theme-anim .toggle-button,
.theme-anim .details-content,
.theme-anim .filter-chip,
.theme-anim .filter-reset-all,
.theme-anim .theme-button,
.theme-anim .nav-prev, .theme-anim .nav-next,
.theme-anim .burger-menu,
.theme-anim .menu-content a {
  transition: color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}

/* Corner dots & +/× icon bars */
.symbol::before, .symbol::after { background: currentColor; } /* follow text color */
.theme-anim .flex-item::before,
.theme-anim .flex-item::after,
.theme-anim .flex-item > span::before,
.theme-anim .flex-item > span::after,
.theme-anim .symbol::before,
.theme-anim .symbol::after {
  transition: background-color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease);
}

/* Images that change CSS filter (logo, gallery if you filter) */
.theme-anim .logo img,
.theme-anim .brand img,
.theme-anim img[src$="logo.png"],
.theme-anim .flex-item img {
  transition: filter var(--theme-dur) var(--theme-ease),
              opacity .15s var(--theme-ease);
}

/* Mobile overlay should also fade its bg between themes */
.theme-anim .menu-overlay {
  transition: opacity .3s ease, visibility .3s ease,
              background-color var(--theme-dur) var(--theme-ease);
}

/* Optional: cursor color swap */
.theme-anim .cursor-dot,
.theme-anim .cursor-ring {
  transition: background-color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease),
              opacity .15s var(--theme-ease);
}

/* Reduced motion respects user setting */
@media (prefers-reduced-motion: reduce) {
  .theme-anim, .theme-anim * {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
/* --- Stop the panel/chips from animating while theme flips --- */
.no-panel-anim .details-content,
.no-panel-anim .details-content * {
  transition: none !important;
}

/* Make chips/buttons use the same timing as the gallery (no 'all') */
.details-content button,
.filter-chip {
  transition:
    color 300ms cubic-bezier(.4,0,.2,1),
    background-color 300ms cubic-bezier(.4,0,.2,1),
    border-color 300ms cubic-bezier(.4,0,.2,1);
    border-radius: 0;
}

/* Tone down the repaint triggers inside the panel during theme change */
.details-content {
  /* remove heavy isolation that can cause a flash on color swap */
  contain: none;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  will-change: background-color, color, border-color;
}
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;          /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;
}
.details-content.active{ opacity: 1; }
/* Make the panel overlay properly and receive clicks */
.project-details { position: relative; }
.project-details .details-content { z-index: 1500; pointer-events: auto; }

/* Filter panel base: JS controls height; no CSS height animation */
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;          /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;
}
.details-content.active{ opacity: 1; }
/* ===== Animated gallery cards (same timing as theme) ===== */
.gallery-card {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--theme-dur, 300ms) var(--theme-ease, cubic-bezier(.4,0,.2,1)),
    transform var(--theme-dur, 300ms) var(--theme-ease, cubic-bezier(.4,0,.2,1));
  will-change: opacity, transform;
}

.gallery-card.enter {            /* new cards appear */
  opacity: 0;
  transform: translateY(8px);
}

.gallery-card.leaving {          /* removed cards fade out */
  opacity: 0;
  transform: translateY(8px);
}
/* ensure cursor ring always animates on index too */
.cursor-ring {
  transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out !important;
  transform: translate(-50%, -50%); /* base */
}
.cursor-ring.enlarge { width: 32px; height: 32px; }
/* Portfolio mode: hide the whole filter UI (toggle + panel + reset) */


